TheoremnewFor_of_newForB
Statement
theorem newFor_of_newForB {U' : List BVar} {ty : Src.BTy} {CU : List BVar} (h : newForB U' ty CU = true) :
NewFor U' ty CUProof
by
simp only [newForB, Bool.and_eq_true, decide_eq_true_eq] at h
obtain ⟨rfl, hu⟩ := h
refine ⟨fun v hv => ?_, fun s => ?_, hu, fun v hv s hs => ?_⟩
· obtain ⟨s, -, rfl⟩ := mem_newU0 (List.mem_filter.mp hv).1
exact nameVar_named ty s
· constructor
· intro hs
obtain ⟨v, hv, hvs⟩ := mem_namesU.mp hs
obtain ⟨hv0, hp⟩ := List.mem_filter.mp hv
obtain ⟨s', hs', rfl⟩ := mem_newU0 hv0
rw [name?_nameVar, Option.some.injEq] at hvs
subst hvs
simp only [name?_nameVar, Bool.not_eq_true', decide_eq_false_iff_not] at hp
exact ⟨hs', hp⟩
· rintro ⟨hs, hc⟩
refine mem_namesU.mpr ⟨nameVar ty s, List.mem_filter.mpr ⟨?_, ?_⟩, name?_nameVar ty s⟩
· exact List.mem_map.mpr ⟨s, mem_dedupL.mpr hs, rfl⟩
· simp only [name?_nameVar, Bool.not_eq_true', decide_eq_false_iff_not]; exact hc
· obtain ⟨s', -, rfl⟩ := mem_newU0 (List.mem_filter.mp hv).1
rw [name?_nameVar, Option.some.injEq] at hs
subst hs; rflProved with tactics, which Lean expands into a proof term that its kernel checks.
Theorems it uses
Used by
In StandardElmMech/Stat/Schemes.lean: Type functions, schemes and their canonical form, instances (Gen, genAt), explicit variables (NewFor), closure (closGroup, A93).
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.