Elm Exactly

Theorembody_erase

StandardElmMech/Stat/RefuseTypes.lean:1739, The type of `main` · tactic proof

Statement

theorem body_erase {a : AModule} {m : BModule} {d : BTopDec} (he : a.erase = m) (hd : m.body = some d) :
    ∃ ad, a.body = some ad ∧ ad.erase = d

Proof

by
  have hb : a.body.map ATopDec.erase = some d := by rw [← hd, ← he]; rfl
  cases h : a.body with
  | none => rw [h] at hb; cases hb
  | some ad => rw [h] at hb; simp only [Option.map_some, Option.some.injEq] at hb; exact ⟨ad, rfl, hb⟩

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

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.