All proofs
Project-declaredLean 4.31.0 · null

Enforce Compiled Policy eqv enforce ok

Cedar.Thm.enforceCompiledPolicy_eqv_enforce_ok

Project documentation

This theorem covers the "happy path" -- showing that if optimized policy compilation succeeds, then enforce and enforceCompiledPolicy are equivalent.

Exact Lean statement

theorem enforceCompiledPolicy_eqv_enforce_ok {p wp : Policy} {cp : CompiledPolicy} {Γ : Validation.TypeEnv} :
  CompiledPolicy.compile p Γ = .ok cp →
  wellTypedPolicy p Γ = .ok wp →
  enforce [wp.toExpr] (SymEnv.ofTypeEnv Γ) = enforceCompiledPolicy cp

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem enforceCompiledPolicy_eqv_enforce_ok {p wp : Policy} {cp : CompiledPolicy} {Γ : Validation.TypeEnv} :  CompiledPolicy.compile p Γ = .ok cp   wellTypedPolicy p Γ = .ok wp   enforce [wp.toExpr] (SymEnv.ofTypeEnv Γ) = enforceCompiledPolicy cp:= by  simp [enforce, enforceCompiledPolicy]  intro h₀ h₁  simp [    cp_compile_produces_the_right_env h₀,    cp_compile_produces_the_right_footprint h₀,    cp_compile_produces_the_right_acyclicity h₀,    cp_compile_produces_the_right_policy h₀ h₁,  ]  simp [footprints]  simp [Data.Set.make_make_eqv, List.Equiv, List.subset_def]  constructor  · intro t h₂    cases h₂    · left      rename_i h₂      replace t', h₂, ht := h₂ ; subst t ; rename Term => t      rw [Data.Set.mem_elts_iff_mem_set] at *      rw [List.mem_mapUnion_iff_mem_exists] at h₂      replace s, hs, h₂ := h₂      simp at hs ; subst s      simp [Data.Set.mem_map]      exists t    · right      rename_i h₂      replace s, hs, t', ht', h₂ := h₂ ; subst t ; rename Term => t      simp [Data.Set.mem_elts_iff_mem_set, List.mem_mapUnion_iff_mem_exists] at *      exists s      simp [hs]      exists t  · intro t h₂    cases h₂    · left      rename_i h₂      simp [Data.Set.mem_elts_iff_mem_set, Data.Set.mem_map] at h₂      replace t', ht', h₂ := h₂ ; subst t ; rename Term => t      exists t      simp [Data.Set.mem_elts_iff_mem_set, List.mem_mapUnion_iff_mem_exists]      exact ht'    · right      rename_i h₂      replace s, hs, t', ht', h₂ := h₂ ; subst t ; rename Term => t      exists s      rw [Data.Set.mem_elts_iff_mem_set] at *      simp [List.mem_mapUnion_iff_mem_exists, hs]      exists t      simp [Data.Set.mem_elts_iff_mem_set, List.mem_mapUnion_iff_mem_exists, ht']
Project
Cedar Specification
License
Apache-2.0
Commit
3f093947b8ae
Source
cedar-lean/Cedar/Thm/SymCC/Opt/Enforcer.lean:33-83

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

Project-declaredLean 4.31.0

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.

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

Find? notmem keys

Cedar.Data.Map.find?_notmem_keys

Plain-language statement

Inverse of find?_mem_toList, except that this requires wf

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

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

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record