mathlib3 documentation

data.finsupp.multiset

Equivalence between multiset and ℕ-valued finitely supported functions #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This defines finsupp.to_multiset the equivalence between α →₀ ℕ and multiset α, along with multiset.to_finsupp the reverse equivalence and finsupp.order_iso_multiset the equivalence promoted to an order isomorphism.

noncomputable def finsupp.to_multiset {α : Type u_1} :

Given f : α →₀ ℕ, f.to_multiset is the multiset with multiplicities given by the values of f on the elements of α. We define this function as an add_equiv.

Equations
theorem finsupp.to_multiset_apply {α : Type u_1} (f : α →₀ ℕ) :
⇑finsupp.to_multiset f = f.sum (λ (a : α) (n : ℕ), n • {a})
@[simp]
theorem finsupp.to_multiset_symm_apply {α : Type u_1} [decidable_eq α] (s : multiset α) (x : α) :
@[simp]
theorem finsupp.to_multiset_single {α : Type u_1} (a : α) (n : ℕ) :
theorem finsupp.to_multiset_sum {α : Type u_1} {ι : Type u_3} {f : ι → α →₀ ℕ} (s : finset ι) :
⇑finsupp.to_multiset (s.sum (λ (i : ι), f i)) = s.sum (λ (i : ι), ⇑finsupp.to_multiset (f i))
theorem finsupp.to_multiset_sum_single {ι : Type u_3} (s : finset ι) (n : ℕ) :
⇑finsupp.to_multiset (s.sum (λ (i : ι), finsupp.single i n)) = n • s.val
theorem finsupp.card_to_multiset {α : Type u_1} (f : α →₀ ℕ) :
@[simp]
theorem finsupp.prod_to_multiset {α : Type u_1} [comm_monoid α] (f : α →₀ ℕ) :
(⇑finsupp.to_multiset f).prod = f.prod (λ (a : α) (n : ℕ), a ^ n)
@[simp]
theorem finsupp.count_to_multiset {α : Type u_1} [decidable_eq α] (f : α →₀ ℕ) (a : α) :
@[simp]
theorem finsupp.mem_to_multiset {α : Type u_1} (f : α →₀ ℕ) (i : α) :
noncomputable def multiset.to_finsupp {α : Type u_1} :

Given a multiset s, s.to_finsupp returns the finitely supported function on ℕ given by the multiplicities of the elements of s.

Equations
@[simp]
theorem multiset.to_finsupp_apply {α : Type u_1} [decidable_eq α] (s : multiset α) (a : α) :
@[simp]

As an order isomorphism #

theorem finsupp.sum_id_lt_of_lt {ι : Type u_3} (m n : ι →₀ ℕ) (h : m < n) :
m.sum (λ (_x : ι), id) < n.sum (λ (_x : ι), id)
theorem finsupp.lt_wf (ι : Type u_3) :

The order on ι →₀ ℕ is well-founded.