Skip to content

Commit 9c053cf

Browse files
committed
chore(CategoryTheory/Sites): make Subcanonical a class (#18186)
1 parent 9fc8d76 commit 9c053cf

File tree

8 files changed

+63
-40
lines changed

8 files changed

+63
-40
lines changed

Mathlib/AlgebraicGeometry/Sites/BigZariski.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ lemma zariskiTopology_openCover {Y : Scheme.{u}} (U : OpenCover.{v} Y) :
7070
rintro _ _ ⟨y⟩
7171
exact ⟨_, 𝟙 _, U.map (U.f y), ⟨_⟩, by simp⟩
7272

73-
lemma subcanonical_zariskiTopology : Sheaf.Subcanonical zariskiTopology := by
74-
apply Sheaf.Subcanonical.of_yoneda_isSheaf
73+
instance subcanonical_zariskiTopology : zariskiTopology.Subcanonical := by
74+
apply GrothendieckTopology.Subcanonical.of_isSheaf_yoneda_obj
7575
intro X
7676
rw [Presieve.isSheaf_pretopology]
7777
rintro Y S ⟨𝓤,rfl⟩ x hx

Mathlib/CategoryTheory/Sites/Canonical.lean

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -205,60 +205,83 @@ theorem isSheaf_of_isRepresentable (P : Cᵒᵖ ⥤ Type v) [P.IsRepresentable]
205205
Presieve.IsSheaf (canonicalTopology C) P :=
206206
Presieve.isSheaf_iso (canonicalTopology C) P.reprW (isSheaf_yoneda_obj _)
207207

208+
end Sheaf
209+
210+
namespace GrothendieckTopology
211+
212+
open Sheaf
213+
208214
/-- A subcanonical topology is a topology which is smaller than the canonical topology.
209215
Equivalently, a topology is subcanonical iff every representable is a sheaf.
210216
-/
211-
def Subcanonical (J : GrothendieckTopology C) : Prop :=
212-
J ≤ canonicalTopology C
217+
class Subcanonical (J : GrothendieckTopology C) : Prop where
218+
le_canonical : J ≤ canonicalTopology C
219+
220+
lemma le_canonical (J : GrothendieckTopology C) [Subcanonical J] : J ≤ canonicalTopology C :=
221+
Subcanonical.le_canonical
222+
223+
instance : (canonicalTopology C).Subcanonical where
224+
le_canonical := le_rfl
213225

214226
namespace Subcanonical
215227

216228
/-- If every functor `yoneda.obj X` is a `J`-sheaf, then `J` is subcanonical. -/
217-
theorem of_yoneda_isSheaf (J : GrothendieckTopology C)
218-
(h : ∀ X, Presieve.IsSheaf J (yoneda.obj X)) : Subcanonical J :=
219-
le_finestTopology _ _
220-
(by
221-
rintro P ⟨X, rfl⟩
222-
apply h)
229+
theorem of_isSheaf_yoneda_obj (J : GrothendieckTopology C)
230+
(h : ∀ X, Presieve.IsSheaf J (yoneda.obj X)) : Subcanonical J where
231+
le_canonical := le_finestTopology _ _ (by rintro P ⟨X, rfl⟩; apply h)
223232

224233
/-- If `J` is subcanonical, then any representable is a `J`-sheaf. -/
225-
theorem isSheaf_of_isRepresentable {J : GrothendieckTopology C} (hJ : Subcanonical J)
234+
theorem isSheaf_of_isRepresentable {J : GrothendieckTopology C} [Subcanonical J]
226235
(P : Cᵒᵖ ⥤ Type v) [P.IsRepresentable] : Presieve.IsSheaf J P :=
227-
Presieve.isSheaf_of_le _ hJ (Sheaf.isSheaf_of_isRepresentable P)
236+
Presieve.isSheaf_of_le _ J.le_canonical (Sheaf.isSheaf_of_isRepresentable P)
228237

229-
variable {J}
238+
variable {J : GrothendieckTopology C}
239+
240+
end Subcanonical
241+
242+
variable {J : GrothendieckTopology C}
230243

231244
/--
232245
If `J` is subcanonical, we obtain a "Yoneda" functor from the defining site
233246
into the sheaf category.
234247
-/
235248
@[simps]
236-
def yoneda (hJ : Subcanonical J) : C ⥤ Sheaf J (Type v) where
249+
def yoneda [J.Subcanonical] : C ⥤ Sheaf J (Type v) where
237250
obj X := ⟨CategoryTheory.yoneda.obj X, by
238251
rw [isSheaf_iff_isSheaf_of_type]
239-
apply hJ.isSheaf_of_isRepresentable⟩
252+
apply Subcanonical.isSheaf_of_isRepresentable⟩
240253
map f := ⟨CategoryTheory.yoneda.map f⟩
241254

242-
variable (hJ : Subcanonical J)
255+
variable [Subcanonical J]
243256

244257
/--
245258
The yoneda embedding into the presheaf category factors through the one
246259
to the sheaf category.
247260
-/
248261
def yonedaCompSheafToPresheaf :
249-
hJ.yoneda ⋙ sheafToPresheaf J (Type v) ≅ CategoryTheory.yoneda :=
262+
J.yoneda ⋙ sheafToPresheaf J (Type v) ≅ CategoryTheory.yoneda :=
250263
Iso.refl _
251264

252265
/-- The yoneda functor into the sheaf category is fully faithful -/
253-
def yonedaFullyFaithful : hJ.yoneda.FullyFaithful :=
266+
def yonedaFullyFaithful : (J.yoneda).FullyFaithful :=
254267
Functor.FullyFaithful.ofCompFaithful (G := sheafToPresheaf J (Type v)) Yoneda.fullyFaithful
255268

256-
instance : hJ.yoneda.Full := hJ.yonedaFullyFaithful.full
269+
instance : (J.yoneda).Full := (J.yonedaFullyFaithful).full
257270

258-
instance : hJ.yoneda.Faithful := hJ.yonedaFullyFaithful.faithful
271+
instance : (J.yoneda).Faithful := (J.yonedaFullyFaithful).faithful
259272

260-
end Subcanonical
273+
end GrothendieckTopology
261274

262-
end Sheaf
275+
@[deprecated (since := "2024-10-29")] alias Sheaf.Subcanonical := GrothendieckTopology.Subcanonical
276+
@[deprecated (since := "2024-10-29")] alias Sheaf.Subcanonical.of_isSheaf_yoneda_obj :=
277+
GrothendieckTopology.Subcanonical.of_isSheaf_yoneda_obj
278+
@[deprecated (since := "2024-10-29")] alias Sheaf.Subcanonical.isSheaf_of_isRepresentable :=
279+
GrothendieckTopology.Subcanonical.isSheaf_of_isRepresentable
280+
@[deprecated (since := "2024-10-29")] alias Sheaf.Subcanonical.yoneda :=
281+
GrothendieckTopology.yoneda
282+
@[deprecated (since := "2024-10-29")] alias Sheaf.Subcanonical.yonedaCompSheafToPresheaf :=
283+
GrothendieckTopology.yonedaCompSheafToPresheaf
284+
@[deprecated (since := "2024-10-29")] alias Sheaf.Subcanonical.yonedaFullyFaithful :=
285+
GrothendieckTopology.yonedaFullyFaithful
263286

264287
end CategoryTheory

Mathlib/CategoryTheory/Sites/Coherent/CoherentSheaves.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ theorem isSheaf_yoneda_obj (W : C) : Presieve.IsSheaf (coherentTopology C) (yone
5959

6060
variable (C) in
6161
/-- The coherent topology on a precoherent category is subcanonical. -/
62-
theorem subcanonical : Sheaf.Subcanonical (coherentTopology C) :=
63-
Sheaf.Subcanonical.of_yoneda_isSheaf _ isSheaf_yoneda_obj
62+
instance subcanonical : (coherentTopology C).Subcanonical :=
63+
GrothendieckTopology.Subcanonical.of_isSheaf_yoneda_obj _ isSheaf_yoneda_obj
6464

6565
end coherentTopology
6666

Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ theorem extensiveTopology.isSheaf_yoneda_obj (W : C) : Presieve.IsSheaf (extensi
6969
exact isSheafFor_extensive_of_preservesFiniteProducts _ _
7070

7171
/-- The extensive topology on a finitary pre-extensive category is subcanonical. -/
72-
theorem extensiveTopology.subcanonical : Sheaf.Subcanonical (extensiveTopology C) :=
73-
Sheaf.Subcanonical.of_yoneda_isSheaf _ isSheaf_yoneda_obj
72+
instance extensiveTopology.subcanonical : (extensiveTopology C).Subcanonical :=
73+
GrothendieckTopology.Subcanonical.of_isSheaf_yoneda_obj _ isSheaf_yoneda_obj
7474

7575
variable [FinitaryExtensive C]
7676

Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ lemma isSheaf_yoneda_obj [Preregular C] (W : C) :
257257
· exact fun y hy ↦ t_uniq y <| Presieve.isAmalgamation_sieveExtend x y hy
258258

259259
/-- The regular topology on any preregular category is subcanonical. -/
260-
theorem subcanonical [Preregular C] : Sheaf.Subcanonical (regularTopology C) :=
261-
Sheaf.Subcanonical.of_yoneda_isSheaf _ isSheaf_yoneda_obj
260+
instance subcanonical [Preregular C] : (regularTopology C).Subcanonical :=
261+
GrothendieckTopology.Subcanonical.of_isSheaf_yoneda_obj _ isSheaf_yoneda_obj
262262

263263
end regularTopology
264264

Mathlib/CategoryTheory/Sites/Types.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ noncomputable def typeEquiv : Type u ≌ SheafOfTypes typesGrothendieckTopology
158158
dsimp [yoneda', yonedaEquiv, evalEquiv]
159159
erw [typesGlue_eval]
160160

161-
theorem subcanonical_typesGrothendieckTopology : Sheaf.Subcanonical typesGrothendieckTopology.{u} :=
162-
Sheaf.Subcanonical.of_yoneda_isSheaf _ fun _ => isSheaf_yoneda'
161+
instance subcanonical_typesGrothendieckTopology : typesGrothendieckTopology.{u}.Subcanonical :=
162+
GrothendieckTopology.Subcanonical.of_isSheaf_yoneda_obj _ fun _ => isSheaf_yoneda'
163163

164164
theorem typesGrothendieckTopology_eq_canonical :
165165
typesGrothendieckTopology.{u} = Sheaf.canonicalTopology (Type u) := by
166-
refine le_antisymm subcanonical_typesGrothendieckTopology (sInf_le ?_)
166+
refine le_antisymm typesGrothendieckTopology.le_canonical (sInf_le ?_)
167167
refine ⟨yoneda.obj (ULift Bool), ⟨_, rfl⟩, GrothendieckTopology.ext ?_⟩
168168
funext α
169169
ext S

Mathlib/Condensed/Functors.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ section Topology
4242

4343
/-- The functor from `CompHaus` to `Condensed.{u} (Type u)` given by the Yoneda sheaf. -/
4444
def compHausToCondensed' : CompHaus.{u} ⥤ Condensed.{u} (Type u) :=
45-
(coherentTopology.subcanonical CompHaus).yoneda
45+
(coherentTopology CompHaus).yoneda
4646

4747
/-- The yoneda presheaf as an actual condensed set. -/
4848
def compHausToCondensed : CompHaus.{u} ⥤ CondensedSet.{u} :=
@@ -66,13 +66,13 @@ def stoneanToCondensed : Stonean.{u} ⥤ CondensedSet.{u} :=
6666
abbrev Stonean.toCondensed (S : Stonean.{u}) : CondensedSet.{u} := stoneanToCondensed.obj S
6767

6868
instance : compHausToCondensed'.Full :=
69-
show (Sheaf.Subcanonical.yoneda _).Full from inferInstance
69+
inferInstanceAs ((coherentTopology CompHaus).yoneda).Full
7070

7171
instance : compHausToCondensed'.Faithful :=
72-
show (Sheaf.Subcanonical.yoneda _).Faithful from inferInstance
72+
inferInstanceAs ((coherentTopology CompHaus).yoneda).Faithful
7373

74-
instance : compHausToCondensed.Full := show (_ ⋙ _).Full from inferInstance
74+
instance : compHausToCondensed.Full := inferInstanceAs (_ ⋙ _).Full
7575

76-
instance : compHausToCondensed.Faithful := show (_ ⋙ _).Faithful from inferInstance
76+
instance : compHausToCondensed.Faithful := inferInstanceAs (_ ⋙ _).Faithful
7777

7878
end Topology

Mathlib/Condensed/Light/Functors.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ open CategoryTheory Limits
2525

2626
/-- The functor from `LightProfinite.{u}` to `LightCondSet.{u}` given by the Yoneda sheaf. -/
2727
def lightProfiniteToLightCondSet : LightProfinite.{u} ⥤ LightCondSet.{u} :=
28-
(coherentTopology.subcanonical LightProfinite).yoneda
28+
(coherentTopology LightProfinite).yoneda
2929

3030
/-- Dot notation for the value of `lightProfiniteToLightCondSet`. -/
3131
abbrev LightProfinite.toCondensed (S : LightProfinite.{u}) : LightCondSet.{u} :=
@@ -34,10 +34,10 @@ abbrev LightProfinite.toCondensed (S : LightProfinite.{u}) : LightCondSet.{u} :=
3434
/-- `lightProfiniteToLightCondSet` is fully faithful. -/
3535
abbrev lightProfiniteToLightCondSetFullyFaithful :
3636
lightProfiniteToLightCondSet.FullyFaithful :=
37-
Sheaf.Subcanonical.yonedaFullyFaithful _
37+
(coherentTopology LightProfinite).yonedaFullyFaithful
3838

3939
instance : lightProfiniteToLightCondSet.Full :=
40-
show (Sheaf.Subcanonical.yoneda _).Full from inferInstance
40+
inferInstanceAs ((coherentTopology LightProfinite).yoneda).Full
4141

4242
instance : lightProfiniteToLightCondSet.Faithful :=
43-
show (Sheaf.Subcanonical.yoneda _).Faithful from inferInstance
43+
inferInstanceAs ((coherentTopology LightProfinite).yoneda).Faithful

0 commit comments

Comments
 (0)