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

Commit 11e19d8

Browse files
refactor(ring_theory/noetherian): make is_noetherian and is_noetherian_ring classes (#689)
* refactor(ring_theory/noetherian): make is_noetherian and is_noetherian_ring classes * correct spelling mistake. * add well_founded_submodule_gt
1 parent 1f50e0d commit 11e19d8

File tree

4 files changed

+74
-60
lines changed

4 files changed

+74
-60
lines changed

src/field_theory/splitting_field.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ lemma exists_root_of_splits {f : polynomial α} (hs : splits i f) (hf0 : degree
8080
if hf0 : f = 0 then37, by simp [hf0]⟩
8181
else
8282
let ⟨g, hg⟩ := is_noetherian_ring.exists_irreducible_factor
83-
principal_ideal_domain.is_noetherian_ring
8483
(show ¬ is_unit (f.map i), from mt is_unit_iff_degree_eq_zero.1 (by rwa degree_map))
8584
(by rw [ne.def, map_eq_zero]; exact hf0) in
8685
let ⟨x, hx⟩ := exists_root_of_degree_eq_one (hs.resolve_left hf0 hg.1 hg.2) in
@@ -93,7 +92,7 @@ lemma exists_multiset_of_splits {f : polynomial α} : splits i f →
9392
suffices splits id (f.map i) → ∃ s : multiset β, f.map i =
9493
(C (f.map i).leading_coeff) * (s.map (λ a : β, (X : polynomial β) - C a)).prod,
9594
by rwa [splits_map_iff, leading_coeff_map i] at this,
96-
is_noetherian_ring.irreducible_induction_on principal_ideal_domain.is_noetherian_ring (f.map i)
95+
is_noetherian_ring.irreducible_induction_on (f.map i)
9796
(λ _, ⟨{37}, by simp [is_ring_hom.map_zero i]⟩)
9897
(λ u hu _, ⟨0,
9998
by conv_lhs { rw eq_C_of_degree_eq_zero (is_unit_iff_degree_eq_zero.1 hu) };
@@ -165,7 +164,7 @@ lemma splits_comp_of_splits (j : β → γ) [is_field_hom j] {f : polynomial α}
165164
begin
166165
change i with (λ x, id (i x)) at h,
167166
rw [← splits_map_iff],
168-
rw [← splits_map_iff i id] at h,
167+
rw [← splits_map_iff i id] at h,
169168
exact splits_of_splits_id _ h
170169
end
171170

src/ring_theory/noetherian.lean

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,22 @@ end
100100

101101
end submodule
102102

103-
def is_noetherian (α β) [ring α] [add_comm_group β] [module α β] : Prop :=
104-
∀ (s : submodule α β), s.fg
103+
class is_noetherian (α β) [ring α] [add_comm_group β] [module α β] : Prop :=
104+
(noetherian : ∀ (s : submodule α β), s.fg)
105105

106106
section
107107
variables {α : Type*} {β : Type*} {γ : Type*}
108108
variables [ring α] [add_comm_group β] [add_comm_group γ]
109109
variables [module α β] [module α γ]
110+
open is_noetherian
110111
include α
111112

112113
theorem is_noetherian_submodule {N : submodule α β} :
113114
is_noetherian α N ↔ ∀ s : submodule α β, s ≤ N → s.fg :=
114-
⟨λ hn s hs, have s ≤ N.subtype.range, from (N.range_subtype).symm ▸ hs,
115+
⟨λ ⟨hn⟩, λ s hs, have s ≤ N.subtype.range, from (N.range_subtype).symm ▸ hs,
115116
linear_map.map_comap_eq_self this ▸ submodule.fg_map (hn _),
116-
λ h s, submodule.fg_of_fg_map_of_fg_inf_ker N.subtype (h _ $ submodule.map_subtype_le _ _) $
117-
by rw [submodule.ker_subtype, inf_bot_eq]; exact submodule.fg_bot⟩
117+
λ h, ⟨λ s, submodule.fg_of_fg_map_of_fg_inf_ker N.subtype (h _ $ submodule.map_subtype_le _ _) $
118+
by rw [submodule.ker_subtype, inf_bot_eq]; exact submodule.fg_bot⟩
118119

119120
theorem is_noetherian_submodule_left {N : submodule α β} :
120121
is_noetherian α N ↔ ∀ s : submodule α β, (N ⊓ s).fg :=
@@ -128,29 +129,31 @@ is_noetherian_submodule.trans
128129

129130
variable (β)
130131
theorem is_noetherian_of_surjective (f : β →ₗ[α] γ) (hf : f.range = ⊤)
131-
(hb : is_noetherian α β) : is_noetherian α γ :=
132-
λ s, have (s.comap f).map f = s, from linear_map.map_comap_eq_self $ hf.symm ▸ le_top,
133-
this ▸ submodule.fg_map $ hb _
132+
[is_noetherian α β] : is_noetherian α γ :=
133+
λ s, have (s.comap f).map f = s, from linear_map.map_comap_eq_self $ hf.symm ▸ le_top,
134+
this ▸ submodule.fg_map $ noetherian _⟩
134135
variable {β}
135136

136137
theorem is_noetherian_of_linear_equiv (f : β ≃ₗ[α] γ)
137-
(hb : is_noetherian α β) : is_noetherian α γ :=
138-
is_noetherian_of_surjective _ f.to_linear_map f.range hb
138+
[is_noetherian α β] : is_noetherian α γ :=
139+
is_noetherian_of_surjective _ f.to_linear_map f.range
139140

140-
theorem is_noetherian_prod (hb : is_noetherian α β)
141-
(hc : is_noetherian α γ) : is_noetherian α (β × γ) :=
142-
λ s, submodule.fg_of_fg_map_of_fg_inf_ker (linear_map.snd α β γ) (hc _) $
141+
instance is_noetherian_prod [is_noetherian α β]
142+
[is_noetherian α γ] : is_noetherian α (β × γ) :=
143+
λ s, submodule.fg_of_fg_map_of_fg_inf_ker (linear_map.snd α β γ) (noetherian _) $
143144
have s ⊓ linear_map.ker (linear_map.snd α β γ) ≤ linear_map.range (linear_map.inl α β γ),
144145
from λ x ⟨hx1, hx2⟩, ⟨x.1, trivial, prod.ext rfl $ eq.symm $ linear_map.mem_ker.1 hx2⟩,
145-
linear_map.map_comap_eq_self this ▸ submodule.fg_map (hb _)
146+
linear_map.map_comap_eq_self this ▸ submodule.fg_map (noetherian _)
146147

147-
theorem is_noetherian_pi {α ι : Type*} {β : ι → Type*} [ring α]
148+
instance is_noetherian_pi {α ι : Type*} {β : ι → Type*} [ring α]
148149
[Π i, add_comm_group (β i)] [Π i, module α (β i)] [fintype ι]
149-
(hb : ∀ i, is_noetherian α (β i)) : is_noetherian α (Π i, β i) :=
150+
[∀ i, is_noetherian α (β i)] : is_noetherian α (Π i, β i) :=
150151
begin
151152
haveI := classical.dec_eq ι,
152153
suffices : ∀ s : finset ι, is_noetherian α (Π i : (↑s : set ι), β i),
153-
{ refine is_noetherian_of_linear_equiv ⟨_, _, _, _, _, _⟩ (this finset.univ),
154+
{ letI := this finset.univ,
155+
refine @is_noetherian_of_linear_equiv _ _ _ _ _ _ _ _
156+
⟨_, _, _, _, _, _⟩ (this finset.univ),
154157
{ exact λ f i, f ⟨i, finset.mem_univ _⟩ },
155158
{ intros, ext, refl },
156159
{ intros, ext, refl },
@@ -159,9 +162,10 @@ begin
159162
{ intro, ext i, refl } },
160163
intro s,
161164
induction s using finset.induction with a s has ih,
162-
{ intro s, convert submodule.fg_bot, apply eq_bot_iff.2,
165+
{ split, intro s, convert submodule.fg_bot, apply eq_bot_iff.2,
163166
intros x hx, refine (submodule.mem_bot α).2 _, ext i, cases i.2 },
164-
refine is_noetherian_of_linear_equiv ⟨_, _, _, _, _, _⟩ (is_noetherian_prod (hb a) ih),
167+
refine @is_noetherian_of_linear_equiv _ _ _ _ _ _ _ _
168+
⟨_, _, _, _, _, _⟩ (@is_noetherian_prod _ (β a) _ _ _ _ _ _ _ ih),
165169
{ exact λ f i, or.by_cases (finset.mem_insert.1 i.2)
166170
(λ h : i.1 = a, show β i.1, from (eq.rec_on h.symm f.1))
167171
(λ h : i.1 ∈ s, show β i.1, from f.2 ⟨i.1, h⟩) },
@@ -191,6 +195,8 @@ end
191195

192196
end
193197

198+
open is_noetherian
199+
194200
theorem is_noetherian_iff_well_founded
195201
{α β} [ring α] [add_comm_group β] [module α β] :
196202
is_noetherian α β ↔ well_founded ((>) : submodule α β → submodule α β → Prop) :=
@@ -199,7 +205,8 @@ theorem is_noetherian_iff_well_founded
199205
swap, { apply is_strict_order.swap },
200206
rintro ⟨⟨N, hN⟩⟩,
201207
let M := ⨆ n, N n,
202-
rcases submodule.fg_def.1 (h M) with ⟨t, h₁, h₂⟩,
208+
resetI,
209+
rcases submodule.fg_def.1 (noetherian M) with ⟨t, h₁, h₂⟩,
203210
have hN' : ∀ {a b}, a ≤ b → N a ≤ N b :=
204211
λ a b, (le_iff_le_of_strict_mono N (λ _ _, hN.1)).2,
205212
have : t ⊆ ⋃ i, (N i : set β),
@@ -222,7 +229,7 @@ theorem is_noetherian_iff_well_founded
222229
(le_trans (le_supr _ _) this)
223230
end,
224231
begin
225-
assume h N,
232+
assume h, split, assume N,
226233
suffices : ∀ M ≤ N, ∃ s, finite s ∧ M ⊔ submodule.span α s = N,
227234
{ rcases this ⊥ bot_le with ⟨s, hs, e⟩,
228235
exact submodule.fg_def.2 ⟨s, hs, by simpa using e⟩ },
@@ -243,16 +250,23 @@ theorem is_noetherian_iff_well_founded
243250
rw [← hs₂, sup_assoc, ← submodule.span_union], simp }
244251
end
245252

246-
def is_noetherian_ring (α) [ring α] : Prop := is_noetherian α α
253+
lemma well_founded_submodule_gt {α β} [ring α] [add_comm_group β] [module α β] :
254+
∀ [is_noetherian α β], well_founded ((>) : submodule α β → submodule α β → Prop) :=
255+
is_noetherian_iff_well_founded.mp
256+
257+
@[class] def is_noetherian_ring (α) [ring α] : Prop := is_noetherian α α
258+
259+
instance is_noetherian_ring.to_is_noetherian {α : Type*} [ring α] :
260+
∀ [is_noetherian_ring α], is_noetherian α α := id
247261

248-
theorem ring.is_noetherian_of_fintype (R M) [ring R] [add_comm_group M] [module R M] [fintype M] : is_noetherian R M :=
262+
instance ring.is_noetherian_of_fintype (R M) [ring R] [add_comm_group M] [module R M] [fintype M] : is_noetherian R M :=
249263
by letI := classical.dec; exact
250-
assume s, ⟨to_finset s, by rw [finset.coe_to_finset', submodule.span_eq]⟩
264+
assume s, ⟨to_finset s, by rw [finset.coe_to_finset', submodule.span_eq]
251265

252266
theorem ring.is_noetherian_of_zero_eq_one {R} [ring R] (h01 : (0 : R) = 1) : is_noetherian_ring R :=
253267
by haveI := subsingleton_of_zero_eq_one R h01;
254268
haveI := fintype.of_subsingleton (0:R);
255-
exact ring.is_noetherian_of_fintype R R
269+
exact ring.is_noetherian_of_fintype _ _
256270

257271
theorem is_noetherian_of_submodule_of_noetherian (R M) [ring R] [add_comm_group M] [module R M] (N : submodule R M)
258272
(h : is_noetherian R M) : is_noetherian R N :=
@@ -269,13 +283,14 @@ begin
269283
end
270284

271285
theorem is_noetherian_of_fg_of_noetherian {R M} [ring R] [add_comm_group M] [module R M] (N : submodule R M)
272-
(h : is_noetherian_ring R) (hN : N.fg) : is_noetherian R N :=
286+
[is_noetherian_ring R] (hN : N.fg) : is_noetherian R N :=
273287
let ⟨s, hs⟩ := hN in
274288
begin
275289
haveI := classical.dec_eq M,
290+
letI : is_noetherian R R := by apply_instance,
276291
have : ∀ x ∈ s, x ∈ N, from λ x hx, hs ▸ submodule.subset_span hx,
277292
refine @@is_noetherian_of_surjective ((↑s : set M) → R) _ _ _ (pi.module _)
278-
_ _ _ (is_noetherian_pi $ λ _, h),
293+
_ _ _ is_noetherian_pi,
279294
{ fapply linear_map.mk,
280295
{ exact λ f, ⟨s.attach.sum (λ i, f i • i.1), N.sum_mem (λ c _, N.smul_mem _ $ this _ c.2)⟩ },
281296
{ intros f g, apply subtype.eq,
@@ -298,42 +313,42 @@ begin
298313
end
299314

300315
theorem is_noetherian_ring_of_surjective (R) [comm_ring R] (S) [comm_ring S]
301-
(f : R → S) (hf : is_ring_hom f) (hf : function.surjective f)
302-
(H : is_noetherian_ring R) : is_noetherian_ring S :=
316+
(f : R → S) [is_ring_hom f] (hf : function.surjective f)
317+
[H : is_noetherian_ring R] : is_noetherian_ring S :=
303318
begin
304319
unfold is_noetherian_ring at H ⊢,
305320
rw is_noetherian_iff_well_founded at H ⊢,
306321
convert order_embedding.well_founded (order_embedding.rsymm (ideal.lt_order_embedding_of_surjective f hf)) H
307322
end
308323

309-
theorem is_noetherian_ring_range {R} [comm_ring R] {S} [comm_ring S] (f : R → S) (hf : is_ring_hom f)
310-
(h : is_noetherian_ring R) : is_noetherian_ring (set.range f) :=
311-
is_noetherian_ring_of_surjective _ _ (λ r, ⟨f r, r, rfl⟩)
312-
⟨subtype.eq $ is_ring_hom.map_one f, λ x y, subtype.eq $ is_ring_hom.map_mul f, λ x y, subtype.eq $ is_ring_hom.map_add f⟩
313-
(λ ⟨y, r, h⟩, ⟨r, subtype.eq h⟩) h
324+
instance is_noetherian_ring_range {R} [comm_ring R] {S} [comm_ring S] (f : R → S) [is_ring_hom f]
325+
[is_noetherian_ring R] : is_noetherian_ring (set.range f) :=
326+
@is_noetherian_ring_of_surjective R _ (set.range f) _ (λ x, ⟨f x, x, rfl⟩)
327+
(⟨subtype.eq (is_ring_hom.map_one f),
328+
λ _ _, subtype.eq (is_ring_hom.map_mul f),
329+
λ _ _, subtype.eq (is_ring_hom.map_add f)⟩)
330+
(λ ⟨x, y, hy⟩, ⟨y, subtype.eq hy⟩) _
314331

315332
theorem is_noetherian_ring_of_ring_equiv (R) [comm_ring R] {S} [comm_ring S]
316-
(f : R ≃r S) (H : is_noetherian_ring R) : is_noetherian_ring S :=
317-
is_noetherian_ring_of_surjective R S f.1 f.2 f.1.bijective.2 H
333+
(f : R ≃r S) [is_noetherian_ring R] : is_noetherian_ring S :=
334+
is_noetherian_ring_of_surjective R S f.1 f.1.bijective.2
318335

319336
namespace is_noetherian_ring
320337

321-
variables {α : Type*} [integral_domain α] (hα : is_noetherian_ring α)
322-
include
338+
variables {α : Type*} [integral_domain α] [is_noetherian_ring α]
323339
open associates nat
324340

325341
local attribute [elab_as_eliminator] well_founded.fix
326342

327343
lemma well_founded_dvd_not_unit : well_founded (λ a b : α, a ≠ 0 ∧ ∃ x, ¬is_unit x ∧ b = a * x ) :=
328344
by simp only [ideal.span_singleton_lt_span_singleton.symm];
329-
exact inv_image.wf (λ a, ideal.span ({a} : set α))
330-
(is_noetherian_iff_well_founded.1 hα)
345+
exact inv_image.wf (λ a, ideal.span ({a} : set α)) well_founded_submodule_gt
331346

332347
lemma exists_irreducible_factor {a : α} (ha : ¬ is_unit a) (ha0 : a ≠ 0) :
333348
∃ i, irreducible i ∧ i ∣ a :=
334349
(irreducible_or_factor a ha).elim (λ hai, ⟨a, hai, dvd_refl _⟩)
335350
(well_founded.fix
336-
(well_founded_dvd_not_unit hα)
351+
well_founded_dvd_not_unit
337352
(λ a ih ha ha0 ⟨x, y, hx, hy, hxy⟩,
338353
have hx0 : x ≠ 0, from λ hx0, ha0 (by rw [← hxy, hx0, zero_mul]),
339354
(irreducible_or_factor x hx).elim
@@ -346,18 +361,18 @@ lemma exists_irreducible_factor {a : α} (ha : ¬ is_unit a) (ha0 : a ≠ 0) :
346361
(hi : ∀ a i : α, a ≠ 0 → irreducible i → P a → P (i * a)) :
347362
P a :=
348363
by haveI := classical.dec; exact
349-
well_founded.fix (well_founded_dvd_not_unit hα)
364+
well_founded.fix well_founded_dvd_not_unit
350365
(λ a ih, if ha0 : a = 0 then ha0.symm ▸ h0
351366
else if hau : is_unit a then hu a hau
352-
else let ⟨i, hii, ⟨b, hb⟩⟩ := exists_irreducible_factor hau ha0 in
367+
else let ⟨i, hii, ⟨b, hb⟩⟩ := exists_irreducible_factor hau ha0 in
353368
have hb0 : b ≠ 0, from λ hb0, by simp * at *,
354369
hb.symm ▸ hi _ _ hb0 hii (ih _ ⟨hb0, i,
355370
hii.1, by rw [hb, mul_comm]⟩))
356371
a
357372

358373
lemma exists_factors (a : α) : a ≠ 0
359374
∃f:multiset α, (∀b∈f, irreducible b) ∧ associated a f.prod :=
360-
is_noetherian_ring.irreducible_induction_on a
375+
is_noetherian_ring.irreducible_induction_on a
361376
(λ h, (h rfl).elim)
362377
(λ u hu _, ⟨0, by simp [associated_one_iff_is_unit, hu]⟩)
363378
(λ a i ha0 hii ih hia0,

src/ring_theory/polynomial.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,26 +136,26 @@ begin
136136
I.leading_coeff_nth_mono (nat.le_add_left _ _)⟩
137137
end
138138

139-
theorem is_fg_degree_le (hnr : is_noetherian_ring R) (n : ℕ) :
139+
theorem is_fg_degree_le [is_noetherian_ring R] (n : ℕ) :
140140
submodule.fg (I.degree_le n) :=
141-
is_noetherian_submodule_left.1 (is_noetherian_of_fg_of_noetherian _ hnr
141+
is_noetherian_submodule_left.1 (is_noetherian_of_fg_of_noetherian _
142142
⟨_, degree_le_eq_span_X_pow.symm⟩) _
143143

144144
end ideal
145145

146146
/-- Hilbert basis theorem. -/
147-
theorem is_noetherian_ring_polynomial (hnr : is_noetherian_ring R) : is_noetherian_ring (polynomial R) :=
148-
assume I : ideal (polynomial R),
147+
theorem is_noetherian_ring_polynomial [is_noetherian_ring R] : is_noetherian_ring (polynomial R) :=
148+
assume I : ideal (polynomial R),
149149
let L := I.leading_coeff in
150-
let M := well_founded.min (is_noetherian_iff_well_founded.1 hnr)
150+
let M := well_founded.min (is_noetherian_iff_well_founded.1 (by apply_instance))
151151
(set.range I.leading_coeff_nth) (set.ne_empty_of_mem ⟨0, rfl⟩) in
152152
have hm : M ∈ set.range I.leading_coeff_nth := well_founded.min_mem _ _ _,
153-
let ⟨N, HN⟩ := hm, ⟨s, hs⟩ := I.is_fg_degree_le hnr N in
153+
let ⟨N, HN⟩ := hm, ⟨s, hs⟩ := I.is_fg_degree_le N in
154154
have hm2 : ∀ k, I.leading_coeff_nth k ≤ M := λ k, or.cases_on (le_or_lt k N)
155155
(λ h, HN ▸ I.leading_coeff_nth_mono h)
156156
(λ h x hx, classical.by_contradiction $ λ hxm,
157157
have ¬M < I.leading_coeff_nth k, by refine well_founded.not_lt_min
158-
(is_noetherian_iff_well_founded.1 hnr) _ _ _; exact ⟨k, rfl⟩,
158+
well_founded_submodule_gt _ _ _; exact ⟨k, rfl⟩,
159159
this ⟨HN ▸ I.leading_coeff_nth_mono (le_of_lt h), λ H, hxm (H hx)⟩),
160160
have hs2 : ∀ {x}, x ∈ I.degree_le N → x ∈ ideal.span (↑s : set (polynomial R)),
161161
from hs ▸ λ x hx, submodule.span_induction hx (λ _ hx, ideal.subset_span hx) (ideal.zero_mem _)
@@ -200,4 +200,4 @@ from hs ▸ λ x hx, submodule.span_induction hx (λ _ hx, ideal.subset_span hx)
200200
refine ih _ _ (I.sub_mem hp (I.mul_mem_right hq)) rfl,
201201
rwa [polynomial.degree_eq_nat_degree hpq, with_bot.coe_lt_coe, hn] at this },
202202
exact hs2 ⟨polynomial.mem_degree_le.2 hdq, hq⟩ }
203-
end
203+
end

src/ring_theory/principal_ideal_domain.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ end
9595
namespace principal_ideal_domain
9696
variables [principal_ideal_domain α]
9797

98-
lemma is_noetherian_ring : is_noetherian_ring α :=
99-
assume s : ideal α,
98+
instance is_noetherian_ring : is_noetherian_ring α :=
99+
assume s : ideal α,
100100
begin
101101
cases (principal s).principal with a hs,
102102
refine ⟨finset.singleton a, submodule.ext' _⟩, rw hs, refl
103-
end
103+
end
104104

105105
section
106106
local attribute [instance] classical.prop_decidable
@@ -140,14 +140,14 @@ local attribute [instance] classical.prop_decidable
140140

141141
noncomputable def factors (a : α) : multiset α :=
142142
if h : a = 0 thenelse classical.some
143-
(is_noetherian_ring.exists_factors is_noetherian_ring a h)
143+
(is_noetherian_ring.exists_factors a h)
144144

145145
lemma factors_spec (a : α) (h : a ≠ 0) :
146146
(∀b∈factors a, irreducible b) ∧ associated a (factors a).prod :=
147147
begin
148148
unfold factors, rw [dif_neg h],
149149
exact classical.some_spec
150-
(is_noetherian_ring.exists_factors is_noetherian_ring a h)
150+
(is_noetherian_ring.exists_factors a h)
151151
end
152152

153153
/-- The unique factorization domain structure given by the principal ideal domain.

0 commit comments

Comments
 (0)