Skip to content

Commit d7739e4

Browse files
committed
chore(AlgebraicGeometry): make SheafOfModule.IsQuasicoherent an ObjectProperty and clean up of finiteness conditions (#30372)
We introduce `isQuasicoherent` as an `ObjectProperty (SheafOfModules _)` (and similarly for `isFinitePresentation`). The basic API also undergoes some cleaning up.
1 parent 34f670d commit d7739e4

File tree

2 files changed

+77
-56
lines changed

2 files changed

+77
-56
lines changed

Mathlib/Algebra/Category/ModuleCat/Sheaf/Generators.lean

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ def equivOfIso (e : M ≅ N) :
8484
dsimp
8585
simp only [← opEpi_comp, e.inv_hom_id, opEpi_id]
8686

87+
/-- `σ : M.GeneratingSections` is finite type if the index type `σ.I` is finite. -/
88+
class IsFiniteType (σ : M.GeneratingSections) : Prop where
89+
finite : Finite σ.I := by infer_instance
90+
91+
attribute [instance] IsFiniteType.finite
92+
8793
end GeneratingSections
8894

8995
variable [∀ (X : C), HasWeakSheafify (J.over X) AddCommGrpCat.{u}]
@@ -101,24 +107,24 @@ structure LocalGeneratorsData where
101107
/-- the data of sections of `M` over `X i` which generate `M.over (X i)` -/
102108
generators (i : I) : (M.over (X i)).GeneratingSections
103109

110+
variable {M} in
111+
/-- The data of local generators of a sheaf of modules is finite type if
112+
each family of generators is finite type. -/
113+
class LocalGeneratorsData.IsFiniteType (p : M.LocalGeneratorsData) : Prop where
114+
isFiniteType (i : p.I) : (p.generators i).IsFiniteType := by infer_instance
115+
104116
/-- A sheaf of modules is of finite type if locally, it is generated by finitely
105117
many sections. -/
106-
class IsFiniteType : Prop where
107-
exists_localGeneratorsData :
108-
∃ (σ : M.LocalGeneratorsData), ∀ (i : σ.I), Finite (σ.generators i).I
109-
110-
section
111-
112-
variable [h : M.IsFiniteType]
118+
class IsFiniteType (M : SheafOfModules.{u} R) : Prop where
119+
exists_localGeneratorsData (M) :
120+
∃ (σ : M.LocalGeneratorsData), σ.IsFiniteType
113121

114122
/-- A choice of local generators when `M` is a sheaf of modules of finite type. -/
115-
noncomputable def localGeneratorsDataOfIsFiniteType : M.LocalGeneratorsData :=
116-
h.exists_localGeneratorsData.choose
117-
118-
instance (i : M.localGeneratorsDataOfIsFiniteType.I) :
119-
Finite (M.localGeneratorsDataOfIsFiniteType.generators i).I :=
120-
h.exists_localGeneratorsData.choose_spec i
121-
122-
end
123+
@[deprecated "Use the lemma `IsFiniteType.exists_localGeneratorsData` instead."
124+
(since := "2025-10-28")]
125+
noncomputable def localGeneratorsDataOfIsFiniteType (M : SheafOfModules.{u} R)
126+
[M.IsFiniteType] :
127+
M.LocalGeneratorsData :=
128+
(IsFiniteType.exists_localGeneratorsData M).choose
123129

124130
end SheafOfModules

Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean

Lines changed: 56 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ universe u v' u'
2323
open CategoryTheory Limits
2424

2525
variable {C : Type u'} [Category.{v'} C] {J : GrothendieckTopology C}
26-
27-
28-
variable {R : Sheaf J RingCat.{u}}
26+
{R : Sheaf J RingCat.{u}}
2927

3028
namespace SheafOfModules
3129

32-
variable (M : SheafOfModules.{u} R)
33-
3430
section
3531

3632
variable [HasWeakSheafify J AddCommGrpCat.{u}] [J.WEqualsLocallyBijective AddCommGrpCat.{u}]
@@ -39,12 +35,21 @@ variable [HasWeakSheafify J AddCommGrpCat.{u}] [J.WEqualsLocallyBijective AddCom
3935
/-- A global presentation of a sheaf of modules `M` consists of a family `generators.s`
4036
of sections `s` which generate `M`, and a family of sections which generate
4137
the kernel of the morphism `generators.π : free (generators.I) ⟶ M`. -/
42-
structure Presentation where
38+
structure Presentation (M : SheafOfModules.{u} R) where
4339
/-- generators -/
4440
generators : M.GeneratingSections
4541
/-- relations -/
4642
relations : (kernel generators.π).GeneratingSections
4743

44+
/-- A global presentation of a sheaf of module if finite if the type
45+
of generators and relations are finite. -/
46+
class Presentation.IsFinite {M : SheafOfModules.{u} R} (p : M.Presentation) : Prop where
47+
isFiniteType_generators : p.generators.IsFiniteType := by infer_instance
48+
finite_relations : Finite p.relations.I := by infer_instance
49+
50+
attribute [instance] Presentation.IsFinite.isFiniteType_generators
51+
Presentation.IsFinite.finite_relations
52+
4853
end
4954

5055

@@ -54,7 +59,7 @@ variable [∀ X, (J.over X).HasSheafCompose (forget₂ RingCat.{u} AddCommGrpCat
5459

5560
/-- This structure contains the data of a family of objects `X i` which cover
5661
the terminal object, and of a presentation of `M.over (X i)` for all `i`. -/
57-
structure QuasicoherentData where
62+
structure QuasicoherentData (M : SheafOfModules.{u} R) where
5863
/-- the index type of the covering -/
5964
I : Type u'
6065
/-- a family of objects which cover the terminal object -/
@@ -65,55 +70,65 @@ structure QuasicoherentData where
6570

6671
namespace QuasicoherentData
6772

68-
variable {M}
69-
7073
/-- If `M` is quasicoherent, it is locally generated by sections. -/
7174
@[simps]
72-
def localGeneratorsData (q : M.QuasicoherentData) : M.LocalGeneratorsData where
75+
def localGeneratorsData {M : SheafOfModules.{u} R} (q : M.QuasicoherentData) :
76+
M.LocalGeneratorsData where
7377
I := q.I
7478
X := q.X
7579
coversTop := q.coversTop
7680
generators i := (q.presentation i).generators
7781

82+
/-- A (local) presentation of a sheaf of module `M` is a finite presentation
83+
if each given presentation of `M.over (X i)` is a finite presentation. -/
84+
class IsFinitePresentation {M : SheafOfModules.{u} R} (q : M.QuasicoherentData) : Prop where
85+
isFinite_presentation (i : q.I) : (q.presentation i).IsFinite := by infer_instance
86+
87+
attribute [instance] IsFinitePresentation.isFinite_presentation
88+
89+
instance {M : SheafOfModules.{u} R} (q : M.QuasicoherentData) [q.IsFinitePresentation] :
90+
q.localGeneratorsData.IsFiniteType where
91+
isFiniteType := by dsimp; infer_instance
92+
7893
end QuasicoherentData
7994

8095
/-- A sheaf of modules is quasi-coherent if it is locally the cokernel of a
8196
morphism between coproducts of copies of the sheaf of rings. -/
82-
class IsQuasicoherent : Prop where
83-
nonempty_quasicoherentData : Nonempty M.QuasicoherentData
97+
class IsQuasicoherent (M : SheafOfModules.{u} R) : Prop where
98+
nonempty_quasicoherentData : Nonempty M.QuasicoherentData := by infer_instance
99+
100+
variable (R) in
101+
@[inherit_doc IsQuasicoherent]
102+
abbrev isQuasicoherent : ObjectProperty (SheafOfModules.{u} R) :=
103+
IsQuasicoherent
84104

85105
/-- A sheaf of modules is finitely presented if it is locally the cokernel of a
86106
morphism between coproducts of finitely many copies of the sheaf of rings. -/
87-
class IsFinitePresentation : Prop where
88-
exists_quasicoherentData :
89-
∃ (σ : M.QuasicoherentData), ∀ (i : σ.I), (Finite (σ.presentation i).generators.I ∧
90-
Finite (σ.presentation i).relations.I)
91-
92-
section
93-
94-
variable [h : M.IsFinitePresentation]
107+
class IsFinitePresentation (M : SheafOfModules.{u} R) : Prop where
108+
exists_quasicoherentData (M) :
109+
∃ (σ : M.QuasicoherentData), σ.IsFinitePresentation
110+
111+
variable (R) in
112+
@[inherit_doc IsFinitePresentation]
113+
abbrev isFinitePresentation : ObjectProperty (SheafOfModules.{u} R) :=
114+
IsFinitePresentation
115+
116+
instance (M : SheafOfModules.{u} R) [M.IsFinitePresentation] :
117+
M.IsQuasicoherent where
118+
nonempty_quasicoherentData :=
119+
⟨(IsFinitePresentation.exists_quasicoherentData M).choose⟩
120+
121+
instance (M : SheafOfModules.{u} R) [M.IsFinitePresentation] :
122+
M.IsFiniteType where
123+
exists_localGeneratorsData := by
124+
obtain ⟨σ, _⟩ := IsFinitePresentation.exists_quasicoherentData M
125+
exact ⟨σ.localGeneratorsData, inferInstance⟩
95126

96127
/-- A choice of local presentations when `M` is a sheaf of modules of finite presentation. -/
97-
noncomputable def quasicoherentDataOfIsFinitePresentation : M.QuasicoherentData :=
98-
h.exists_quasicoherentData.choose
99-
100-
instance (i : M.quasicoherentDataOfIsFinitePresentation.I) :
101-
Finite (M.quasicoherentDataOfIsFinitePresentation.presentation i).generators.I :=
102-
have : _ ∧ Finite (M.quasicoherentDataOfIsFinitePresentation.presentation i).relations.I :=
103-
h.exists_quasicoherentData.choose_spec i
104-
this.1
105-
106-
instance (i : M.quasicoherentDataOfIsFinitePresentation.I) :
107-
Finite (M.quasicoherentDataOfIsFinitePresentation.presentation i).relations.I :=
108-
have : _ ∧ Finite (M.quasicoherentDataOfIsFinitePresentation.presentation i).relations.I :=
109-
h.exists_quasicoherentData.choose_spec i
110-
this.2
111-
112-
end
113-
114-
instance [M.IsFinitePresentation] : M.IsFiniteType where
115-
exists_localGeneratorsData :=
116-
⟨M.quasicoherentDataOfIsFinitePresentation.localGeneratorsData,
117-
by intro; dsimp; infer_instance⟩
128+
@[deprecated "Use the lemma `IsFinitePresentation.exists_quasicoherentData` instead."
129+
(since := "2025-10-28")]
130+
noncomputable def quasicoherentDataOfIsFinitePresentation
131+
(M : SheafOfModules.{u} R) [M.IsFinitePresentation] : M.QuasicoherentData :=
132+
(IsFinitePresentation.exists_quasicoherentData M).choose
118133

119134
end SheafOfModules

0 commit comments

Comments
 (0)