Elm Exactly

Theoremvesound_conBind

StandardElmMech/Stat/RefuseScope.lean:839, Top-level declarations · term proof

Statement

theorem vesound_conBind (C : Ctx) (args : List Ty) (t : TyName) : (cb : BConBind) → (VE : ValEnv) →
    elabConBind C (.con args t) cb = some VE → VESound VE (conBs cb)
  | [], VE, h => by
    simp only [elabConBind, Option.some.injEq] at h; subst h
    exact vesound_nil
  | (k, tys) :: rest, VE, h => by
    simp only [elabConBind] at h
    split at h
    · rename_i τs VE' h1 h2
      cases h
      simp only [conBs]
      refine vesound_modify (vesound_single ?_) (vesound_conBind C args t rest VE' h2)
      intro n hn _
      cases hn
      exact ⟨τs, args, t, rfl, elabTyList_length C tys τs h1⟩
    · cases h

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.