Elm Exactly

Theoremlabels_insert_perm

StandardElmMech/Eff/Normalise.lean:72, Labels increasing as a pairwise property · term proof

Statement

theorem labels_insert_perm (l : String) (τ : PTy) : ∀ fs : PFields,
    (PFields.insert l τ fs).labels.Perm (l :: fs.labels)
  | .nil => by simp [PFields.insert, PFields.labels]
  | .cons l' τ' rest => by
    unfold PFields.insert
    split
    · exact List.Perm.refl _
    · simp only [PFields.labels]
      exact ((labels_insert_perm l τ rest).cons l').trans (List.Perm.swap l l' _)

Proof

Proved by a term, which Lean's kernel checks directly.

Used by

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.