Sum and difference of multisets #
This file defines the following operations on multisets:
Add (Multiset α)instance:s + tadds the multiplicities of the elements ofsandtSub (Multiset α)instance:s - tsubtracts the multiplicities of the elements ofsandtMultiset.erase:s.erase xreduces the multiplicity ofxinsby one.
Notation (defined later) #
Additive monoid #
@[instance_reducible]
Equations
- Multiset.instAdd = { add := Multiset.add }
Alias of the reverse direction of Multiset.add_le_add_iff_left.
Alias of the forward direction of Multiset.add_le_add_iff_left.
Alias of the forward direction of Multiset.add_le_add_iff_right.
Alias of the reverse direction of Multiset.add_le_add_iff_right.
Erasing one copy of an element #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem Multiset.mem_erase_of_ne {α : Type u_1} [DecidableEq α] {a b : α} {s : Multiset α} (ab : a ≠ b) :
theorem Multiset.erase_le_erase {α : Type u_1} [DecidableEq α] {s t : Multiset α} (a : α) (h : s ≤ t) :
@[simp]
@[simp]
theorem Multiset.count_erase_of_ne {α : Type u_1} [DecidableEq α] {a b : α} (ab : a ≠ b) (s : Multiset α) :
Subtraction #
@[instance_reducible]
Equations
- Multiset.instSub = { sub := Multiset.sub }
@[simp]
@[simp]
This is a special case of tsub_zero, which should be used instead of this.
This is needed to prove OrderedSub (Multiset α).
@[simp]
@[simp]
This is a special case of tsub_le_iff_right, which should be used instead of this.
This is needed to prove OrderedSub (Multiset α).
This is a special case of tsub_le_iff_left, which should be used instead of this.
theorem Multiset.sub_le_sub_right {α : Type u_1} [DecidableEq α] {s t u : Multiset α} (hst : s ≤ t) :
theorem Multiset.eq_sub_of_add_eq {α : Type u_1} [DecidableEq α] {s t u : Multiset α} (hstu : s + t = u) :
@[simp]