Elm Exactly

Theoremann_sim

StandardElmMech/Stat/RefuseTypes.lean:1179, Annotations and ports · tactic proof

An annotation elaborated in a derivation's context elaborates, collapsed, at a candidate.

Statement

theorem ann_sim {C' : Ctx} (hL : ∀ lc, LookSim f C' A lc) (hU : C'.U = []) {ty : BTy} {U' : List BVar}
    {τ : Ty} (hnew : newForB U' ty C'.U = true) (hel : elabTy (C'.plusU U') ty = some τ) :
    ∃ U ∈ annCands ty, elabTy (A.plusU U) ty = some (mapTy f τ)

Proof

by
  rw [hU] at hnew
  obtain ⟨U'', hU'', hUeq⟩ := annCands_cover hnew
  refine ⟨U'', hU'', ?_⟩
  exact elabTy_sim f hcol.builtins (C'.plusU U') (A.plusU U'')
    (by simp only [Ctx.plusU, hU, hAU]; exact uEq_unionL_nil _ _ hUeq) ty τ
    (fun lc _ => lookSim_plusU _ _ (hL lc)) hel

Proved with tactics, which Lean expands into a proof term that its kernel checks.

Theorems it uses

Used by

In StandardElmMech/Stat/RefuseTypes.lean: Refusals by type expressions (aliases, constructor arguments, annotations, ports) and by the type of main (typesFailB, mainFailB), for every choice of generated names and variable sorts.

A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.