Skip to content

Commit 1c13c14

Browse files
chrisflavcallesonne
authored andcommitted
chore(RingTheory/TensorProduct): more product compatibilities (leanprover-community#24380)
1 parent fea2d37 commit 1c13c14

File tree

1 file changed

+48
-4
lines changed
  • Mathlib/RingTheory/TensorProduct

1 file changed

+48
-4
lines changed

Mathlib/RingTheory/TensorProduct/Pi.lean

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Christian Merten
55
-/
66
import Mathlib.Algebra.Algebra.Pi
77
import Mathlib.LinearAlgebra.TensorProduct.Pi
8+
import Mathlib.LinearAlgebra.TensorProduct.Prod
89
import Mathlib.RingTheory.TensorProduct.Basic
910

1011
/-!
@@ -17,7 +18,7 @@ is a direct application of `Mathlib/LinearAlgebra/TensorProduct/Pi.lean` to the
1718

1819
open TensorProduct
1920

20-
section
21+
namespace Algebra.TensorProduct
2122

2223
variable (R S A : Type*) [CommSemiring R] [CommSemiring S] [Algebra R S] [CommSemiring A]
2324
[Algebra R A] [Algebra S A] [IsScalarTower R S A]
@@ -47,12 +48,55 @@ noncomputable def piRightHom : A ⊗[R] (∀ i, B i) →ₐ[S] ∀ i, A ⊗[R] B
4748
variable [Fintype ι] [DecidableEq ι]
4849

4950
/-- Tensor product of rings commutes with finite products on the right. -/
50-
noncomputable def Algebra.TensorProduct.piRight :
51-
A ⊗[R] (∀ i, B i) ≃ₐ[S] ∀ i, A ⊗[R] B i :=
51+
noncomputable def piRight : A ⊗[R] (∀ i, B i) ≃ₐ[S] ∀ i, A ⊗[R] B i :=
5252
AlgEquiv.ofLinearEquiv (_root_.TensorProduct.piRight R S A B) (by simp) (by simp)
5353

5454
@[simp]
55-
lemma Algebra.TensorProduct.piRight_tmul (x : A) (f : ∀ i, B i) :
55+
lemma piRight_tmul (x : A) (f : ∀ i, B i) :
5656
piRight R S A B (x ⊗ₜ f) = (fun j ↦ x ⊗ₜ f j) := rfl
5757

58+
variable (ι) in
59+
/-- Variant of `Algebra.TensorProduct.piRight` with constant factors. -/
60+
noncomputable def piScalarRight : A ⊗[R] (ι → R) ≃ₐ[S] ι → A :=
61+
(piRight R S A (fun _ : ι ↦ R)).trans <|
62+
AlgEquiv.piCongrRight (fun _ ↦ Algebra.TensorProduct.rid R S A)
63+
64+
lemma piScalarRight_tmul (x : A) (y : ι → R) :
65+
piScalarRight R S A ι (x ⊗ₜ y) = fun i ↦ y i • x :=
66+
rfl
67+
68+
@[simp]
69+
lemma piScalarRight_tmul_apply (x : A) (y : ι → R) (i : ι) :
70+
piScalarRight R S A ι (x ⊗ₜ y) i = y i • x :=
71+
rfl
72+
73+
section
74+
75+
variable (B C : Type*) [Semiring B] [Semiring C] [Algebra R B] [Algebra R C]
76+
77+
/-- Tensor product of rings commutes with binary products on the right. -/
78+
noncomputable nonrec def prodRight : A ⊗[R] (B × C) ≃ₐ[S] A ⊗[R] B × A ⊗[R] C :=
79+
AlgEquiv.ofLinearEquiv (TensorProduct.prodRight R S A B C)
80+
(by simp [Algebra.TensorProduct.one_def])
81+
(LinearMap.map_mul_of_map_mul_tmul (fun _ _ _ _ ↦ by simp))
82+
83+
lemma prodRight_tmul (a : A) (x : B × C) : prodRight R S A B C (a ⊗ₜ x) = (a ⊗ₜ x.1, a ⊗ₜ x.2) :=
84+
rfl
85+
86+
@[simp]
87+
lemma prodRight_tmul_fst (a : A) (x : B × C) : (prodRight R S A B C (a ⊗ₜ x)).fst = a ⊗ₜ x.1 :=
88+
rfl
89+
90+
@[simp]
91+
lemma prodRight_tmul_snd (a : A) (x : B × C) : (prodRight R S A B C (a ⊗ₜ x)).snd = a ⊗ₜ x.2 :=
92+
rfl
93+
94+
@[simp]
95+
lemma prodRight_symm_tmul (a : A) (b : B) (c : C) :
96+
(prodRight R S A B C).symm (a ⊗ₜ b, a ⊗ₜ c) = a ⊗ₜ (b, c) := by
97+
apply (prodRight R S A B C).injective
98+
simp [prodRight_tmul]
99+
58100
end
101+
102+
end Algebra.TensorProduct

0 commit comments

Comments
 (0)