Elm Exactly

Theoremnames_distinct

StandardElmMech/Src/AliasOrderProof.lean:63 · tactic proof

Statement

theorem names_distinct {l : List AliasD} (h : (l.map (·.1)).Nodup) :
    ∀ i j (hi : i < l.length) (hj : j < l.length), i ≠ j → l[i].1 ≠ l[j].1

Proof

by
  intro i j hi hj hij he
  have hp := List.pairwise_iff_getElem.mp h
  rcases Nat.lt_or_gt_of_ne hij with hlt | hlt
  · exact hp i j (by simpa using hi) (by simpa using hj) hlt (by simpa using he)
  · exact hp j i (by simpa using hj) (by simpa using hi) hlt (by simpa using he.symm)

Proved with tactics, which Lean expands into a proof term that its kernel checks.

Used by

In StandardElmMech/Src/AliasOrderProof.lean: aliasOrder_valid: the canonical order of aliases is one the book allows.

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.