TheoremelabPort_shape
Statement
theorem elabPort_shape {C : Ctx} {x : Var} {ty : BTy} {U : List BVar} {r : Env × PortEnv}
(h : elabPort C x ty U = some r) :
newForB U ty C.U = true ∧ (∃ τ, elabTy (C.plusU U) ty = some τ ∧ portShapeB τ = true) ∧
∃ s PE, r = (Env.ofVE [(x, s)], PE)Proof
by
unfold elabPort at h
split at h
· rename_i hn
split at h
· rename_i τ' α t he
split at h
· rename_i hc
cases h
exact ⟨hn, ⟨_, he, by simp [portShapeB, hc.1, hc.2]⟩, _, _, rfl⟩
· split at h
· rename_i τ'' α'
split at h
· rename_i hc
cases h
refine ⟨hn, ⟨_, he, ?_⟩, _, _, rfl⟩
simp [portShapeB, hc.1, hc.2.1, hc.2.2]
· cases h
· cases h
· cases h
· cases hProved 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.