Elm Exactly

TheoremcheckTypes_sk

StandardElmMech/Stat/RefuseScope.lean:1448, The skeleton of a module's interface is the same in every derivation · tactic proof

Statement

theorem checkTypes_sk {C : Ctx} {TE : TyEnv} {VE : ValEnv} {db : Option BDatBind} {tbs : List BTypBind}
    (h : checkTypes C TE VE db tbs = true) : FMap.mapV TE skS = teSkTypes db tbs

Proof

by
  replace h := checkTypes_fix h
  unfold checkTypesFix at h
  cases db with
  | none =>
    simp only at h
    split at h
    · rename_i VEs TEs h1
      simp only [decide_eq_true_eq] at h
      obtain ⟨_, rfl, _⟩ := h
      rw [mapV_plusAll, typBinds_sk _ tbs VEs TEs h1]
      simp [teSkTypes, datTeSk, FMap.modify]
    · cases h
  | some d =>
    simp only at h
    split at h
    · rename_i VE' TE' VEs TEs h1 h2
      simp only [Bool.and_eq_true, decide_eq_true_eq] at h
      obtain ⟨_, _, rfl, _⟩ := h
      rw [mapV_modify, mapV_plusAll, typBinds_sk _ tbs VEs TEs h2, datBind_sk _ _ d VE' TE' h1]
      rfl
    · cases h

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

Theorems it uses

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.