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 dfinsupp.to_multiset
the equivalence between Π₀ a : α, ℕ
and multiset α
, along
with multiset.to_dfinsupp
the reverse equivalence.
Note that this provides a computable alternative to finsupp.to_multiset
.
@[protected, instance]
def
dfinsupp.add_zero_class'
{α : Type u_1}
{β : Type u_2}
[add_zero_class β] :
add_zero_class (Π₀ (a : α), β)
Non-dependent special case of dfinsupp.add_zero_class
to help typeclass search.
Equations
A computable version of finsupp.to_multiset
.
Equations
@[simp]
A computable version of multiset.to_finsupp
@[simp]
theorem
multiset.to_dfinsupp_apply
{α : Type u_1}
[decidable_eq α]
(s : multiset α)
(a : α) :
⇑(⇑multiset.to_dfinsupp s) a = multiset.count a s
@[simp]
@[simp]
@[simp]
theorem
multiset.to_dfinsupp_singleton
{α : Type u_1}
[decidable_eq α]
(a : α) :
⇑multiset.to_dfinsupp {a} = dfinsupp.single a 1
multiset.to_dfinsupp
as an add_equiv
.
Equations
- multiset.equiv_dfinsupp = multiset.to_dfinsupp.to_add_equiv dfinsupp.to_multiset multiset.equiv_dfinsupp._proof_1 multiset.equiv_dfinsupp._proof_2
@[simp]
@[simp]
@[simp]
@[simp]
theorem
multiset.to_dfinsupp_inj
{α : Type u_1}
[decidable_eq α]
{s t : multiset α} :
⇑multiset.to_dfinsupp s = ⇑multiset.to_dfinsupp t ↔ s = t
@[simp]
theorem
multiset.to_dfinsupp_le_to_dfinsupp
{α : Type u_1}
[decidable_eq α]
{s t : multiset α} :
⇑multiset.to_dfinsupp s ≤ ⇑multiset.to_dfinsupp t ↔ s ≤ t
@[simp]
theorem
multiset.to_dfinsupp_lt_to_dfinsupp
{α : Type u_1}
[decidable_eq α]
{s t : multiset α} :
⇑multiset.to_dfinsupp s < ⇑multiset.to_dfinsupp t ↔ s < t
@[simp]
@[simp]
@[simp]
@[simp]
theorem
dfinsupp.to_multiset_inj
{α : Type u_1}
[decidable_eq α]
{f g : Π₀ (a : α), ℕ} :
⇑dfinsupp.to_multiset f = ⇑dfinsupp.to_multiset g ↔ f = g
@[simp]
theorem
dfinsupp.to_multiset_le_to_multiset
{α : Type u_1}
[decidable_eq α]
{f g : Π₀ (a : α), ℕ} :
⇑dfinsupp.to_multiset f ≤ ⇑dfinsupp.to_multiset g ↔ f ≤ g
@[simp]
theorem
dfinsupp.to_multiset_lt_to_multiset
{α : Type u_1}
[decidable_eq α]
{f g : Π₀ (a : α), ℕ} :
⇑dfinsupp.to_multiset f < ⇑dfinsupp.to_multiset g ↔ f < g
@[simp]
@[simp]