Enforce Pair Compiled Policy eqv enforce ok
Cedar.Thm.enforcePairCompiledPolicy_eqv_enforce_ok
Project documentation
This theorem covers the "happy path" -- showing that if optimized policy compilation succeeds, then enforce and enforcePairCompiledPolicy are equivalent.
Exact Lean statement
theorem enforcePairCompiledPolicy_eqv_enforce_ok {p₁ p₂ wp₁ wp₂ : Policy} {cp₁ cp₂ : CompiledPolicy} {Γ : Validation.TypeEnv} :
CompiledPolicy.compile p₁ Γ = .ok cp₁ →
CompiledPolicy.compile p₂ Γ = .ok cp₂ →
wellTypedPolicy p₁ Γ = .ok wp₁ →
wellTypedPolicy p₂ Γ = .ok wp₂ →
enforce [wp₁.toExpr, wp₂.toExpr] (SymEnv.ofTypeEnv Γ) = enforcePairCompiledPolicy cp₁ cp₂Formal artifact
Lean source
theorem enforcePairCompiledPolicy_eqv_enforce_ok {p₁ p₂ wp₁ wp₂ : Policy} {cp₁ cp₂ : CompiledPolicy} {Γ : Validation.TypeEnv} : CompiledPolicy.compile p₁ Γ = .ok cp₁ → CompiledPolicy.compile p₂ Γ = .ok cp₂ → wellTypedPolicy p₁ Γ = .ok wp₁ → wellTypedPolicy p₂ Γ = .ok wp₂ → enforce [wp₁.toExpr, wp₂.toExpr] (SymEnv.ofTypeEnv Γ) = enforcePairCompiledPolicy cp₁ cp₂:= by simp [enforce, enforcePairCompiledPolicy] intro h₀ h₁ h₂ h₃ simp [ cp_compile_produces_the_right_env h₀, cp_compile_produces_the_right_env h₁, cp_compile_produces_the_right_footprint h₀, cp_compile_produces_the_right_footprint h₁, cp_compile_produces_the_right_acyclicity h₀, cp_compile_produces_the_right_acyclicity h₁, cp_compile_produces_the_right_policy h₀ h₂, cp_compile_produces_the_right_policy h₁ h₃, ] have h_split : [wp₁.toExpr, wp₂.toExpr] = [wp₁.toExpr] ++ [wp₂.toExpr] := by simp rw [h_split, footprints_append, footprints_singleton, footprints_singleton] simp [Data.Set.make_make_eqv, List.Equiv, List.subset_def] constructor · intro t₁ h₁ cases h₁ <;> rename_i h₁ · replace ⟨t₂, h₁, htemp⟩ := h₁ ; subst t₁ simp only [List.cons_append, List.nil_append, Data.Set.mem_elts_iff_mem_set, Data.Set.mem_map] at * 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 exists t₂ · 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₁ 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 exact h₁- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Opt/Enforcer.lean:90-139
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.