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

Commit 48883dc

Browse files
committed
chore(algebra/basic): split out facts about lmul (#9300)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 854e5c6 commit 48883dc

File tree

10 files changed

+233
-189
lines changed

10 files changed

+233
-189
lines changed

src/algebra/algebra/basic.lean

Lines changed: 6 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Authors: Kenny Lau, Yury Kudryashov
55
-/
66
import algebra.iterate_hom
77
import data.equiv.ring_aut
8-
import linear_algebra.tensor_product
9-
import tactic.nth_rewrite
8+
import algebra.module.basic
9+
import linear_algebra.basic
1010

1111
/-!
12-
# Algebra over Commutative Semiring
12+
# Algebras over commutative semirings
1313
1414
In this file we define `algebra`s over commutative (semi)rings, algebra homomorphisms `alg_hom`,
15-
algebra equivalences `alg_equiv`. We also define usual operations on `alg_hom`s
16-
(`id`, `comp`).
15+
and algebra equivalences `alg_equiv`.
16+
We also define the usual operations on `alg_hom`s (`id`, `comp`).
1717
1818
`subalgebra`s are defined in `algebra.algebra.subalgebra`.
1919
@@ -32,7 +32,7 @@ For the category of `R`-algebras, denoted `Algebra R`, see the file
3232

3333
universes u v w u₁ v₁
3434

35-
open_locale tensor_product big_operators
35+
open_locale big_operators
3636

3737
section prio
3838
-- We set this priority to 0 later in this file
@@ -1247,127 +1247,8 @@ variables {R}
12471247

12481248
theorem of_id_apply (r) : of_id R A r = algebra_map R A r := rfl
12491249

1250-
variables (R A)
1251-
/-- The multiplication in an algebra is a bilinear map.
1252-
1253-
A weaker version of this for semirings exists as `add_monoid_hom.mul`. -/
1254-
def lmul : A →ₐ[R] (End R A) :=
1255-
{ map_one' := by { ext a, exact one_mul a },
1256-
map_mul' := by { intros a b, ext c, exact mul_assoc a b c },
1257-
map_zero' := by { ext a, exact zero_mul a },
1258-
commutes' := by { intro r, ext a, dsimp, rw [smul_def] },
1259-
.. (show A →ₗ[R] A →ₗ[R] A, from linear_map.mk₂ R (*)
1260-
(λ x y z, add_mul x y z)
1261-
(λ c x y, by rw [smul_def, smul_def, mul_assoc _ x y])
1262-
(λ x y z, mul_add x y z)
1263-
(λ c x y, by rw [smul_def, smul_def, left_comm])) }
1264-
1265-
variables {A}
1266-
1267-
/-- The multiplication on the left in an algebra is a linear map. -/
1268-
def lmul_left (r : A) : A →ₗ[R] A :=
1269-
lmul R A r
1270-
1271-
/-- The multiplication on the right in an algebra is a linear map. -/
1272-
def lmul_right (r : A) : A →ₗ[R] A :=
1273-
(lmul R A).to_linear_map.flip r
1274-
1275-
/-- Simultaneous multiplication on the left and right is a linear map. -/
1276-
def lmul_left_right (vw: A × A) : A →ₗ[R] A :=
1277-
(lmul_right R vw.2).comp (lmul_left R vw.1)
1278-
1279-
/-- The multiplication map on an algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/
1280-
def lmul' : A ⊗[R] A →ₗ[R] A :=
1281-
tensor_product.lift (lmul R A).to_linear_map
1282-
1283-
lemma commute_lmul_left_right (a b : A) :
1284-
commute (lmul_left R a) (lmul_right R b) :=
1285-
by { ext c, exact (mul_assoc a c b).symm, }
1286-
1287-
variables {R A}
1288-
1289-
@[simp] lemma lmul_apply (p q : A) : lmul R A p q = p * q := rfl
1290-
@[simp] lemma lmul_left_apply (p q : A) : lmul_left R p q = p * q := rfl
1291-
@[simp] lemma lmul_right_apply (p q : A) : lmul_right R p q = q * p := rfl
1292-
@[simp] lemma lmul_left_right_apply (vw : A × A) (p : A) :
1293-
lmul_left_right R vw p = vw.1 * p * vw.2 := rfl
1294-
1295-
@[simp] lemma lmul_left_one : lmul_left R (1:A) = linear_map.id :=
1296-
by { ext, simp only [linear_map.id_coe, one_mul, id.def, lmul_left_apply] }
1297-
1298-
@[simp] lemma lmul_left_mul (a b : A) :
1299-
lmul_left R (a * b) = (lmul_left R a).comp (lmul_left R b) :=
1300-
by { ext, simp only [lmul_left_apply, linear_map.comp_apply, mul_assoc] }
1301-
1302-
@[simp] lemma lmul_right_one : lmul_right R (1:A) = linear_map.id :=
1303-
by { ext, simp only [linear_map.id_coe, mul_one, id.def, lmul_right_apply] }
1304-
1305-
@[simp] lemma lmul_right_mul (a b : A) :
1306-
lmul_right R (a * b) = (lmul_right R b).comp (lmul_right R a) :=
1307-
by { ext, simp only [lmul_right_apply, linear_map.comp_apply, mul_assoc] }
1308-
1309-
@[simp] lemma lmul_left_zero_eq_zero :
1310-
lmul_left R (0 : A) = 0 :=
1311-
(lmul R A).map_zero
1312-
1313-
@[simp] lemma lmul_right_zero_eq_zero :
1314-
lmul_right R (0 : A) = 0 :=
1315-
(lmul R A).to_linear_map.flip.map_zero
1316-
1317-
@[simp] lemma lmul_left_eq_zero_iff (a : A) :
1318-
lmul_left R a = 0 ↔ a = 0 :=
1319-
begin
1320-
split; intros h,
1321-
{ rw [← mul_one a, ← lmul_left_apply a 1, h, linear_map.zero_apply], },
1322-
{ rw h, exact lmul_left_zero_eq_zero, },
1323-
end
1324-
1325-
@[simp] lemma lmul_right_eq_zero_iff (a : A) :
1326-
lmul_right R a = 0 ↔ a = 0 :=
1327-
begin
1328-
split; intros h,
1329-
{ rw [← one_mul a, ← lmul_right_apply a 1, h, linear_map.zero_apply], },
1330-
{ rw h, exact lmul_right_zero_eq_zero, },
1331-
end
1332-
1333-
@[simp] lemma pow_lmul_left (a : A) (n : ℕ) :
1334-
(lmul_left R a) ^ n = lmul_left R (a ^ n) :=
1335-
((lmul R A).map_pow a n).symm
1336-
1337-
@[simp] lemma pow_lmul_right (a : A) (n : ℕ) :
1338-
(lmul_right R a) ^ n = lmul_right R (a ^ n) :=
1339-
linear_map.coe_injective $ ((lmul_right R a).coe_pow n).symm ▸ (mul_right_iterate a n)
1340-
1341-
@[simp] lemma lmul'_apply {x y : A} : lmul' R (x ⊗ₜ y) = x * y :=
1342-
by simp only [algebra.lmul', tensor_product.lift.tmul, alg_hom.to_linear_map_apply, lmul_apply]
1343-
1344-
end algebra
1345-
1346-
section ring
1347-
1348-
namespace algebra
1349-
1350-
variables {R A : Type*} [comm_semiring R] [ring A] [algebra R A]
1351-
1352-
lemma lmul_left_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
1353-
function.injective (lmul_left R x) :=
1354-
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
1355-
exact mul_right_injective' hx }
1356-
1357-
lemma lmul_right_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
1358-
function.injective (lmul_right R x) :=
1359-
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
1360-
exact mul_left_injective' hx }
1361-
1362-
lemma lmul_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
1363-
function.injective (lmul R A x) :=
1364-
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
1365-
exact mul_right_injective' hx }
1366-
13671250
end algebra
13681251

1369-
end ring
1370-
13711252
section int
13721253

13731254
variables (R : Type*) [ring R]

src/algebra/algebra/bilinear.lean

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/-
2+
Copyright (c) 2018 Kenny Lau. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Kenny Lau, Yury Kudryashov
5+
-/
6+
import algebra.algebra.basic
7+
import linear_algebra.tensor_product
8+
9+
/-!
10+
# Facts about algebras involving bilinear maps and tensor products
11+
12+
We move a few basic statements about algebras out of `algebra.algebra.basic`,
13+
in order to avoid importing `linear_algebra.bilinear_map` and
14+
`linear_algebra.tensor_product` unnecessarily.
15+
-/
16+
17+
universes u v w
18+
19+
namespace algebra
20+
21+
open_locale tensor_product
22+
open module
23+
24+
section
25+
26+
variables (R A : Type*) [comm_semiring R] [semiring A] [algebra R A]
27+
28+
/-- The multiplication in an algebra is a bilinear map.
29+
30+
A weaker version of this for semirings exists as `add_monoid_hom.mul`. -/
31+
def lmul : A →ₐ[R] (End R A) :=
32+
{ map_one' := by { ext a, exact one_mul a },
33+
map_mul' := by { intros a b, ext c, exact mul_assoc a b c },
34+
map_zero' := by { ext a, exact zero_mul a },
35+
commutes' := by { intro r, ext a, dsimp, rw [smul_def] },
36+
.. (show A →ₗ[R] A →ₗ[R] A, from linear_map.mk₂ R (*)
37+
(λ x y z, add_mul x y z)
38+
(λ c x y, by rw [smul_def, smul_def, mul_assoc _ x y])
39+
(λ x y z, mul_add x y z)
40+
(λ c x y, by rw [smul_def, smul_def, left_comm])) }
41+
42+
variables {R A}
43+
44+
@[simp] lemma lmul_apply (p q : A) : lmul R A p q = p * q := rfl
45+
46+
47+
variables (R)
48+
49+
/-- The multiplication on the left in an algebra is a linear map. -/
50+
def lmul_left (r : A) : A →ₗ[R] A :=
51+
lmul R A r
52+
53+
/-- The multiplication on the right in an algebra is a linear map. -/
54+
def lmul_right (r : A) : A →ₗ[R] A :=
55+
(lmul R A).to_linear_map.flip r
56+
57+
/-- Simultaneous multiplication on the left and right is a linear map. -/
58+
def lmul_left_right (vw: A × A) : A →ₗ[R] A :=
59+
(lmul_right R vw.2).comp (lmul_left R vw.1)
60+
61+
lemma commute_lmul_left_right (a b : A) :
62+
commute (lmul_left R a) (lmul_right R b) :=
63+
by { ext c, exact (mul_assoc a c b).symm, }
64+
65+
/-- The multiplication map on an algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/
66+
def lmul' : A ⊗[R] A →ₗ[R] A :=
67+
tensor_product.lift (lmul R A).to_linear_map
68+
69+
variables {R A}
70+
71+
@[simp] lemma lmul'_apply {x y : A} : lmul' R (x ⊗ₜ y) = x * y :=
72+
by simp only [algebra.lmul', tensor_product.lift.tmul, alg_hom.to_linear_map_apply, lmul_apply]
73+
74+
@[simp] lemma lmul_left_apply (p q : A) : lmul_left R p q = p * q := rfl
75+
@[simp] lemma lmul_right_apply (p q : A) : lmul_right R p q = q * p := rfl
76+
@[simp] lemma lmul_left_right_apply (vw : A × A) (p : A) :
77+
lmul_left_right R vw p = vw.1 * p * vw.2 := rfl
78+
79+
@[simp] lemma lmul_left_one : lmul_left R (1:A) = linear_map.id :=
80+
by { ext, simp only [linear_map.id_coe, one_mul, id.def, lmul_left_apply] }
81+
82+
@[simp] lemma lmul_left_mul (a b : A) :
83+
lmul_left R (a * b) = (lmul_left R a).comp (lmul_left R b) :=
84+
by { ext, simp only [lmul_left_apply, linear_map.comp_apply, mul_assoc] }
85+
86+
@[simp] lemma lmul_right_one : lmul_right R (1:A) = linear_map.id :=
87+
by { ext, simp only [linear_map.id_coe, mul_one, id.def, lmul_right_apply] }
88+
89+
@[simp] lemma lmul_right_mul (a b : A) :
90+
lmul_right R (a * b) = (lmul_right R b).comp (lmul_right R a) :=
91+
by { ext, simp only [lmul_right_apply, linear_map.comp_apply, mul_assoc] }
92+
93+
@[simp] lemma lmul_left_zero_eq_zero :
94+
lmul_left R (0 : A) = 0 :=
95+
(lmul R A).map_zero
96+
97+
@[simp] lemma lmul_right_zero_eq_zero :
98+
lmul_right R (0 : A) = 0 :=
99+
(lmul R A).to_linear_map.flip.map_zero
100+
101+
@[simp] lemma lmul_left_eq_zero_iff (a : A) :
102+
lmul_left R a = 0 ↔ a = 0 :=
103+
begin
104+
split; intros h,
105+
{ rw [← mul_one a, ← lmul_left_apply a 1, h, linear_map.zero_apply], },
106+
{ rw h, exact lmul_left_zero_eq_zero, },
107+
end
108+
109+
@[simp] lemma lmul_right_eq_zero_iff (a : A) :
110+
lmul_right R a = 0 ↔ a = 0 :=
111+
begin
112+
split; intros h,
113+
{ rw [← one_mul a, ← lmul_right_apply a 1, h, linear_map.zero_apply], },
114+
{ rw h, exact lmul_right_zero_eq_zero, },
115+
end
116+
117+
@[simp] lemma pow_lmul_left (a : A) (n : ℕ) :
118+
(lmul_left R a) ^ n = lmul_left R (a ^ n) :=
119+
((lmul R A).map_pow a n).symm
120+
121+
@[simp] lemma pow_lmul_right (a : A) (n : ℕ) :
122+
(lmul_right R a) ^ n = lmul_right R (a ^ n) :=
123+
linear_map.coe_injective $ ((lmul_right R a).coe_pow n).symm ▸ (mul_right_iterate a n)
124+
125+
end
126+
127+
section
128+
129+
variables {R A : Type*} [comm_semiring R] [ring A] [algebra R A]
130+
131+
lemma lmul_left_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
132+
function.injective (lmul_left R x) :=
133+
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
134+
exact mul_right_injective' hx }
135+
136+
lemma lmul_right_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
137+
function.injective (lmul_right R x) :=
138+
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
139+
exact mul_left_injective' hx }
140+
141+
lemma lmul_injective [no_zero_divisors A] {x : A} (hx : x ≠ 0) :
142+
function.injective (lmul R A x) :=
143+
by { letI : domain A := { exists_pair_ne := ⟨x, 0, hx⟩, ..‹ring A›, ..‹no_zero_divisors A› },
144+
exact mul_right_injective' hx }
145+
146+
end
147+
148+
end algebra

src/algebra/algebra/operations.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2019 Kenny Lau. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Kenny Lau
55
-/
6-
import algebra.algebra.basic
6+
import algebra.algebra.bilinear
77
import algebra.module.submodule_pointwise
88

99
/-!

src/linear_algebra/alternating.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Eric Wieser, Zhangir Azerbayev
55
-/
66

7-
import linear_algebra.multilinear
7+
import linear_algebra.multilinear.tensor_product
88
import linear_algebra.linear_independent
99
import group_theory.perm.sign
1010
import group_theory.perm.subgroup
1111
import data.equiv.fin
12-
import linear_algebra.tensor_product
1312
import group_theory.quotient_group
1413

1514
/-!

src/linear_algebra/determinant.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import linear_algebra.matrix.basis
88
import linear_algebra.matrix.diagonal
99
import linear_algebra.matrix.to_linear_equiv
1010
import linear_algebra.matrix.reindex
11-
import linear_algebra.multilinear
11+
import linear_algebra.multilinear.basic
1212
import linear_algebra.dual
1313
import ring_theory.algebra_tower
1414

0 commit comments

Comments
 (0)