Plain-language statement
Combined case for or and and
Exact Lean statement
theorem compile_well_typed_or_and
{a : TypedExpr} {b : TypedExpr} {ty : CedarType}
{Γ : TypeEnv} {εnv : SymEnv}
(iha : CompileWellTypedAndWF a εnv)
(ihb : CompileWellTypedAndWF b εnv) :
(CompileWellTypedCondition (.or a b ty) Γ εnv →
CompileWellTyped (.or a b ty) εnv) ∧
(CompileWellTypedCondition (.and a b ty) Γ εnv →
CompileWellTyped (.and a b ty) εnv)Formal artifact
Lean source
theorem compile_well_typed_or_and {a : TypedExpr} {b : TypedExpr} {ty : CedarType} {Γ : TypeEnv} {εnv : SymEnv} (iha : CompileWellTypedAndWF a εnv) (ihb : CompileWellTypedAndWF b εnv) : (CompileWellTypedCondition (.or a b ty) Γ εnv → CompileWellTyped (.or a b ty) εnv) ∧ (CompileWellTypedCondition (.and a b ty) Γ εnv → CompileWellTyped (.and a b ty) εnv):= by constructor all_goals intros hcond have ⟨hεnv, hwt, hwf⟩ := hcond have ⟨tcomp_a, hcomp_a, hty_comp_a, hwf_comp_a⟩ := iha have ⟨tcomp_b, hcomp_b, hty_comp_b, hwf_comp_b⟩ := ihb have ⟨hwf_get_comp_a, hty_get_comp_a⟩ := wf_option_get hwf_comp_a hty_comp_a have ⟨hwf_get_comp_b, hty_get_comp_b⟩ := wf_option_get hwf_comp_b hty_comp_b -- By well-typedness, a and b must be booleans -- So we substitute that fact and simplify cases hwt; case _ _ hbool_a _ hbool_b => simp only [hbool_a, hbool_b] at *; clear hbool_a hbool_b simp only [TermType.ofType] at * simp only [ hcomp_a, hcomp_b, hty_comp_b, hty_comp_a, CompileWellTyped, TypedExpr.toExpr, compile, compileOr, compileAnd, Except.bind_ok, ↓reduceIte, ] split · apply Exists.intro; constructor; rfl simp [TermType.ofType, TypedExpr.typeOf] · apply Exists.intro; constructor; rfl apply typeOf_ifSome_option apply wf_typeOf_ite any_goals assumption constructor apply wf_bool simp [TermType.ofType, Factory.someOf, TypedExpr.typeOf] · contradiction- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Compiler/WellTyped.lean:497-539
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.