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

Commit 68bcded

Browse files
committed
feat(ring_theory/algebra_operations): submodules form a semiring
1 parent d62a04b commit 68bcded

File tree

4 files changed

+88
-58
lines changed

4 files changed

+88
-58
lines changed

src/algebra/pointwise.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import data.set.lattice
22
import algebra.group
33
import group_theory.subgroup
4+
import data.set.finite
45

56
namespace set
67
open function
@@ -38,6 +39,11 @@ set.ext $ λ a,
3839
by { rintros ⟨_, _, _, _, rfl⟩, exact ⟨(_, _), mem_prod.mpr ⟨‹_›, ‹_›⟩, rfl⟩ },
3940
by { rintros ⟨_, _, rfl⟩, exact ⟨_, (mem_prod.mp ‹_›).1, _, (mem_prod.mp ‹_›).2, rfl⟩ }⟩
4041

42+
@[to_additive set.pointwise_add_finite]
43+
lemma pointwise_mul_finite [has_mul α] {s t : set α} (hs : finite s) (ht : finite t) :
44+
finite (s * t) :=
45+
by { rw pointwise_mul_eq_image, apply set.finite_image, exact set.finite_prod hs ht }
46+
4147
def pointwise_mul_semigroup [semigroup α] : semigroup (set α) :=
4248
{ mul_assoc := λ _ _ _, set.ext $ λ _,
4349
begin

src/ring_theory/algebra_operations.lean

Lines changed: 60 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,48 @@ Authors: Kenny Lau
66
Multiplication of submodules of an algebra.
77
-/
88

9-
import ring_theory.algebra ring_theory.noetherian
9+
import ring_theory.algebra algebra.pointwise ring_theory.ideals
10+
import tactic.chain
1011

1112
universes u v
1213

13-
open lattice submodule
14+
open lattice algebra
1415

15-
namespace algebra
16+
local attribute [instance] set.pointwise_mul_semiring
17+
18+
namespace submodule
1619

1720
variables {R : Type u} [comm_ring R]
1821

1922
section ring
2023

2124
variables {A : Type v} [ring A] [algebra R A]
25+
variables (S T : set A) {M N P Q : submodule R A} {m n : A}
26+
27+
instance : has_one (submodule R A) :=
28+
⟨submodule.map (of_id R A).to_linear_map (⊤ : ideal R)⟩
29+
30+
theorem one_eq_map_top :
31+
(1 : submodule R A) = submodule.map (of_id R A).to_linear_map (⊤ : ideal R) := rfl
32+
33+
theorem one_eq_span : (1 : submodule R A) = span R {1} :=
34+
begin
35+
apply submodule.ext,
36+
intro a,
37+
erw [mem_map, mem_span_singleton],
38+
apply exists_congr,
39+
intro r,
40+
simpa [smul_def],
41+
end
42+
43+
theorem one_le : (1 : submodule R A) ≤ P ↔ (1 : A) ∈ P :=
44+
by simpa only [one_eq_span, span_le, set.singleton_subset_iff]
2245

2346
set_option class.instance_max_depth 50
2447
instance : has_mul (submodule R A) :=
2548
⟨λ M N, ⨆ s : M, N.map $ algebra.lmul R A s.1
2649
set_option class.instance_max_depth 32
2750

28-
variables (S T : set A) {M N P Q : submodule R A} {m n : A}
29-
3051
theorem mul_mem_mul (hm : m ∈ M) (hn : n ∈ N) : m * n ∈ M * N :=
3152
(le_supr _ ⟨m, hm⟩ : _ ≤ M * N) ⟨n, hn, rfl⟩
3253

@@ -42,27 +63,21 @@ theorem mul_le : M * N ≤ P ↔ ∀ (m ∈ M) (n ∈ N), m * n ∈ P :=
4263
(@mul_le _ _ _ _ _ _ _ ⟨C, h0, ha, hs⟩).2 hm hr
4364

4465
variables R
45-
theorem span_mul_span : span R S * span R T = span R ((S.prod T).image (λ p, p.1 * p.2)) :=
46-
le_antisymm
47-
(mul_le.2 $ λ x1 hx1 x2 hx2, span_induction hx1
48-
(λ y1 hy1, span_induction hx2
49-
(λ y2 hy2, subset_span ⟨(y1, y2), ⟨hy1, hy2⟩, rfl⟩)
50-
((mul_zero y1).symm ▸ zero_mem _)
51-
(λ r1 r2, (mul_add y1 r1 r2).symm ▸ add_mem _)
52-
(λ s r, (algebra.mul_smul_comm s y1 r).symm ▸ smul_mem _ _))
53-
((zero_mul x2).symm ▸ zero_mem _)
54-
(λ r1 r2, (add_mul r1 r2 x2).symm ▸ add_mem _)
55-
(λ s r, (algebra.smul_mul_assoc s r x2).symm ▸ smul_mem _ _))
56-
(span_le.2 (set.image_subset_iff.2 $ λ ⟨x1, x2⟩ ⟨hx1, hx2⟩,
57-
mul_mem_mul (subset_span hx1) (subset_span hx2)))
66+
theorem span_mul_span : span R S * span R T = span R (S * T) :=
67+
begin
68+
apply le_antisymm,
69+
{ rw mul_le, intros a ha b hb,
70+
apply span_induction ha,
71+
work_on_goal 0 { intros, apply span_induction hb,
72+
work_on_goal 0 { intros, exact subset_span ⟨_, ‹_›, _, ‹_›, rfl⟩ } },
73+
all_goals { intros, simp only [mul_zero, zero_mul, zero_mem,
74+
left_distrib, right_distrib, mul_smul_comm, smul_mul_assoc],
75+
try {apply add_mem _ _ _}, try {apply smul_mem _ _ _} }, assumption' },
76+
{ rw span_le, rintros _ ⟨a, ha, b, hb, rfl⟩,
77+
exact mul_mem_mul (subset_span ha) (subset_span hb) }
78+
end
5879
variables {R}
5980

60-
theorem fg_mul (hm : M.fg) (hn : N.fg) : (M * N).fg :=
61-
let ⟨m, hf1, hm⟩ := fg_def.1 hm, ⟨n, hf2, hn⟩ := fg_def.1 hn in
62-
fg_def.2 ⟨(m.prod n).image (λ p, p.1 * p.2),
63-
set.finite_image _ (set.finite_prod hf1 hf2),
64-
span_mul_span R m n ▸ hm ▸ hn ▸ rfl⟩
65-
6681
variables (M N P Q)
6782
set_option class.instance_max_depth 50
6883
protected theorem mul_assoc : (M * N) * P = M * (N * P) :=
@@ -79,6 +94,13 @@ eq_bot_iff.2 $ mul_le.2 $ λ m hm n hn, by rw [submodule.mem_bot] at hn ⊢; rw
7994

8095
@[simp] theorem bot_mul : ⊥ * M = ⊥ :=
8196
eq_bot_iff.2 $ mul_le.2 $ λ m hm n hn, by rw [submodule.mem_bot] at hm ⊢; rw [hm, zero_mul]
97+
98+
@[simp] protected theorem one_mul : (1 : submodule R A) * M = M :=
99+
by { conv_lhs { rw [one_eq_span, ← span_eq M] }, erw [span_mul_span, one_mul, span_eq] }
100+
101+
@[simp] protected theorem mul_one : M * 1 = M :=
102+
by { conv_lhs { rw [one_eq_span, ← span_eq M] }, erw [span_mul_span, mul_one, span_eq] }
103+
82104
variables {M N P Q}
83105

84106
@[mono] theorem mul_le_mul (hmp : M ≤ P) (hnq : N ≤ Q) : M * N ≤ P * Q :=
@@ -102,19 +124,17 @@ le_antisymm (mul_le.2 $ λ mn hmn p hp, let ⟨m, hm, n, hn, hmn⟩ := mem_sup.1
102124
(sup_le (mul_le_mul_left le_sup_left) (mul_le_mul_left le_sup_right))
103125
variables {M N P}
104126

105-
instance : semigroup (submodule R A) :=
106-
{ mul := (*),
107-
mul_assoc := algebra.mul_assoc }
108-
109-
instance : mul_zero_class (submodule R A) :=
110-
{ zero_mul := bot_mul,
111-
mul_zero := mul_bot,
112-
.. submodule.add_comm_monoid, .. algebra.semigroup }
113-
114-
instance : distrib (submodule R A) :=
115-
{ left_distrib := mul_sup,
127+
instance : semiring (submodule R A) :=
128+
{ one_mul := submodule.one_mul,
129+
mul_one := submodule.mul_one,
130+
mul_assoc := submodule.mul_assoc,
131+
zero_mul := bot_mul,
132+
mul_zero := mul_bot,
133+
left_distrib := mul_sup,
116134
right_distrib := sup_mul,
117-
.. submodule.add_comm_monoid, .. algebra.semigroup }
135+
..submodule.add_comm_monoid,
136+
..submodule.has_one,
137+
..submodule.has_mul }
118138

119139
end ring
120140

@@ -131,10 +151,10 @@ protected theorem mul_comm : M * N = N * M :=
131151
le_antisymm (mul_le.2 $ λ r hrm s hsn, mul_mem_mul_rev hsn hrm)
132152
(mul_le.2 $ λ r hrn s hsm, mul_mem_mul_rev hsm hrn)
133153

134-
instance : comm_semigroup (submodule R A) :=
135-
{ mul_comm := algebra.mul_comm,
136-
.. algebra.semigroup }
154+
instance : comm_semiring (submodule R A) :=
155+
{ mul_comm := submodule.mul_comm,
156+
.. submodule.semiring }
137157

138158
end comm_ring
139159

140-
end algebra
160+
end submodule

src/ring_theory/ideal_operations.lean

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ More operations on modules and ideals.
99
import ring_theory.ideals data.nat.choose order.zorn
1010
import linear_algebra.tensor_product
1111
import data.equiv.algebra
12+
import ring_theory.algebra_operations
1213

1314
universes u v w x
1415

@@ -107,15 +108,15 @@ theorem smul_mono_right (h : N ≤ P) : I • N ≤ I • P :=
107108
smul_mono (le_refl I) h
108109

109110
variables (I J N P)
110-
theorem smul_bot : I • (⊥ : submodule R M) = ⊥ :=
111+
@[simp] theorem smul_bot : I • (⊥ : submodule R M) = ⊥ :=
111112
eq_bot_iff.2 $ smul_le.2 $ λ r hri s hsb,
112113
(submodule.mem_bot R).2 $ ((submodule.mem_bot R).1 hsb).symm ▸ smul_zero r
113114

114-
theorem bot_smul : (⊥ : ideal R) • N = ⊥ :=
115+
@[simp] theorem bot_smul : (⊥ : ideal R) • N = ⊥ :=
115116
eq_bot_iff.2 $ smul_le.2 $ λ r hrb s hsi,
116117
(submodule.mem_bot R).2 $ ((submodule.mem_bot R).1 hrb).symm ▸ zero_smul _ s
117118

118-
theorem top_smul : (⊤ : ideal R) • N = N :=
119+
@[simp] theorem top_smul : (⊤ : ideal R) • N = N :=
119120
le_antisymm smul_le_right $ λ r hri, one_smul R r ▸ smul_mem_smul mem_top hri
120121

121122
theorem smul_sup : I • (N ⊔ P) = I • N ⊔ I • P :=
@@ -379,22 +380,12 @@ have is_prime m, from ⟨by rintro rfl; rw radical_top at hrm; exact hrm trivial
379380
refine m.add_mem (m.mul_mem_right hpm) (m.add_mem (m.mul_mem_left hfm) (m.mul_mem_left hxym))⟩⟩,
380381
hrm $ this.radical.symm ▸ (Inf_le ⟨him, this⟩ : Inf {J : ideal R | I ≤ J ∧ is_prime J} ≤ m) hr
381382

382-
instance : comm_semiring (ideal R) :=
383-
{ mul := (*),
384-
mul_assoc := ideal.mul_assoc,
385-
zero_mul := bot_mul,
386-
mul_zero := mul_bot,
387-
one := ⊤,
388-
one_mul := top_mul,
389-
mul_one := mul_top,
390-
left_distrib := mul_sup,
391-
right_distrib := sup_mul,
392-
mul_comm := ideal.mul_comm,
393-
.. submodule.add_comm_monoid }
383+
instance : comm_semiring (ideal R) := submodule.comm_semiring
394384

395385
@[simp] lemma add_eq_sup : I + J = I ⊔ J := rfl
396386
@[simp] lemma zero_eq_bot : (0 : ideal R) = ⊥ := rfl
397-
@[simp] lemma one_eq_top : (1 : ideal R) = ⊤ := rfl
387+
@[simp] lemma one_eq_top : (1 : ideal R) = ⊤ :=
388+
by erw [submodule.one_eq_map_top, submodule.map_id]
398389

399390
variables (I)
400391
theorem radical_pow (n : ℕ) (H : n > 0) : radical (I^n) = radical I :=
@@ -551,13 +542,14 @@ namespace submodule
551542

552543
variables {R : Type u} {M : Type v}
553544
variables [comm_ring R] [add_comm_group M] [module R M]
554-
variables (I J : ideal R) (N P : submodule R M)
545+
546+
-- It is even a semialgebra. But those aren't in mathlib yet.
555547

556548
instance : semimodule (ideal R) (submodule R M) :=
557549
{ smul_add := smul_sup,
558550
add_smul := sup_smul,
559551
mul_smul := smul_assoc,
560-
one_smul := top_smul,
552+
one_smul := by simp,
561553
zero_smul := bot_smul,
562554
smul_zero := smul_bot }
563555

src/ring_theory/noetherian.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,15 @@ is_noetherian_ring.irreducible_induction_on a
418418
exact associated_mul_mul (by refl) hs.2⟩⟩)
419419

420420
end is_noetherian_ring
421+
422+
namespace submodule
423+
variables {R : Type*} {A : Type*} [comm_ring R] [ring A] [algebra R A]
424+
variables (M N : submodule R A)
425+
426+
local attribute [instance] set.pointwise_mul_semiring
427+
428+
theorem fg_mul (hm : M.fg) (hn : N.fg) : (M * N).fg :=
429+
let ⟨m, hfm, hm⟩ := fg_def.1 hm, ⟨n, hfn, hn⟩ := fg_def.1 hn in
430+
fg_def.2 ⟨m * n, set.pointwise_mul_finite hfm hfn, span_mul_span R m n ▸ hm ▸ hn ▸ rfl⟩
431+
432+
end submodule

0 commit comments

Comments
 (0)