Erasing duplicates in a multiset. #
dedup #
dedup s
removes duplicates from s
, yielding a nodup
multiset.
Equations
- s.dedup = Quot.liftOn s (fun (l : List α) => ↑l.dedup) ⋯
Instances For
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
Alias of the reverse direction of Multiset.dedup_eq_self
.
theorem
Multiset.count_dedup
{α : Type u_1}
[DecidableEq α]
(m : Multiset α)
(a : α)
:
Multiset.count a m.dedup = if a ∈ m then 1 else 0
@[simp]
theorem
Multiset.dedup_idem
{α : Type u_1}
[DecidableEq α]
{m : Multiset α}
:
m.dedup.dedup = m.dedup
@[simp]
theorem
Multiset.dedup_map_dedup_eq
{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
(f : α → β)
(s : Multiset α)
:
(Multiset.map f s.dedup).dedup = (Multiset.map f s).dedup
@[simp]
theorem
Multiset.Nodup.le_dedup_iff_le
{α : Type u_1}
[DecidableEq α]
{s : Multiset α}
{t : Multiset α}
(hno : s.Nodup)
: