Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit bc3ad25

Browse files
committed
feat(linear_algebra/tensor_algebra): Add missing lemmas about subtraction (#5428)
1 parent 34d5750 commit bc3ad25

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/linear_algebra/tensor_product.lean

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,17 @@ variables {R M N P}
9191
theorem map_zero₂ (y) : f 0 y = 0 := (flip f y).map_zero
9292

9393
theorem map_neg₂ {R : Type*} [comm_semiring R] {M N P : Type*}
94-
[add_comm_group M] [add_comm_group N] [add_comm_group P]
94+
[add_comm_group M] [add_comm_monoid N] [add_comm_group P]
9595
[semimodule R M] [semimodule R N] [semimodule R P] (f : M →ₗ[R] N →ₗ[R] P) (x y) :
9696
f (-x) y = -f x y :=
9797
(flip f y).map_neg _
9898

99+
theorem map_sub₂ {R : Type*} [comm_semiring R] {M N P : Type*}
100+
[add_comm_group M] [add_comm_monoid N] [add_comm_group P]
101+
[semimodule R M] [semimodule R N] [semimodule R P] (f : M →ₗ[R] N →ₗ[R] P) (x y z) :
102+
f (x - y) z = f x z - f y z :=
103+
(flip f z).map_sub _ _
104+
99105
theorem map_add₂ (x₁ x₂ y) : f (x₁ + x₂) y = f x₁ y + f x₂ y := (flip f y).map_add _ _
100106

101107
theorem map_smul₂ (r:R) (x y) : f (r • x) y = r • f x y := (flip f y).map_smul _ _
@@ -769,8 +775,6 @@ instance : has_neg (M ⊗[R] N) :=
769775
by simp_rw [add_monoid_hom.map_add, add_comm]
770776
end }
771777

772-
lemma neg_tmul (m : M) (n : N) : (-m) ⊗ₜ n = -(m ⊗ₜ[R] n) := rfl
773-
774778
instance : add_comm_group (M ⊗[R] N) :=
775779
{ neg := has_neg.neg,
776780
sub := _,
@@ -785,8 +789,16 @@ instance : add_comm_group (M ⊗[R] N) :=
785789
rw [hx, hy, add_zero], }),
786790
..(infer_instance : add_comm_monoid (M ⊗[R] N)) }
787791

792+
lemma neg_tmul (m : M) (n : N) : (-m) ⊗ₜ n = -(m ⊗ₜ[R] n) := rfl
793+
788794
lemma tmul_neg (m : M) (n : N) : m ⊗ₜ (-n) = -(m ⊗ₜ[R] n) := (mk R M N _).map_neg _
789795

796+
lemma tmul_sub (m : M) (n₁ n₂ : N) : m ⊗ₜ (n₁ - n₂) = (m ⊗ₜ[R] n₁) - (m ⊗ₜ[R] n₂) :=
797+
(mk R M N _).map_sub _ _
798+
799+
lemma sub_tmul (m₁ m₂ : M) (n : N) : (m₁ - m₂) ⊗ₜ n = (m₁ ⊗ₜ[R] n) - (m₂ ⊗ₜ[R] n) :=
800+
(mk R M N).map_sub₂ _ _ _
801+
790802
end tensor_product
791803

792804
namespace linear_map

0 commit comments

Comments
 (0)