-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathQuasicoherent.lean
More file actions
385 lines (312 loc) · 16.9 KB
/
Quasicoherent.lean
File metadata and controls
385 lines (312 loc) · 16.9 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
375
376
377
378
379
380
381
382
383
384
385
/-
Copyright (c) 2024 Joël Riou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Joël Riou
-/
module
public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Generators
public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Abelian
public import Mathlib.CategoryTheory.Comma.Over.Pullback
/-!
# Quasicoherent sheaves
A sheaf of modules is quasi-coherent if it admits locally a presentation as the
cokernel of a morphism between coproducts of copies of the sheaf of rings.
When these coproducts are finite, we say that the sheaf is of finite presentation.
## References
* https://stacks.math.columbia.edu/tag/01BD
-/
@[expose] public section
universe w u v₁ v₂ u₁ u₂
open CategoryTheory Limits
variable {C : Type u₁} [Category.{v₁} C] {J : GrothendieckTopology C}
{R : Sheaf J RingCat.{u}}
namespace SheafOfModules
section
variable [HasWeakSheafify J AddCommGrpCat.{u}] [J.WEqualsLocallyBijective AddCommGrpCat.{u}]
[J.HasSheafCompose (forget₂ RingCat.{u} AddCommGrpCat.{u})]
/-- A global presentation of a sheaf of modules `M` consists of a family `generators.s`
of sections `s` which generate `M`, and a family of sections which generate
the kernel of the morphism `generators.π : free (generators.I) ⟶ M`. -/
structure Presentation (M : SheafOfModules.{u} R) where
/-- generators -/
generators : M.GeneratingSections
/-- relations -/
relations : (kernel generators.π).GeneratingSections
/-- A global presentation of a sheaf of module if finite if the type
of generators and relations are finite. -/
class Presentation.IsFinite {M : SheafOfModules.{u} R} (p : M.Presentation) : Prop where
isFiniteType_generators : p.generators.IsFiniteType := by infer_instance
isFiniteType_relations : p.relations.IsFiniteType := by infer_instance
attribute [instance] Presentation.IsFinite.isFiniteType_generators
Presentation.IsFinite.isFiniteType_relations
@[deprecated Presentation.IsFinite.isFiniteType_relations (since := "2026-04-14")]
lemma Presentation.IsFinite.finite_relations {M : SheafOfModules.{u} R} (p : M.Presentation)
[p.IsFinite] : Finite p.relations.I := GeneratingSections.IsFiniteType.finite
end
noncomputable section
variable {C : Type u₁} [Category.{v₁} C] {J : GrothendieckTopology C} {R : Sheaf J RingCat.{u}}
[HasSheafify J AddCommGrpCat] [J.WEqualsLocallyBijective AddCommGrpCat]
[J.HasSheafCompose (forget₂ RingCat AddCommGrpCat)] {ι σ : Type u}
/-- Given two morphisms of sheaves of `R`-modules `f : free ι ⟶ free σ` and `g : free σ ⟶ M`
satisfying `H : f ≫ g = 0` and `IsColimit (CokernelCofork.ofπ g H)`, we obtain
generators of `Presentation M`. -/
@[simps! I s]
def generatorsOfIsCokernelFree {M : SheafOfModules.{u} R}
(f : free ι ⟶ free σ) (g : free σ ⟶ M) (H : f ≫ g = 0)
(H' : IsColimit (CokernelCofork.ofπ g H)) : M.GeneratingSections where
I := σ
s := M.freeHomEquiv g
epi := by simpa using epi_of_isColimit_cofork H'
@[simp]
theorem generatorsOfIsCokernelFree_π {M : SheafOfModules.{u} R}
(f : free ι ⟶ free σ) (g : free σ ⟶ M) (H : f ≫ g = 0)
(H' : IsColimit (CokernelCofork.ofπ g H)) :
(generatorsOfIsCokernelFree f g H H').π = g := M.freeHomEquiv.symm_apply_apply g
set_option backward.isDefEq.respectTransparency false in
/-- Given two morphisms of sheaves of `R`-modules `f : free ι ⟶ free σ` and `g : free σ ⟶ M`
satisfying `H : f ≫ g = 0` and `IsColimit (CokernelCofork.ofπ g H)`, we obtain
relations of `Presentation M`. -/
@[simps! I s]
def relationsOfIsCokernelFree {M : SheafOfModules.{u} R}
(f : free ι ⟶ free σ) (g : free σ ⟶ M) (H : f ≫ g = 0)
(H' : IsColimit (CokernelCofork.ofπ g H)) :
(kernel (generatorsOfIsCokernelFree f g H H').π).GeneratingSections where
I := ι
s := (kernel (generatorsOfIsCokernelFree f g H H').π).freeHomEquiv <| kernel.lift
(generatorsOfIsCokernelFree f g H H').π f (by simp [H])
epi := by
let h : cokernel f ≅ M := (H'.coconePointUniqueUpToIso (colimit.isColimit _)).symm
let h' : Abelian.image f ≅ kernel (generatorsOfIsCokernelFree f g H H').π :=
kernel.mapIso (cokernel.π f) (generatorsOfIsCokernelFree f g H H').π
(Iso.refl _) h (by simp [h])
have comp_aux : Abelian.factorThruImage f ≫ h'.hom =
(kernel.lift (generatorsOfIsCokernelFree f g H H').π f (by simp [H])) :=
equalizer.hom_ext <| by simp [h']
rw [← comp_aux, Equiv.symm_apply_apply]
infer_instance
/-- Given two morphisms of sheaves of `R`-modules `f : free ι ⟶ free σ` and `g : free σ ⟶ M`
satisfying `H : f ≫ g = 0` and `IsColimit (CokernelCofork.ofπ g H)`, we obtain a
`Presentation M`. -/
@[simps]
def presentationOfIsCokernelFree {M : SheafOfModules.{u} R}
(f : free ι ⟶ free σ) (g : free σ ⟶ M) (H : f ≫ g = 0)
(H' : IsColimit (CokernelCofork.ofπ g H)) : Presentation M where
generators := generatorsOfIsCokernelFree f g H H'
relations := relationsOfIsCokernelFree f g H H'
/-- Given a sheaf of `R`-modules `M` and a `Presentation M`, there is two morphism of
sheaves of `R`-modules `f : free ι ⟶ free σ` and `g : free σ ⟶ M` satisfying `H : f ≫ g = 0`
and `IsColimit (CokernelCofork.ofπ g H)`. -/
def Presentation.isColimit {M : SheafOfModules.{u} R} (P : Presentation M) :
IsColimit (CokernelCofork.ofπ (f := (freeHomEquiv _).symm P.relations.s ≫ (kernel.ι _))
P.generators.π (by simp)) :=
isCokernelEpiComp (c := CokernelCofork.ofπ _ (kernel.condition P.generators.π))
(Abelian.epiIsCokernelOfKernel _ <| limit.isLimit _) _ rfl
/-- Mapping a presentation under an isomorphism. -/
@[simps]
noncomputable def Presentation.ofIsIso {M N : SheafOfModules.{u} R} (f : M ⟶ N) [IsIso f]
(σ : M.Presentation) : N.Presentation where
generators := σ.generators.ofEpi f
relations := σ.relations.ofEpi ((kernelCompMono _ f).symm.trans <| eqToIso (by simp)).hom
@[deprecated (since := "2026-04-15")] alias Presentation.of_isIso := Presentation.ofIsIso
instance {M N : SheafOfModules.{u} R} (f : M ⟶ N) [IsIso f]
(σ : M.Presentation) [σ.IsFinite] : (σ.ofIsIso f).IsFinite where
isFiniteType_generators := inferInstanceAs (σ.generators.ofEpi _).IsFiniteType
isFiniteType_relations := inferInstanceAs (σ.relations.ofEpi _).IsFiniteType
variable {C' : Type u₂} [Category.{v₂} C'] {J' : GrothendieckTopology C'} {S : Sheaf J' RingCat.{u}}
[HasSheafify J' AddCommGrpCat] [J'.WEqualsLocallyBijective AddCommGrpCat]
[J'.HasSheafCompose (forget₂ RingCat AddCommGrpCat)]
variable {M : SheafOfModules.{u} R} (P : Presentation M)
(F : SheafOfModules.{u} R ⥤ SheafOfModules.{u} S) [PreservesColimitsOfSize.{u, u} F]
(η : F.obj (unit R) ≅ unit S)
-- `preservesColimitsOfSize_shrink` is not a global instance because it loops indefinitely.
-- But here it is fine as an instance since the universe `u` is inferrable from the type of `F`.
local instance : PreservesColimitsOfSize.{0, 0} F := preservesColimitsOfSize_shrink _
/-- Let `F` be a functor from sheaf of `R`-module to sheaf of `S`-module, if `F` preserves
colimits and `F.obj (unit R) ≅ unit S`, given a `P : Presentation M`, then we will obtain
relations of `Presentation (F.obj M)`. -/
def Presentation.mapRelations : free P.relations.I (R := S) ⟶ free P.generators.I :=
(mapFree F η P.relations.I).inv ≫ F.map ((freeHomEquiv _).symm P.relations.s) ≫
F.map (kernel.ι _) ≫ (mapFree F η P.generators.I).hom
/-- Let `F` be a functor from sheaf of `R`-module to sheaf of `S`-module, if `F` preserves
colimits and `F.obj (unit R) ≅ unit S`, given a `P : Presentation M`, then we will obtain
generators of `Presentation (F.obj M)`. -/
def Presentation.mapGenerators : free P.generators.I ⟶ F.obj M :=
(mapFree F η P.generators.I).inv ≫ F.map (P.generators.π)
@[reassoc (attr := simp)]
theorem Presentation.mapRelations_mapGenerators :
P.mapRelations F η ≫ P.mapGenerators F η = 0 := by
simp only [mapRelations, mapGenerators, Category.assoc, Iso.hom_inv_id_assoc,
← Functor.map_comp, kernel.condition, Functor.map_zero, comp_zero]
/-- Let `F` be a functor from sheaf of `R`-module to sheaf of `S`-module, if `F` preserves
colimits and `F.obj (unit R) ≅ unit S`, given a `P : Presentation M`, then we will get a
`Presentation (F.obj M)`. -/
@[simps! generators_I relations_I]
def Presentation.map : Presentation (F.obj M) :=
presentationOfIsCokernelFree (P.mapRelations F η) (P.mapGenerators F η)
(P.mapRelations_mapGenerators F η) <| by
refine IsColimit.equivOfNatIsoOfIso (parallelPairIsoMk (mapFree F η _) (mapFree F η _)
(by simp [Presentation.mapRelations]) (by simp)) _ _ ?_ (isColimitOfPreserves F P.isColimit)
exact (Cocone.ext (Iso.refl _) <| by rintro (_ | _)
<;> simp [Presentation.mapRelations, Presentation.mapGenerators, ← Functor.map_comp])
theorem Presentation.map_π_eq :
(P.map F η).generators.π = (mapFree F η _).inv ≫ F.map (P.generators.π) :=
(F.obj M).freeHomEquiv.symm_apply_eq.mpr rfl
end
section
variable [∀ X, (J.over X).HasSheafCompose (forget₂ RingCat.{u} AddCommGrpCat.{u})]
[∀ X, HasWeakSheafify (J.over X) AddCommGrpCat.{u}]
[∀ X, (J.over X).WEqualsLocallyBijective AddCommGrpCat.{u}]
/-- This structure contains the data of a family of objects `X i` which cover
the terminal object, and of a presentation of `M.over (X i)` for all `i`. -/
structure QuasicoherentData (M : SheafOfModules.{u} R) where
/-- the index type of the covering -/
I : Type w
/-- a family of objects which cover the terminal object -/
X : I → C
coversTop : J.CoversTop X
/-- a presentation of the sheaf of modules `M.over (X i)` for any `i : I` -/
presentation (i : I) : (M.over (X i)).Presentation
namespace QuasicoherentData
/-- Shrink the indexing type of `QuasicoherentData` into the universe of the site. -/
noncomputable
def shrink {M : SheafOfModules.{u} R} (q : M.QuasicoherentData) :
QuasicoherentData.{u₁} M where
I := Set.range q.X
X i := q.X i.2.choose
coversTop X := by
refine J.superset_covering (fun Y hY H ↦ ?_) (q.coversTop X)
obtain ⟨i, ⟨hi⟩⟩ := (Sieve.mem_ofObjects_iff ..).mp H
exact ⟨⟨_, i, rfl⟩, ⟨hi ≫ eqToHom (by grind)⟩⟩
presentation i := q.presentation i.2.choose
/-- If `M` is quasicoherent, it is locally generated by sections. -/
@[simps]
def localGeneratorsData {M : SheafOfModules.{u} R} (q : M.QuasicoherentData) :
M.LocalGeneratorsData where
I := q.I
X := q.X
coversTop := q.coversTop
generators i := (q.presentation i).generators
/-- A (local) presentation of a sheaf of module `M` is a finite presentation
if each given presentation of `M.over (X i)` is a finite presentation. -/
class IsFinitePresentation {M : SheafOfModules.{u} R} (q : M.QuasicoherentData) : Prop where
isFinite_presentation (i : q.I) : (q.presentation i).IsFinite := by infer_instance
attribute [instance] IsFinitePresentation.isFinite_presentation
set_option backward.isDefEq.respectTransparency false in
instance {M : SheafOfModules.{u} R} (q : M.QuasicoherentData) [q.IsFinitePresentation] :
q.localGeneratorsData.IsFiniteType where
isFiniteType := by dsimp; infer_instance
end QuasicoherentData
/-- A sheaf of modules is quasi-coherent if it is locally the cokernel of a
morphism between coproducts of copies of the sheaf of rings. -/
class IsQuasicoherent (M : SheafOfModules.{u} R) : Prop where
nonempty_quasicoherentData : Nonempty (QuasicoherentData.{u₁} M) := by infer_instance
lemma QuasicoherentData.isQuasicoherent {M : SheafOfModules.{u} R} (q : M.QuasicoherentData) :
M.IsQuasicoherent := ⟨⟨q.shrink⟩⟩
variable (R) in
@[inherit_doc IsQuasicoherent]
abbrev isQuasicoherent : ObjectProperty (SheafOfModules.{u} R) :=
IsQuasicoherent
/-- A sheaf of modules is finitely presented if it is locally the cokernel of a
morphism between coproducts of finitely many copies of the sheaf of rings. -/
class IsFinitePresentation (M : SheafOfModules.{u} R) : Prop where
exists_quasicoherentData (M) :
∃ (σ : QuasicoherentData.{u₁} M), σ.IsFinitePresentation
variable (R) in
@[inherit_doc IsFinitePresentation]
abbrev isFinitePresentation : ObjectProperty (SheafOfModules.{u} R) :=
IsFinitePresentation
instance (M : SheafOfModules.{u} R) [M.IsFinitePresentation] :
M.IsQuasicoherent where
nonempty_quasicoherentData :=
⟨(IsFinitePresentation.exists_quasicoherentData M).choose⟩
instance (M : SheafOfModules.{u} R) [M.IsFinitePresentation] :
M.IsFiniteType where
exists_localGeneratorsData := by
obtain ⟨σ, _⟩ := IsFinitePresentation.exists_quasicoherentData M
exact ⟨σ.localGeneratorsData, inferInstance⟩
/-- A choice of local presentations when `M` is a sheaf of modules of finite presentation. -/
@[deprecated "Use the lemma `IsFinitePresentation.exists_quasicoherentData` instead."
(since := "2025-10-28")]
noncomputable def quasicoherentDataOfIsFinitePresentation
(M : SheafOfModules.{u} R) [M.IsFinitePresentation] : M.QuasicoherentData :=
(IsFinitePresentation.exists_quasicoherentData M).choose
end
noncomputable section
open CategoryTheory Limits
variable {C : Type u₁} [Category.{v₁} C] [HasBinaryProducts C] {J : GrothendieckTopology C}
{R : Sheaf J RingCat.{u}} [HasSheafify J AddCommGrpCat] [J.WEqualsLocallyBijective AddCommGrpCat]
[J.HasSheafCompose (forget₂ RingCat AddCommGrpCat)]
variable [∀ X, (J.over X).HasSheafCompose (forget₂ RingCat AddCommGrpCat)]
[∀ X, HasSheafify (J.over X) AddCommGrpCat]
[∀ X, (J.over X).WEqualsLocallyBijective AddCommGrpCat]
/-- Given a sheaf of `R`-modules `M` and a `Presentation M`, we may construct the quasi-coherent
data on the trivial cover. -/
@[simps]
def Presentation.quasicoherentData {M : SheafOfModules.{u} R} (P : Presentation M) :
QuasicoherentData M where
I := C
X := id
coversTop x := GrothendieckTopology.covering_of_eq_top J <| by
rw [Sieve.ext_iff]
intro _ f
simpa [Sieve.top_apply, iff_true] using ⟨x, Nonempty.intro f⟩
presentation x := P.map (pushforward (𝟙 (R.over x))) (by rfl)
/-- If a sheaf of `R`-modules `M` has a presentation, then `M` is quasi-coherent. -/
theorem Presentation.isQuasicoherent {M : SheafOfModules.{u} R} (P : Presentation M) :
IsQuasicoherent M where
nonempty_quasicoherentData := Nonempty.intro (Presentation.quasicoherentData P)
/-- Mapping quasicoherent data under an isomorphism. -/
@[simps]
noncomputable def QuasicoherentData.ofIsIso {M N : SheafOfModules.{u} R} (f : M ⟶ N) [IsIso f]
(σ : M.QuasicoherentData) : N.QuasicoherentData where
I := σ.I
X := σ.X
coversTop := σ.coversTop
presentation i := Presentation.ofIsIso (f.over (σ.X i)) (σ.presentation i)
instance : (isQuasicoherent R).IsClosedUnderIsomorphisms where
of_iso e := by
intro ⟨⟨q⟩⟩
exact ⟨⟨q.ofIsIso e.hom⟩⟩
instance {M N : SheafOfModules.{u} R} (f : M ⟶ N) [IsIso f] (σ : M.QuasicoherentData)
[σ.IsFinitePresentation] : (σ.ofIsIso f).IsFinitePresentation where
isFinite_presentation i := by
dsimp
exact inferInstanceAs ((σ.presentation i).ofIsIso _).IsFinite
instance : (isFinitePresentation R).IsClosedUnderIsomorphisms where
of_iso e := by
intro ⟨σ, hσ⟩
exact ⟨σ.ofIsIso e.hom, inferInstance⟩
end
section bind
variable [∀ X, (J.over X).HasSheafCompose (forget₂ RingCat.{u} AddCommGrpCat.{u})]
[∀ X, HasSheafify (J.over X) AddCommGrpCat.{u}]
[∀ X, (J.over X).WEqualsLocallyBijective AddCommGrpCat.{u}]
[∀ X Y, ((J.over X).over Y).HasSheafCompose (forget₂ RingCat.{u} AddCommGrpCat.{u})]
[∀ X Y, HasSheafify ((J.over X).over Y) AddCommGrpCat.{u}]
[∀ X Y, ((J.over X).over Y).WEqualsLocallyBijective AddCommGrpCat.{u}]
/-- Given an cover `X` and a quasicoherent data for `M` restricted onto each `Mᵢ`, we may glue them
into a quasicoherent data of `M` itself. -/
noncomputable def QuasicoherentData.bind {R : Sheaf J RingCat.{u}}
(M : SheafOfModules.{u} R) {I : Type u}
(X : I → C) (hX : J.CoversTop X) (D : Π i, QuasicoherentData (M.over (X i))) :
M.QuasicoherentData where
I := Σ i, (D i).I
X ij := ((D ij.1).X ij.2).left
coversTop Y := J.transitive (hX Y) _ fun Z f ⟨i, ⟨g⟩⟩ ↦
J.superset_covering ((Sieve.functorPushforward_ofObjects_le _ _ _).trans
(Sieve.ofObjects_mono fun i' ↦ by aesop)) ((D i).coversTop (.mk g))
presentation i :=
letI e := pushforwardPushforwardEquivalence (Over.iteratedSliceEquiv ((D i.1).X i.2))
(S := (R.over _).over _) (R := R.over _) (𝟙 _) (𝟙 _)
(by ext : 2; exact R.1.map_id _) (by ext : 2; exact R.1.map_id _)
(((D i.1).presentation i.2).map e.inverse (.refl _)).ofIsIso
(e.fullyFaithfulFunctor.preimageIso
(by exact e.counitIso.app ((M.over (X i.1)).over ((D i.1).X i.2)))).hom
lemma IsQuasicoherent.of_coversTop {R : Sheaf J RingCat.{u}}
(M : SheafOfModules.{u} R) {I : Type u}
(X : I → C) (hX : J.CoversTop X) [∀ i, IsQuasicoherent (M.over (X i))] :
IsQuasicoherent M :=
(QuasicoherentData.bind M X hX fun _ ↦
IsQuasicoherent.nonempty_quasicoherentData.some).isQuasicoherent
end bind
end SheafOfModules