TheoremelabTypBind_sound
Statement
theorem elabTypBind_sound (C : Ctx) (tb : BTypBind) (VE : ValEnv) (TE : TyEnv)
(h : elabTypBind C tb = some (VE, TE)) : ElTypBind C tb VE TEProof
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
exact .r_sm_typbind rfl (elabTy_sound _ _ _ hτ) hl
| 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
· rename_i hlen
simp only [Option.some.injEq, Prod.mk.injEq] at h
obtain ⟨rfl, rfl⟩ := h
exact .r_sm_typbind_record rfl (elabTy_sound _ _ _ hτ) hl rfl hτs hlen rfl
· cases h
| .record _ (some _), h => cases h
| .var _, h => cases h
| .fn _ _, h => cases h
| .con _ _, h => cases hProved with tactics, which Lean expands into a proof term that its kernel checks.
Rules of the book it uses
Theorems it uses
Used by
In StandardElmMech/Stat/Deterministic.lean: The deterministic parts as functions, each sound for its relation: type expressions, imports and exposing, type declarations given their names (checkTypes), ports.
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.