[Merged by Bors] - chore(ring_theory/tensor_product): replace is_scalar_tower by smul_comm_class in left_algebra#19118
[Merged by Bors] - chore(ring_theory/tensor_product): replace is_scalar_tower by smul_comm_class in left_algebra#19118
is_scalar_tower by smul_comm_class in left_algebra#19118Conversation
| lemma algebra_map_apply [smul_comm_class R S A] (r : S) : | ||
| (algebra_map S (A ⊗[R] B)) r = ((algebra_map S A) r) ⊗ₜ 1 := rfl | ||
|
|
||
| instance : is_scalar_tower R S (A ⊗[R] B) := ⟨λ a b c, by simp⟩ |
There was a problem hiding this comment.
Where did this instance go? Is it true by apply_instance? If so, please mention that in the PR description!
There was a problem hiding this comment.
Yes, both of the following work:
instance [algebra R S] [is_scalar_tower R S A] : is_scalar_tower R S (A ⊗[R] B) := infer_instance
instance [algebra S R] [is_scalar_tower S R A] : is_scalar_tower S R (A ⊗[R] B) := infer_instanceI added it to the PR description.
There was a problem hiding this comment.
Since this creates a forward-porting obligation anyway, should we add the missing results:
is_scalar_tower S (A ⊗[R] B) (A ⊗[R] B)smul_comm_class S (A ⊗[R] B) (A ⊗[R] B)
for when A is a non-unital algebra? (they're inferred from left_algebra when the algebra is unital)
There was a problem hiding this comment.
These are the two instances I was thinking of:
instance [monoid S] [distrib_mul_action S A] [is_scalar_tower S A A] [smul_comm_class R S A] :
is_scalar_tower S (A ⊗[R] B) (A ⊗[R] B) :=
{ smul_assoc := λ r x y, begin
change (r • x) * y = r • (x * y),
apply tensor_product.induction_on y,
{ simp [smul_zero], },
{ apply tensor_product.induction_on x,
{ simp [smul_zero] },
{ intros a b a' b',
dsimp,
rw [tensor_product.smul_tmul', tensor_product.smul_tmul', tmul_mul_tmul, smul_mul_assoc], },
{ intros, simp [smul_add, add_mul, *], } },
{ intros, simp [smul_add, mul_add, *], },
end }
instance [monoid S] [distrib_mul_action S A] [smul_comm_class S A A] [smul_comm_class R S A] :
smul_comm_class S (A ⊗[R] B) (A ⊗[R] B) :=
{ smul_comm := λ r x y, begin
change r • (x * y) = x * r • y,
apply tensor_product.induction_on y,
{ simp [smul_zero], },
{ apply tensor_product.induction_on x,
{ simp [smul_zero] },
{ intros a b a' b',
dsimp,
rw [tensor_product.smul_tmul', tensor_product.smul_tmul', tmul_mul_tmul, mul_smul_comm], },
{ intros, simp [smul_add, add_mul, *], } },
{ intros, simp [smul_add, mul_add, *], },
end }
eric-wieser
left a comment
There was a problem hiding this comment.
bors d+
Thanks!
Please wait for the out-of-sync queue to drop below 20 items before merging
|
✌️ ADedecker can now approve this pull request. To approve and merge a pull request, simply reply with |
|
It is also interesting to add S-linearity instances on the right. Around line 430 : I tried to make further adjustement to the |
|
One additional question: there are |
src/ring_theory/tensor_product.lean
Outdated
| /-- The `R`-algebra morphism `A →ₐ[R] A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/ | ||
| def include_left : A →ₐ[R] A ⊗[R] B := | ||
| /-- The `R`-algebra morphism `A →ₐ[S] A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/ | ||
| def include_left [smul_comm_class R S A] : A →ₐ[S] A ⊗[R] B := |
There was a problem hiding this comment.
You're right, and it's often painful otherwise (hence a few include_left : _ \to\_a[S] _ later in the file). However, I wonder whether one could have a variant include_left where S and R are equal, and include_left' for the more general one (with one explicit argument).
There was a problem hiding this comment.
We do use that pattern elsewhere; though it means you end up duplicating lots of api
There was a problem hiding this comment.
I don't understand what you mean with “duplicating lots of api”: no new lemma is created.
In the commutative case, the application suggested by @ADedecker requires less than what is done here, namely just A \to\_a A \otimes[R] B. But if A is not commutative, that does not work and one needs all intermediate linearity properties A \to\_a [S] A\otimes[R] B, for adequate S.
There was a problem hiding this comment.
If we have both include_left and include_left', then every time you write a lemma about the primed one you have to duplicate it for the unprimed one. So I think we should just have only the fully-general one; I don't think making people write a single R is much of a burden.
There was a problem hiding this comment.
Thank you, I see. I had imagined having include_left := include_left' R, but that would require many simp only [include_left] to access the API of include_left', or duplicating it as you say.
There was a problem hiding this comment.
(I'll have to check, but it seems that one needs to do similar modifications in linear_map.tensor_product.lean)
There was a problem hiding this comment.
I would suggest making this generalization in a separate PR; the typeclass change by itelf is pretty self-contained
There was a problem hiding this comment.
If I understand you correctly, this PR would just change the few instances that are invoked, and adding linearity is given in a separate PR ?
This reverts commit 8d0673e. I suggested modifications but it seems that the better for this PR is to have just the change in the instance and that further results be delegated to a later PR.
|
bors merge |
…_comm_class` in `left_algebra` (#19118) With this change, this instance works for both restriction (e.g tensor product over `ℂ` of complex algebras is a real algebra) and extension (e.g tensor product over `ℝ` of complex algebras is a complex algebra) of scalars. [Zulip](https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/Tensor.20products) I also removes [algebra.tensor_product.tensor_product.is_scalar_tower](https://leanprover-community.github.io/mathlib_docs/ring_theory/tensor_product.html#algebra.tensor_product.tensor_product.is_scalar_tower) since it is automatically inferred from [tensor_product.is_scalar_tower](https://leanprover-community.github.io/mathlib_docs/linear_algebra/tensor_product.html#tensor_product.is_scalar_tower) Co-authored-by: Antoine Chambert-Loir <antoine.chambert-loir@math.univ-paris-diderot.fr>
|
Pull request successfully merged into master. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
is_scalar_tower by smul_comm_class in left_algebrais_scalar_tower by smul_comm_class in left_algebra
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
This also removes a stray `import Mathlib.Tactic`, which causes a downstream file to break. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
This also removes a stray `import Mathlib.Tactic`, which causes a downstream file to break. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
With this change, this instance works for both restriction (e.g tensor product over
ℂof complex algebras is a real algebra) and extension (e.g tensor product overℝof complex algebras is a complex algebra) of scalars.Zulip
I also removes algebra.tensor_product.tensor_product.is_scalar_tower since it is automatically inferred from tensor_product.is_scalar_tower