Skip to content

Commit 5c99765

Browse files
themathqueenb-mehta
authored andcommitted
chore(RingTheory/TensorProduct/Basic): some API for includeLeft and includeRight (leanprover-community#39694)
1 parent aff0c56 commit 5c99765

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

Mathlib/LinearAlgebra/TensorProduct/Tower.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ nonrec def mk (A M N : Type*) [Semiring A]
176176

177177
variable {R A B M N P Q}
178178

179+
/-- The heterobasic version of `mk` coincides with the regular version. -/
180+
lemma mk_eq : mk R R M N = TensorProduct.mk R M N := rfl
181+
179182
/-- Heterobasic version of `TensorProduct.map` -/
180183
def map (f : M →ₗ[A] P) (g : N →ₗ[R] Q) : M ⊗[R] N →ₗ[A] P ⊗[R] Q :=
181184
lift <|

Mathlib/RingTheory/TensorProduct/Basic.lean

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,9 @@ theorem tmul_pow (a : A) (b : B) (k : ℕ) : a ⊗ₜ[R] b ^ k = (a ^ k) ⊗ₜ[
269269
| succ k ih => simp [pow_succ, ih]
270270

271271
/-- The ring morphism `A →+* A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/
272-
@[simps]
272+
@[simps!]
273273
def includeLeftRingHom : A →+* A ⊗[R] B where
274-
toFun a := a ⊗ₜ 1
275-
map_zero' := by simp
276-
map_add' := by simp [add_tmul]
274+
__ := (AlgebraTensorModule.mk R R A B).flip 1 |>.toAddMonoidHom
277275
map_one' := rfl
278276
map_mul' := by simp
279277

@@ -317,19 +315,23 @@ theorem includeLeft_apply [SMulCommClass R S A] (a : A) :
317315
(includeLeft : A →ₐ[S] A ⊗[R] B) a = a ⊗ₜ 1 :=
318316
rfl
319317

318+
@[simp] theorem toLinearMap_includeLeft [SMulCommClass R S A] :
319+
(includeLeft : A →ₐ[S] A ⊗[R] B).toLinearMap = (AlgebraTensorModule.mk R S A B).flip 1 := rfl
320+
320321
/-- The algebra morphism `B →ₐ[R] A ⊗[R] B` sending `b` to `1 ⊗ₜ b`. -/
321322
def includeRight : B →ₐ[R] A ⊗[R] B where
322-
toFun b := 1 ⊗ₜ b
323-
map_zero' := by simp
324-
map_add' := by simp [tmul_add]
323+
__ := AlgebraTensorModule.mk R R A B 1 |>.toAddMonoidHom
325324
map_one' := rfl
326325
map_mul' := by simp
327-
commutes' r := by simp only [algebraMap_apply']
326+
commutes' r := by simp [algebraMap_eq_smul_one', smul_tmul]
328327

329328
@[simp]
330329
theorem includeRight_apply (b : B) : (includeRight : B →ₐ[R] A ⊗[R] B) b = 1 ⊗ₜ b :=
331330
rfl
332331

332+
@[simp] theorem toLinearMap_includeRight :
333+
(includeRight : B →ₐ[R] A ⊗[R] B).toLinearMap = AlgebraTensorModule.mk R R A B 1 := rfl
334+
333335
theorem includeLeftRingHom_comp_algebraMap :
334336
(includeLeftRingHom.comp (algebraMap R A) : R →+* A ⊗[R] B) =
335337
includeRight.toRingHom.comp (algebraMap R B) := by

Mathlib/RingTheory/TensorProduct/IncludeLeftSubRight.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ lemma includeLeftSubRight_apply (s : S) : includeLeftSubRight R S s = s ⊗ₜ[R
5454
lemma includeLeftSubRight_zero_of_mem_range {s : S} (hs : s ∈ Set.range ⇑(algebraMap R S)) :
5555
includeLeftSubRight R S s = 0 := by
5656
obtain ⟨_, hr⟩ := Set.mem_range.mp hs
57-
simp [includeLeftSubRight, ← hr]
57+
simp [← hr, algebraMap_eq_smul_one]
5858

5959
/-- `includeLeftSubRight R S` vanishes at `algebraMap R S r`. -/
6060
lemma includeLeftSubRight_algebraMap_zero (r : R) :

0 commit comments

Comments
 (0)