TheoremkeysIn_typBinds
Statement
theorem keysIn_typBinds (C : Ctx) : (tbs : List BTypBind) → (VEs : List ValEnv) → (TEs : List TyEnv) →
elabTypBinds C tbs = some (VEs, TEs) → ∀ f ∈ VEs, KeysIn f (tbs.map (·.c))
| [], VEs, TEs, h => by
simp only [elabTypBinds, Option.some.injEq, Prod.mk.injEq] at h
obtain ⟨rfl, rfl⟩Proof
h
simp
| tb :: tbs, VEs, TEs, h => by
simp only [elabTypBinds] at h
split at h
· rename_i VE TE VEs' TEs' h1 h2
simp only [Option.some.injEq, Prod.mk.injEq] at h
obtain ⟨rfl, rfl⟩ := h
intro f hf
simp only [List.mem_cons] at hf
rcases hf with rfl | hf
· exact keysIn_mono (keysIn_typBind C tb f TE h1) (by simp)
· exact keysIn_mono (keysIn_typBinds C tbs VEs' TEs' h2 f hf) (by intro x hx; simp [hx])
· cases hProved by a term, which Lean's kernel checks directly.
Theorems it uses
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.