# Documentation

Mathlib.Data.Multiset.Dedup

# Erasing duplicates in a multiset. #

### dedup #

def Multiset.dedup {α : Type u_1} [inst : ] (s : ) :

dedup s removes duplicates from s, yielding a nodup multiset.

Equations
@[simp]
theorem Multiset.coe_dedup {α : Type u_1} [inst : ] (l : List α) :
= ↑()
@[simp]
theorem Multiset.dedup_zero {α : Type u_1} [inst : ] :
@[simp]
theorem Multiset.mem_dedup {α : Type u_1} [inst : ] {a : α} {s : } :
a s
@[simp]
theorem Multiset.dedup_cons_of_mem {α : Type u_1} [inst : ] {a : α} {s : } :
a sMultiset.dedup (a ::ₘ s) =
@[simp]
theorem Multiset.dedup_cons_of_not_mem {α : Type u_1} [inst : ] {a : α} {s : } :
¬a sMultiset.dedup (a ::ₘ s) =
theorem Multiset.dedup_le {α : Type u_1} [inst : ] (s : ) :
theorem Multiset.dedup_subset {α : Type u_1} [inst : ] (s : ) :
theorem Multiset.subset_dedup {α : Type u_1} [inst : ] (s : ) :
@[simp]
theorem Multiset.dedup_subset' {α : Type u_1} [inst : ] {s : } {t : } :
s t
@[simp]
theorem Multiset.subset_dedup' {α : Type u_1} [inst : ] {s : } {t : } :
s t
@[simp]
theorem Multiset.nodup_dedup {α : Type u_1} [inst : ] (s : ) :
theorem Multiset.dedup_eq_self {α : Type u_1} [inst : ] {s : } :
theorem Multiset.Nodup.dedup {α : Type u_1} [inst : ] {s : } :

Alias of the reverse direction of Multiset.dedup_eq_self.

theorem Multiset.count_dedup {α : Type u_1} [inst : ] (m : ) (a : α) :
= if a m then 1 else 0
@[simp]
theorem Multiset.dedup_idempotent {α : Type u_1} [inst : ] {m : } :
@[simp]
theorem Multiset.dedup_bind_dedup {α : Type u_2} {β : Type u_1} [inst : ] [inst : ] (m : ) (f : α) :
theorem Multiset.dedup_eq_zero {α : Type u_1} [inst : ] {s : } :
s = 0
@[simp]
theorem Multiset.dedup_singleton {α : Type u_1} [inst : ] {a : α} :
= {a}
theorem Multiset.le_dedup {α : Type u_1} [inst : ] {s : } {t : } :
s t
theorem Multiset.le_dedup_self {α : Type u_1} [inst : ] {s : } :
theorem Multiset.dedup_ext {α : Type u_1} [inst : ] {s : } {t : } :
∀ (a : α), a s a t
theorem Multiset.dedup_map_dedup_eq {α : Type u_2} {β : Type u_1} [inst : ] [inst : ] (f : αβ) (s : ) :
=
@[simp]
theorem Multiset.dedup_nsmul {α : Type u_1} [inst : ] {s : } {n : } (h0 : n 0) :
theorem Multiset.Nodup.le_dedup_iff_le {α : Type u_1} [inst : ] {s : } {t : } (hno : ) :
s t
theorem Multiset.Nodup.le_nsmul_iff_le {α : Type u_1} {s : } {t : } {n : } (h : ) (hn : n 0) :
s n t s t