Elm Exactly

TheoremdatBind_sk

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

Statement

theorem datBind_sk (C : Ctx) (names : String → Option TyName) : (d : BDatBind) → (VE : ValEnv) →
    (TE : TyEnv) → elabDatBind C names d = some (VE, TE) → FMap.mapV TE skS = datTeSkL d
  | [], VE, TE, h => by
    simp only [elabDatBind, Option.some.injEq, Prod.mk.injEq] at h
    obtain ⟨rfl, rfl⟩

Proof

h
    rfl
  | (c, ps, cb) :: rest, VE, TE, h => by
    simp only [elabDatBind] at h
    split at h
    · cases h
    · rename_i t _
      split at h
      · rename_i τs VE' TE' _ h2
        split at h
        · rename_i VEc h3
          split at h
          · simp only [Option.some.injEq, Prod.mk.injEq] at h
            obtain ⟨rfl, rfl⟩ := h
            rw [mapV_modify, datBind_sk C names rest VE' TE' h2]
            simp only [datTeSkL, FMap.mapV, List.map_cons, List.map_nil, skS]
            rw [← FMap.mapV, closVE_sk, conBind_sk _ _ cb VEc h3]
          · cases h
        · cases h
      · cases h

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

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.