The nodup
predicate for multisets without duplicate elements. #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
nodup s
means that s
has no duplicates, i.e. the multiplicity of
any element is at most 1.
Equations
- s.nodup = quot.lift_on s list.nodup multiset.nodup._proof_1
Instances for multiset.nodup
theorem
multiset.nodup_iff_count_le_one
{α : Type u_1}
[decidable_eq α]
{s : multiset α} :
s.nodup ↔ ∀ (a : α), multiset.count a s ≤ 1
@[simp]
theorem
multiset.count_eq_one_of_mem
{α : Type u_1}
[decidable_eq α]
{a : α}
{s : multiset α}
(d : s.nodup)
(h : a ∈ s) :
multiset.count a s = 1
theorem
multiset.count_eq_of_nodup
{α : Type u_1}
[decidable_eq α]
{a : α}
{s : multiset α}
(d : s.nodup) :
multiset.count a s = ite (a ∈ s) 1 0
theorem
multiset.nodup_iff_pairwise
{α : Type u_1}
{s : multiset α} :
s.nodup ↔ multiset.pairwise ne s
theorem
multiset.nodup.of_map
{α : Type u_1}
{β : Type u_2}
{s : multiset α}
(f : α → β) :
(multiset.map f s).nodup → 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.filter
{α : Type u_1}
(p : α → Prop)
[decidable_pred p]
{s : multiset α} :
s.nodup → (multiset.filter p s).nodup
@[protected, instance]
Equations
- s.nodup_decidable = quotient.rec_on_subsingleton s (λ (l : list α), l.nodup_decidable)
theorem
multiset.nodup.not_mem_erase
{α : Type u_1}
[decidable_eq α]
{a : α}
{s : multiset α}
(h : s.nodup) :
theorem
multiset.nodup.inter_left
{α : Type u_1}
{s : multiset α}
[decidable_eq α]
(t : multiset α) :
theorem
multiset.nodup.inter_right
{α : Type u_1}
{t : multiset α}
[decidable_eq α]
(s : multiset α) :
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)
(h : ∀ (a : α) (ha : a ∈ s), f a = g (i a ha))
(i_inj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
(i_surj : ∀ (b : β), b ∈ t → (∃ (a : α) (ha : a ∈ s), b = i a ha)) :
multiset.map f s = multiset.map g t