Documentation

Mathlib.Data.Multiset.Nodup

The Nodup predicate for multisets without duplicate elements. #

def Multiset.Nodup {α : Type u_1} (s : Multiset α) :

Nodup s means that s has no duplicates, i.e. the multiplicity of any element is at most 1.

Equations
Instances For
    @[simp]
    theorem Multiset.coe_nodup {α : Type u_1} {l : List α} :
    (↑l).Nodup l.Nodup
    @[simp]
    @[simp]
    theorem Multiset.nodup_cons {α : Type u_1} {a : α} {s : Multiset α} :
    (a ::ₘ s).Nodup as s.Nodup
    theorem Multiset.Nodup.cons {α : Type u_1} {s : Multiset α} {a : α} (m : as) (n : s.Nodup) :
    (a ::ₘ s).Nodup
    @[simp]
    theorem Multiset.nodup_singleton {α : Type u_1} (a : α) :
    {a}.Nodup
    theorem Multiset.Nodup.of_cons {α : Type u_1} {s : Multiset α} {a : α} (h : (a ::ₘ s).Nodup) :
    s.Nodup
    theorem Multiset.Nodup.not_mem {α : Type u_1} {s : Multiset α} {a : α} (h : (a ::ₘ s).Nodup) :
    as
    theorem Multiset.nodup_of_le {α : Type u_1} {s : Multiset α} {t : Multiset α} (h : s t) :
    t.Nodups.Nodup
    theorem Multiset.not_nodup_pair {α : Type u_1} (a : α) :
    ¬(a ::ₘ a ::ₘ 0).Nodup
    theorem Multiset.nodup_iff_le {α : Type u_1} {s : Multiset α} :
    s.Nodup ∀ (a : α), ¬a ::ₘ a ::ₘ 0 s
    theorem Multiset.nodup_iff_ne_cons_cons {α : Type u_1} {s : Multiset α} :
    s.Nodup ∀ (a : α) (t : Multiset α), s a ::ₘ a ::ₘ t
    theorem Multiset.nodup_iff_count_le_one {α : Type u_1} [DecidableEq α] {s : Multiset α} :
    s.Nodup ∀ (a : α), Multiset.count a s 1
    theorem Multiset.nodup_iff_count_eq_one {α : Type u_1} {s : Multiset α} [DecidableEq α] :
    s.Nodup as, Multiset.count a s = 1
    @[simp]
    theorem Multiset.count_eq_one_of_mem {α : Type u_1} [DecidableEq α] {a : α} {s : Multiset α} (d : s.Nodup) (h : a s) :
    theorem Multiset.count_eq_of_nodup {α : Type u_1} [DecidableEq α] {a : α} {s : Multiset α} (d : s.Nodup) :
    Multiset.count a s = if a s then 1 else 0
    theorem Multiset.nodup_iff_pairwise {α : Type u_4} {s : Multiset α} :
    s.Nodup Multiset.Pairwise (fun (x x_1 : α) => x x_1) s
    theorem Multiset.Nodup.pairwise {α : Type u_1} {r : ααProp} {s : Multiset α} :
    (∀ as, bs, a br a b)s.NodupMultiset.Pairwise r s
    theorem Multiset.Pairwise.forall {α : Type u_1} {r : ααProp} {s : Multiset α} (H : Symmetric r) (hs : Multiset.Pairwise r s) ⦃a : α :
    a s∀ ⦃b : α⦄, b sa br a b
    theorem Multiset.nodup_add {α : Type u_1} {s : Multiset α} {t : Multiset α} :
    (s + t).Nodup s.Nodup t.Nodup s.Disjoint t
    theorem Multiset.disjoint_of_nodup_add {α : Type u_1} {s : Multiset α} {t : Multiset α} (d : (s + t).Nodup) :
    s.Disjoint t
    theorem Multiset.Nodup.add_iff {α : Type u_1} {s : Multiset α} {t : Multiset α} (d₁ : s.Nodup) (d₂ : t.Nodup) :
    (s + t).Nodup s.Disjoint t
    theorem Multiset.Nodup.of_map {α : Type u_1} {β : Type u_2} {s : Multiset α} (f : αβ) :
    (Multiset.map f s).Nodups.Nodup
    theorem Multiset.Nodup.map_on {α : Type u_1} {β : Type u_2} {s : Multiset α} {f : αβ} :
    (∀ xs, ys, f x = f yx = y)s.Nodup(Multiset.map f s).Nodup
    theorem Multiset.Nodup.map {α : Type u_1} {β : Type u_2} {f : αβ} {s : Multiset α} (hf : Function.Injective f) :
    s.Nodup(Multiset.map f s).Nodup
    theorem Multiset.nodup_map_iff_of_inj_on {α : Type u_1} {β : Type u_2} {s : Multiset α} {f : αβ} (d : xs, ys, f x = f yx = y) :
    (Multiset.map f s).Nodup s.Nodup
    theorem Multiset.nodup_map_iff_of_injective {α : Type u_1} {β : Type u_2} {s : Multiset α} {f : αβ} (d : Function.Injective f) :
    (Multiset.map f s).Nodup s.Nodup
    theorem Multiset.inj_on_of_nodup_map {α : Type u_1} {β : Type u_2} {f : αβ} {s : Multiset α} :
    (Multiset.map f s).Nodupxs, ys, f x = f yx = y
    theorem Multiset.nodup_map_iff_inj_on {α : Type u_1} {β : Type u_2} {f : αβ} {s : Multiset α} (d : s.Nodup) :
    (Multiset.map f s).Nodup xs, ys, f x = f yx = y
    theorem Multiset.Nodup.filter {α : Type u_1} (p : αProp) [DecidablePred p] {s : Multiset α} :
    s.Nodup(Multiset.filter p s).Nodup
    @[simp]
    theorem Multiset.nodup_attach {α : Type u_1} {s : Multiset α} :
    s.attach.Nodup s.Nodup
    theorem Multiset.Nodup.attach {α : Type u_1} {s : Multiset α} :
    s.Nodups.attach.Nodup

    Alias of the reverse direction of Multiset.nodup_attach.

    theorem Multiset.Nodup.pmap {α : Type u_1} {β : Type u_2} {p : αProp} {f : (a : α) → p aβ} {s : Multiset α} {H : as, p a} (hf : ∀ (a : α) (ha : p a) (b : α) (hb : p b), f a ha = f b hba = b) :
    s.Nodup(Multiset.pmap f s H).Nodup
    instance Multiset.nodupDecidable {α : Type u_1} [DecidableEq α] (s : Multiset α) :
    Decidable s.Nodup
    Equations
    theorem Multiset.Nodup.erase_eq_filter {α : Type u_1} [DecidableEq α] (a : α) {s : Multiset α} :
    s.Nodups.erase a = Multiset.filter (fun (x : α) => x a) s
    theorem Multiset.Nodup.erase {α : Type u_1} [DecidableEq α] (a : α) {l : Multiset α} :
    l.Nodup(l.erase a).Nodup
    theorem Multiset.Nodup.mem_erase_iff {α : Type u_1} [DecidableEq α] {a : α} {b : α} {l : Multiset α} (d : l.Nodup) :
    a l.erase b a b a l
    theorem Multiset.Nodup.not_mem_erase {α : Type u_1} [DecidableEq α] {a : α} {s : Multiset α} (h : s.Nodup) :
    as.erase a
    theorem Multiset.Nodup.filterMap {α : Type u_1} {β : Type u_2} {s : Multiset α} (f : αOption β) (H : ∀ (a a' : α), bf a, b f a'a = a') :
    s.Nodup(Multiset.filterMap f s).Nodup
    theorem Multiset.Nodup.inter_left {α : Type u_1} {s : Multiset α} [DecidableEq α] (t : Multiset α) :
    s.Nodup(s t).Nodup
    theorem Multiset.Nodup.inter_right {α : Type u_1} {t : Multiset α} [DecidableEq α] (s : Multiset α) :
    t.Nodup(s t).Nodup
    @[simp]
    theorem Multiset.nodup_union {α : Type u_1} [DecidableEq α] {s : Multiset α} {t : Multiset α} :
    (s t).Nodup s.Nodup t.Nodup
    theorem Multiset.Nodup.ext {α : Type u_1} {s : Multiset α} {t : Multiset α} :
    s.Nodupt.Nodup(s = t ∀ (a : α), a s a t)
    theorem Multiset.le_iff_subset {α : Type u_1} {s : Multiset α} {t : Multiset α} :
    s.Nodup(s t s t)
    theorem Multiset.mem_sub_of_nodup {α : Type u_1} [DecidableEq α] {a : α} {s : Multiset α} {t : Multiset α} (d : s.Nodup) :
    a s - t a s at
    theorem Multiset.map_eq_map_of_bij_of_nodup {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αγ) (g : βγ) {s : Multiset α} {t : Multiset β} (hs : s.Nodup) (ht : t.Nodup) (i : (a : α) → a sβ) (hi : ∀ (a : α) (ha : a s), i a ha t) (i_inj : ∀ (a₁ : α) (ha₁ : a₁ s) (a₂ : α) (ha₂ : a₂ s), i a₁ ha₁ = i a₂ ha₂a₁ = a₂) (i_surj : bt, ∃ (a : α) (ha : a s), i a ha = b) (h : ∀ (a : α) (ha : a s), f a = g (i a ha)) :