TheoremcanonB_insert
Statement
theorem canonB_insert (l : String) (τ : PTy) : ∀ fs : PFields,
(PFields.insert l τ fs).canonB = (τ.canonB && fs.canonB)
| .nil => by simp [PFields.insert, PFields.canonB]
| .cons l' τ' rest => by
unfold PFields.insert
split
· simp [PFields.canonB]
· simp only [PFields.canonB, canonB_insert l τ rest]
cases τ.canonB <;> cases τ'.canonB <;> simpProof
Proved by a term, which Lean's kernel checks directly.
In StandardElmMech/Eff/Normalise.lean: PTy.normalise (record fields sorted by label) and normalise_canon: canonical when each record's labels are distinct.
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.