Elm Exactly

TheoremtypBind_shape

StandardElmMech/Stat/RefuseTypes.lean:735, Type declarations · tactic proof

Statement

theorem typBind_shape (C : Ctx) (tb : BTypBind) (VE1 : ValEnv) (TE1 : TyEnv)
    (h : elabTypBind C tb = some (VE1, TE1)) :
    ∃ τ X, elabTy (C.plusU (aliasVars tb)) tb.t = some τ ∧ TE1 = [(tb.c, (TyFcn.canon ⟨aliasVars tb, τ⟩, X))]

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
    refine ⟨τ, ?_⟩
    split at h
    · simp only [Option.some.injEq, Prod.mk.injEq] at h; exact ⟨_, hτ, h.2.symm⟩
    · split at h
      · split at h
        · split at h
          · simp only [Option.some.injEq, Prod.mk.injEq] at h; exact ⟨_, hτ, h.2.symm⟩
          · cases h
        · cases h
      · cases h

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

Used by

In StandardElmMech/Stat/RefuseTypes.lean: Refusals by type expressions (aliases, constructor arguments, annotations, ports) and by the type of main (typesFailB, mainFailB), for every choice of generated names and variable sorts.

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.