File: Mathlib/Data/Multiset/Dedup.lean

full_name: Multiset.dedup
code: /-- `dedup s` removes duplicates from `s`, yielding a `nodup` multiset. -/
def dedup (s : Multiset α) : Multiset α 
goal: Multiset α

full_name: Multiset.coe_dedup
code: @[simp]
theorem coe_dedup (l : List α) : @dedup α _ l = l.dedup 
goal: (↑l).dedup = ↑l.dedup

full_name: Multiset.dedup_zero
code: @[simp]
theorem dedup_zero : @dedup α _ 0 = 0 
goal: Multiset.dedup 0 = 0

full_name: Multiset.mem_dedup
code: @[simp]
theorem mem_dedup {a : α} {s : Multiset α} : a ∈ dedup s ↔ a ∈ s 
goal: a ∈ s.dedup ↔ a ∈ s

full_name: Multiset.dedup_cons_of_mem
code: @[simp]
theorem dedup_cons_of_mem {a : α} {s : Multiset α} : a ∈ s → dedup (a ::ₘ s) = dedup s 
goal: a ∈ s → (a ::ₘ s).dedup = s.dedup

full_name: Multiset.dedup_cons_of_not_mem
code: @[simp]
theorem dedup_cons_of_not_mem {a : α} {s : Multiset α} : a ∉ s → dedup (a ::ₘ s) = a ::ₘ dedup s 
goal: a ∉ s → (a ::ₘ s).dedup = a ::ₘ s.dedup

full_name: Multiset.dedup_le
code: theorem dedup_le (s : Multiset α) : dedup s ≤ s 
goal: s.dedup ≤ s

full_name: Multiset.dedup_subset
code: theorem dedup_subset (s : Multiset α) : dedup s ⊆ s 
goal: s.dedup ⊆ s

full_name: Multiset.subset_dedup
code: theorem subset_dedup (s : Multiset α) : s ⊆ dedup s 
goal: s ⊆ s.dedup

full_name: Multiset.dedup_subset'
code: @[simp]
theorem dedup_subset' {s t : Multiset α} : dedup s ⊆ t ↔ s ⊆ t 
goal: s.dedup ⊆ t ↔ s ⊆ t

full_name: Multiset.subset_dedup'
code: @[simp]
theorem subset_dedup' {s t : Multiset α} : s ⊆ dedup t ↔ s ⊆ t 
goal: s ⊆ t.dedup ↔ s ⊆ t

full_name: Multiset.nodup_dedup
code: @[simp]
theorem nodup_dedup (s : Multiset α) : Nodup (dedup s) 
goal: s.dedup.Nodup

full_name: Multiset.dedup_eq_self
code: theorem dedup_eq_self {s : Multiset α} : dedup s = s ↔ Nodup s 
goal: s.dedup = s ↔ s.Nodup

full_name: Multiset.count_dedup
code: theorem count_dedup (m : Multiset α) (a : α) : m.dedup.count a = if a ∈ m then 1 else 0 
goal: Multiset.count a m.dedup = if a ∈ m then 1 else 0

full_name: Multiset.dedup_idem
code: @[simp]
theorem dedup_idem {m : Multiset α} : m.dedup.dedup = m.dedup 
goal: m.dedup.dedup = m.dedup

full_name: Multiset.dedup_eq_zero
code: theorem dedup_eq_zero {s : Multiset α} : dedup s = 0 ↔ s = 0 
goal: s.dedup = 0 ↔ s = 0

full_name: Multiset.dedup_singleton
code: @[simp]
theorem dedup_singleton {a : α} : dedup ({a} : Multiset α) = {a} 
goal: {a}.dedup = {a}

full_name: Multiset.le_dedup
code: theorem le_dedup {s t : Multiset α} : s ≤ dedup t ↔ s ≤ t ∧ Nodup s 
goal: s ≤ t.dedup ↔ s ≤ t ∧ s.Nodup

full_name: Multiset.le_dedup_self
code: theorem le_dedup_self {s : Multiset α} : s ≤ dedup s ↔ Nodup s 
goal: s ≤ s.dedup ↔ s.Nodup

full_name: Multiset.dedup_ext
code: theorem dedup_ext {s t : Multiset α} : dedup s = dedup t ↔ ∀ a, a ∈ s ↔ a ∈ t 
goal: s.dedup = t.dedup ↔ ∀ (a : α), a ∈ s ↔ a ∈ t

full_name: Multiset.dedup_map_of_injective
code: theorem dedup_map_of_injective [DecidableEq β] {f : α → β} (hf : Function.Injective f)
    (s : Multiset α) :
    (s.map f).dedup = s.dedup.map f 
goal: (Multiset.map f s).dedup = Multiset.map f s.dedup

full_name: Multiset.dedup_map_dedup_eq
code: theorem dedup_map_dedup_eq [DecidableEq β] (f : α → β) (s : Multiset α) :
    dedup (map f (dedup s)) = dedup (map f s) 
goal: (Multiset.map f s.dedup).dedup = (Multiset.map f s).dedup

full_name: Multiset.dedup_nsmul
code: @[simp]
theorem dedup_nsmul {s : Multiset α} {n : ℕ} (h0 : n ≠ 0) : (n • s).dedup = s.dedup 
goal: (n • s).dedup = s.dedup

full_name: Multiset.Nodup.le_dedup_iff_le
code: theorem Nodup.le_dedup_iff_le {s t : Multiset α} (hno : s.Nodup) : s ≤ t.dedup ↔ s ≤ t 
goal: s ≤ t.dedup ↔ s ≤ t

full_name: Multiset.Subset.dedup_add_right
code: theorem Subset.dedup_add_right {s t : Multiset α} (h : s ⊆ t) :
    dedup (s + t) = dedup t 
goal: (s + t).dedup = t.dedup

full_name: Multiset.Subset.dedup_add_left
code: theorem Subset.dedup_add_left {s t : Multiset α} (h : t ⊆ s) :
    dedup (s + t) = dedup s 
goal: (s + t).dedup = s.dedup

full_name: Multiset.Disjoint.dedup_add
code: theorem Disjoint.dedup_add {s t : Multiset α} (h : Disjoint s t) :
    dedup (s + t) = dedup s + dedup t 
goal: (s + t).dedup = s.dedup + t.dedup

full_name: List.Subset.dedup_append_left
code: /-- Note that the stronger `List.Subset.dedup_append_right` is proved earlier. -/
theorem _root_.List.Subset.dedup_append_left {s t : List α} (h : t ⊆ s) :
    List.dedup (s ++ t) ~ List.dedup s 
goal: (s ++ t).dedup.Perm s.dedup

full_name: Multiset.Nodup.le_nsmul_iff_le
code: theorem Multiset.Nodup.le_nsmul_iff_le {α : Type*} {s t : Multiset α} {n : ℕ} (h : s.Nodup)
    (hn : n ≠ 0) : s ≤ n • t ↔ s ≤ t 
goal: s ≤ n • t ↔ s ≤ t