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

Commit fd03625

Browse files
chore(ring_theory/ideal): Move local rings into separate file (#8849)
Moves the material on local rings and local ring homomorphisms into a separate file and adds a module docstring.
1 parent 88db4e2 commit fd03625

File tree

7 files changed

+248
-212
lines changed

7 files changed

+248
-212
lines changed

src/algebraic_geometry/locally_ringed_space.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import algebraic_geometry.sheafed_space
88
import algebra.category.CommRing.limits
99
import algebra.category.CommRing.colimits
1010
import algebraic_geometry.stalks
11-
import ring_theory.ideal.basic
11+
import ring_theory.ideal.local_ring
1212

1313
/-!
1414
# The category of locally ringed spaces

src/data/equiv/transfer_instance.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import algebra.field
88
import algebra.module
99
import algebra.algebra.basic
1010
import algebra.group.type_tags
11-
import ring_theory.ideal.basic
11+
import ring_theory.ideal.local_ring
1212

1313
/-!
1414
# Transfer algebraic structures across `equiv`s

src/ring_theory/discrete_valuation_ring.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Kevin Buzzard
66

77
import ring_theory.principal_ideal_domain
88
import order.conditionally_complete_lattice
9+
import ring_theory.ideal.local_ring
910
import ring_theory.multiplicity
1011
import ring_theory.valuation.basic
1112

src/ring_theory/ideal/basic.lean

Lines changed: 0 additions & 210 deletions
Original file line numberDiff line numberDiff line change
@@ -775,213 +775,3 @@ begin
775775
rcases ideal.exists_le_maximal _ this with ⟨I, Imax, H⟩,
776776
use [I, Imax], apply H, apply ideal.subset_span, exact set.mem_singleton a
777777
end
778-
779-
/-- A commutative ring is local if it has a unique maximal ideal. Note that
780-
`local_ring` is a predicate. -/
781-
class local_ring (α : Type u) [comm_ring α] extends nontrivial α : Prop :=
782-
(is_local : ∀ (a : α), (is_unit a) ∨ (is_unit (1 - a)))
783-
784-
namespace local_ring
785-
786-
variables [comm_ring α] [local_ring α]
787-
788-
lemma is_unit_or_is_unit_one_sub_self (a : α) :
789-
(is_unit a) ∨ (is_unit (1 - a)) :=
790-
is_local a
791-
792-
lemma is_unit_of_mem_nonunits_one_sub_self (a : α) (h : (1 - a) ∈ nonunits α) :
793-
is_unit a :=
794-
or_iff_not_imp_right.1 (is_local a) h
795-
796-
lemma is_unit_one_sub_self_of_mem_nonunits (a : α) (h : a ∈ nonunits α) :
797-
is_unit (1 - a) :=
798-
or_iff_not_imp_left.1 (is_local a) h
799-
800-
lemma nonunits_add {x y} (hx : x ∈ nonunits α) (hy : y ∈ nonunits α) :
801-
x + y ∈ nonunits α :=
802-
begin
803-
rintros ⟨u, hu⟩,
804-
apply hy,
805-
suffices : is_unit ((↑u⁻¹ : α) * y),
806-
{ rcases this with ⟨s, hs⟩,
807-
use u * s,
808-
convert congr_arg (λ z, (u : α) * z) hs,
809-
rw ← mul_assoc, simp },
810-
rw show (↑u⁻¹ * y) = (1 - ↑u⁻¹ * x),
811-
{ rw eq_sub_iff_add_eq,
812-
replace hu := congr_arg (λ z, (↑u⁻¹ : α) * z) hu.symm,
813-
simpa [mul_add, add_comm] using hu },
814-
apply is_unit_one_sub_self_of_mem_nonunits,
815-
exact mul_mem_nonunits_right hx
816-
end
817-
818-
variable (α)
819-
820-
/-- The ideal of elements that are not units. -/
821-
def maximal_ideal : ideal α :=
822-
{ carrier := nonunits α,
823-
zero_mem' := zero_mem_nonunits.2 $ zero_ne_one,
824-
add_mem' := λ x y hx hy, nonunits_add hx hy,
825-
smul_mem' := λ a x, mul_mem_nonunits_right }
826-
827-
instance maximal_ideal.is_maximal : (maximal_ideal α).is_maximal :=
828-
begin
829-
rw ideal.is_maximal_iff,
830-
split,
831-
{ intro h, apply h, exact is_unit_one },
832-
{ intros I x hI hx H,
833-
erw not_not at hx,
834-
rcases hx with ⟨u,rfl⟩,
835-
simpa using I.mul_mem_left ↑u⁻¹ H }
836-
end
837-
838-
lemma maximal_ideal_unique :
839-
∃! I : ideal α, I.is_maximal :=
840-
⟨maximal_ideal α, maximal_ideal.is_maximal α,
841-
λ I hI, hI.eq_of_le (maximal_ideal.is_maximal α).1.1 $
842-
λ x hx, hI.1.1 ∘ I.eq_top_of_is_unit_mem hx⟩
843-
844-
variable {α}
845-
846-
lemma eq_maximal_ideal {I : ideal α} (hI : I.is_maximal) : I = maximal_ideal α :=
847-
unique_of_exists_unique (maximal_ideal_unique α) hI $ maximal_ideal.is_maximal α
848-
849-
lemma le_maximal_ideal {J : ideal α} (hJ : J ≠ ⊤) : J ≤ maximal_ideal α :=
850-
begin
851-
rcases ideal.exists_le_maximal J hJ with ⟨M, hM1, hM2⟩,
852-
rwa ←eq_maximal_ideal hM1
853-
end
854-
855-
@[simp] lemma mem_maximal_ideal (x) :
856-
x ∈ maximal_ideal α ↔ x ∈ nonunits α := iff.rfl
857-
858-
end local_ring
859-
860-
lemma local_of_nonunits_ideal [comm_ring α] (hnze : (0:α) ≠ 1)
861-
(h : ∀ x y ∈ nonunits α, x + y ∈ nonunits α) : local_ring α :=
862-
{ exists_pair_ne := ⟨0, 1, hnze⟩,
863-
is_local := λ x, or_iff_not_imp_left.mpr $ λ hx,
864-
begin
865-
by_contra H,
866-
apply h _ _ hx H,
867-
simp [-sub_eq_add_neg, add_sub_cancel'_right]
868-
end }
869-
870-
lemma local_of_unique_max_ideal [comm_ring α] (h : ∃! I : ideal α, I.is_maximal) :
871-
local_ring α :=
872-
local_of_nonunits_ideal
873-
(let ⟨I, Imax, _⟩ := h in (λ (H : 0 = 1), Imax.1.1 $ I.eq_top_iff_one.2 $ H ▸ I.zero_mem))
874-
$ λ x y hx hy H,
875-
let ⟨I, Imax, Iuniq⟩ := h in
876-
let ⟨Ix, Ixmax, Hx⟩ := exists_max_ideal_of_mem_nonunits hx in
877-
let ⟨Iy, Iymax, Hy⟩ := exists_max_ideal_of_mem_nonunits hy in
878-
have xmemI : x ∈ I, from ((Iuniq Ix Ixmax) ▸ Hx),
879-
have ymemI : y ∈ I, from ((Iuniq Iy Iymax) ▸ Hy),
880-
Imax.1.1 $ I.eq_top_of_is_unit_mem (I.add_mem xmemI ymemI) H
881-
882-
lemma local_of_unique_nonzero_prime (R : Type u) [comm_ring R]
883-
(h : ∃! P : ideal R, P ≠ ⊥ ∧ ideal.is_prime P) : local_ring R :=
884-
local_of_unique_max_ideal begin
885-
rcases h with ⟨P, ⟨hPnonzero, hPnot_top, _⟩, hPunique⟩,
886-
refine ⟨P, ⟨⟨hPnot_top, _⟩⟩, λ M hM, hPunique _ ⟨_, ideal.is_maximal.is_prime hM⟩⟩,
887-
{ refine ideal.maximal_of_no_maximal (λ M hPM hM, ne_of_lt hPM _),
888-
exact (hPunique _ ⟨ne_bot_of_gt hPM, ideal.is_maximal.is_prime hM⟩).symm },
889-
{ rintro rfl,
890-
exact hPnot_top (hM.1.2 P (bot_lt_iff_ne_bot.2 hPnonzero)) },
891-
end
892-
893-
lemma local_of_surjective {A B : Type*} [comm_ring A] [local_ring A] [comm_ring B] [nontrivial B]
894-
(f : A →+* B) (hf : function.surjective f) :
895-
local_ring B :=
896-
{ is_local :=
897-
begin
898-
intros b,
899-
obtain ⟨a, rfl⟩ := hf b,
900-
apply (local_ring.is_unit_or_is_unit_one_sub_self a).imp f.is_unit_map _,
901-
rw [← f.map_one, ← f.map_sub],
902-
apply f.is_unit_map,
903-
end,
904-
.. ‹nontrivial B› }
905-
906-
/-- A local ring homomorphism is a homomorphism between local rings
907-
such that the image of the maximal ideal of the source is contained within
908-
the maximal ideal of the target. -/
909-
class is_local_ring_hom [semiring α] [semiring β] (f : α →+* β) : Prop :=
910-
(map_nonunit : ∀ a, is_unit (f a) → is_unit a)
911-
912-
instance is_local_ring_hom_id (A : Type*) [semiring A] : is_local_ring_hom (ring_hom.id A) :=
913-
{ map_nonunit := λ a, id }
914-
915-
@[simp] lemma is_unit_map_iff {A B : Type*} [semiring A] [semiring B] (f : A →+* B)
916-
[is_local_ring_hom f] (a) :
917-
is_unit (f a) ↔ is_unit a :=
918-
⟨is_local_ring_hom.map_nonunit a, f.is_unit_map⟩
919-
920-
instance is_local_ring_hom_comp {A B C : Type*} [semiring A] [semiring B] [semiring C]
921-
(g : B →+* C) (f : A →+* B) [is_local_ring_hom g] [is_local_ring_hom f] :
922-
is_local_ring_hom (g.comp f) :=
923-
{ map_nonunit := λ a, is_local_ring_hom.map_nonunit a ∘ is_local_ring_hom.map_nonunit (f a) }
924-
925-
@[simp] lemma is_unit_of_map_unit [semiring α] [semiring β] (f : α →+* β) [is_local_ring_hom f]
926-
(a) (h : is_unit (f a)) : is_unit a :=
927-
is_local_ring_hom.map_nonunit a h
928-
929-
theorem of_irreducible_map [semiring α] [semiring β] (f : α →+* β) [h : is_local_ring_hom f] {x : α}
930-
(hfx : irreducible (f x)) : irreducible x :=
931-
⟨λ h, hfx.not_unit $ is_unit.map f.to_monoid_hom h, λ p q hx, let ⟨H⟩ := h in
932-
or.imp (H p) (H q) $ hfx.is_unit_or_is_unit $ f.map_mul p q ▸ congr_arg f hx⟩
933-
934-
section
935-
open local_ring
936-
variables [comm_ring α] [local_ring α] [comm_ring β] [local_ring β]
937-
variables (f : α →+* β) [is_local_ring_hom f]
938-
939-
lemma map_nonunit (a) (h : a ∈ maximal_ideal α) : f a ∈ maximal_ideal β :=
940-
λ H, h $ is_unit_of_map_unit f a H
941-
942-
end
943-
944-
namespace local_ring
945-
variables [comm_ring α] [local_ring α] [comm_ring β] [local_ring β]
946-
947-
variable (α)
948-
/-- The residue field of a local ring is the quotient of the ring by its maximal ideal. -/
949-
def residue_field := (maximal_ideal α).quotient
950-
951-
noncomputable instance residue_field.field : field (residue_field α) :=
952-
ideal.quotient.field (maximal_ideal α)
953-
954-
noncomputable instance : inhabited (residue_field α) := ⟨37
955-
956-
/-- The quotient map from a local ring to its residue field. -/
957-
def residue : α →+* (residue_field α) :=
958-
ideal.quotient.mk _
959-
960-
namespace residue_field
961-
962-
variables {α β}
963-
/-- The map on residue fields induced by a local homomorphism between local rings -/
964-
noncomputable def map (f : α →+* β) [is_local_ring_hom f] :
965-
residue_field α →+* residue_field β :=
966-
ideal.quotient.lift (maximal_ideal α) ((ideal.quotient.mk _).comp f) $
967-
λ a ha,
968-
begin
969-
erw ideal.quotient.eq_zero_iff_mem,
970-
exact map_nonunit f a ha
971-
end
972-
973-
end residue_field
974-
975-
end local_ring
976-
977-
namespace field
978-
variables [field α]
979-
980-
@[priority 100] -- see Note [lower instance priority]
981-
instance : local_ring α :=
982-
{ is_local := λ a,
983-
if h : a = 0
984-
then or.inr (by rw [h, sub_zero]; exact is_unit_one)
985-
else or.inl $ is_unit.mk0 a h }
986-
987-
end field

0 commit comments

Comments
 (0)