Elm Exactly

Theoremresult_inv

StandardElmMech/Stat/RefuseScope.lean:1630, Two modules: the second module's imports, or its body, fail for every derivation of the first · tactic proof

Statement

theorem result_inv {B : SBasis} {a : AModule} {B' : SBasis} {E : Env} (h : a.result B = some (B', E)) :
    ∃ C E' PE I, checkTopDecOpt C a.body = some (E', PE) ∧ expose E' a.header.exposing = some I ∧
      B'.ME = [(a.header.name, I)]

Proof

by
  unfold AModule.result at h
  cases hC : importCtx B a.imports with
  | none => rw [hC] at h; cases h
  | some C =>
    rw [hC] at h
    simp only at h
    unfold AModule.resultIn at h
    split at h
    · cases h
    · rename_i E' PE hd
      split at h
      · cases h
      · rename_i I hI
        split at h
        · cases h
        · simp only [Option.some.injEq, Prod.mk.injEq] at h
          obtain ⟨rfl, rfl⟩ := h
          exact ⟨C, E', PE, I, hd, hI, rfl⟩

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

Used by

In StandardElmMech/Stat/RefuseScope.lean: Refusals by scope, constructor arity and imports, for one module and for a module after a helper (scopeFailB).

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.