The nodup
predicate for multisets without duplicate elements. #
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
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.nodup_iff_pairwise
{α : Type u_1}
{s : multiset α} :
s.nodup ↔ multiset.pairwise ne s
@[protected]
theorem
multiset.nodup.pairwise
{α : Type u_1}
{r : α → α → Prop}
{s : multiset α} :
(∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → a ≠ b → r a b) → s.nodup → multiset.pairwise r s
theorem
multiset.pairwise.forall
{α : Type u_1}
{r : α → α → Prop}
{s : multiset α}
(H : symmetric r)
(hs : multiset.pairwise r s)
⦃a : α⦄ :
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
theorem
multiset.nodup.pmap
{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
{f : Π (a : α), p a → β}
{s : multiset α}
{H : ∀ (a : α), a ∈ s → p a}
(hf : ∀ (a : α) (ha : p a) (b : α) (hb : p b), f a ha = f b hb → a = b) :
s.nodup → (multiset.pmap f s H).nodup
@[protected, instance]
Equations
- s.nodup_decidable = quotient.rec_on_subsingleton s (λ (l : list α), l.nodup_decidable)
theorem
multiset.nodup.erase_eq_filter
{α : Type u_1}
[decidable_eq α]
(a : α)
{s : multiset α} :
s.nodup → s.erase a = multiset.filter (λ (_x : α), _x ≠ a) s
theorem
multiset.nodup.not_mem_erase
{α : Type u_1}
[decidable_eq α]
{a : α}
{s : multiset α}
(h : s.nodup) :
@[protected]
theorem
multiset.nodup.filter_map
{α : Type u_1}
{β : Type u_2}
{s : multiset α}
(f : α → option β)
(H : ∀ (a a' : α) (b : β), b ∈ f a → b ∈ f a' → a = a') :
s.nodup → (multiset.filter_map f 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 α) :
@[simp]
@[protected]
theorem
multiset.nodup.powerset_len
{α : Type u_1}
{s : multiset α}
{n : ℕ}
(h : s.nodup) :
(multiset.powerset_len n s).nodup
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