TheoremelabTy_sound
Statement
theorem elabTy_sound (C : Ctx) : (t : BTy) → (τ : Ty) → elabTy C t = some τ → ElTy C t τ
| .tyvar a, τ, h => by
unfold elabTy at h
split at h
· cases h; exact .r_s_ty_tyvar ‹_›
· split at h
· cases h; rename_i hc; exact .r_s_ty_rowvar hc.1 hc.2
· cases h
| .record row, τ, h => by
unfold elabTy at h
split at h
· cases h; exact .r_s_ty_record (elabTyRowOpt_sound C row _ ‹_›)
· cases h
| .openRecord r row, τ, h => by
unfold elabTy at h
split at h
· rename_i hc
split at h
· cases h; exact .r_s_ty_openrecord hc.1 hc.2 (elabTyRow_sound C row _ ‹_›)
· cases h
· cases h
| .unit, τ, h => by unfold elabTy at h; cases h; exact .r_s_ty_unit
| .tuple t1 t2 t3, τ, h => by
unfold elabTy at h
split at h
· rename_i τ1 τ2 τ3 h1 h2 h3
cases h
exact .r_s_ty_tuple (elabTy_sound C t1 _ h1) (elabTy_sound C t2 _ h2) (elabTyOpt_sound C t3 _ h3)
· cases h
| .con c args, τ, h => by
unfold elabTy at h
split at h
· rename_i θ VE τs hl hs
exact .r_s_ty_con hl (elabTyList_sound C args _ hs) h
· cases h
| .fn t1 t2, τ, h => by
unfold elabTy at h
split at h
· rename_i τ1 τ2 h1 h2
cases h
exact .r_s_ty_fun (elabTy_sound C t1 _ h1) (elabTy_sound C t2 _ h2)
· cases h
| .paren t, τ, h => by
unfold elabTy at h
exact .r_s_ty_paren (elabTy_sound C t _ h)Proof
Proved by a term, which Lean's kernel checks directly.
Rules of the book 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.