Theoremsort_increasing
Statement
theorem sort_increasing : ∀ fs : PFields, fs.labels.Nodup → fs.sort.labels.Pairwise (· < ·)
| .nil, _ => by simp [PFields.sort, PFields.labels]
| .cons l τ rest, hn => by
simp only [PFields.labels, List.nodup_cons] at hn
exact insert_increasing l τ rest.sort (fun hm => hn.1 ((labels_sort_perm rest).mem_iff.mp hm))
(sort_increasing rest hn.2)Proof
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.