@@ -36,6 +36,7 @@ theorem eq_top_iff_one : I = ⊤ ↔ (1:α) ∈ I :=
36
36
theorem ne_top_iff_one : I ≠ ⊤ ↔ (1 :α) ∉ I :=
37
37
not_congr I.eq_top_iff_one
38
38
39
+ /-- The ideal generated by a subset of a ring -/
39
40
def span (s : set α) : ideal α := submodule.span α s
40
41
41
42
lemma subset_span {s : set α} : s ⊆ span s := submodule.subset_span
@@ -73,6 +74,7 @@ lemma span_singleton_eq_bot {x} : span ({x} : set α) = ⊥ ↔ x = 0 := submodu
73
74
lemma span_singleton_eq_top {x} : span ({x} : set α) = ⊤ ↔ is_unit x :=
74
75
by rw [is_unit_iff_dvd_one, ← span_singleton_le_span_singleton, span_singleton_one, eq_top_iff]
75
76
77
+ /-- An ideal `P` of a ring `R` is prime if `P ≠ R` and `xy ∈ P → x ∈ P ∨ y ∈ P` -/
76
78
@[class] def is_prime (I : ideal α) : Prop :=
77
79
I ≠ ⊤ ∧ ∀ {x y : α}, x * y ∈ I → x ∈ I ∨ y ∈ I
78
80
@@ -98,6 +100,7 @@ theorem span_singleton_prime {p : α} (hp : p ≠ 0) :
98
100
is_prime (span ({p} : set α)) ↔ prime p :=
99
101
by simp [is_prime, prime, span_singleton_eq_top, hp, mem_span_singleton]
100
102
103
+ /-- An ideal is maximal if it is maximal in the collection of proper ideals. -/
101
104
@[class] def is_maximal (I : ideal α) : Prop :=
102
105
I ≠ ⊤ ∧ ∀ J, I < J → J = ⊤
103
106
@@ -165,12 +168,17 @@ lt_of_le_not_le (ideal.span_le.2 $ singleton_subset_iff.2 $
165
168
h₂ $ is_unit_of_dvd_one _ $ (mul_dvd_mul_iff_left h₁).1 $
166
169
by rwa [mul_one, ← ideal.span_singleton_le_span_singleton]
167
170
171
+ /-- The quotient `R/I` of a ring `R` by an ideal `I`. -/
168
172
def quotient (I : ideal α) := I.quotient
169
173
170
174
namespace quotient
171
175
variables {I} {x y : α}
176
+
177
+ /-- The map from a ring `R` to a quotient ring `R/I`. -/
172
178
def mk (I : ideal α) (a : α) : I.quotient := submodule.quotient.mk a
173
179
180
+ instance : inhabited (quotient I) := ⟨mk I 37 ⟩
181
+
174
182
protected theorem eq : mk I x = mk I y ↔ x - y ∈ I := submodule.quotient.eq I
175
183
176
184
instance (I : ideal α) : has_one I.quotient := ⟨mk I 1 ⟩
@@ -209,6 +217,7 @@ def mk_hom (I : ideal α) : α →+* I.quotient := ⟨mk I, rfl, λ _ _, rfl, rf
209
217
210
218
lemma mk_eq_mk_hom (I : ideal α) (x : α) : ideal.quotient.mk I x = ideal.quotient.mk_hom I x := rfl
211
219
220
+ /-- The image of an ideal J under the quotient map `R → R/I`. -/
212
221
def map_mk (I J : ideal α) : ideal I.quotient :=
213
222
{ carrier := mk I '' J,
214
223
zero_mem' := ⟨0 , J.zero_mem, rfl⟩,
@@ -353,12 +362,15 @@ end
353
362
354
363
section prio
355
364
set_option default_priority 100 -- see Note [default priority]
356
- class local_ring (α : Type u) extends comm_ring α, nonzero α :=
365
+ /-- A commutative ring is local if it has a unique maximal ideal. Note that
366
+ `local_ring` is a predicate. -/
367
+ class local_ring (α : Type u) [comm_ring α] extends nonzero α : Prop :=
357
368
(is_local : ∀ (a : α), (is_unit a) ∨ (is_unit (1 - a)))
358
369
end prio
359
370
360
371
namespace local_ring
361
- variable [local_ring α]
372
+
373
+ variables [comm_ring α] [local_ring α]
362
374
363
375
lemma is_unit_or_is_unit_one_sub_self (a : α) :
364
376
(is_unit a) ∨ (is_unit (1 - a)) :=
@@ -393,13 +405,13 @@ end
393
405
variable (α)
394
406
395
407
/-- The ideal of elements that are not units. -/
396
- def nonunits_ideal : ideal α :=
408
+ def maximal_ideal : ideal α :=
397
409
{ carrier := nonunits α,
398
410
zero_mem' := zero_mem_nonunits.2 $ zero_ne_one,
399
411
add_mem' := λ x y hx hy, nonunits_add hx hy,
400
412
smul_mem' := λ a x, mul_mem_nonunits_right }
401
413
402
- instance nonunits_ideal .is_maximal : (nonunits_ideal α).is_maximal :=
414
+ instance maximal_ideal .is_maximal : (maximal_ideal α).is_maximal :=
403
415
begin
404
416
rw ideal.is_maximal_iff,
405
417
split,
@@ -412,40 +424,28 @@ end
412
424
413
425
lemma max_ideal_unique :
414
426
∃! I : ideal α, I.is_maximal :=
415
- ⟨nonunits_ideal α, nonunits_ideal .is_maximal α,
416
- λ I hI, hI.eq_of_le (nonunits_ideal .is_maximal α).1 $
427
+ ⟨maximal_ideal α, maximal_ideal .is_maximal α,
428
+ λ I hI, hI.eq_of_le (maximal_ideal .is_maximal α).1 $
417
429
λ x hx, hI.1 ∘ I.eq_top_of_is_unit_mem hx⟩
418
430
419
431
variable {α}
420
432
421
- @[simp] lemma mem_nonunits_ideal (x) :
422
- x ∈ nonunits_ideal α ↔ x ∈ nonunits α := iff.rfl
433
+ @[simp] lemma mem_maximal_ideal (x) :
434
+ x ∈ maximal_ideal α ↔ x ∈ nonunits α := iff.rfl
423
435
424
436
end local_ring
425
437
426
- def is_local_ring (α : Type u) [comm_ring α] : Prop :=
427
- ((0 :α) ≠ 1 ) ∧ ∀ (a : α), (is_unit a) ∨ (is_unit (1 - a))
428
-
429
- def local_of_is_local_ring [comm_ring α] (h : is_local_ring α) : local_ring α :=
430
- { zero_ne_one := h.1 ,
431
- is_local := h.2 ,
432
- .. ‹comm_ring α› }
433
-
434
- def local_of_unit_or_unit_one_sub [comm_ring α] (hnze : (0 :α) ≠ 1 )
435
- (h : ∀ x : α, is_unit x ∨ is_unit (1 - x)) : local_ring α :=
436
- local_of_is_local_ring ⟨hnze, h⟩
437
-
438
- def local_of_nonunits_ideal [comm_ring α] (hnze : (0 :α) ≠ 1 )
438
+ lemma local_of_nonunits_ideal [comm_ring α] (hnze : (0 :α) ≠ 1 )
439
439
(h : ∀ x y ∈ nonunits α, x + y ∈ nonunits α) : local_ring α :=
440
- local_of_is_local_ring ⟨ hnze,
441
- λ x, or_iff_not_imp_left.mpr $ λ hx,
440
+ { zero_ne_one := hnze,
441
+ is_local := λ x, or_iff_not_imp_left.mpr $ λ hx,
442
442
begin
443
443
by_contra H,
444
444
apply h _ _ hx H,
445
445
simp [-sub_eq_add_neg, add_sub_cancel'_right]
446
- end ⟩
446
+ end }
447
447
448
- def local_of_unique_max_ideal [comm_ring α] (h : ∃! I : ideal α, I.is_maximal) :
448
+ lemma local_of_unique_max_ideal [comm_ring α] (h : ∃! I : ideal α, I.is_maximal) :
449
449
local_ring α :=
450
450
local_of_nonunits_ideal
451
451
(let ⟨I, Imax, _⟩ := h in (λ (H : 0 = 1 ), Imax.1 $ I.eq_top_iff_one.2 $ H ▸ I.zero_mem))
@@ -459,6 +459,9 @@ Imax.1 $ I.eq_top_of_is_unit_mem (I.add_mem xmemI ymemI) H
459
459
460
460
section prio
461
461
set_option default_priority 100 -- see Note [default priority]
462
+ /-- A local ring homomorphism is a homomorphism between local rings
463
+ such that the image of the maximal ideal of the source is contained within
464
+ the maximal ideal of the target. -/
462
465
class is_local_ring_hom [semiring α] [semiring β] (f : α →+* β) : Prop :=
463
466
(map_nonunit : ∀ a, is_unit (f a) → is_unit a)
464
467
end prio
@@ -469,33 +472,37 @@ is_local_ring_hom.map_nonunit a h
469
472
470
473
section
471
474
open local_ring
472
- variables [local_ring α] [local_ring β]
475
+ variables [comm_ring α] [ local_ring α] [comm_ring β ] [local_ring β]
473
476
variables (f : α →+* β) [is_local_ring_hom f]
474
477
475
- lemma map_nonunit (a) (h : a ∈ nonunits_ideal α) : f a ∈ nonunits_ideal β :=
478
+ lemma map_nonunit (a) (h : a ∈ maximal_ideal α) : f a ∈ maximal_ideal β :=
476
479
λ H, h $ is_unit_of_map_unit f a H
477
480
478
481
end
479
482
480
483
namespace local_ring
481
- variables [local_ring α] [local_ring β]
484
+ variables [comm_ring α] [ local_ring α] [comm_ring β ] [local_ring β]
482
485
483
486
variable (α)
484
- def residue_field := (nonunits_ideal α).quotient
487
+ /-- The residue field of a local ring is the quotient of the ring by its maximal ideal. -/
488
+ def residue_field := (maximal_ideal α).quotient
485
489
486
490
noncomputable instance residue_field.field : field (residue_field α) :=
487
- ideal.quotient.field (nonunits_ideal α)
491
+ ideal.quotient.field (maximal_ideal α)
492
+
493
+ noncomputable instance : inhabited (residue_field α) := ⟨37 ⟩
488
494
489
- /-- The quotient map from a local ring to it's residue field. -/
495
+ /-- The quotient map from a local ring to its residue field. -/
490
496
def residue : α →+* (residue_field α) :=
491
497
ideal.quotient.mk_hom _
492
498
493
499
namespace residue_field
494
500
495
501
variables {α β}
502
+ /-- The map on residue fields induced by a local homomorphism between local rings -/
496
503
noncomputable def map (f : α →+* β) [is_local_ring_hom f] :
497
504
residue_field α →+* residue_field β :=
498
- ideal.quotient.lift (nonunits_ideal α) ((ideal.quotient.mk_hom _).comp f) $
505
+ ideal.quotient.lift (maximal_ideal α) ((ideal.quotient.mk_hom _).comp f) $
499
506
λ a ha,
500
507
begin
501
508
erw ideal.quotient.eq_zero_iff_mem,
0 commit comments