Erasure of duplicates in a list #
This file proves basic results about List.dedup (definition in Data.List.Defs).
dedup l returns l without its duplicates. It keeps the earliest (that is, rightmost)
occurrence of each.
Tags #
duplicate, multiplicity, nodup, nub
@[simp]
@[simp]
@[simp]
theorem List.dedup_map_of_injective {α : Type u_1} {β : Type u_2} [DecidableEq α] [DecidableEq β] {f : α → β} (hf : Function.Injective f) (xs : List α) :
theorem List.Subset.dedup_append_right {α : Type u_1} [DecidableEq α] {xs ys : List α} (h : xs ⊆ ys) :
Note that the weaker List.Subset.dedup_append_left is proved later.
theorem List.Disjoint.union_eq {α : Type u_1} [DecidableEq α] {xs ys : List α} (h : xs.Disjoint ys) :