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

Commit 17c4651

Browse files
kim-emkbuzzardlaughinggas
committed
feat(algebraic_geometry): structure sheaf on Spec R (#3907)
This defines the structure sheaf on Spec R, following Hartshorne, as a sheaf in `CommRing` on `prime_spectrum R`. We still need to show at the stalk at a point is just the localization; this is another page of Hartshorne, and will come in a subsequent PR. Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Ashvni <ashvni.n@gmail.com>
1 parent 84d47a0 commit 17c4651

File tree

2 files changed

+235
-1
lines changed

2 files changed

+235
-1
lines changed

src/algebraic_geometry/prime_spectrum.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace prime_spectrum
6363
as an ideal of that ring. -/
6464
abbreviation as_ideal (x : prime_spectrum R) : ideal R := x.val
6565

66-
instance as_ideal.is_prime (x : prime_spectrum R) :
66+
instance is_prime (x : prime_spectrum R) :
6767
x.as_ideal.is_prime := x.2
6868

6969
@[ext] lemma ext {x y : prime_spectrum R} :
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
/-
2+
Copyright (c) 2020 Scott Morrison. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Johan Commelin, Scott Morrison
5+
-/
6+
import algebraic_geometry.prime_spectrum
7+
import algebra.category.CommRing
8+
import topology.sheaves.local_predicate
9+
import topology.sheaves.forget
10+
import ring_theory.localization
11+
import ring_theory.subring
12+
13+
/-!
14+
# The structure sheaf on `prime_spectrum R`.
15+
16+
We define the structure sheaf on `Top.of (prime_spectrum R)`, for a commutative ring `R`.
17+
We define this as a subsheaf of the sheaf of dependent functions into the localizations,
18+
cut out by the condition that the function must be locally equal to a ratio of elements of `R`.
19+
20+
Because the condition "is equal to a fraction" passes to smaller open subsets,
21+
the subset of functions satisfying this condition is automatically a subpresheaf.
22+
Because the condition "is locally equal to a fraction" is local,
23+
it is also a subsheaf.
24+
25+
(It may be helpful to refer back to `topology.sheaves.sheaf_of_functions`,
26+
where we show that dependent functions into any type family form a sheaf,
27+
and also `topology.sheaves.local_predicate`, where we characterise the predicates
28+
which pick out sub-presheaves and sub-sheaves of these sheaves.)
29+
30+
We also set up the ring structure, obtaining
31+
`structure_sheaf R : sheaf CommRing (Top.of (prime_spectrum R))`.
32+
-/
33+
34+
universe u
35+
36+
noncomputable theory
37+
38+
variables (R : Type u) [comm_ring R]
39+
40+
open Top
41+
open topological_space
42+
open category_theory
43+
open opposite
44+
45+
namespace algebraic_geometry
46+
47+
/--
48+
$Spec R$, just as a topological space.
49+
-/
50+
def Spec.Top : Top := Top.of (prime_spectrum R)
51+
52+
namespace structure_sheaf
53+
54+
/--
55+
The type family over `prime_spectrum R` consisting of the localization over each point.
56+
-/
57+
@[derive [comm_ring, local_ring]]
58+
def localizations (P : Spec.Top R) : Type u := localization.at_prime P.as_ideal
59+
60+
instance (P : Spec.Top R) : inhabited (localizations R P) :=
61+
⟨(localization.of _).to_map 1
62+
63+
variables {R}
64+
65+
/--
66+
The predicate saying that a dependent function on an open `U` is realised as a fixed fraction
67+
`r / s` in each of the stalks (which are localizations at various prime ideals).
68+
-/
69+
def is_fraction {U : opens (Spec.Top R)} (f : Π x : U, localizations R x) : Prop :=
70+
∃ (r s : R), ∀ x : U,
71+
¬ (s ∈ x.1.as_ideal) ∧ f x * (localization.of _).to_map s = (localization.of _).to_map r
72+
73+
variables (R)
74+
75+
/--
76+
The predicate `is_fraction` is "prelocal",
77+
in the sense that if it holds on `U` it holds on any open subset `V` of `U`.
78+
-/
79+
def is_fraction_prelocal : prelocal_predicate (localizations R) :=
80+
{ pred := λ U f, is_fraction f,
81+
res := by { rintro V U i f ⟨r, s, w⟩, exact ⟨r, s, λ x, w (i x)⟩ } }
82+
83+
/--
84+
We will define the structure sheaf as
85+
the subsheaf of all dependent functions in `Π x : U, localizations R x`
86+
consisting of those functions which can locally be expressed as a ratio of
87+
(the images in the localization of) elements of `R`.
88+
89+
Quoting Hartshorne:
90+
91+
For an open set $$U ⊆ Spec A$$, we define $$𝒪(U)$$ to be the set of functions
92+
$$s : U → ⨆_{𝔭 ∈ U} A_𝔭$$, such that $s(𝔭) ∈ A_𝔭$$ for each $$𝔭$$,
93+
and such that $$s$$ is locally a quotient of elements of $$A$$:
94+
to be precise, we require that for each $$𝔭 ∈ U$$, there is a neighborhood $$V$$ of $$𝔭$$,
95+
contained in $$U$$, and elements $$a, f ∈ A$$, such that for each $$𝔮 ∈ V, f ∉ 𝔮$$,
96+
and $$s(𝔮) = a/f$$ in $$A_𝔮$$.
97+
98+
Now Hartshorne had the disadvantage of not knowing about dependent functions,
99+
so we replace his circumlocution about functions into a disjoint union with
100+
`Π x : U, localizations x`.
101+
-/
102+
def is_locally_fraction : local_predicate (localizations R) :=
103+
(is_fraction_prelocal R).sheafify
104+
105+
@[simp]
106+
lemma is_locally_fraction_pred
107+
{U : opens (Spec.Top R)} (f : Π x : U, localizations R x) :
108+
(is_locally_fraction R).pred f =
109+
∀ x : U, ∃ (V) (m : x.1 ∈ V) (i : V ⟶ U),
110+
∃ (r s : R), ∀ y : V,
111+
¬ (s ∈ y.1.as_ideal) ∧
112+
f (i y : U) * (localization.of _).to_map s = (localization.of _).to_map r :=
113+
rfl
114+
115+
/--
116+
The functions satisfying `is_locally_fraction` form a submonoid.
117+
-/
118+
def sections_subring (U : (opens (Spec.Top R))ᵒᵖ) :
119+
subring (Π x : unop U, localizations R x) :=
120+
{ carrier := { f | (is_locally_fraction R).pred f },
121+
zero_mem' :=
122+
begin
123+
refine λ x, ⟨unop U, x.2, 𝟙 _, 0, 1, λ y, ⟨_, _⟩⟩,
124+
{ rw ←ideal.ne_top_iff_one, exact y.1.is_prime.1, },
125+
{ simp, },
126+
end,
127+
one_mem' :=
128+
begin
129+
refine λ x, ⟨unop U, x.2, 𝟙 _, 1, 1, λ y, ⟨_, _⟩⟩,
130+
{ rw ←ideal.ne_top_iff_one, exact y.1.is_prime.1, },
131+
{ simp, },
132+
end,
133+
add_mem' :=
134+
begin
135+
intros a b ha hb x,
136+
rcases ha x with ⟨Va, ma, ia, ra, sa, wa⟩,
137+
rcases hb x with ⟨Vb, mb, ib, rb, sb, wb⟩,
138+
refine ⟨Va ⊓ Vb, ⟨ma, mb⟩, opens.inf_le_left _ _ ≫ ia, ra * sb + rb * sa, sa * sb, _⟩,
139+
intro y,
140+
rcases wa (opens.inf_le_left _ _ y) with ⟨nma, wa⟩,
141+
rcases wb (opens.inf_le_right _ _ y) with ⟨nmb, wb⟩,
142+
fsplit,
143+
{ intro H, cases y.1.is_prime.mem_or_mem H; contradiction, },
144+
{ simp only [add_mul, ring_hom.map_add, pi.add_apply, ring_hom.map_mul],
145+
erw [←wa, ←wb],
146+
simp only [mul_assoc],
147+
congr' 2,
148+
rw [mul_comm], refl, }
149+
end,
150+
neg_mem' :=
151+
begin
152+
intros a ha x,
153+
rcases ha x with ⟨V, m, i, r, s, w⟩,
154+
refine ⟨V, m, i, -r, s, _⟩,
155+
intro y,
156+
rcases w y with ⟨nm, w⟩,
157+
fsplit,
158+
{ exact nm, },
159+
{ simp only [ring_hom.map_neg, pi.neg_apply],
160+
erw [←w],
161+
simp only [neg_mul_eq_neg_mul_symm], }
162+
end,
163+
mul_mem' :=
164+
begin
165+
intros a b ha hb x,
166+
rcases ha x with ⟨Va, ma, ia, ra, sa, wa⟩,
167+
rcases hb x with ⟨Vb, mb, ib, rb, sb, wb⟩,
168+
refine ⟨Va ⊓ Vb, ⟨ma, mb⟩, opens.inf_le_left _ _ ≫ ia, ra * rb, sa * sb, _⟩,
169+
intro y,
170+
rcases wa (opens.inf_le_left _ _ y) with ⟨nma, wa⟩,
171+
rcases wb (opens.inf_le_right _ _ y) with ⟨nmb, wb⟩,
172+
fsplit,
173+
{ intro H, cases y.1.is_prime.mem_or_mem H; contradiction, },
174+
{ simp only [pi.mul_apply, ring_hom.map_mul],
175+
erw [←wa, ←wb],
176+
simp only [mul_left_comm, mul_assoc, mul_comm],
177+
refl, }
178+
end, }
179+
180+
end structure_sheaf
181+
182+
open structure_sheaf
183+
184+
/--
185+
The structure sheaf (valued in `Type`, not yet `CommRing`) is the subsheaf consisting of
186+
functions satisfying `is_locally_fraction`.
187+
-/
188+
def structure_sheaf_in_Type : sheaf (Type u) (Spec.Top R):=
189+
subsheaf_to_Types (is_locally_fraction R)
190+
191+
instance comm_ring_structure_sheaf_in_Type_obj (U : (opens (Spec.Top R))ᵒᵖ) :
192+
comm_ring ((structure_sheaf_in_Type R).presheaf.obj U) :=
193+
(sections_subring R U).to_comm_ring
194+
195+
/--
196+
The structure presheaf, valued in `CommRing`, constructed by dressing up the `Type` valued
197+
structure presheaf.
198+
-/
199+
@[simps]
200+
def structure_presheaf_in_CommRing : presheaf CommRing (Spec.Top R) :=
201+
{ obj := λ U, CommRing.of ((structure_sheaf_in_Type R).presheaf.obj U),
202+
map := λ U V i,
203+
{ to_fun := ((structure_sheaf_in_Type R).presheaf.map i),
204+
map_zero' := rfl,
205+
map_add' := λ x y, rfl,
206+
map_one' := rfl,
207+
map_mul' := λ x y, rfl, }, }
208+
209+
/--
210+
Some glue, verifying that that structure presheaf valued in `CommRing` agrees
211+
with the `Type` valued structure presheaf.
212+
-/
213+
def structure_presheaf_comp_forget :
214+
structure_presheaf_in_CommRing R ⋙ (forget CommRing) ≅ (structure_sheaf_in_Type R).presheaf :=
215+
nat_iso.of_components
216+
(λ U, iso.refl _)
217+
(by tidy)
218+
219+
/--
220+
The structure sheaf on $Spec R$, valued in `CommRing`.
221+
222+
This is provided as a bundled `SheafedSpace` as `Spec.SheafedSpace R` later.
223+
-/
224+
def structure_sheaf : sheaf CommRing (Spec.Top R) :=
225+
{ presheaf := structure_presheaf_in_CommRing R,
226+
sheaf_condition :=
227+
-- We check the sheaf condition under `forget CommRing`.
228+
(sheaf_condition_equiv_sheaf_condition_comp _ _).symm
229+
(sheaf_condition_equiv_of_iso (structure_presheaf_comp_forget R).symm
230+
(structure_sheaf_in_Type R).sheaf_condition), }
231+
232+
-- TODO: we need to prove that the stalk at `P` is `localization.at_prime P.as_ideal`
233+
234+
end algebraic_geometry

0 commit comments

Comments
 (0)