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

Commit b86c528

Browse files
erdOnealreadydoneeric-wieser
committed
feat(ring_theory/ideal/local_ring): API for local rings. (#17185)
Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com> Co-authored-by: Junyan Xu <junyanxumath@gmail.com> Co-authored-by: Junyan Xu <junyanxu.math@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
1 parent bf27744 commit b86c528

6 files changed

Lines changed: 88 additions & 15 deletions

File tree

src/algebraic_geometry/prime_spectrum/basic.lean

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ begin
446446
(is_closed_singleton_iff_is_maximal _).1 (t1_space.t1 ⟨⊥, hbot⟩)) (not_not.2 rfl)) },
447447
{ refine ⟨λ x, (is_closed_singleton_iff_is_maximal x).2 _⟩,
448448
by_cases hx : x.as_ideal = ⊥,
449-
{ exact hx.symm ▸ @ideal.bot_is_maximal R (@field.to_division_ring _ h.to_field) },
449+
{ letI := h.to_field, exact hx.symm ▸ ideal.bot_is_maximal },
450450
{ exact absurd h (ring.not_is_field_iff_exists_prime.2 ⟨x.as_ideal, ⟨hx, x.2⟩⟩) } }
451451
end
452452

@@ -822,6 +822,14 @@ order_embedding.of_map_le_iff nhds $ λ a b, (le_iff_specializes a b).symm
822822

823823
instance : t0_space (prime_spectrum R) := ⟨nhds_order_embedding.injective⟩
824824

825+
instance [is_domain R] : order_bot (prime_spectrum R) :=
826+
{ bot := ⟨⊥, ideal.bot_prime⟩,
827+
bot_le := λ I, @bot_le _ _ _ I.as_ideal }
828+
829+
instance {R : Type*} [field R] : unique (prime_spectrum R) :=
830+
{ default := ⊥,
831+
uniq := λ x, ext _ _ ((is_simple_order.eq_bot_or_eq_top _).resolve_right x.2.ne_top) }
832+
825833
end order
826834

827835
/-- If `x` specializes to `y`, then there is a natural map from the localization of `y` to the
@@ -856,4 +864,24 @@ by { rw [(local_hom_tfae f).out 0 4, prime_spectrum.ext_iff], refl }
856864
[is_local_ring_hom f] : prime_spectrum.comap f (closed_point S) = closed_point R :=
857865
(is_local_ring_hom_iff_comap_closed_point f).mp infer_instance
858866

867+
lemma specializes_closed_point (x : prime_spectrum R) :
868+
x ⤳ closed_point R :=
869+
(prime_spectrum.le_iff_specializes _ _).mp (local_ring.le_maximal_ideal x.2.1)
870+
871+
lemma closed_point_mem_iff (U : topological_space.opens $ prime_spectrum R) :
872+
closed_point R ∈ U ↔ U = ⊤ :=
873+
begin
874+
split,
875+
{ rw eq_top_iff, exact λ h x _, (specializes_closed_point x).mem_open U.2 h },
876+
{ rintro rfl, trivial }
877+
end
878+
879+
@[simp] lemma _root_.prime_spectrum.comap_residue (x : prime_spectrum (residue_field R)) :
880+
prime_spectrum.comap (residue R) x = closed_point R :=
881+
begin
882+
rw subsingleton.elim x ⊥,
883+
ext1,
884+
exact ideal.mk_ker,
885+
end
886+
859887
end local_ring

src/ring_theory/discrete_valuation_ring.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ lemma not_a_field : maximal_ideal R ≠ ⊥ := not_a_field'
6161

6262
/-- A discrete valuation ring `R` is not a field. -/
6363
lemma not_is_field : ¬ is_field R :=
64-
ring.not_is_field_iff_exists_prime.mpr ⟨_, not_a_field R, is_maximal.is_prime' (maximal_ideal R)⟩
64+
local_ring.is_field_iff_maximal_ideal_eq.not.mpr (not_a_field R)
6565

6666
variable {R}
6767

src/ring_theory/ideal/basic.lean

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,12 @@ end ideal
535535

536536
end ring
537537

538-
section division_ring
539-
variables {K : Type u} [division_ring K] (I : ideal K)
538+
section division_semiring
539+
variables {K : Type u} [division_semiring K] (I : ideal K)
540540

541541
namespace ideal
542542

543-
/-- All ideals in a division ring are trivial. -/
543+
/-- All ideals in a division (semi)ring are trivial. -/
544544
lemma eq_bot_or_top : I = ⊥ ∨ I = ⊤ :=
545545
begin
546546
rw or_iff_not_imp_right,
@@ -553,8 +553,8 @@ begin
553553
simpa [H, h1] using I.mul_mem_left r⁻¹ hr,
554554
end
555555

556-
/-- Ideals of a `division_ring` are a simple order. Thanks to the way abbreviations work, this
557-
automatically gives a `is_simple_module K` instance. -/
556+
/-- Ideals of a `division_semiring` are a simple order. Thanks to the way abbreviations work,
557+
this automatically gives a `is_simple_module K` instance. -/
558558
instance : is_simple_order (ideal K) := ⟨eq_bot_or_top⟩
559559

560560
lemma eq_bot_of_prime [h : I.is_prime] : I = ⊥ :=
@@ -566,7 +566,7 @@ lemma bot_is_maximal : is_maximal (⊥ : ideal K) :=
566566

567567
end ideal
568568

569-
end division_ring
569+
end division_semiring
570570

571571
section comm_ring
572572

@@ -583,12 +583,11 @@ end ideal
583583

584584
end comm_ring
585585

586+
-- TODO: consider moving the lemmas below out of the `ring` namespace since they are
587+
-- about `comm_semiring`s.
586588
namespace ring
587589

588-
variables {R : Type*} [comm_ring R]
589-
590-
lemma not_is_field_of_subsingleton {R : Type*} [ring R] [subsingleton R] : ¬ is_field R :=
591-
λ ⟨⟨x, y, hxy⟩, _, _⟩, hxy (subsingleton.elim x y)
590+
variables {R : Type*} [comm_semiring R]
592591

593592
lemma exists_not_is_unit_of_not_is_field [nontrivial R] (hf : ¬ is_field R) :
594593
∃ x ≠ (0 : R), ¬ is_unit x :=
@@ -624,6 +623,22 @@ not_is_field_iff_exists_ideal_bot_lt_and_lt_top.trans
624623
⟨p, bot_lt_iff_ne_bot.mp (lt_of_lt_of_le bot_lt le_p), hp.is_prime⟩,
625624
λ ⟨p, ne_bot, prime⟩, ⟨p, bot_lt_iff_ne_bot.mpr ne_bot, lt_top_iff_ne_top.mpr prime.1⟩⟩
626625

626+
/-- Also see `ideal.is_simple_order` for the forward direction as an instance when `R` is a
627+
division (semi)ring.
628+
629+
This result actually holds for all division semirings, but we lack the predicate to state it. -/
630+
lemma is_field_iff_is_simple_order_ideal :
631+
is_field R ↔ is_simple_order (ideal R) :=
632+
begin
633+
casesI subsingleton_or_nontrivial R,
634+
{ exact ⟨λ h, (not_is_field_of_subsingleton _ h).elim,
635+
λ h, by exactI (false_of_nontrivial_of_subsingleton $ ideal R).elim⟩ },
636+
rw [← not_iff_not, ring.not_is_field_iff_exists_ideal_bot_lt_and_lt_top, ← not_iff_not],
637+
push_neg,
638+
simp_rw [lt_top_iff_ne_top, bot_lt_iff_ne_bot, ← or_iff_not_imp_left, not_ne_iff],
639+
exact ⟨λ h, ⟨h⟩, λ h, h.2
640+
end
641+
627642
/-- When a ring is not a field, the maximal ideals are nontrivial. -/
628643
lemma ne_bot_of_is_maximal_of_not_is_field [nontrivial R] {M : ideal R} (max : M.is_maximal)
629644
(not_field : ¬ is_field R) : M ≠ ⊥ :=

src/ring_theory/ideal/local_ring.lean

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ end
130130

131131
@[simp] lemma mem_maximal_ideal (x) : x ∈ maximal_ideal R ↔ x ∈ nonunits R := iff.rfl
132132

133+
lemma is_field_iff_maximal_ideal_eq :
134+
is_field R ↔ maximal_ideal R = ⊥ :=
135+
not_iff_not.mp ⟨ring.ne_bot_of_is_maximal_of_not_is_field infer_instance,
136+
λ h, ring.not_is_field_iff_exists_prime.mpr ⟨_, h, ideal.is_maximal.is_prime' _⟩⟩
137+
133138
end local_ring
134139

135140
end comm_semiring
@@ -324,10 +329,28 @@ ideal.quotient.algebra _
324329

325330
lemma residue_field.algebra_map_eq : algebra_map R (residue_field R) = residue R := rfl
326331

332+
instance : is_local_ring_hom (local_ring.residue R) :=
333+
⟨λ a ha, not_not.mp (ideal.quotient.eq_zero_iff_mem.not.mp (is_unit_iff_ne_zero.mp ha))⟩
334+
327335
variables {R}
328336

329337
namespace residue_field
330338

339+
/-- A local ring homomorphism into a field can be descended onto the residue field. -/
340+
def lift {R S : Type*} [comm_ring R] [local_ring R] [field S]
341+
(f : R →+* S) [is_local_ring_hom f] : local_ring.residue_field R →+* S :=
342+
ideal.quotient.lift _ f (λ a ha,
343+
classical.by_contradiction (λ h, ha (is_unit_of_map_unit f a (is_unit_iff_ne_zero.mpr h))))
344+
345+
lemma lift_comp_residue {R S : Type*} [comm_ring R] [local_ring R] [field S] (f : R →+* S)
346+
[is_local_ring_hom f] : (lift f).comp (residue R) = f :=
347+
ring_hom.ext (λ _, rfl)
348+
349+
@[simp]
350+
lemma lift_residue_apply {R S : Type*} [comm_ring R] [local_ring R] [field S] (f : R →+* S)
351+
[is_local_ring_hom f] (x) : lift f (residue R x) = f x :=
352+
rfl
353+
331354
/-- The map on residue fields induced by a local homomorphism between local rings -/
332355
def map (f : R →+* S) [is_local_ring_hom f] : residue_field R →+* residue_field S :=
333356
ideal.quotient.lift (maximal_ideal R) ((ideal.quotient.mk _).comp f) $
@@ -433,3 +456,7 @@ local_ring.of_is_unit_or_is_unit_one_sub_self $ λ a,
433456
else or.inl $ is_unit.mk0 a h
434457

435458
end field
459+
460+
lemma local_ring.maximal_ideal_eq_bot {R : Type*} [field R] :
461+
local_ring.maximal_ideal R = ⊥ :=
462+
local_ring.is_field_iff_maximal_ideal_eq.mp (field.to_is_field R)

src/ring_theory/ideal/operations.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ end
19041904
(⊥ : ideal (R ⧸ I)).is_maximal ↔ I.is_maximal :=
19051905
⟨λ hI, (@mk_ker _ _ I) ▸
19061906
@comap_is_maximal_of_surjective _ _ _ _ _ _ (quotient.mk I) quotient.mk_surjective ⊥ hI,
1907-
λ hI, @bot_is_maximal _ (@field.to_division_ring _ (@quotient.field _ _ I hI))
1907+
λ hI, by { resetI, letI := quotient.field I, exact bot_is_maximal }
19081908

19091909
/-- See also `ideal.mem_quotient_iff_mem` in case `I ≤ J`. -/
19101910
@[simp]

src/ring_theory/localization/at_prime.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ not_iff_not.mp $ by
139139
simpa only [local_ring.mem_maximal_ideal, mem_nonunits_iff, not_not]
140140
using is_unit_to_map_iff S I x
141141

142+
lemma comap_maximal_ideal (h : _root_.local_ring S := local_ring S I) :
143+
(local_ring.maximal_ideal S).comap (algebra_map R S) = I :=
144+
ideal.ext $ λ x, by simpa only [ideal.mem_comap] using to_map_mem_maximal_iff _ I x
145+
142146
lemma is_unit_mk'_iff (x : R) (y : I.prime_compl) :
143147
is_unit (mk' S x y) ↔ x ∈ I.prime_compl :=
144148
⟨λ h hx, mk'_mem_iff.mpr ((to_map_mem_maximal_iff S I x).mpr hx) h,
@@ -168,8 +172,7 @@ variables {I}
168172
lemma at_prime.comap_maximal_ideal :
169173
ideal.comap (algebra_map R (localization.at_prime I))
170174
(local_ring.maximal_ideal (localization I.prime_compl)) = I :=
171-
ideal.ext $ λ x, by
172-
simpa only [ideal.mem_comap] using at_prime.to_map_mem_maximal_iff _ I x
175+
at_prime.comap_maximal_ideal _ _
173176

174177
/-- The image of `I` in the localization at `I.prime_compl` is a maximal ideal, and in particular
175178
it is the unique maximal ideal given by the local ring structure `at_prime.local_ring` -/

0 commit comments

Comments
 (0)