Partial eval well typed unary App
Cedar.Thm.partial_eval_well_typed_unaryApp
Project documentation
Helper theorem: Partial evaluation preserves well-typedness for unary application residuals.
Exact Lean statement
theorem partial_eval_well_typed_unaryApp {env : TypeEnv} {op : UnaryOp} {expr : Residual} {ty : CedarType} {req : Request} {preq : PartialRequest} {es : Entities} {pes : PartialEntities} :
Residual.WellTyped env (TPE.evaluate expr preq pes) →
PEWellTyped env (Residual.unaryApp op expr ty) (TPE.evaluate (Residual.unaryApp op expr ty) preq pes) req preq es pesFormal artifact
Lean source
theorem partial_eval_well_typed_unaryApp {env : TypeEnv} {op : UnaryOp} {expr : Residual} {ty : CedarType} {req : Request} {preq : PartialRequest} {es : Entities} {pes : PartialEntities} : Residual.WellTyped env (TPE.evaluate expr preq pes) → PEWellTyped env (Residual.unaryApp op expr ty) (TPE.evaluate (Residual.unaryApp op expr ty) preq pes) req preq es pes:= by intros h_expr_wt h_wf h_ref h_wt simp only [TPE.evaluate] cases h_wt with | unaryApp h_expr h_op => let expr_eval := TPE.evaluate expr preq pes unfold TPE.apply₁ split case h_1 => apply Residual.WellTyped.error case h_2 => cases h : expr_eval.asValue with | some v => simp only [someOrError] split case h_2 => apply Residual.WellTyped.error case h_1 v ty ox x v₂ heq => unfold Spec.apply₁ at heq split at heq any_goals cases h_op simp only [Except.toOption, Option.some.injEq] at heq rw [← heq] exact well_typed_bool case h_2 => simp only [Except.toOption, intOrErr] at heq rename Int64 => i cases h₂: i.neg? . rw [h₂] at heq simp at heq . rw [h₂] at heq simp only [Option.some.injEq] at heq rw [← heq] cases h_op exact well_typed_int case h_6 => contradiction | none => simp only [] split . cases h_op; exact well_typed_bool . cases h_op; exact well_typed_bool . case h_3 => apply Residual.WellTyped.unaryApp exact h_expr_wt cases h_op all_goals first | apply UnaryResidualWellTyped.not | apply UnaryResidualWellTyped.neg | apply UnaryResidualWellTyped.isEmpty | apply UnaryResidualWellTyped.like | apply UnaryResidualWellTyped.is rw [partial_eval_preserves_typeof _ h_expr] assumption- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/TPE/WellTyped/Unary.lean:38-95
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.