Check Disjoint Opt eqv check Disjoint
Cedar.Thm.checkDisjointOpt_eqv_checkDisjoint
Plain-language statement
Full equivalence for checkDisjoint and checkDisjointOpt, including both the .ok and .error cases
Exact Lean statement
theorem checkDisjointOpt_eqv_checkDisjoint {ps₁ ps₂ : Policies} {Γ : Validation.TypeEnv} :
Γ.WellFormed →
(do
let cpset₁ ← CompiledPolicySet.compile ps₁ Γ
let cpset₂ ← CompiledPolicySet.compile ps₂ Γ
pure $ checkDisjointOpt cpset₁ cpset₂
) =
(do
let wps₁ ← wellTypedPolicies ps₁ Γ |>.mapError .validationError
let wps₂ ← wellTypedPolicies ps₂ Γ |>.mapError .validationError
pure $ checkDisjoint wps₁ wps₂ (SymEnv.ofTypeEnv Γ)
)Formal artifact
Lean source
theorem checkDisjointOpt_eqv_checkDisjoint {ps₁ ps₂ : Policies} {Γ : Validation.TypeEnv} : Γ.WellFormed → (do let cpset₁ ← CompiledPolicySet.compile ps₁ Γ let cpset₂ ← CompiledPolicySet.compile ps₂ Γ pure $ checkDisjointOpt cpset₁ cpset₂ ) = (do let wps₁ ← wellTypedPolicies ps₁ Γ |>.mapError .validationError let wps₂ ← wellTypedPolicies ps₂ Γ |>.mapError .validationError pure $ checkDisjoint wps₁ wps₂ (SymEnv.ofTypeEnv Γ) ):= by intro hwf have h₁ := compile_ok_iff_welltypedpolicies_ok hwf (ps := ps₁) have h₂ := compile_ok_iff_welltypedpolicies_ok hwf (ps := ps₂) cases hcpset₁ : CompiledPolicySet.compile ps₁ Γ <;> cases hcpset₂ : CompiledPolicySet.compile ps₂ Γ <;> cases hwps₁ : wellTypedPolicies ps₁ Γ <;> cases hwps₂ : wellTypedPolicies ps₂ Γ -- this eliminates all the cases where the behavior of CompiledPolicySet.compile is inconsistent -- with the behavior of wellTypedPolicies on the same policyset <;> simp_all [Except.mapError, Except.isOk, Except.toBool] case ok.ok.ok.ok cpset₁ cpset₂ wps₁ wps₂ => have ⟨wps₁', wps₂', hwps₁', hwps₂', h⟩ := checkDisjointOpt_eqv_checkDisjoint_ok hwf hcpset₁ hcpset₂ simp_all case error.ok.error.ok | error.error.error.error => simp [CompiledPolicySet.compile, Except.mapError, hwps₁] at hcpset₁ simp [hcpset₁] case ok.error.ok.error => simp [CompiledPolicySet.compile, Except.mapError, hwps₂] at hcpset₂ simp [hcpset₂]- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Opt.lean:1594-1625
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.