Elm Exactly

Theoremnodup_of_map

StandardElmMech/Eff/RoundTrip.lean:143, Lists and their values · term proof

Statement

theorem nodup_of_map {α β : Type} (f : α → β) : ∀ {l : List α}, (l.map f).Nodup → l.Nodup
  | [], _ => List.nodup_nil
  | a :: l, h => by
    simp only [List.map_cons, List.nodup_cons] at h
    exact List.nodup_cons.mpr ⟨fun hm => h.1 (List.mem_map_of_mem hm), nodup_of_map f h.2⟩

Proof

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

Used by

In StandardElmMech/Eff/RoundTrip.lean: The round trip of encoding and decoding (roundtrip), except where A88 says otherwise (NoExc), under the named hypothesis FloatRoundTrip; the exceptions shown to be needed.

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.