The Cartesian product of multisets #
Main definitions #
Multiset.pi: Cartesian product of multisets indexed by a multiset.
def Multiset.Pi.cons {α : Type u_1} [DecidableEq α] {δ : α → Sort u_2} (m : Multiset α) (a : α) (b : δ a) (f : (a : α) → a ∈ m → δ a) (a' : α) :
Given δ : α → Sort*, a multiset m and a term a, as well as a term b : δ a and a
function f such that f a' : δ a' for all a' in m, Pi.cons m a b f is a function g such
that g a'' : δ a'' for all a'' in a ::ₘ m.
Equations
- Multiset.Pi.cons m a b f a' ha' = if h : a' = a then ⋯ ▸ b else f a' ⋯
Instances For
theorem Multiset.Pi.cons_map {α : Type u_1} [DecidableEq α] {δ : α → Sort u_2} {m : Multiset α} {a : α} (b : δ a) (f : (a' : α) → a' ∈ m → δ a') {δ' : α → Sort u_3} (φ : ⦃a' : α⦄ → δ a' → δ' a') :
theorem Multiset.Pi.forall_rel_cons_ext {α : Type u_1} [DecidableEq α] {δ : α → Sort u_2} {m : Multiset α} {a : α} {r : ⦃a : α⦄ → δ a → δ a → Prop} {b₁ b₂ : δ a} {f₁ f₂ : (a' : α) → a' ∈ m → δ a'} (hb : r b₁ b₂) (hf : ∀ (a : α) (ha : a ∈ m), r (f₁ a ha) (f₂ a ha)) (a✝ : α) (ha : a✝ ∈ a ::ₘ m) :
theorem Multiset.Pi.cons_injective {α : Type u_1} [DecidableEq α] {δ : α → Sort u_2} {a : α} {b : δ a} {s : Multiset α} (hs : ¬a ∈ s) :
Function.Injective (cons s a b)
def Multiset.pi {α : Type u_1} [DecidableEq α] {β : α → Type u_2} (m : Multiset α) (t : (a : α) → Multiset (β a)) :
pi m t constructs the Cartesian product over t indexed by m.
Equations
- m.pi t = m.recOn {Multiset.Pi.empty β} (fun (a : α) (m : Multiset α) (p : Multiset ((a : α) → a ∈ m → β a)) => (t a).bind fun (b : β a) => Multiset.map (Multiset.Pi.cons m a b) p) ⋯