Erasing duplicates in a multiset. #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
dedup #
dedup s
removes duplicates from s
, yielding a nodup
multiset.
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
Alias of the reverse direction of multiset.dedup_eq_self
.
theorem
multiset.count_dedup
{α : Type u_1}
[decidable_eq α]
(m : multiset α)
(a : α) :
multiset.count a m.dedup = ite (a ∈ m) 1 0
@[simp]
@[simp]
theorem
multiset.dedup_bind_dedup
{α : Type u_1}
{β : Type u_2}
[decidable_eq α]
[decidable_eq β]
(m : multiset α)
(f : α → multiset β) :
@[simp]
theorem
multiset.dedup_map_dedup_eq
{α : Type u_1}
{β : Type u_2}
[decidable_eq α]
[decidable_eq β]
(f : α → β)
(s : multiset α) :
(multiset.map f s.dedup).dedup = (multiset.map f s).dedup
theorem
multiset.nodup.le_dedup_iff_le
{α : Type u_1}
[decidable_eq α]
{s t : multiset α}
(hno : s.nodup) :