Elm Exactly

TheoremtypBind_sk

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

Statement

theorem typBind_sk (C : Ctx) (tb : BTypBind) (VE : ValEnv) (TE : TyEnv)
    (h : elabTypBind C tb = some (VE, TE)) : FMap.mapV TE skS = tbTeSk tb

Proof

by
  unfold elabTypBind at h
  cases hτ : elabTy (C.plusU (seqVars tb.params (bTyExtNames tb.t))) tb.t with
  | none => rw [hτ] at h; cases h
  | some τ =>
    rw [hτ] at h
    simp only at h
    cases hl : smlabs tb.t with
    | none =>
      rw [hl] at h
      simp only [Option.some.injEq, Prod.mk.injEq] at h
      obtain ⟨rfl, rfl⟩ := h
      simp [tbTeSk, hl, FMap.mapV, skS]
    | some ls =>
      rw [hl] at h
      simp only at h
      match τ, h with
      | .record ρ none, h =>
        simp only at h
        cases hτs : Row.lookupAll ρ ls with
        | none => rw [hτs] at h; cases h
        | some τs =>
          rw [hτs] at h
          simp only at h
          split at h
          · simp only [Option.some.injEq, Prod.mk.injEq] at h
            obtain ⟨rfl, rfl⟩ := h
            simp [tbTeSk, hl, FMap.mapV, skS, closVE]
          · cases h
      | .record _ (some _), h => cases h
      | .var _, h => cases h
      | .fn _ _, h => cases h
      | .con _ _, h => cases h

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

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.