Conversion between finsupp
and homogenous dfinsupp
#
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This module provides conversions between finsupp
and dfinsupp
.
It is in its own file since neither finsupp
or dfinsupp
depend on each other.
Main definitions #
- "identity" maps between
finsupp
anddfinsupp
:finsupp.to_dfinsupp : (ι →₀ M) → (Π₀ i : ι, M)
dfinsupp.to_finsupp : (Π₀ i : ι, M) → (ι →₀ M)
- Bundled equiv versions of the above:
finsupp_equiv_dfinsupp : (ι →₀ M) ≃ (Π₀ i : ι, M)
finsupp_add_equiv_dfinsupp : (ι →₀ M) ≃+ (Π₀ i : ι, M)
finsupp_lequiv_dfinsupp R : (ι →₀ M) ≃ₗ[R] (Π₀ i : ι, M)
- stronger versions of
finsupp.split
:sigma_finsupp_equiv_dfinsupp : ((Σ i, η i) →₀ N) ≃ (Π₀ i, (η i →₀ N))
sigma_finsupp_add_equiv_dfinsupp : ((Σ i, η i) →₀ N) ≃+ (Π₀ i, (η i →₀ N))
sigma_finsupp_lequiv_dfinsupp : ((Σ i, η i) →₀ N) ≃ₗ[R] (Π₀ i, (η i →₀ N))
Theorems #
The defining features of these operations is that they preserve the function and support:
finsupp.to_dfinsupp_coe
finsupp.to_dfinsupp_support
dfinsupp.to_finsupp_coe
dfinsupp.to_finsupp_support
and therefore map finsupp.single
to dfinsupp.single
and vice versa:
as well as preserving arithmetic operations.
For the bundled equivalences, we provide lemmas that they reduce to finsupp.to_dfinsupp
:
finsupp_add_equiv_dfinsupp_apply
finsupp_lequiv_dfinsupp_apply
finsupp_add_equiv_dfinsupp_symm_apply
finsupp_lequiv_dfinsupp_symm_apply
Implementation notes #
We provide dfinsupp.to_finsupp
and finsupp_equiv_dfinsupp
computably by adding
[decidable_eq ι]
and [Π m : M, decidable (m ≠ 0)]
arguments. To aid with definitional unfolding,
these arguments are also present on the noncomputable
equivs.
Basic definitions and lemmas #
Interpret a homogenous dfinsupp
as a finsupp
.
Note that the elaborator has a lot of trouble with this definition - it is often necessary to
write (dfinsupp.to_finsupp f : ι →₀ M)
instead of f.to_finsupp
, as for some unknown reason
using dot notation or omitting the type ascription prevents the type being resolved correctly.
Equations
- f.to_finsupp = {support := f.support, to_fun := ⇑f, mem_support_to_fun := _}
Lemmas about arithmetic operations #
finsupp.to_dfinsupp
and dfinsupp.to_finsupp
together form an equiv.
Equations
- finsupp_equiv_dfinsupp = {to_fun := finsupp.to_dfinsupp _inst_2, inv_fun := dfinsupp.to_finsupp (λ (m : M), _inst_3 m), left_inv := _, right_inv := _}
The additive version of finsupp.to_finsupp
. Note that this is noncomputable
because
finsupp.has_add
is noncomputable.
Equations
- finsupp_add_equiv_dfinsupp = {to_fun := finsupp.to_dfinsupp (add_zero_class.to_has_zero M), inv_fun := dfinsupp.to_finsupp (λ (m : M), _inst_3 m), left_inv := _, right_inv := _, map_add' := _}
The additive version of finsupp.to_finsupp
. Note that this is noncomputable
because
finsupp.has_add
is noncomputable.
Equations
- finsupp_lequiv_dfinsupp R = {to_fun := finsupp.to_dfinsupp (add_zero_class.to_has_zero M), map_add' := _, map_smul' := _, inv_fun := dfinsupp.to_finsupp (λ (m : M), _inst_4 m), left_inv := _, right_inv := _}
finsupp.split
is an equivalence between (Σ i, η i) →₀ N
and Π₀ i, (η i →₀ N)
.
Equations
- sigma_finsupp_equiv_dfinsupp = {to_fun := λ (f : (Σ (i : ι), η i) →₀ N), {to_fun := f.split, support' := trunc.mk ⟨f.split_support.val, _⟩}, inv_fun := λ (f : Π₀ (i : ι), η i →₀ N), finsupp.on_finset (f.support.sigma (λ (j : ι), (⇑f j).support)) (λ (ji : Σ (i : ι), η i), ⇑(⇑f ji.fst) ji.snd) _, left_inv := _, right_inv := _}
finsupp.split
is an additive equivalence between (Σ i, η i) →₀ N
and Π₀ i, (η i →₀ N)
.
Equations
- sigma_finsupp_add_equiv_dfinsupp = {to_fun := ⇑sigma_finsupp_equiv_dfinsupp, inv_fun := ⇑(sigma_finsupp_equiv_dfinsupp.symm), left_inv := _, right_inv := _, map_add' := _}
finsupp.split
is a linear equivalence between (Σ i, η i) →₀ N
and Π₀ i, (η i →₀ N)
.
Equations
- sigma_finsupp_lequiv_dfinsupp R = {to_fun := sigma_finsupp_add_equiv_dfinsupp.to_fun, map_add' := _, map_smul' := _, inv_fun := sigma_finsupp_add_equiv_dfinsupp.inv_fun, left_inv := _, right_inv := _}