mathlib documentation

data.list.erase_dup

Erasure of duplicates in a list #

This file proves basic results about list.erase_dup (definition in data.list.defs). erase_dup l returns l without its duplicates. It keeps the earliest (that is, rightmost) occurrence of each.

Tags #

duplicate, multiplicity, nodup, nub

@[simp]
theorem list.erase_dup_cons_of_mem' {α : Type u} [decidable_eq α] {a : α} {l : list α} (h : a l.erase_dup) :
theorem list.erase_dup_cons_of_not_mem' {α : Type u} [decidable_eq α] {a : α} {l : list α} (h : a l.erase_dup) :
@[simp]
theorem list.mem_erase_dup {α : Type u} [decidable_eq α] {a : α} {l : list α} :
@[simp]
theorem list.erase_dup_cons_of_mem {α : Type u} [decidable_eq α] {a : α} {l : list α} (h : a l) :
@[simp]
theorem list.erase_dup_cons_of_not_mem {α : Type u} [decidable_eq α] {a : α} {l : list α} (h : a l) :
theorem list.erase_dup_sublist {α : Type u} [decidable_eq α] (l : list α) :
theorem list.erase_dup_subset {α : Type u} [decidable_eq α] (l : list α) :
theorem list.subset_erase_dup {α : Type u} [decidable_eq α] (l : list α) :
theorem list.nodup_erase_dup {α : Type u} [decidable_eq α] (l : list α) :
theorem list.erase_dup_eq_self {α : Type u} [decidable_eq α] {l : list α} :
@[protected]
theorem list.nodup.erase_dup {α : Type u} [decidable_eq α] {l : list α} (h : l.nodup) :
@[simp]
theorem list.erase_dup_idempotent {α : Type u} [decidable_eq α] {l : list α} :
theorem list.erase_dup_append {α : Type u} [decidable_eq α] (l₁ l₂ : list α) :
(l₁ ++ l₂).erase_dup = l₁ l₂.erase_dup