Skip to content

Commit bcfe954

Browse files
jjaassoonndagurtomas
authored andcommitted
feat(LinearAlgebra/TensorProduct): add TensorProduct.map₂ (#10986)
1 parent ef2834e commit bcfe954

2 files changed

Lines changed: 20 additions & 28 deletions

File tree

Mathlib/LinearAlgebra/TensorProduct.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,19 @@ def homTensorHomMap : (M →ₗ[R] P) ⊗[R] (N →ₗ[R] Q) →ₗ[R] M ⊗[R]
945945

946946
variable {R M N P Q}
947947

948+
/--
949+
This is a binary version of `TensorProduct.map`: Given a bilinear map `f : M ⟶ P ⟶ Q` and a
950+
bilinear map `g : N ⟶ S ⟶ T`, if we think `f` and `g` as linear maps with two inputs, then
951+
`map₂ f g` is a bilinear map taking two inputs `M ⊗ N → P ⊗ S → Q ⊗ S` defined by
952+
`map₂ f g (m ⊗ n) (p ⊗ s) = f m p ⊗ g n s`.
953+
954+
Mathematically, `TensorProduct.map₂` is defined as the composition
955+
`M ⊗ N -map→ Hom(P, Q) ⊗ Hom(S, T) -homTensorHomMap→ Hom(P ⊗ S, Q ⊗ T)`.
956+
-/
957+
def map₂ (f : M →ₗ[R] P →ₗ[R] Q) (g : N →ₗ[R] S →ₗ[R] T) :
958+
M ⊗[R] N →ₗ[R] P ⊗[R] S →ₗ[R] Q ⊗[R] T :=
959+
homTensorHomMap R _ _ _ _ ∘ₗ map f g
960+
948961
@[simp]
949962
theorem mapBilinear_apply (f : M →ₗ[R] P) (g : N →ₗ[R] Q) : mapBilinear R M N P Q f g = map f g :=
950963
rfl
@@ -968,6 +981,10 @@ theorem homTensorHomMap_apply (f : M →ₗ[R] P) (g : N →ₗ[R] Q) :
968981
rfl
969982
#align tensor_product.hom_tensor_hom_map_apply TensorProduct.homTensorHomMap_apply
970983

984+
@[simp]
985+
theorem map₂_apply_tmul (f : M →ₗ[R] P →ₗ[R] Q) (g : N →ₗ[R] S →ₗ[R] T) (m : M) (n : N) :
986+
map₂ f g (m ⊗ₜ n) = map (f m) (g n) := rfl
987+
971988
@[simp]
972989
theorem map_zero_left (g : N →ₗ[R] Q) : map (0 : M →ₗ[R] P) g = 0 :=
973990
(mapBilinear R M N P Q).map_zero₂ _

Mathlib/RingTheory/TensorProduct.lean

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -213,40 +213,15 @@ variable [CommSemiring R]
213213
variable [NonUnitalNonAssocSemiring A] [Module R A] [SMulCommClass R A A] [IsScalarTower R A A]
214214
variable [NonUnitalNonAssocSemiring B] [Module R B] [SMulCommClass R B B] [IsScalarTower R B B]
215215

216-
/-- (Implementation detail)
217-
The multiplication map on `A ⊗[R] B`,
218-
for a fixed pure tensor in the first argument,
219-
as an `R`-linear map.
220-
-/
221-
def mulAux (a₁ : A) (b₁ : B) : A ⊗[R] B →ₗ[R] A ⊗[R] B :=
222-
TensorProduct.map (LinearMap.mulLeft R a₁) (LinearMap.mulLeft R b₁)
223-
#align algebra.tensor_product.mul_aux Algebra.TensorProduct.mulAux
224-
225-
@[simp]
226-
theorem mulAux_apply (a₁ a₂ : A) (b₁ b₂ : B) :
227-
(mulAux a₁ b₁) (a₂ ⊗ₜ[R] b₂) = (a₁ * a₂) ⊗ₜ[R] (b₁ * b₂) :=
228-
rfl
229-
#align algebra.tensor_product.mul_aux_apply Algebra.TensorProduct.mulAux_apply
216+
#noalign algebra.tensor_product.mul_aux
217+
#noalign algebra.tensor_product.mul_aux_apply
230218

231219
/-- (Implementation detail)
232220
The multiplication map on `A ⊗[R] B`,
233221
as an `R`-bilinear map.
234222
-/
235223
def mul : A ⊗[R] B →ₗ[R] A ⊗[R] B →ₗ[R] A ⊗[R] B :=
236-
TensorProduct.lift <|
237-
LinearMap.mk₂ R mulAux
238-
(fun x₁ x₂ y =>
239-
TensorProduct.ext' fun x' y' => by
240-
simp only [mulAux_apply, LinearMap.add_apply, add_mul, add_tmul])
241-
(fun c x y =>
242-
TensorProduct.ext' fun x' y' => by
243-
simp only [mulAux_apply, LinearMap.smul_apply, smul_tmul', smul_mul_assoc])
244-
(fun x y₁ y₂ =>
245-
TensorProduct.ext' fun x' y' => by
246-
simp only [mulAux_apply, LinearMap.add_apply, add_mul, tmul_add])
247-
fun c x y =>
248-
TensorProduct.ext' fun x' y' => by
249-
simp only [mulAux_apply, LinearMap.smul_apply, smul_tmul, smul_tmul', smul_mul_assoc]
224+
TensorProduct.map₂ (LinearMap.mul R A) (LinearMap.mul R B)
250225
#align algebra.tensor_product.mul Algebra.TensorProduct.mul
251226

252227
@[simp]

0 commit comments

Comments
 (0)