Skip to content

Commit 02dfd80

Browse files
committed
feat(CategoryTheory/Sites): characterization of covering sieves using locally surjective morphisms (leanprover-community#35529)
The sieve generated by a family of morphisms `f i : X i ⟶ S` is covering iff the induced map from the coproduct of the presheaves represented by the `X i` to the presheaf represented by `S` is locally surjective.
1 parent 8a838ae commit 02dfd80

2 files changed

Lines changed: 136 additions & 2 deletions

File tree

Mathlib/CategoryTheory/ShrinkYoneda.lean

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ noncomputable def shrinkYonedaObjObjEquiv {X : C} {Y : Cᵒᵖ} :
7171
((shrinkYoneda.{w}.obj X).obj Y) ≃ (Y.unop ⟶ X) :=
7272
(equivShrink _).symm
7373

74+
lemma shrinkYoneda_obj_map_shrinkYonedaObjObjEquiv_symm
75+
{X : C} {Y Y' : Cᵒᵖ} (g : Y ⟶ Y') (f : Y.unop ⟶ X) :
76+
(shrinkYoneda.obj _).map g (shrinkYonedaObjObjEquiv.symm f) =
77+
shrinkYonedaObjObjEquiv.symm (g.unop ≫ f) := by
78+
simp [shrinkYoneda, shrinkYonedaObjObjEquiv]
79+
80+
lemma shrinkYonedaObjObjEquiv_symm_comp {X Y Y' : C} (g : Y' ⟶ Y) (f : Y ⟶ X) :
81+
shrinkYonedaObjObjEquiv.symm (g ≫ f) =
82+
(shrinkYoneda.obj _).map g.op (shrinkYonedaObjObjEquiv.symm f) :=
83+
(shrinkYoneda_obj_map_shrinkYonedaObjObjEquiv_symm g.op f).symm
84+
85+
lemma shrinkYoneda_map_app_shrinkYonedaObjObjEquiv_symm
86+
{X X' : C} {Y : Cᵒᵖ} (f : Y.unop ⟶ X) (g : X ⟶ X') :
87+
(shrinkYoneda.map g).app _ (shrinkYonedaObjObjEquiv.symm f) =
88+
shrinkYonedaObjObjEquiv.symm (f ≫ g) := by
89+
simp [shrinkYoneda, shrinkYonedaObjObjEquiv]
90+
7491
set_option backward.isDefEq.respectTransparency false in
7592
/-- The type of natural transformations `shrinkYoneda.{w}.obj X ⟶ P`
7693
with `X : C` and `P : Cᵒᵖ ⥤ Type w` is equivalent to `P.obj (op X)`. -/
@@ -119,6 +136,13 @@ lemma shrinkYonedaEquiv_symm_map {X Y : Cᵒᵖ} (f : X ⟶ Y) {P : Cᵒᵖ ⥤
119136
rw [← shrinkYonedaEquiv_naturality]
120137
simp)
121138

139+
lemma shrinkYonedaEquiv_symm_app_shrinkYonedaObjObjEquiv_symm {X : C} {P : Cᵒᵖ ⥤ Type w}
140+
(s : P.obj (op X)) {Y : C} (f : Y ⟶ X) :
141+
(shrinkYonedaEquiv.symm s).app (op Y) (shrinkYonedaObjObjEquiv.symm f) =
142+
P.map f.op s := by
143+
obtain ⟨g, rfl⟩ := shrinkYonedaEquiv.surjective s
144+
simp [map_shrinkYonedaEquiv]
145+
122146
variable (C) in
123147
/-- The functor `shrinkYoneda : C ⥤ Cᵒᵖ ⥤ Type w` for a locally `w`-small category `C`
124148
is fully faithful. -/
@@ -134,4 +158,14 @@ instance : (shrinkYoneda.{w} (C := C)).Faithful := (fullyFaithfulShrinkYoneda C)
134158

135159
instance : (shrinkYoneda.{w} (C := C)).Full := (fullyFaithfulShrinkYoneda C).full
136160

161+
/-- `uliftYoneda` identifies to `shrinkYoneda`. -/
162+
noncomputable def uliftYonedaIsoShrinkYoneda :
163+
uliftYoneda.{w'} (C := C) ≅ shrinkYoneda.{max w' v} :=
164+
NatIso.ofComponents (fun X ↦ NatIso.ofComponents
165+
(fun Y ↦ (Equiv.ulift.trans shrinkYonedaObjObjEquiv.symm).toIso) (fun f ↦ by
166+
ext
167+
exact (shrinkYoneda_obj_map_shrinkYonedaObjObjEquiv_symm _ _).symm)) (fun g ↦ by
168+
ext
169+
exact (shrinkYoneda_map_app_shrinkYonedaObjObjEquiv_symm _ _).symm)
170+
137171
end CategoryTheory

Mathlib/CategoryTheory/Sites/LocallySurjective.lean

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.CategoryTheory.Sites.Subsheaf
99
public import Mathlib.CategoryTheory.Sites.CompatibleSheafification
1010
public import Mathlib.CategoryTheory.Sites.LocallyInjective
11+
public import Mathlib.CategoryTheory.ShrinkYoneda
1112
/-!
1213
1314
# Locally surjective morphisms
@@ -29,9 +30,9 @@ public import Mathlib.CategoryTheory.Sites.LocallyInjective
2930
@[expose] public section
3031

3132

32-
universe v u w v' u' w'
33+
universe w v u v' u' w'
3334

34-
open Opposite CategoryTheory CategoryTheory.GrothendieckTopology CategoryTheory.Functor
35+
open Opposite CategoryTheory CategoryTheory.GrothendieckTopology CategoryTheory.Functor Limits
3536

3637
namespace CategoryTheory
3738

@@ -52,6 +53,13 @@ def imageSieve {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : ToType (G.obj (o
5253
refine ⟨F.map j.op t, ?_⟩
5354
rw [op_comp, G.map_comp, ConcreteCategory.comp_apply, ← ht, NatTrans.naturality_apply f]
5455

56+
lemma pullback_imageSieve
57+
{F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : ToType (G.obj (op U)))
58+
{V : C} (g : V ⟶ U) :
59+
(imageSieve f s).pullback g = imageSieve f (G.map g.op s) := by
60+
ext W g
61+
simp [imageSieve]
62+
5563
theorem imageSieve_eq_sieveOfSection {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C}
5664
(s : ToType (G.obj (op U))) :
5765
imageSieve f s = (Subfunctor.range (whiskerRight f (forget A))).sieveOfSection s :=
@@ -399,4 +407,96 @@ lemma isAmalgamation_map_localPreimage :
399407

400408
end Presieve.FamilyOfElements
401409

410+
namespace Presheaf
411+
412+
variable {S : C} {ι : Type*} [Small.{w} ι] {X : ι → C} (f : ∀ i, X i ⟶ S)
413+
414+
variable [LocallySmall.{w} C]
415+
416+
lemma imageSieve_cofanIsColimitDesc_shrinkYoneda_map
417+
{c : Cofan (fun i ↦ shrinkYoneda.{w}.obj (X i))} (hc : IsColimit c)
418+
{U : C} (g : U ⟶ S) :
419+
Presheaf.imageSieve
420+
(Cofan.IsColimit.desc hc (fun i ↦ shrinkYoneda.{w}.map (f i))) (U := U)
421+
(shrinkYonedaObjObjEquiv.symm g) = Sieve.pullback g (Sieve.ofArrows X f) := by
422+
ext V v
423+
simp only [Sieve.pullback_apply, Sieve.generate_apply]
424+
refine ⟨fun hv ↦ ?_, ?_⟩
425+
· obtain ⟨w, hw⟩ := hv
426+
obtain ⟨⟨i⟩, a, rfl⟩ := Types.jointly_surjective_of_isColimit
427+
(isColimitOfPreserves ((evaluation _ _).obj (op V)) hc) w
428+
obtain ⟨a : V ⟶ X i, rfl⟩ := shrinkYonedaObjObjEquiv.symm.surjective a
429+
refine ⟨_, a, _, ⟨i⟩, shrinkYonedaObjObjEquiv.symm.injective ?_⟩
430+
rw [← shrinkYoneda_map_app_shrinkYonedaObjObjEquiv_symm]
431+
convert hw using 1
432+
· exact (congr_fun (NatTrans.congr_app
433+
((Cofan.IsColimit.fac hc (fun i ↦ shrinkYoneda.{w}.map (f i))) i) (op V))
434+
(shrinkYonedaObjObjEquiv.symm a)).symm
435+
· exact (shrinkYoneda_obj_map_shrinkYonedaObjObjEquiv_symm v.op g).symm
436+
· rintro ⟨_, a, _, ⟨i⟩, fac⟩
437+
refine ⟨(c.inj i).app (op V) (shrinkYonedaObjObjEquiv.symm a),
438+
(congr_fun (NatTrans.congr_app
439+
((Cofan.IsColimit.fac hc (fun i ↦ shrinkYoneda.{w}.map (f i))) i) (op V))
440+
(shrinkYonedaObjObjEquiv.symm a)).trans ?_⟩
441+
rw [shrinkYoneda_map_app_shrinkYonedaObjObjEquiv_symm a (f i), fac]
442+
exact (shrinkYoneda_obj_map_shrinkYonedaObjObjEquiv_symm v.op g).symm
443+
444+
end Presheaf
445+
446+
namespace GrothendieckTopology
447+
448+
lemma ofArrows_mem_iff_isLocallySurjective_cofanIsColimitDesc_shrinkYoneda_map
449+
[LocallySmall.{w} C] {S : C} {ι : Type*} [Small.{w} ι] {X : ι → C}
450+
(f : ∀ i, X i ⟶ S)
451+
{c : Cofan (fun i ↦ shrinkYoneda.{w}.obj (X i))} (hc : IsColimit c) :
452+
Sieve.ofArrows _ f ∈ J S ↔
453+
Presheaf.IsLocallySurjective J
454+
(Cofan.IsColimit.desc hc (fun i ↦ shrinkYoneda.{w}.map (f i))) := by
455+
refine ⟨fun hf ↦ ⟨fun {U u} ↦ ?_⟩, fun hf ↦ ?_⟩
456+
· obtain ⟨u, rfl⟩ := shrinkYonedaObjObjEquiv.symm.surjective u
457+
replace hf := J.pullback_stable u hf
458+
rwa [← Presheaf.imageSieve_cofanIsColimitDesc_shrinkYoneda_map f hc u] at hf
459+
· rw [← Sieve.pullback_id (S := Sieve.ofArrows X f),
460+
← Presheaf.imageSieve_cofanIsColimitDesc_shrinkYoneda_map f hc (𝟙 S)]
461+
exact Presheaf.imageSieve_mem J (Cofan.IsColimit.desc hc (fun i ↦ shrinkYoneda.{w}.map (f i)))
462+
(shrinkYonedaObjObjEquiv.symm (𝟙 S))
463+
464+
lemma ofArrows_mem_iff_isLocallySurjective_cofanIsColimitDesc_uliftYoneda_map
465+
{S : C} {ι : Type*} [Small.{max w v} ι] {X : ι → C}
466+
(f : ∀ i, X i ⟶ S)
467+
{c : Cofan (fun i ↦ uliftYoneda.{w}.obj (X i))} (hc : IsColimit c) :
468+
Sieve.ofArrows _ f ∈ J S ↔
469+
Presheaf.IsLocallySurjective J
470+
(Cofan.IsColimit.desc hc (fun i ↦ uliftYoneda.{w}.map (f i))) := by
471+
let e : Discrete.functor (fun i ↦ uliftYoneda.{w}.obj (X i)) ≅
472+
Discrete.functor (fun i ↦ shrinkYoneda.{max w v}.obj (X i)) :=
473+
Discrete.natIso (fun i ↦ uliftYonedaIsoShrinkYoneda.{w}.app (X i.as))
474+
let hc' := (IsColimit.precomposeInvEquiv e _).2 hc
475+
rw [ofArrows_mem_iff_isLocallySurjective_cofanIsColimitDesc_shrinkYoneda_map.{max w v} J f hc']
476+
have :
477+
Cofan.IsColimit.desc hc (fun i ↦ uliftYoneda.map (f i)) ≫
478+
uliftYonedaIsoShrinkYoneda.hom.app _ =
479+
Cofan.IsColimit.desc hc' (fun i ↦ shrinkYoneda.map (f i)) :=
480+
Cofan.IsColimit.hom_ext hc _ _ (fun i ↦ by
481+
rw [Cofan.IsColimit.fac_assoc, NatTrans.naturality,
482+
← Cofan.IsColimit.fac hc' (fun i ↦ shrinkYoneda.map (f i)) i]
483+
simp [Cofan.inj, e])
484+
rw [← this, Presheaf.isLocallySurjective_comp_iff J]
485+
486+
lemma ofArrows_mem_iff_isLocallySurjective_sigmaDesc_shrinkYoneda_map [LocallySmall.{w} C]
487+
{S : C} {ι : Type*} [Small.{w} ι] {X : ι → C} (f : ∀ i, X i ⟶ S) :
488+
Sieve.ofArrows _ f ∈ J S ↔
489+
Presheaf.IsLocallySurjective J (Sigma.desc (fun i ↦ shrinkYoneda.{w}.map (f i))) :=
490+
ofArrows_mem_iff_isLocallySurjective_cofanIsColimitDesc_shrinkYoneda_map J f
491+
(coproductIsCoproduct _)
492+
493+
lemma ofArrows_mem_iff_isLocallySurjective_sigmaDesc_uliftYoneda_map
494+
{S : C} {ι : Type*} [Small.{max w v} ι] {X : ι → C} (f : ∀ i, X i ⟶ S) :
495+
Sieve.ofArrows _ f ∈ J S ↔
496+
Presheaf.IsLocallySurjective J (Sigma.desc (fun i ↦ uliftYoneda.{w}.map (f i))) :=
497+
ofArrows_mem_iff_isLocallySurjective_cofanIsColimitDesc_uliftYoneda_map J f
498+
(coproductIsCoproduct _)
499+
500+
end GrothendieckTopology
501+
402502
end CategoryTheory

0 commit comments

Comments
 (0)