Enforce Pair Compiled Policy Set eqv enforce ok
Cedar.Thm.enforcePairCompiledPolicySet_eqv_enforce_ok
Project documentation
This theorem covers the "happy path" -- showing that if optimized policy compilation succeeds, then enforce and enforcePairCompiledPolicySet are equivalent.
Exact Lean statement
theorem enforcePairCompiledPolicySet_eqv_enforce_ok {ps₁ ps₂ wps₁ wps₂ : Policies} {cpset₁ cpset₂ : CompiledPolicySet} {Γ : Validation.TypeEnv} :
CompiledPolicySet.compile ps₁ Γ = .ok cpset₁ →
CompiledPolicySet.compile ps₂ Γ = .ok cpset₂ →
wellTypedPolicies ps₁ Γ = .ok wps₁ →
wellTypedPolicies ps₂ Γ = .ok wps₂ →
enforce (wps₁.map Policy.toExpr ++ wps₂.map Policy.toExpr) (SymEnv.ofTypeEnv Γ) = enforcePairCompiledPolicySet cpset₁ cpset₂Formal artifact
Lean source
theorem enforcePairCompiledPolicySet_eqv_enforce_ok {ps₁ ps₂ wps₁ wps₂ : Policies} {cpset₁ cpset₂ : CompiledPolicySet} {Γ : Validation.TypeEnv} : CompiledPolicySet.compile ps₁ Γ = .ok cpset₁ → CompiledPolicySet.compile ps₂ Γ = .ok cpset₂ → wellTypedPolicies ps₁ Γ = .ok wps₁ → wellTypedPolicies ps₂ Γ = .ok wps₂ → enforce (wps₁.map Policy.toExpr ++ wps₂.map Policy.toExpr) (SymEnv.ofTypeEnv Γ) = enforcePairCompiledPolicySet cpset₁ cpset₂:= by simp [enforce, enforcePairCompiledPolicySet] intro hcpset₁ hcpset₂ hwps₁ hwps₂ simp [ cpset_compile_produces_the_right_env hcpset₁, cpset_compile_produces_the_right_env hcpset₂, cpset_compile_produces_the_right_footprint hcpset₁, cpset_compile_produces_the_right_footprint hcpset₂, cpset_compile_produces_the_right_acyclicity hcpset₁, cpset_compile_produces_the_right_acyclicity hcpset₂, cpset_compile_produces_the_right_policies hcpset₁ hwps₁, cpset_compile_produces_the_right_policies hcpset₂ hwps₂, ] simp [footprints_append] rw [Data.Set.make_make_eqv] simp [List.Equiv, List.subset_def] constructor · intro t₁ h₁ cases h₁ <;> rename_i h₁ · replace ⟨t₂, h₁, htemp⟩ := h₁ ; subst t₁ simp only [Data.Set.mem_elts_iff_mem_set, Data.Set.mem_map] at * simp only [footprints, List.mapUnion_map] change t₂ ∈ _ ∪ _ at h₁ rw [Data.Set.mem_union] at h₁ cases h₁ <;> rename_i h₁ case' inl => left case' inr => right ; left all_goals { simp only [footprints, List.mapUnion_map] at h₁ rw [List.mem_mapUnion_iff_mem_exists] at h₁ replace ⟨x, h₁, h₂⟩ := h₁ exists t₂ simp only [List.mem_mapUnion_iff_mem_exists, Function.comp_apply, and_true] exists x } · right ; right simp [*] · intro t₁ h₁ cases h₁ <;> rename_i h₁ <;> try (cases h₁ <;> rename_i h₁) case right.inr.inr => right ; exact h₁ case' right.inl | right.inr.inl => left simp [Data.Set.mem_elts_iff_mem_set, Data.Set.mem_map] at h₁ replace ⟨t₂, h₁, htemp⟩ := h₁ ; subst t₁ simp [mem_footprints_iff] at h₁ replace ⟨x, ⟨p, hp, htemp⟩, h₁⟩ := h₁ ; subst x exists t₂ simp [Data.Set.mem_elts_iff_mem_set, HAppend.hAppend] change t₂ ∈ _ ∪ _ rw [Data.Set.mem_union] case' right.inl => left case' right.inr.inl => right all_goals { simp [mem_footprints_iff] exists p.toExpr apply And.intro _ h₁ exists p }- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Opt/Enforcer.lean:146-209
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Find? ext
Cedar.Data.Map.find?_ext
Plain-language statement
Two well-formed maps are equal if they have the same find? for every key.
Source project: Cedar Specification
Person-level attribution pending.
Find? notmem keys
Cedar.Data.Map.find?_notmem_keys
Plain-language statement
Inverse of find?_mem_toList, except that this requires wf
Source project: Cedar Specification
Person-level attribution pending.
Find? some iff in values
Cedar.Data.Map.find?_some_iff_in_values
Plain-language statement
The mp direction of this does not need the wf precondition and, in fact, is available separately as find?_some_implies_in_values above
Source project: Cedar Specification
Person-level attribution pending.