Elm Exactly

Theoremexists_idx

StandardElmMech/Src/AliasOrderProof.lean:42 · term proof

The index of an alias of a list with distinct names.

Statement

theorem exists_idx {a : AliasD} (h : a ∈ all) : ∃ i, ∃ hi : i < all.length, all[i] = a

Proof

List.getElem_of_mem h

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

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.