|
| 1 | +/- |
| 2 | +Copyright (c) 2023 Eric Wieser. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Eric Wieser |
| 5 | +-/ |
| 6 | +import Mathlib.LinearAlgebra.TensorProduct |
| 7 | +import Mathlib.LinearAlgebra.Prod |
| 8 | + |
| 9 | +/-! |
| 10 | +# Tensor products of products |
| 11 | +
|
| 12 | +This file shows that taking `TensorProduct`s commutes with taking `Prod`s in both arguments. |
| 13 | +
|
| 14 | +## Main results |
| 15 | +
|
| 16 | +* `TensorProduct.prodLeft` |
| 17 | +* `TensorProduct.prodRight` |
| 18 | +-/ |
| 19 | + |
| 20 | +universe uR uM₁ uM₂ uM₃ |
| 21 | +variable (R : Type uR) (M₁ : Type uM₁) (M₂ : Type uM₂) (M₃ : Type uM₃) |
| 22 | + |
| 23 | +namespace TensorProduct |
| 24 | + |
| 25 | +variable [CommSemiring R] [AddCommMonoid M₁] [AddCommMonoid M₂] [AddCommMonoid M₃] |
| 26 | +variable [Module R M₁] [Module R M₂] [Module R M₃] |
| 27 | + |
| 28 | +attribute [ext] TensorProduct.ext |
| 29 | + |
| 30 | +/-- Tensor products distribute over a product on the right. -/ |
| 31 | +def prodRight : M₁ ⊗[R] (M₂ × M₃) ≃ₗ[R] ((M₁ ⊗[R] M₂) × (M₁ ⊗[R] M₃)) := |
| 32 | + LinearEquiv.ofLinear |
| 33 | + (lift <| |
| 34 | + LinearMap.prodMapLinear R M₂ M₃ (M₁ ⊗[R] M₂) (M₁ ⊗[R] M₃) R |
| 35 | + ∘ₗ LinearMap.prod (mk _ _ _) (mk _ _ _)) |
| 36 | + (LinearMap.coprod |
| 37 | + (LinearMap.lTensor _ <| LinearMap.inl _ _ _) |
| 38 | + (LinearMap.lTensor _ <| LinearMap.inr _ _ _)) |
| 39 | + (by ext <;> simp) |
| 40 | + (by ext <;> simp) |
| 41 | + |
| 42 | +@[simp] theorem prodRight_tmul (m₁ : M₁) (m₂ : M₂) (m₃ : M₃) : |
| 43 | + prodRight R M₁ M₂ M₃ (m₁ ⊗ₜ (m₂, m₃)) = (m₁ ⊗ₜ m₂, m₁ ⊗ₜ m₃) := |
| 44 | + rfl |
| 45 | + |
| 46 | +@[simp] theorem prodRight_symm_tmul (m₁ : M₁) (m₂ : M₂) (m₃ : M₃) : |
| 47 | + (prodRight R M₁ M₂ M₃).symm (m₁ ⊗ₜ m₂, m₁ ⊗ₜ m₃) = (m₁ ⊗ₜ (m₂, m₃)) := |
| 48 | + (LinearEquiv.symm_apply_eq _).mpr rfl |
| 49 | + |
| 50 | +/-- Tensor products distribute over a product on the left . -/ |
| 51 | +def prodLeft : (M₁ × M₂) ⊗[R] M₃ ≃ₗ[R] ((M₁ ⊗[R] M₃) × (M₂ ⊗[R] M₃)) := |
| 52 | + TensorProduct.comm _ _ _ |
| 53 | + ≪≫ₗ TensorProduct.prodRight R _ _ _ |
| 54 | + ≪≫ₗ (TensorProduct.comm R _ _).prod (TensorProduct.comm R _ _) |
| 55 | + |
| 56 | +@[simp] theorem prodLeft_tmul (m₁ : M₁) (m₂ : M₂) (m₃ : M₃) : |
| 57 | + prodLeft R M₁ M₂ M₃ ((m₁, m₂) ⊗ₜ m₃) = (m₁ ⊗ₜ m₃, m₂ ⊗ₜ m₃) := |
| 58 | + rfl |
| 59 | + |
| 60 | +@[simp] theorem prodLeft_symm_tmul (m₁ : M₁) (m₂ : M₂) (m₃ : M₃) : |
| 61 | + (prodLeft R M₁ M₂ M₃).symm (m₁ ⊗ₜ m₃, m₂ ⊗ₜ m₃) = ((m₁, m₂) ⊗ₜ m₃) := |
| 62 | + (LinearEquiv.symm_apply_eq _).mpr rfl |
| 63 | + |
| 64 | +end TensorProduct |
0 commit comments