Theoremwf_ofList
Statement
theorem wf_ofList : ∀ (vs : List Val), (∀ v ∈ vs, v.WF) → (Val.ofList vs).WF
| [], _ => by
intro h; simp only [Val.ofList] at h
cases h with
| con _ _ v hm _ => simp at hm
| v :: vs, h => by
intro hb
simp only [Val.ofList] at hb
cases hb with
| con _ _ w hm hw =>
simp only [List.mem_cons] at hm
rcases hm with rfl | rfl | hm
· exact h w (by simp) hw
· exact wf_ofList vs (fun x hx => h x (List.mem_cons_of_mem _ hx)) hw
· simp at hmProof
Proved by a term, which Lean's kernel checks directly.
In StandardElmMech/Eff/WF.lean: Well-formed values (Val.WF): no byte sequence outside an out leaf.
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.