Elm Exactly

Theoremvesound_checkTypes

StandardElmMech/Stat/RefuseScope.lean:930, Top-level declarations · tactic proof

Statement

theorem vesound_checkTypes {C : Ctx} {TE : TyEnv} {VE : ValEnv} {db : Option BDatBind}
    {tbs : List BTypBind} (h : checkTypes C TE VE db tbs = true) : VESound VE (typesBs 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
      simp only [typesBs, datBs, List.append_nil]
      exact vesound_typBinds h1
    · 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
      simp only [typesBs, datBs]
      exact vesound_modify (vesound_datBind _ _ d VE' TE' h1) (vesound_typBinds h2)
    · 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.