-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathMorphismProperty.lean
More file actions
374 lines (321 loc) Β· 15.3 KB
/
MorphismProperty.lean
File metadata and controls
374 lines (321 loc) Β· 15.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
/-
Copyright (c) 2024 Christian Merten, Andrew Yang. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Christian Merten, Andrew Yang
-/
import Mathlib.AlgebraicGeometry.OpenImmersion
import Mathlib.CategoryTheory.MorphismProperty.Limits
/-!
# Covers of schemes
This file provides the basic API for covers of schemes. A cover of a scheme `X` with respect to
a morphism property `P` is a jointly surjective indexed family of scheme morphisms with
target `X` all satisfying `P`.
## Implementation details
The definition on the pullback of a cover along a morphism depends on results that
are developed later in the import tree. Hence in this file, they have additional assumptions
that will be automatically satisfied in later files. The motivation here is that we already
know that these assumptions are satisfied for open immersions and hence the cover API for open
immersions can be used to deduce these assumptions in the general case.
-/
noncomputable section
open TopologicalSpace CategoryTheory Opposite CategoryTheory.Limits
universe v vβ vβ u
namespace AlgebraicGeometry
namespace Scheme
-- TODO: provide API to and from a presieve.
/-- A cover of `X` consists of jointly surjective indexed family of scheme morphisms
with target `X` all satisfying `P`.
This is merely a coverage in the pretopology defined by `P`, and it would be optimal
if we could reuse the existing API about pretopologies, However, the definitions of sieves and
grothendieck topologies uses `Prop`s, so that the actual open sets and immersions are hard to
obtain. Also, since such a coverage in the pretopology usually contains a proper class of
immersions, it is quite hard to glue them, reason about finite covers, etc.
Note: The `map_prop` field is equipped with a default argument `by infer_instance`. In general
this causes worse error messages, but in practice `P` is mostly defined via `class`.
-/
structure Cover (P : MorphismProperty Scheme.{u}) (X : Scheme.{u}) where
/-- index set of a cover of a scheme `X` -/
J : Type v
/-- the components of a cover -/
obj (j : J) : Scheme
/-- the components map to `X` -/
map (j : J) : obj j βΆ X
/-- given a point of `x : X`, `f x` is the index of the component which contains `x` -/
f (x : X) : J
/-- the components cover `X` -/
covers (x : X) : x β Set.range (map (f x)).base
/-- the component maps satisfy `P` -/
map_prop (j : J) : P (map j) := by infer_instance
variable {P : MorphismProperty Scheme.{u}}
variable {X Y Z : Scheme.{u}} (π° : X.Cover P) (f : X βΆ Z) (g : Y βΆ Z)
variable [β x, HasPullback (π°.map x β« f) g]
theorem Cover.iUnion_range {X : Scheme.{u}} (π° : X.Cover P) :
β i, Set.range (π°.map i).base = Set.univ := by
rw [Set.eq_univ_iff_forall]
intro x
rw [Set.mem_iUnion]
exact β¨π°.f x, π°.covers xβ©
lemma Cover.exists_eq (π° : X.Cover P) (x : X) : β i y, (π°.map i).base y = x :=
β¨_, π°.covers xβ©
instance Cover.nonempty_of_nonempty [Nonempty X] (π° : X.Cover P) : Nonempty π°.J :=
Nonempty.map π°.f βΉ_βΊ
/-- Given a family of schemes with morphisms to `X` satisfying `P` that jointly
cover `X`, `Cover.mkOfCovers` is an associated `P`-cover of `X`. -/
@[simps]
def Cover.mkOfCovers (J : Type*) (obj : J β Scheme.{u}) (map : (j : J) β obj j βΆ X)
(covers : β x, β j y, (map j).base y = x)
(map_prop : β j, P (map j) := by infer_instance) : X.Cover P where
J := J
obj := obj
map := map
f x := (covers x).choose
covers x := (covers x).choose_spec
map_prop := map_prop
/-- Turn a `P`-cover into a `Q`-cover by showing that the components satisfy `Q`. -/
def Cover.changeProp (Q : MorphismProperty Scheme.{u}) (π° : X.Cover P) (h : β j, Q (π°.map j)) :
X.Cover Q where
J := π°.J
obj := π°.obj
map := π°.map
f := π°.f
covers := π°.covers
map_prop := h
/-- Given a `P`-cover `{ Uα΅’ }` of `X`, and for each `Uα΅’` a `P`-cover, we may combine these
covers to form a `P`-cover of `X`. -/
@[simps! J obj map]
def Cover.bind [P.IsStableUnderComposition] (f : β x : π°.J, (π°.obj x).Cover P) : X.Cover P where
J := Ξ£ i : π°.J, (f i).J
obj x := (f x.1).obj x.2
map x := (f x.1).map x.2 β« π°.map x.1
f x := β¨_, (f _).f (π°.covers x).chooseβ©
covers x := by
let y := (π°.covers x).choose
have hy : (π°.map (π°.f x)).base y = x := (π°.covers x).choose_spec
rcases (f (π°.f x)).covers y with β¨z, hzβ©
change x β Set.range ((f (π°.f x)).map ((f (π°.f x)).f y) β« π°.map (π°.f x)).base
use z
simp only [comp_coeBase, TopCat.hom_comp, ContinuousMap.comp_apply]
rw [hz, hy]
map_prop _ := P.comp_mem _ _ ((f _).map_prop _) (π°.map_prop _)
/-- An isomorphism `X βΆ Y` is a `P`-cover of `Y`. -/
@[simps J obj map]
def coverOfIsIso [P.ContainsIdentities] [P.RespectsIso] {X Y : Scheme.{u}} (f : X βΆ Y)
[IsIso f] : Cover.{v} P Y where
J := PUnit.{v + 1}
obj _ := X
map _ := f
f _ := PUnit.unit
covers x := by
rw [Set.range_eq_univ.mpr]
all_goals try trivial
rw [β TopCat.epi_iff_surjective]
infer_instance
map_prop _ := P.of_isIso _
/-- We construct a cover from another, by providing the needed fields and showing that the
provided fields are isomorphic with the original cover. -/
@[simps J obj map]
def Cover.copy [P.RespectsIso] {X : Scheme.{u}} (π° : X.Cover P)
(J : Type*) (obj : J β Scheme)
(map : β i, obj i βΆ X) (eβ : J β π°.J) (eβ : β i, obj i β
π°.obj (eβ i))
(h : β i, map i = (eβ i).hom β« π°.map (eβ i)) : X.Cover P :=
{ J, obj, map
f := fun x β¦ eβ.symm (π°.f x)
covers := fun x β¦ by
rw [h, Scheme.comp_base, TopCat.coe_comp, Set.range_comp, Set.range_eq_univ.mpr,
Set.image_univ, eβ.rightInverse_symm]
Β· exact π°.covers x
Β· rw [β TopCat.epi_iff_surjective]; infer_instance
map_prop := fun j β¦ by
rw [h, P.cancel_left_of_respectsIso]
exact π°.map_prop (eβ j) }
/-- The pushforward of a cover along an isomorphism. -/
@[simps! J obj map]
def Cover.pushforwardIso [P.RespectsIso] [P.ContainsIdentities] [P.IsStableUnderComposition]
{X Y : Scheme.{u}} (π° : Cover.{v} P X) (f : X βΆ Y) [IsIso f] :
Cover.{v} P Y :=
((coverOfIsIso.{v, u} f).bind fun _ => π°).copy π°.J _ _
((Equiv.punitProd _).symm.trans (Equiv.sigmaEquivProd PUnit π°.J).symm) (fun _ => Iso.refl _)
fun _ => (Category.id_comp _).symm
/-- Adding map satisfying `P` into a cover gives another cover. -/
@[simps]
def Cover.add {X Y : Scheme.{u}} (π° : X.Cover P) (f : Y βΆ X) (hf : P f := by infer_instance) :
X.Cover P where
J := Option π°.J
obj i := Option.rec Y π°.obj i
map i := Option.rec f π°.map i
f x := some (π°.f x)
covers := π°.covers
map_prop j := by
obtain β¨_ | _β© := j
Β· exact hf
Β· exact π°.map_prop _
/-- A morphism property of schemes is said to preserve joint surjectivity, if
for any pair of morphisms `f : X βΆ S` and `g : Y βΆ S` where `g` satisfies `P`,
any pair of points `x : X` and `y : Y` with `f x = g y` can be lifted to a point
of `X Γ[S] Y`.
In later files, this will be automatic, since this holds for any morphism `g`
(see `AlgebraicGeometry.Scheme.isJointlySurjectivePreserving`). But at
this early stage in the import tree, we only know it for open immersions. -/
class IsJointlySurjectivePreserving (P : MorphismProperty Scheme.{u}) where
exists_preimage_fst_triplet_of_prop {X Y S : Scheme.{u}} {f : X βΆ S} {g : Y βΆ S} [HasPullback f g]
(hg : P g) (x : X) (y : Y) (h : f.base x = g.base y) :
β a : β(pullback f g), (pullback.fst f g).base a = x
lemma IsJointlySurjectivePreserving.exists_preimage_snd_triplet_of_prop
[IsJointlySurjectivePreserving P] {X Y S : Scheme.{u}} {f : X βΆ S} {g : Y βΆ S} [HasPullback f g]
(hf : P f) (x : X) (y : Y) (h : f.base x = g.base y) :
β a : β(pullback f g), (pullback.snd f g).base a = y := by
let iso := pullbackSymmetry f g
haveI : HasPullback g f := hasPullback_symmetry f g
obtain β¨a, haβ© := exists_preimage_fst_triplet_of_prop hf y x h.symm
use (pullbackSymmetry f g).inv.base a
rwa [β Scheme.comp_base_apply, pullbackSymmetry_inv_comp_snd]
instance : IsJointlySurjectivePreserving @IsOpenImmersion where
exists_preimage_fst_triplet_of_prop {X Y S f g} _ hg x y h := by
rw [β show _ = (pullback.fst _ _ : pullback f g βΆ _).base from
PreservesPullback.iso_hom_fst Scheme.forgetToTop f g]
have : x β Set.range (pullback.fst f.base g.base) := by
rw [TopCat.pullback_fst_range f.base g.base]
use y
obtain β¨a, haβ© := this
use (PreservesPullback.iso forgetToTop f g).inv a
rwa [β TopCat.comp_app, Iso.inv_hom_id_assoc]
/-- Given a cover on `X`, we may pull them back along a morphism `W βΆ X` to obtain
a cover of `W`.
Note that this requires the (unnecessary) assumptions that the pullback exists and that `P`
preserves joint surjectivity. This is needed, because we don't know these in general at this
stage of the import tree, but this API is used in the case of `P = IsOpenImmersion` to
obtain these results in the general case. -/
@[simps]
def Cover.pullbackCover [P.IsStableUnderBaseChange] [IsJointlySurjectivePreserving P]
{X W : Scheme.{u}} (π° : X.Cover P) (f : W βΆ X) [β x, HasPullback f (π°.map x)] : W.Cover P where
J := π°.J
obj x := pullback f (π°.map x)
map _ := pullback.fst _ _
f x := π°.f (f.base x)
covers x := by
obtain β¨y, hyβ© := π°.covers (f.base x)
exact IsJointlySurjectivePreserving.exists_preimage_fst_triplet_of_prop
(π°.map_prop _) x y hy.symm
map_prop j := P.pullback_fst _ _ (π°.map_prop j)
/-- The family of morphisms from the pullback cover to the original cover. -/
def Cover.pullbackHom [P.IsStableUnderBaseChange] [IsJointlySurjectivePreserving P]
{X W : Scheme.{u}} (π° : X.Cover P)
(f : W βΆ X) (i) [β x, HasPullback f (π°.map x)] :
(π°.pullbackCover f).obj i βΆ π°.obj i :=
pullback.snd f (π°.map i)
@[reassoc (attr := simp)]
lemma Cover.pullbackHom_map [P.IsStableUnderBaseChange] [IsJointlySurjectivePreserving P]
{X W : Scheme.{u}} (π° : X.Cover P) (f : W βΆ X) [β (x : π°.J), HasPullback f (π°.map x)] (i) :
π°.pullbackHom f i β« π°.map i = (π°.pullbackCover f).map i β« f := pullback.condition.symm
/-- Given a cover on `X`, we may pull them back along a morphism `f : W βΆ X` to obtain
a cover of `W`. This is similar to `Scheme.Cover.pullbackCover`, but here we
take `pullback (π°.map x) f` instead of `pullback f (π°.map x)`. -/
@[simps]
def Cover.pullbackCover' [P.IsStableUnderBaseChange] [IsJointlySurjectivePreserving P]
{X W : Scheme.{u}} (π° : X.Cover P) (f : W βΆ X)
[β x, HasPullback (π°.map x) f] :
W.Cover P where
J := π°.J
obj x := pullback (π°.map x) f
map _ := pullback.snd _ _
f x := π°.f (f.base x)
covers x := by
obtain β¨y, hyβ© := π°.covers (f.base x)
exact IsJointlySurjectivePreserving.exists_preimage_snd_triplet_of_prop
(π°.map_prop _) y x hy
map_prop j := P.pullback_snd _ _ (π°.map_prop j)
/-- Given covers `{ Uα΅’ }` and `{ Uβ±Ό }`, we may form the cover `{ Uα΅’ Γ[X] Uβ±Ό }`. -/
def Cover.inter [P.IsStableUnderBaseChange] [P.IsStableUnderComposition]
[IsJointlySurjectivePreserving P]
{X : Scheme.{u}} (π°β : Scheme.Cover.{vβ} P X)
(π°β : Scheme.Cover.{vβ} P X)
[β (i : π°β.J) (j : π°β.J), HasPullback (π°β.map i) (π°β.map j)] : X.Cover P where
J := π°β.J Γ π°β.J
obj ij := pullback (π°β.map ij.1) (π°β.map ij.2)
map ij := pullback.fst _ _ β« π°β.map ij.1
f x := β¨π°β.f x, π°β.f xβ©
covers x := by
simp only [comp_coeBase, TopCat.coe_comp, Set.mem_range, Function.comp_apply]
obtain β¨yβ, hyββ© := π°β.covers x
obtain β¨yβ, hyββ© := π°β.covers x
obtain β¨z, hzβ© := IsJointlySurjectivePreserving.exists_preimage_fst_triplet_of_prop
(π°β.map_prop _) yβ yβ (by rw [hyβ, hyβ])
use z
rw [hz, hyβ]
map_prop ij := P.comp_mem _ _ (P.pullback_fst _ _ (π°β.map_prop ij.2)) (π°β.map_prop ij.1)
/--
An affine cover of `X` consists of a jointly surjective family of maps into `X` from
spectra of rings.
Note: The `map_prop` field is equipped with a default argument `by infer_instance`. In general
this causes worse error messages, but in practice `P` is mostly defined via `class`.
-/
structure AffineCover (P : MorphismProperty Scheme.{u}) (X : Scheme.{u}) where
/-- index set of an affine cover of a scheme `X` -/
J : Type v
/-- the ring associated to a component of an affine cover -/
obj (j : J) : CommRingCat.{u}
/-- the components map to `X` -/
map (j : J) : Spec (obj j) βΆ X
/-- given a point of `x : X`, `f x` is the index of the component which contains `x` -/
f (x : X) : J
/-- the components cover `X` -/
covers (x : X) : x β Set.range (map (f x)).base
/-- the component maps satisfy `P` -/
map_prop (j : J) : P (map j) := by infer_instance
/-- The cover associated to an affine cover. -/
@[simps]
def AffineCover.cover {X : Scheme.{u}} (π° : X.AffineCover P) : X.Cover P where
obj j := Spec (π°.obj j)
J := π°.J
map := π°.map
f := π°.f
covers := π°.covers
map_prop := π°.map_prop
section category
/--
A morphism between covers `π° βΆ π±` indicates that `π°` is a refinement of `π±`.
Since covers of schemes are indexed, the definition also involves a map on the
indexing types.
-/
@[ext]
structure Cover.Hom {X : Scheme.{u}} (π° π± : Cover.{v} P X) where
/-- The map on indexing types associated to a morphism of covers. -/
idx : π°.J β π±.J
/-- The morphism between open subsets associated to a morphism of covers. -/
app (j : π°.J) : π°.obj j βΆ π±.obj (idx j)
app_prop (j : π°.J) : P (app j) := by infer_instance
w (j : π°.J) : app j β« π±.map _ = π°.map _ := by aesop_cat
attribute [reassoc (attr := simp)] Cover.Hom.w
/-- The identity morphism in the category of covers of a scheme. -/
def Cover.Hom.id [P.ContainsIdentities] {X : Scheme.{u}} (π° : Cover.{v} P X) : π°.Hom π° where
idx j := j
app _ := π _
app_prop _ := P.id_mem _
/-- The composition of two morphisms in the category of covers of a scheme. -/
def Cover.Hom.comp [P.IsStableUnderComposition] {X : Scheme.{u}} {π° π± π² : Cover.{v} P X}
(f : π°.Hom π±) (g : π±.Hom π²) : π°.Hom π² where
idx j := g.idx <| f.idx j
app _ := f.app _ β« g.app _
app_prop _ := P.comp_mem _ _ (f.app_prop _) (g.app_prop _)
instance Cover.category [P.IsMultiplicative] {X : Scheme.{u}} : Category (Cover.{v} P X) where
Hom π° π± := π°.Hom π±
id := Cover.Hom.id
comp f g := f.comp g
variable [P.IsMultiplicative]
@[simp]
lemma Cover.id_idx_apply {X : Scheme.{u}} (π° : X.Cover P) (j : π°.J) :
(π π° : π° βΆ π°).idx j = j := rfl
@[simp]
lemma Cover.id_app {X : Scheme.{u}} (π° : X.Cover P) (j : π°.J) :
(π π° : π° βΆ π°).app j = π _ := rfl
@[simp]
lemma Cover.comp_idx_apply {X : Scheme.{u}} {π° π± π² : X.Cover P}
(f : π° βΆ π±) (g : π± βΆ π²) (j : π°.J) :
(f β« g).idx j = g.idx (f.idx j) := rfl
@[simp]
lemma Cover.comp_app {X : Scheme.{u}} {π° π± π² : X.Cover P}
(f : π° βΆ π±) (g : π± βΆ π²) (j : π°.J) :
(f β« g).app j = f.app j β« g.app _ := rfl
end category
end Scheme
end AlgebraicGeometry