@@ -5,10 +5,10 @@ Authors: Johan Commelin
5
5
-/
6
6
import algebra.punit_instances
7
7
import linear_algebra.finsupp
8
- import ring_theory.nilpotent
9
- import ring_theory.localization.away
10
- import ring_theory.ideal.prod
11
8
import ring_theory.ideal.over
9
+ import ring_theory.ideal.prod
10
+ import ring_theory.localization.away
11
+ import ring_theory.nilpotent
12
12
import topology.sets.closeds
13
13
import topology.sober
14
14
@@ -37,79 +37,84 @@ whereas we denote subsets of prime spectra with `t`, `t'`, etc...
37
37
38
38
## Inspiration/contributors
39
39
40
- The contents of this file draw inspiration from
41
- <https://github.com/ramonfmir/lean-scheme>
40
+ The contents of this file draw inspiration from <https://github.com/ramonfmir/lean-scheme>
42
41
which has contributions from Ramon Fernandez Mir, Kevin Buzzard, Kenny Lau,
43
42
and Chris Hughes (on an earlier repository).
44
-
45
43
-/
46
44
47
45
noncomputable theory
48
46
open_locale classical
49
47
50
48
universes u v
51
49
52
- variables (R : Type u) [comm_ring R]
50
+ variables (R : Type u) (S : Type v) [comm_ring R] [comm_ring S ]
53
51
54
- /-- The prime spectrum of a commutative ring `R`
55
- is the type of all prime ideals of `R`.
52
+ /-- The prime spectrum of a commutative ring `R` is the type of all prime ideals of `R`.
56
53
57
54
It is naturally endowed with a topology (the Zariski topology),
58
55
and a sheaf of commutative rings (see `algebraic_geometry.structure_sheaf`).
59
56
It is a fundamental building block in algebraic geometry. -/
60
- @[nolint has_nonempty_instance]
61
- def prime_spectrum := {I : ideal R // I.is_prime}
57
+ @[ext] structure prime_spectrum :=
58
+ (as_ideal : ideal R)
59
+ (is_prime : as_ideal.is_prime)
62
60
63
- variable {R}
61
+ attribute [instance] prime_spectrum.is_prime
64
62
65
63
namespace prime_spectrum
66
64
67
- /-- A method to view a point in the prime spectrum of a commutative ring
68
- as an ideal of that ring. -/
69
- abbreviation as_ideal (x : prime_spectrum R) : ideal R := x.val
65
+ variables {R S}
70
66
71
- instance is_prime (x : prime_spectrum R) :
72
- x.as_ideal.is_prime := x. 2
67
+ instance [nontrivial R] : nonempty $ prime_spectrum R :=
68
+ let ⟨I, hI⟩ := ideal.exists_maximal R in ⟨⟨I, hI.is_prime⟩⟩
73
69
74
- /--
75
- The prime spectrum of the zero ring is empty.
76
- -/
70
+ /-- The prime spectrum of the zero ring is empty. -/
77
71
lemma punit (x : prime_spectrum punit) : false :=
78
72
x.1 .ne_top_iff_one.1 x.2 .1 $ subsingleton.elim (0 : punit) 1 ▸ x.1 .zero_mem
79
73
80
- section
81
- variables (R) (S : Type v) [comm_ring S]
74
+ variables (R S)
75
+
76
+ /-- The map from the direct sum of prime spectra to the prime spectrum of a direct product. -/
77
+ @[simp] def prime_spectrum_prod_of_sum :
78
+ prime_spectrum R ⊕ prime_spectrum S → prime_spectrum (R × S)
79
+ | (sum.inl ⟨I, hI⟩) := ⟨ideal.prod I ⊤, by exactI ideal.is_prime_ideal_prod_top⟩
80
+ | (sum.inr ⟨J, hJ⟩) := ⟨ideal.prod ⊤ J, by exactI ideal.is_prime_ideal_prod_top'⟩
82
81
83
82
/-- The prime spectrum of `R × S` is in bijection with the disjoint unions of the prime spectrum of
84
- `R` and the prime spectrum of `S`. -/
83
+ `R` and the prime spectrum of `S`. -/
85
84
noncomputable def prime_spectrum_prod :
86
85
prime_spectrum (R × S) ≃ prime_spectrum R ⊕ prime_spectrum S :=
87
- ideal.prime_ideals_equiv R S
86
+ equiv.symm $ equiv.of_bijective (prime_spectrum_prod_of_sum R S)
87
+ begin
88
+ split,
89
+ { rintro (⟨I, hI⟩|⟨J, hJ⟩) (⟨I', hI'⟩|⟨J', hJ'⟩) h;
90
+ simp only [ideal.prod.ext_iff, prime_spectrum_prod_of_sum] at h,
91
+ { simp only [h] },
92
+ { exact false.elim (hI.ne_top h.left) },
93
+ { exact false.elim (hJ.ne_top h.right) },
94
+ { simp only [h] } },
95
+ { rintro ⟨I, hI⟩,
96
+ rcases (ideal.ideal_prod_prime I).mp hI with (⟨p, ⟨hp, rfl⟩⟩|⟨p, ⟨hp, rfl⟩⟩),
97
+ { exact ⟨sum.inl ⟨p, hp⟩, rfl⟩ },
98
+ { exact ⟨sum.inr ⟨p, hp⟩, rfl⟩ } }
99
+ end
88
100
89
101
variables {R S}
90
102
91
103
@[simp] lemma prime_spectrum_prod_symm_inl_as_ideal (x : prime_spectrum R) :
92
- ((prime_spectrum_prod R S).symm ( sum.inl x) ).as_ideal = ideal.prod x.as_ideal ⊤ :=
104
+ ((prime_spectrum_prod R S).symm $ sum.inl x).as_ideal = ideal.prod x.as_ideal ⊤ :=
93
105
by { cases x, refl }
106
+
94
107
@[simp] lemma prime_spectrum_prod_symm_inr_as_ideal (x : prime_spectrum S) :
95
- ((prime_spectrum_prod R S).symm ( sum.inr x) ).as_ideal = ideal.prod ⊤ x.as_ideal :=
108
+ ((prime_spectrum_prod R S).symm $ sum.inr x).as_ideal = ideal.prod ⊤ x.as_ideal :=
96
109
by { cases x, refl }
97
110
98
- end
99
-
100
- @[ext] lemma ext {x y : prime_spectrum R} :
101
- x = y ↔ x.as_ideal = y.as_ideal :=
102
- subtype.ext_iff_val
103
-
104
- /-- The zero locus of a set `s` of elements of a commutative ring `R`
105
- is the set of all prime ideals of the ring that contain the set `s`.
111
+ /-- The zero locus of a set `s` of elements of a commutative ring `R` is the set of all prime ideals
112
+ of the ring that contain the set `s`.
106
113
107
- An element `f` of `R` can be thought of as a dependent function
108
- on the prime spectrum of `R`.
109
- At a point `x` (a prime ideal)
110
- the function (i.e., element) `f` takes values in the quotient ring `R` modulo the prime ideal `x`.
111
- In this manner, `zero_locus s` is exactly the subset of `prime_spectrum R`
112
- where all "functions" in `s` vanish simultaneously.
114
+ An element `f` of `R` can be thought of as a dependent function on the prime spectrum of `R`.
115
+ At a point `x` (a prime ideal) the function (i.e., element) `f` takes values in the quotient ring
116
+ `R` modulo the prime ideal `x`. In this manner, `zero_locus s` is exactly the subset of
117
+ `prime_spectrum R` where all "functions" in `s` vanish simultaneously.
113
118
-/
114
119
def zero_locus (s : set R) : set (prime_spectrum R) :=
115
120
{x | s ⊆ x.as_ideal}
@@ -121,15 +126,12 @@ def zero_locus (s : set R) : set (prime_spectrum R) :=
121
126
zero_locus (ideal.span s : set R) = zero_locus s :=
122
127
by { ext x, exact (submodule.gi R R).gc s x.as_ideal }
123
128
124
- /-- The vanishing ideal of a set `t` of points
125
- of the prime spectrum of a commutative ring `R`
126
- is the intersection of all the prime ideals in the set `t`.
129
+ /-- The vanishing ideal of a set `t` of points of the prime spectrum of a commutative ring `R` is
130
+ the intersection of all the prime ideals in the set `t`.
127
131
128
- An element `f` of `R` can be thought of as a dependent function
129
- on the prime spectrum of `R`.
130
- At a point `x` (a prime ideal)
131
- the function (i.e., element) `f` takes values in the quotient ring `R` modulo the prime ideal `x`.
132
- In this manner, `vanishing_ideal t` is exactly the ideal of `R`
132
+ An element `f` of `R` can be thought of as a dependent function on the prime spectrum of `R`.
133
+ At a point `x` (a prime ideal) the function (i.e., element) `f` takes values in the quotient ring
134
+ `R` modulo the prime ideal `x`. In this manner, `vanishing_ideal t` is exactly the ideal of `R`
133
135
consisting of all "functions" that vanish on all of `t`.
134
136
-/
135
137
def vanishing_ideal (t : set (prime_spectrum R)) : ideal R :=
@@ -338,9 +340,8 @@ lemma mem_compl_zero_locus_iff_not_mem {f : R} {I : prime_spectrum R} :
338
340
I ∈ (zero_locus {f} : set (prime_spectrum R))ᶜ ↔ f ∉ I.as_ideal :=
339
341
by rw [set.mem_compl_iff, mem_zero_locus, set.singleton_subset_iff]; refl
340
342
341
- /-- The Zariski topology on the prime spectrum of a commutative ring
342
- is defined via the closed sets of the topology:
343
- they are exactly those sets that are the zero locus of a subset of the ring. -/
343
+ /-- The Zariski topology on the prime spectrum of a commutative ring is defined via the closed sets
344
+ of the topology: they are exactly those sets that are the zero locus of a subset of the ring. -/
344
345
instance zariski_topology : topological_space (prime_spectrum R) :=
345
346
topological_space.of_closed (set.range prime_spectrum.zero_locus)
346
347
(⟨set.univ, by simp⟩)
@@ -387,7 +388,7 @@ begin
387
388
(hs.2 ⟨J, hJ.is_prime⟩ (λ r hr, hIJ (le_of_lt hI $ hs.1 hr)))) },
388
389
{ refine ⟨x.as_ideal.1 , _⟩,
389
390
rw [eq_comm, set.eq_singleton_iff_unique_mem],
390
- refine ⟨λ _ h, h, λ y hy, prime_spectrum.ext. 2 (h.eq_of_le y.2 .ne_top hy).symm⟩ }
391
+ refine ⟨λ _ h, h, λ y hy, prime_spectrum.ext _ _ (h.eq_of_le y.2 .ne_top hy).symm⟩ }
391
392
end
392
393
393
394
lemma zero_locus_vanishing_ideal_eq_closure (t : set (prime_spectrum R)) :
@@ -496,7 +497,7 @@ instance : quasi_sober (prime_spectrum R) :=
496
497
by rw [is_generic_point, closure_singleton, zero_locus_vanishing_ideal_eq_closure, h₂.closure_eq]⟩⟩
497
498
498
499
section comap
499
- variables {S : Type v} [comm_ring S] {S ' : Type *} [comm_ring S']
500
+ variables {S' : Type *} [comm_ring S']
500
501
501
502
lemma preimage_comap_zero_locus_aux (f : R →+* S) (s : set R) :
502
503
(λ y, ⟨ideal.comap f y.as_ideal, infer_instance⟩ :
@@ -540,7 +541,7 @@ preimage_comap_zero_locus_aux f s
540
541
541
542
lemma comap_injective_of_surjective (f : R →+* S) (hf : function.surjective f) :
542
543
function.injective (comap f) :=
543
- λ x y h, prime_spectrum.ext. 2 (ideal.comap_injective_of_surjective f hf
544
+ λ x y h, prime_spectrum.ext _ _ (ideal.comap_injective_of_surjective f hf
544
545
(congr_arg prime_spectrum.as_ideal h : (comap f x).as_ideal = (comap f y).as_ideal))
545
546
546
547
lemma comap_singleton_is_closed_of_surjective (f : R →+* S) (hf : function.surjective f)
@@ -762,7 +763,7 @@ begin
762
763
simp only [set.eq_univ_iff_forall, set.singleton_subset_iff,
763
764
topological_space.opens.coe_bot, nilpotent_iff_mem_prime, set.compl_empty_iff, mem_zero_locus,
764
765
set_like.mem_coe],
765
- exact subtype.forall,
766
+ exact ⟨λ h I hI, h ⟨I, hI⟩, λ h ⟨I, hI⟩, h I hI⟩
766
767
end
767
768
768
769
lemma localization_away_comap_range (S : Type v) [comm_ring S] [algebra R S] (r : R)
@@ -795,20 +796,16 @@ section order
795
796
/-!
796
797
## The specialization order
797
798
798
- We endow `prime_spectrum R` with a partial order,
799
- where `x ≤ y` if and only if `y ∈ closure {x}`.
799
+ We endow `prime_spectrum R` with a partial order, where `x ≤ y` if and only if `y ∈ closure {x}`.
800
800
-/
801
801
802
- instance : partial_order (prime_spectrum R) :=
803
- subtype.partial_order _
802
+ instance : partial_order (prime_spectrum R) := partial_order.lift as_ideal ext
804
803
805
- @[simp] lemma as_ideal_le_as_ideal (x y : prime_spectrum R) :
806
- x.as_ideal ≤ y.as_ideal ↔ x ≤ y :=
807
- subtype.coe_le_coe
804
+ @[simp] lemma as_ideal_le_as_ideal (x y : prime_spectrum R) : x.as_ideal ≤ y.as_ideal ↔ x ≤ y :=
805
+ iff.rfl
808
806
809
- @[simp] lemma as_ideal_lt_as_ideal (x y : prime_spectrum R) :
810
- x.as_ideal < y.as_ideal ↔ x < y :=
811
- subtype.coe_lt_coe
807
+ @[simp] lemma as_ideal_lt_as_ideal (x y : prime_spectrum R) : x.as_ideal < y.as_ideal ↔ x < y :=
808
+ iff.rfl
812
809
813
810
lemma le_iff_mem_closure (x y : prime_spectrum R) :
814
811
x ≤ y ↔ y ∈ closure ({x} : set (prime_spectrum R)) :=
@@ -828,8 +825,8 @@ instance : t0_space (prime_spectrum R) := ⟨nhds_order_embedding.injective⟩
828
825
829
826
end order
830
827
831
- /-- If `x` specializes to `y`, then there is a natural map from the localization of `y` to
832
- the localization of `x`. -/
828
+ /-- If `x` specializes to `y`, then there is a natural map from the localization of `y` to the
829
+ localization of `x`. -/
833
830
def localization_map_of_specializes {x y : prime_spectrum R} (h : x ⤳ y) :
834
831
localization.at_prime y.as_ideal →+* localization.at_prime x.as_ideal :=
835
832
@is_localization.lift _ _ _ _ _ _ _ _
@@ -843,22 +840,18 @@ def localization_map_of_specializes {x y : prime_spectrum R} (h : x ⤳ y) :
843
840
844
841
end prime_spectrum
845
842
846
-
847
843
namespace local_ring
848
844
849
- variables (R) [local_ring R]
845
+ variables [local_ring R]
850
846
851
- /--
852
- The closed point in the prime spectrum of a local ring.
853
- -/
854
- def closed_point : prime_spectrum R :=
855
- ⟨maximal_ideal R, (maximal_ideal.is_maximal R).is_prime⟩
847
+ /-- The closed point in the prime spectrum of a local ring. -/
848
+ def closed_point : prime_spectrum R := ⟨maximal_ideal R, (maximal_ideal.is_maximal R).is_prime⟩
856
849
857
850
variable {R}
858
851
859
852
lemma is_local_ring_hom_iff_comap_closed_point {S : Type v} [comm_ring S] [local_ring S]
860
853
(f : R →+* S) : is_local_ring_hom f ↔ prime_spectrum.comap f (closed_point S) = closed_point R :=
861
- by { rw [(local_hom_tfae f).out 0 4 , subtype .ext_iff], refl }
854
+ by { rw [(local_hom_tfae f).out 0 4 , prime_spectrum .ext_iff], refl }
862
855
863
856
@[simp] lemma comap_closed_point {S : Type v} [comm_ring S] [local_ring S] (f : R →+* S)
864
857
[is_local_ring_hom f] : prime_spectrum.comap f (closed_point S) = closed_point R :=
0 commit comments