Skip to content

Commit e3128c5

Browse files
committed
chore(CategoryTheory/Sites): generalize universes in Sheaf.isSheaf_of_isRepresentable (leanprover-community#34234)
For this we add some API on representable functors.
1 parent dddc62c commit e3128c5

4 files changed

Lines changed: 48 additions & 10 deletions

File tree

Mathlib/Algebra/Category/Grp/Ulift.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ instance : uliftFunctor.{u, v}.Full := uliftFunctorFullyFaithful.full
103103
@[to_additive]
104104
noncomputable instance uliftFunctor_preservesLimit {J : Type w} [Category.{w'} J]
105105
(K : J ⥤ GrpCat.{u}) : PreservesLimit K uliftFunctor.{v, u} where
106-
preserves lc := ⟨isLimitOfReflects (forget GrpCat.{max u v})
107-
(isLimitOfPreserves CategoryTheory.uliftFunctor (isLimitOfPreserves (forget GrpCat) lc))⟩
106+
preserves lc := ⟨isLimitOfReflects (forget GrpCat) <|
107+
isLimitOfPreserves CategoryTheory.uliftFunctor.{v} (isLimitOfPreserves (forget GrpCat) lc)⟩
108108

109109
@[to_additive]
110110
noncomputable instance uliftFunctor_preservesLimitsOfShape {J : Type w} [Category.{w'} J] :
@@ -153,8 +153,8 @@ instance : uliftFunctor.{u, v}.Full := uliftFunctorFullyFaithful.full
153153
@[to_additive]
154154
noncomputable instance uliftFunctor_preservesLimit {J : Type w} [Category.{w'} J]
155155
(K : J ⥤ CommGrpCat.{u}) : PreservesLimit K uliftFunctor.{v, u} where
156-
preserves lc := ⟨isLimitOfReflects (forget CommGrpCat.{max u v})
157-
(isLimitOfPreserves CategoryTheory.uliftFunctor (isLimitOfPreserves (forget CommGrpCat) lc))⟩
156+
preserves lc := ⟨isLimitOfReflects (forget CommGrpCat) <|
157+
isLimitOfPreserves CategoryTheory.uliftFunctor.{v} (isLimitOfPreserves (forget CommGrpCat) lc)⟩
158158

159159
@[to_additive]
160160
noncomputable instance uliftFunctor_preservesLimitsOfShape {J : Type w} [Category.{w'} J] :

Mathlib/CategoryTheory/Sites/Canonical.lean

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,14 @@ theorem isSheaf_yoneda_obj (X : C) : Presieve.IsSheaf (canonicalTopology C) (yon
195195
fun _ _ hS => sheaf_for_finestTopology _ (Set.mem_range_self _) _ hS
196196

197197
/-- A representable functor is a sheaf for the canonical topology. -/
198-
theorem isSheaf_of_isRepresentable (P : Cᵒᵖ ⥤ Type v) [P.IsRepresentable] :
199-
Presieve.IsSheaf (canonicalTopology C) P :=
200-
Presieve.isSheaf_iso (canonicalTopology C) P.reprW (isSheaf_yoneda_obj _)
198+
theorem isSheaf_of_isRepresentable (P : Cᵒᵖ ⥤ Type w) [P.IsRepresentable] :
199+
Presieve.IsSheaf (canonicalTopology C) P := by
200+
rw [← Presieve.isSheaf_comp_uliftFunctor_iff]
201+
refine Presieve.isSheaf_iso (canonicalTopology C) (P ⋙ uliftFunctor.{v}).uliftYonedaReprXIso ?_
202+
rw [← isSheaf_iff_isSheaf_of_type]
203+
refine GrothendieckTopology.HasSheafCompose.isSheaf _ ?_
204+
rw [isSheaf_iff_isSheaf_of_type]
205+
exact isSheaf_yoneda_obj _
201206

202207
end Sheaf
203208

@@ -226,7 +231,7 @@ theorem of_isSheaf_yoneda_obj (J : GrothendieckTopology C)
226231

227232
/-- If `J` is subcanonical, then any representable is a `J`-sheaf. -/
228233
theorem isSheaf_of_isRepresentable {J : GrothendieckTopology C} [Subcanonical J]
229-
(P : Cᵒᵖ ⥤ Type v) [P.IsRepresentable] : Presieve.IsSheaf J P :=
234+
(P : Cᵒᵖ ⥤ Type w) [P.IsRepresentable] : Presieve.IsSheaf J P :=
230235
Presieve.isSheaf_of_le _ J.le_canonical (Sheaf.isSheaf_of_isRepresentable P)
231236

232237
end Subcanonical

Mathlib/CategoryTheory/Sites/SheafOfTypes.lean

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,14 @@ theorem isSheaf_pretopology [HasPullbacks C] (K : Pretopology C) :
160160
theorem isSheaf_bot : IsSheaf (⊥ : GrothendieckTopology C) P := fun X => by
161161
simp [isSheafFor_top]
162162

163+
/-- A presheaf is a sheaf after composiing with a universe lift if and only if it is a sheaf. -/
164+
@[simp]
165+
theorem isSheaf_comp_uliftFunctor_iff : IsSheaf J (P ⋙ uliftFunctor.{w'}) ↔ IsSheaf J P :=
166+
(isSheaf_iff_of_nat_equiv (fun _ => Equiv.ulift.symm) (fun _ _ _ _ => rfl)).symm
167+
163168
/-- The composition of a sheaf with a ULift functor is still a sheaf. -/
164-
theorem isSheaf_comp_uliftFunctor (h : IsSheaf J P) : IsSheaf J (P ⋙ uliftFunctor.{w'}) :=
165-
isSheaf_of_nat_equiv (fun _ => Equiv.ulift.symm) (fun _ _ _ _ => rfl) h
169+
theorem isSheaf_comp_uliftFunctor (h : IsSheaf J P) : IsSheaf J (P ⋙ uliftFunctor.{w'}) := by
170+
rwa [isSheaf_comp_uliftFunctor_iff]
166171

167172
/--
168173
For a presheaf of the form `yoneda.obj W`, a compatible family of elements on a sieve

Mathlib/CategoryTheory/Yoneda.lean

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,17 @@ theorem reprW_hom_app (F : Cᵒᵖ ⥤ Type v₁) [F.IsRepresentable]
533533
F.reprW.hom.app X f = F.map f.op F.reprx := by
534534
apply RepresentableBy.homEquiv_eq
535535

536+
/-- If `F` is representable, it is, modulo universe lifting, isomorphic to
537+
`Hom(-, X)` for the representing object `X`. -/
538+
noncomputable def uliftYonedaReprXIso (F : Cᵒᵖ ⥤ Type (max v v₁)) [F.IsRepresentable] :
539+
uliftYoneda.{v}.obj F.reprX ≅ F :=
540+
(RepresentableBy.equivUliftYonedaIso F _) F.representableBy
541+
542+
lemma uliftYonedaReprXIso_hom_app (F : Cᵒᵖ ⥤ Type (max v v₁)) [F.IsRepresentable]
543+
(X : Cᵒᵖ) (f : ULift (unop X ⟶ F.reprX)) :
544+
F.uliftYonedaReprXIso.hom.app X f = F.map f.down.op F.reprx :=
545+
RepresentableBy.homEquiv_eq _ _
546+
536547
end Representable
537548

538549
section Corepresentable
@@ -571,6 +582,17 @@ theorem coreprW_hom_app (F : C ⥤ Type v₁) [F.IsCorepresentable] (X : C) (f :
571582
F.coreprW.hom.app X f = F.map f F.coreprx := by
572583
apply CorepresentableBy.homEquiv_eq
573584

585+
/-- If `F` is corepresentable, it is, modulo universe lifting, isomorphic to
586+
`Hom(X, -)` for the corepresenting object `X`. -/
587+
noncomputable def uliftCoyonedaCoreprXIso (F : C ⥤ Type (max v v₁)) [F.IsCorepresentable] :
588+
uliftCoyoneda.{v}.obj (op F.coreprX) ≅ F :=
589+
(CorepresentableBy.equivUliftCoyonedaIso F _) F.corepresentableBy
590+
591+
lemma uliftCoyonedaCoreprXIso_hom_app (F : C ⥤ Type (max v v₁)) [F.IsCorepresentable]
592+
(X : C) (f : ULift (F.coreprX ⟶ X)) :
593+
F.uliftCoyonedaCoreprXIso.hom.app X f = F.map f.down F.coreprx :=
594+
CorepresentableBy.homEquiv_eq _ _
595+
574596
end Corepresentable
575597

576598
lemma isRepresentable_comp_uliftFunctor_iff {F : Cᵒᵖ ⥤ Type v} :
@@ -583,6 +605,12 @@ lemma isCorepresentable_comp_uliftFunctor_iff {F : C ⥤ Type v} :
583605
mp | ⟨X, ⟨R⟩⟩ => ⟨X, ⟨corepresentableByUliftFunctorEquiv R⟩⟩
584606
mpr | ⟨X, ⟨R⟩⟩ => ⟨X, ⟨corepresentableByUliftFunctorEquiv.symm R⟩⟩
585607

608+
instance (F : Cᵒᵖ ⥤ Type v) [F.IsRepresentable] : (F ⋙ uliftFunctor.{w}).IsRepresentable :=
609+
isRepresentable_comp_uliftFunctor_iff.mpr ‹_›
610+
611+
instance (F : C ⥤ Type v) [F.IsCorepresentable] : (F ⋙ uliftFunctor.{w}).IsCorepresentable :=
612+
isCorepresentable_comp_uliftFunctor_iff.mpr ‹_›
613+
586614
end Functor
587615

588616
theorem isRepresentable_of_natIso (F : Cᵒᵖ ⥤ Type v₁) {G} (i : F ≅ G) [F.IsRepresentable] :

0 commit comments

Comments
 (0)