Bind operation for multisets #
This file defines a few basic operations on Multiset, notably the monadic bind.
Main declarations #
Multiset.join: The join, aka union or sum, of multisets.Multiset.bind: The bind of a multiset-indexed family of multisets.Multiset.product: Cartesian product of two multisets.Multiset.sigma: Disjoint sum of multisets in a sigma type.
Join #
@[simp]
@[simp]
@[simp]
@[simp]
Bind #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Multiset.dedup_bind_dedup
{α : Type u_1}
{β : Type v}
[DecidableEq α]
[DecidableEq β]
(s : Multiset α)
(f : α → Multiset β)
:
theorem
Multiset.fold_bind
{α : Type u_1}
(op : α → α → α)
[hc : Std.Commutative op]
[ha : Std.Associative op]
{ι : Type u_4}
(s : Multiset ι)
(t : ι → Multiset α)
(b : ι → α)
(b₀ : α)
:
Product of two multisets #
The multiplicity of (a, b) in s ×ˢ t is
the product of the multiplicity of a in s and b in t.
Equations
Instances For
Equations
@[simp]
@[simp]
@[simp]
Disjoint sum of multisets #
def
Multiset.sigma
{α : Type u_1}
{σ : α → Type u_4}
(s : Multiset α)
(t : (a : α) → Multiset (σ a))
:
Multiset ((a : α) × σ a)
Multiset.sigma s t is the dependent version of Multiset.product. It is the sum of
(a, b) as a ranges over s and b ranges over t a.
Equations
Instances For
@[simp]
@[simp]