Skip to content

Commit 807c884

Browse files
committed
chore(CategoryTheory/EssentiallySmall): adding an instance (#30534)
Before this PR, `example (C : Type w) [SmallCategory C] : EssentiallySmall.{w} C := inferInstance` would not work. We fix this by making `essentiallySmall_of_small_of_locallySmall` an instance. Consequently, we need to make certain universes explicit in a few proofs. Some instances in `Sites.Equivalence` are transformed into lemmas because it seems they shadowed more basic instances.
1 parent 6c37355 commit 807c884

File tree

22 files changed

+92
-36
lines changed

22 files changed

+92
-36
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,6 +3127,7 @@ import Mathlib.Condensed.Light.CartesianClosed
31273127
import Mathlib.Condensed.Light.Epi
31283128
import Mathlib.Condensed.Light.Explicit
31293129
import Mathlib.Condensed.Light.Functors
3130+
import Mathlib.Condensed.Light.Instances
31303131
import Mathlib.Condensed.Light.Limits
31313132
import Mathlib.Condensed.Light.Module
31323133
import Mathlib.Condensed.Light.Small

Mathlib/Algebra/Category/Grp/Subobject.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ universe u
1818
namespace AddCommGrpCat
1919

2020
instance wellPowered_addCommGrp : WellPowered.{u} AddCommGrpCat.{u} :=
21-
wellPowered_of_equiv (forget₂ (ModuleCat.{u} ℤ) AddCommGrpCat.{u}).asEquivalence
21+
wellPowered_of_equiv.{u} (forget₂ (ModuleCat.{u} ℤ) AddCommGrpCat.{u}).asEquivalence
2222

2323
end AddCommGrpCat

Mathlib/AlgebraicGeometry/Modules/Presheaf.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ variable (X : Scheme.{u})
2828

2929
/-- The underlying sheaf of rings of a scheme. -/
3030
abbrev ringCatSheaf : TopCat.Sheaf RingCat.{u} X :=
31-
(sheafCompose _ (forget₂ CommRingCat RingCat)).obj X.sheaf
31+
(sheafCompose _ (forget₂ CommRingCat RingCat.{u})).obj X.sheaf
3232

3333
/-- The category of presheaves of modules over a scheme. -/
3434
nonrec abbrev PresheafOfModules := PresheafOfModules.{u} X.ringCatSheaf.val

Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ lemma AB5OfSize_of_univLE [HasFilteredColimitsOfSize.{w₂, w₂'} C] [UnivLE.{w
310310
constructor
311311
intro J _ _
312312
haveI := IsFiltered.of_equivalence ((ShrinkHoms.equivalence.{w₂} J).trans <|
313-
Shrink.equivalence.{w₂'} (ShrinkHoms.{w'} J))
313+
Shrink.equivalence.{w₂', w₂} (ShrinkHoms.{w'} J))
314314
exact HasExactColimitsOfShape.of_domain_equivalence _ ((ShrinkHoms.equivalence.{w₂} J).trans <|
315-
Shrink.equivalence.{w₂'} (ShrinkHoms.{w'} J)).symm
315+
Shrink.equivalence.{w₂', w₂} (ShrinkHoms.{w'} J)).symm
316316

317317
lemma AB5OfSize_shrink [HasFilteredColimitsOfSize.{max w w₂, max w' w₂'} C]
318318
[AB5OfSize.{max w w₂, max w' w₂'} C] :
@@ -344,9 +344,9 @@ lemma AB5StarOfSize_of_univLE [HasCofilteredLimitsOfSize.{w₂, w₂'} C] [UnivL
344344
constructor
345345
intro J _ _
346346
haveI := IsCofiltered.of_equivalence ((ShrinkHoms.equivalence.{w₂} J).trans <|
347-
Shrink.equivalence.{w₂'} (ShrinkHoms.{w'} J))
347+
Shrink.equivalence.{w₂', w₂} (ShrinkHoms.{w'} J))
348348
exact HasExactLimitsOfShape.of_domain_equivalence _ ((ShrinkHoms.equivalence.{w₂} J).trans <|
349-
Shrink.equivalence.{w₂'} (ShrinkHoms.{w'} J)).symm
349+
Shrink.equivalence.{w₂', w₂} (ShrinkHoms.{w'} J)).symm
350350

351351
lemma AB5StarOfSize_shrink [HasCofilteredLimitsOfSize.{max w w₂, max w' w₂'} C]
352352
[AB5StarOfSize.{max w w₂, max w' w₂'} C] :

Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Sheaf.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ instance {C : Type v} [SmallCategory.{v} C] (J : GrothendieckTopology C)
6969
(A : Type u₁) [Category.{v} A] [Abelian A] [IsGrothendieckAbelian.{v} A]
7070
[HasSheafify J A] : IsGrothendieckAbelian.{v} (Sheaf J A) where
7171

72-
instance {C : Type (v + 1)} [LargeCategory C] [EssentiallySmall.{v} C]
72+
attribute [local instance] hasSheafifyEssentiallySmallSite in
73+
lemma isGrothendieckAbelian_of_essentiallySmall
74+
{C : Type u₂} [Category.{v} C] [EssentiallySmall.{v} C]
7375
(J : GrothendieckTopology C)
7476
(A : Type u₁) [Category.{v} A] [Abelian A] [IsGrothendieckAbelian.{v} A]
7577
[HasSheafify ((equivSmallModel C).inverse.inducedTopology J) A] :

Mathlib/CategoryTheory/Adjunction/AdjointFunctorTheorems.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ lemma isRightAdjoint_of_preservesLimits_of_isCoseparating [HasLimits D] [WellPow
105105
(hP : P.IsCoseparating) (G : D ⥤ C) [PreservesLimits G] :
106106
G.IsRightAdjoint := by
107107
have : ∀ A, HasInitial (StructuredArrow A G) := fun A ↦
108-
hasInitial_of_isCoseparating (StructuredArrow.isCoseparating_inverseImage_proj A G hP)
108+
hasInitial_of_isCoseparating.{v} (StructuredArrow.isCoseparating_inverseImage_proj A G hP)
109109
exact isRightAdjointOfStructuredArrowInitials _
110110

111111
/-- The special adjoint functor theorem: if `F : C ⥤ D` preserves colimits and `C` is cocomplete,
@@ -116,7 +116,7 @@ lemma isLeftAdjoint_of_preservesColimits_of_isSeparating [HasColimits C] [WellPo
116116
(h𝒢 : P.IsSeparating) (F : C ⥤ D) [PreservesColimits F] :
117117
F.IsLeftAdjoint :=
118118
have : ∀ A, HasTerminal (CostructuredArrow F A) := fun A =>
119-
hasTerminal_of_isSeparating (CostructuredArrow.isSeparating_inverseImage_proj F A h𝒢)
119+
hasTerminal_of_isSeparating.{v} (CostructuredArrow.isSeparating_inverseImage_proj F A h𝒢)
120120
isLeftAdjoint_of_costructuredArrowTerminals _
121121

122122
end SpecialAdjointFunctorTheorem

Mathlib/CategoryTheory/EssentiallySmall.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,12 @@ theorem essentiallySmall_iff (C : Type u) [Category.{v} C] :
227227
(skeletonEquivalence (ShrinkHoms C)).symm.trans
228228
((inducedFunctor (e'.trans e).symm).asEquivalence.symm)
229229

230-
theorem essentiallySmall_of_small_of_locallySmall [Small.{w} C] [LocallySmall.{w} C] :
230+
instance essentiallySmall_of_small_of_locallySmall [Small.{w} C] [LocallySmall.{w} C] :
231231
EssentiallySmall.{w} C :=
232232
(essentiallySmall_iff C).2 ⟨small_of_surjective Quotient.exists_rep, by infer_instance⟩
233233

234+
example (C : Type w) [SmallCategory C] : EssentiallySmall.{w} C := inferInstance
235+
234236
instance small_skeleton_of_essentiallySmall [h : EssentiallySmall.{w} C] : Small.{w} (Skeleton C) :=
235237
essentiallySmall_iff C |>.1 h |>.1
236238

Mathlib/CategoryTheory/Generator/Abelian.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ variable {C : Type u} [Category.{v} C] [Abelian C]
3333
theorem has_injective_coseparator [HasLimits C] [EnoughInjectives C] (G : C) (hG : IsSeparator G) :
3434
∃ G : C, Injective G ∧ IsCoseparator G := by
3535
haveI : WellPowered.{v} C := wellPowered_of_isDetector G hG.isDetector
36-
haveI : HasProductsOfShape (Subobject (op G)) C := hasProductsOfShape_of_small _ _
36+
haveI : HasProductsOfShape (Subobject (op G)) C := hasProductsOfShape_of_small.{v} _ _
3737
let T : C := Injective.under (piObj fun P : Subobject (op G) => unop P)
3838
refine ⟨T, inferInstance, (Preadditive.isCoseparator_iff _).2 fun X Y f hf => ?_⟩
3939
refine (Preadditive.isSeparator_iff _).1 hG _ fun h => ?_

Mathlib/CategoryTheory/Limits/Filtered.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ lemma hasCofilteredLimitsOfSize_of_univLE [UnivLE.{w, w₂}] [UnivLE.{w', w₂'}
108108
HasCofilteredLimitsOfSize.{w', w} C where
109109
HasLimitsOfShape J :=
110110
haveI := IsCofiltered.of_equivalence ((ShrinkHoms.equivalence.{w₂'} J).trans <|
111-
Shrink.equivalence.{w₂} (ShrinkHoms.{w} J))
111+
Shrink.equivalence.{w₂, w₂'} (ShrinkHoms.{w} J))
112112
hasLimitsOfShape_of_equivalence ((ShrinkHoms.equivalence.{w₂'} J).trans <|
113-
Shrink.equivalence.{w₂} (ShrinkHoms.{w} J)).symm
113+
Shrink.equivalence.{w₂, w₂'} (ShrinkHoms.{w} J)).symm
114114

115115
lemma hasCofilteredLimitsOfSize_shrink [HasCofilteredLimitsOfSize.{max w' w₂', max w w₂} C] :
116116
HasCofilteredLimitsOfSize.{w', w} C :=
@@ -121,9 +121,9 @@ lemma hasFilteredColimitsOfSize_of_univLE [UnivLE.{w, w₂}] [UnivLE.{w', w₂'}
121121
HasFilteredColimitsOfSize.{w', w} C where
122122
HasColimitsOfShape J :=
123123
haveI := IsFiltered.of_equivalence ((ShrinkHoms.equivalence.{w₂'} J).trans <|
124-
Shrink.equivalence.{w₂} (ShrinkHoms.{w} J))
124+
Shrink.equivalence.{w₂, w₂'} (ShrinkHoms.{w} J))
125125
hasColimitsOfShape_of_equivalence ((ShrinkHoms.equivalence.{w₂'} J).trans <|
126-
Shrink.equivalence.{w₂} (ShrinkHoms.{w} J)).symm
126+
Shrink.equivalence.{w₂, w₂'} (ShrinkHoms.{w} J)).symm
127127

128128
lemma hasFilteredColimitsOfSize_shrink [HasFilteredColimitsOfSize.{max w' w₂', max w w₂} C] :
129129
HasFilteredColimitsOfSize.{w', w} C :=

Mathlib/CategoryTheory/Limits/HasLimits.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ variable (C)
571571
theorem hasLimitsOfSizeOfUnivLE [UnivLE.{v₂, v₁}] [UnivLE.{u₂, u₁}]
572572
[HasLimitsOfSize.{v₁, u₁} C] : HasLimitsOfSize.{v₂, u₂} C where
573573
has_limits_of_shape J {_} := hasLimitsOfShape_of_equivalence
574-
((ShrinkHoms.equivalence J).trans <| Shrink.equivalence _).symm
574+
((ShrinkHoms.equivalence.{v₁} J).trans <| Shrink.equivalence _).symm
575575

576576
/-- `hasLimitsOfSizeShrink.{v u} C` tries to obtain `HasLimitsOfSize.{v u} C`
577577
from some other `HasLimitsOfSize C`.
@@ -1086,7 +1086,7 @@ variable (C)
10861086
theorem hasColimitsOfSizeOfUnivLE [UnivLE.{v₂, v₁}] [UnivLE.{u₂, u₁}]
10871087
[HasColimitsOfSize.{v₁, u₁} C] : HasColimitsOfSize.{v₂, u₂} C where
10881088
has_colimits_of_shape J {_} := hasColimitsOfShape_of_equivalence
1089-
((ShrinkHoms.equivalence J).trans <| Shrink.equivalence _).symm
1089+
((ShrinkHoms.equivalence.{v₁} J).trans <| Shrink.equivalence _).symm
10901090

10911091
/-- `hasColimitsOfSizeShrink.{v u} C` tries to obtain `HasColimitsOfSize.{v u} C`
10921092
from some other `HasColimitsOfSize C`.

0 commit comments

Comments
 (0)