TheorembindSubst_map
Statement
theorem bindSubst_map (f : TyName → TyName) :
∀ (vs : List BVar) (ts : List Ty), bindSubst vs (mapTys f ts) = (bindSubst vs ts).map (mapSubst f)
| [], [] => by simp [bindSubst, mapTys, mapSubst, Subst.id]
| [], _ :: _ => by simp [bindSubst, mapTys]
| _ :: _, [] => by simp [bindSubst, mapTys]
| .ty a :: vs, τ :: ts => by
simp only [bindSubst, mapTys]
rw [bindSubst_map f vs ts]
cases bindSubst vs ts <;> simp [mapSubst]
| .row e :: vs, .record ρ tl :: ts => by
simp only [bindSubst, mapTys, mapTy]
rw [bindSubst_map f vs ts]
cases bindSubst vs ts <;> simp [mapSubst]
| .row e :: vs, .var a :: ts => by simp [bindSubst, mapTys, mapTy]
| .row e :: vs, .fn a b :: ts => by simp [bindSubst, mapTys, mapTy]
| .row e :: vs, .con as t :: ts => by simp [bindSubst, mapTys, mapTy]Proof
Proved by a term, which Lean's kernel checks directly.
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.