New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(LinearAlgebra/DirectSum/Finsupp) : tensor products of finsupp functions #10824
Conversation
variable {ι : Type*} [DecidableEq ι] | ||
|
||
/-- The tensor product of `i →₀ M` and `N` is linearly equivalent to `i →₀ M ⊗[R] N` -/ | ||
noncomputable def Finsupp.rTensor : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably this should be called TensorProduct.finsuppLeft
for consistency with TensorProduct.directSumLeft
and TensorProduct.prodLeft
, and similarly for Right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I had to check for the actual meaning of “Arguably” ! — it doesn't mean one can argue, and indeed, i won't…)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the initial file, finsuppTensorProductFinsupp
is in the root name space. Is this reasonable? (but I don't want to have to track at all instances…)
I am presently trying to prove the multiplicativity. |
Change i to iota Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
!bench |
Here are the benchmark results for commit cfa238f. Benchmark Metric Change
================================================================
- ~Mathlib.LinearAlgebra.DirectSum.Finsupp instructions 243.8% |
Is it possible to split the changes in |
Not it's not really possible, that's the whole goal of having these results |
It's best if the changes in |
…supp sums (#11635) ## Modules * `TensorProduct.finsuppLeft`, the tensor product of `ι →₀ M` and `N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppScalarLeft`, the tensor product of `ι →₀ R` and `N` is linearly equivalent to `ι →₀ N` * `TensorProduct.finsuppRight`, the tensor product of `M` and `ι →₀ N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppLeft'`, if `M` is an `S`-module, then the tensor product of `ι →₀ M` and `N` is `S`-linearly equivalent to `ι →₀ M ⊗[R] N` This is the first part of PR #10824 which contains three applications of these functions to monoid algebras, polynomials and multivariate polynomials. It has been split because this part is reasonably sound, while the three other files are more like propositions.
…supp sums (#11635) ## Modules * `TensorProduct.finsuppLeft`, the tensor product of `ι →₀ M` and `N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppScalarLeft`, the tensor product of `ι →₀ R` and `N` is linearly equivalent to `ι →₀ N` * `TensorProduct.finsuppRight`, the tensor product of `M` and `ι →₀ N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppLeft'`, if `M` is an `S`-module, then the tensor product of `ι →₀ M` and `N` is `S`-linearly equivalent to `ι →₀ M ⊗[R] N` This is the first part of PR #10824 which contains three applications of these functions to monoid algebras, polynomials and multivariate polynomials. It has been split because this part is reasonably sound, while the three other files are more like propositions.
…supp sums (#11635) ## Modules * `TensorProduct.finsuppLeft`, the tensor product of `ι →₀ M` and `N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppScalarLeft`, the tensor product of `ι →₀ R` and `N` is linearly equivalent to `ι →₀ N` * `TensorProduct.finsuppRight`, the tensor product of `M` and `ι →₀ N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppLeft'`, if `M` is an `S`-module, then the tensor product of `ι →₀ M` and `N` is `S`-linearly equivalent to `ι →₀ M ⊗[R] N` This is the first part of PR #10824 which contains three applications of these functions to monoid algebras, polynomials and multivariate polynomials. It has been split because this part is reasonably sound, while the three other files are more like propositions.
…supp sums (#11635) ## Modules * `TensorProduct.finsuppLeft`, the tensor product of `ι →₀ M` and `N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppScalarLeft`, the tensor product of `ι →₀ R` and `N` is linearly equivalent to `ι →₀ N` * `TensorProduct.finsuppRight`, the tensor product of `M` and `ι →₀ N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppLeft'`, if `M` is an `S`-module, then the tensor product of `ι →₀ M` and `N` is `S`-linearly equivalent to `ι →₀ M ⊗[R] N` This is the first part of PR #10824 which contains three applications of these functions to monoid algebras, polynomials and multivariate polynomials. It has been split because this part is reasonably sound, while the three other files are more like propositions.
/- | ||
lemma TensorProduct.map_isLinearMap' | ||
[Module S M] [IsScalarTower R S M] [Module S N] [IsScalarTower R S N] | ||
{P : Type*} [AddCommMonoid P] [Module R P] | ||
{Q : Type*} [AddCommMonoid Q] [Module R Q] | ||
(e : M →ₗ[S] N) (f : P →ₗ[R] Q) : | ||
IsLinearMap S (TensorProduct.map (e.restrictScalars R) f) where | ||
map_add := LinearMap.map_add _ | ||
map_smul := fun s t ↦ by | ||
induction t using TensorProduct.induction_on with | ||
| zero => simp | ||
| add x y hx hy => | ||
simp only [smul_add, map_add] at hx hy ⊢ | ||
simp only [hx, hy] | ||
| tmul m p => | ||
rw [smul_tmul'] | ||
simp only [map_tmul, coe_restrictScalars, map_smul] | ||
rfl | ||
-/ | ||
|
||
/- lemma TensorProduct.congr_isLinearMap' | ||
[Module S M] [IsScalarTower R S M] [Module S N] [IsScalarTower R S N] | ||
{P : Type*} [AddCommMonoid P] [Module R P] | ||
{Q : Type*} [AddCommMonoid Q] [Module R Q] | ||
(e : M ≃ₗ[S] N) (f : P ≃ₗ[R] Q) : | ||
IsLinearMap S (TensorProduct.congr (e.restrictScalars R) f) := | ||
TensorProduct.map_isLinearMap' e.toLinearMap f.toLinearMap -/ | ||
|
||
/- | ||
lemma LinearEquiv.rTensor_isLinearMap' | ||
[Module S M] [IsScalarTower R S M] [Module S N] [IsScalarTower R S N] | ||
(P : Type*) [AddCommMonoid P] [Module R P] (e : M ≃ₗ[S] N) : | ||
IsLinearMap S (LinearEquiv.rTensor P (e.restrictScalars R)) := | ||
TensorProduct.map_isLinearMap' e.toLinearMap _ | ||
-/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these supposed to be here?
And is it possible to split the PR into three, considering there are three new files added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this PR can be closed now.
…supp sums (#11635) ## Modules * `TensorProduct.finsuppLeft`, the tensor product of `ι →₀ M` and `N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppScalarLeft`, the tensor product of `ι →₀ R` and `N` is linearly equivalent to `ι →₀ N` * `TensorProduct.finsuppRight`, the tensor product of `M` and `ι →₀ N` is linearly equivalent to `ι →₀ M ⊗[R] N` * `TensorProduct.finsuppLeft'`, if `M` is an `S`-module, then the tensor product of `ι →₀ M` and `N` is `S`-linearly equivalent to `ι →₀ M ⊗[R] N` This is the first part of PR #10824 which contains three applications of these functions to monoid algebras, polynomials and multivariate polynomials. It has been split because this part is reasonably sound, while the three other files are more like propositions.
Modules
TensorProduct.finsuppLeft
, the tensor product ofι →₀ M
andN
is linearly equivalent toι →₀ M ⊗[R] N
TensorProduct.finsuppScalarLeft
, the tensor product ofι →₀ R
andN
is linearly equivalent toι →₀ N
TensorProduct.finsuppRight
, the tensor product ofM
andι →₀ N
is linearly equivalent toι →₀ M ⊗[R] N
TensorProduct.finsuppLeft'
, ifM
is anS
-module, then the tensor product ofι →₀ M
andN
isS
-linearly equivalent toι →₀ M ⊗[R] N
Monoid algebras
MonoidAlgebra.rTensorAlgEquiv
: the tensor product ofMonoidAlgebra M α
withN
isR
-linearly equivalent toMonoidAlgebra (M ⊗[R] N) α
MonoidAlgebra.scalarRTensorAlgEquiv
, the tensor product ofMonoidAlgebra R α
withN
isR
-linearly equivalent toMonoidAlgebra N α
Case of MvPolynomial
These functions apply to
MvPolynomial
, one can defineA proposition in this direction is given in
LinearAlgebra/TensorProduct/MvPolynomial
Case of
Polynomial
Polynomial
is a structure containing aFinsupp
, so these functionscan't be applied directly to
Polynomial
.Some linear equivs need to be added to mathlib for that.
A proposition in this direction is given in
LinearAlgebra.TensorProduct.Polynomial
TODO
reprove
TensorProduct.finsuppLeft'
using existing heterobasic version ofTensorProduct.congr
align what has been done for monoid agebras with what is missing for MvPolynomial or Polynomial