Elm Exactly

TheoreminferModuleIn_imports

StandardElmMech/Stat/Legal.lean:99, One-module programs · tactic proof

Statement

theorem inferModuleIn_imports {B : SBasis} {C : Ctx} {m : BModule} {a : AModule}
    (h : inferModuleIn B C m = .ok a) : a.imports = m.imports

Proof

by
  unfold inferModuleIn at h
  cases hb : m.body with
  | none => simp [hb, pure, Except.pure, bind, Except.bind] at h; subst h; rfl
  | some d =>
    simp only [hb] at h
    cases hi : inferTopDec C (1000 + B.T.length) d with
    | error e => simp [hi, bind, Except.bind] at h
    | ok v => simp [hi, bind, Except.bind, pure, Except.pure] at h; subst h; rfl

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

Used by

In StandardElmMech/Stat/Legal.lean: The master theorems: a program whose inferred derivation checks, meets the further restrictions and gives main a Chapter 9 type is legal, under D11 (legal_of_infer1, legal_of_infer).

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.