Elm Exactly

Theoremsc_exp

StandardElmMech/Stat/RefuseScope.lean:710, The bare checker is sound · term proof

Statement

theorem sc_exp : (a : AExp) → (C : Ctx) → (Γ : Shape) → Abs C Γ → checkExpS C a = true →
    scExp Γ a.erase = true
  | .atexp a, C, Γ, hA, h => by
    simp only [checkExpS] at h
    simp only [AExp.erase, scExp]
    exact sc_atExp a C Γ hA h
  | .app e a, C, Γ, hA, h => by
    simp only [checkExpS, Bool.and_eq_true] at h
    simp only [AExp.erase, scExp, Bool.and_eq_true]
    exact ⟨sc_exp e C Γ hA h.1.1, sc_atExp a C Γ hA h.1.2⟩
  | .lam p e, C, Γ, hA, h => by
    simp only [checkExpS, Bool.and_eq_true] at h
    simp only [AExp.erase, scExp, Bool.and_eq_true]
    exact ⟨sc_atPat C Γ hA p h.1, sc_exp e _ _ (abs_plusVE hA (keys_atPat p)) h.2⟩
  | .caseE e m, C, Γ, hA, h => by
    simp only [checkExpS, Bool.and_eq_true] at h
    simp only [AExp.erase, scExp, Bool.and_eq_true]
    exact ⟨sc_exp e C Γ hA h.1.1, sc_match m C Γ hA h.1.2⟩

Proof

Proved by a term, which Lean's kernel checks directly.

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.