Implies Opt? eqv implies? ok
Cedar.Thm.impliesOpt?_eqv_implies?_ok
Project documentation
This theorem covers the "happy path" -- showing that if optimized policy compilation succeeds, then wellTypedPolicies succeeds and implies? and impliesOpt? are equivalent.
Exact Lean statement
theorem impliesOpt?_eqv_implies?_ok {ps₁ ps₂ : Policies} {cpset₁ cpset₂ : CompiledPolicySet} {Γ : Validation.TypeEnv} :
Γ.WellFormed →
CompiledPolicySet.compile ps₁ Γ = .ok cpset₁ →
CompiledPolicySet.compile ps₂ Γ = .ok cpset₂ →
∃ wps₁ wps₂,
wellTypedPolicies ps₁ Γ = .ok wps₁ ∧
wellTypedPolicies ps₂ Γ = .ok wps₂ ∧
impliesOpt? cpset₁ cpset₂ = implies? wps₁ wps₂ (SymEnv.ofTypeEnv Γ)Formal artifact
Lean source
theorem impliesOpt?_eqv_implies?_ok {ps₁ ps₂ : Policies} {cpset₁ cpset₂ : CompiledPolicySet} {Γ : Validation.TypeEnv} : Γ.WellFormed → CompiledPolicySet.compile ps₁ Γ = .ok cpset₁ → CompiledPolicySet.compile ps₂ Γ = .ok cpset₂ → ∃ wps₁ wps₂, wellTypedPolicies ps₁ Γ = .ok wps₁ ∧ wellTypedPolicies ps₂ Γ = .ok wps₂ ∧ impliesOpt? cpset₁ cpset₂ = implies? wps₁ wps₂ (SymEnv.ofTypeEnv Γ):= by simp [implies?, impliesOpt?] simp [sat?] intro hwf hcpset₁ hcpset₂ have ⟨wps₁, hwps₁⟩ := compile_ok_then_exists_wtps hwf hcpset₁ exists wps₁ ; apply And.intro hwps₁ have ⟨wps₂, hwps₂⟩ := compile_ok_then_exists_wtps hwf hcpset₂ exists wps₂ ; apply And.intro hwps₂ have ⟨asserts, h₁⟩ := verifyImplies_is_ok hwf hwps₁ hwps₂ simp [h₁] have := cpset_satAssertsOpt?_eqv_satAsserts?_ok (pss := [ps₁, ps₂]) (wpss := [wps₁, wps₂]) (cpsets := [cpset₁, cpset₂]) (asserts := asserts) (Γ := Γ) (by simp) (by simp) simp only [List.flatten_cons, List.flatten_nil, List.append_nil, List.map_cons, List.map_nil] at this rw [this] ; clear this · have := verifyImpliesOpt_eqv_verifyImplies_ok hcpset₁ hcpset₂ hwps₁ hwps₂ simp [h₁, ResultAssertsEquiv] at this exact Asserts.Equiv.satAssertsOpt? [.pset cpset₁, .pset cpset₂] (Asserts.Equiv.symm this) · simp [hcpset₁, hcpset₂] · simp [hwps₁, hwps₂]- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Opt.lean:668-693
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.