Elm Exactly

Theoremmem_dedupFirst

StandardElmMech/Stat/CopyLoop.lean:59, `dedupFirst` · term proof

Statement

theorem mem_dedupFirst {α : Type} [DecidableEq α] : ∀ {l : List α} {x : α}, x ∈ dedupFirst l ↔ x ∈ l
  | [], _ => by simp [dedupFirst]
  | y :: ys, x => by
    simp only [dedupFirst, List.mem_cons, List.mem_filter, mem_dedupFirst, decide_eq_true_eq]
    by_cases h : x = y <;> simp [h]

Proof

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

Used by

In StandardElmMech/Stat/CopyLoop.lean: The copy loop terminates within 2^k + 1 rounds, makes the least set of copies closed under requests, at most 2^k (copyLoop_fuel, copyLoop_least, copies_le_pow).

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.