Skip to content

Commit 082d63c

Browse files
kim-emclaude
andcommitted
convert #adaptation_note to -- comments for univ_out_params annotations
These are permanent annotations, not temporary workarounds, so #adaptation_note is the wrong mechanism. Use regular comments placed after the doc-string and before the @[univ_out_params] attribute. Also restore the reference to lean4#12423 alongside lean4#12286. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d61b93d commit 082d63c

File tree

13 files changed

+54
-52
lines changed

13 files changed

+54
-52
lines changed

Mathlib/CategoryTheory/Category/Basic.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,13 @@ elab (name := cat_disch) "cat_disch" : tactic =>
222222

223223
set_option mathlib.tactic.category.grind true
224224

225-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
226-
the morphism universe `v` would default to being a universe output parameter.
227-
See Note [universe output parameters and typeclass caching]. -/
228225
/-- The typeclass `Category C` describes morphisms associated to objects of type `C`.
229226
The universe levels of the objects and morphisms are unconstrained, and will often need to be
230227
specified explicitly, as `Category.{v} C`. (See also `LargeCategory` and `SmallCategory`.) -/
228+
-- After https://github.com/leanprover/lean4/pull/12286 and
229+
-- https://github.com/leanprover/lean4/pull/12423, the morphism universe `v` would default to
230+
-- being a universe output parameter.
231+
-- See Note [universe output parameters and typeclass caching].
231232
@[univ_out_params, pp_with_univ, stacks 0014]
232233
class Category (obj : Type u) : Type max u (v + 1) extends CategoryStruct.{v} obj where
233234
/-- Identity morphisms are left identities for composition. -/

Mathlib/CategoryTheory/Enriched/Limits/HasConicalLimits.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ class HasConicalLimitsOfShape : Prop where
6868

6969
attribute [instance] HasConicalLimitsOfShape.hasConicalLimit
7070

71-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
72-
the shape universes `v₁, u₁` would default to universe output parameters.
73-
See Note [universe output parameters and typeclass caching]. -/
7471
/--
7572
`C` has all conical limits of size `v₁ u₁` (`HasLimitsOfSize.{v₁ u₁} C`)
7673
if it has conical limits of every shape `J : Type u₁` with `[Category.{v₁} J]`.
7774
-/
75+
-- After https://github.com/leanprover/lean4/pull/12286 and
76+
-- https://github.com/leanprover/lean4/pull/12423, the shape universes `v₁, u₁` would default
77+
-- to universe output parameters. See Note [universe output parameters and typeclass caching].
7878
@[univ_out_params, pp_with_univ]
7979
class HasConicalLimitsOfSize : Prop where
8080
/-- All functors `F : J ⥤ C` from all small `J` have conical limits -/

Mathlib/CategoryTheory/EssentiallySmall.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ variable (C : Type u) [Category.{v} C]
3636

3737
namespace CategoryTheory
3838

39-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
40-
the smallness universe `w` in `EssentiallySmall` and `LocallySmall` would default to a
41-
universe output parameter.
42-
See Note [universe output parameters and typeclass caching]. -/
4339
/-- A category is `EssentiallySmall.{w}` if there exists
4440
an equivalence to some `S : Type w` with `[SmallCategory S]`. -/
41+
-- After https://github.com/leanprover/lean4/pull/12286 and
42+
-- https://github.com/leanprover/lean4/pull/12423, the smallness universe `w` in
43+
-- `EssentiallySmall` and `LocallySmall` would default to a universe output parameter.
44+
-- See Note [universe output parameters and typeclass caching].
4545
@[univ_out_params, pp_with_univ]
4646
class EssentiallySmall (C : Type u) [Category.{v} C] : Prop where
4747
/-- An essentially small category is equivalent to some small category. -/
@@ -92,6 +92,7 @@ theorem essentiallySmallSelf : EssentiallySmall.{max w v u} C :=
9292
9393
See `ShrinkHoms C` for a category instance where every hom set has been replaced by a small model.
9494
-/
95+
-- See comment on `EssentiallySmall` above.
9596
@[univ_out_params, pp_with_univ]
9697
class LocallySmall (C : Type u) [Category.{v} C] : Prop where
9798
/-- A locally small category has small hom-types. -/

Mathlib/CategoryTheory/Limits/Creates.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ class CreatesLimit (K : J ⥤ C) (F : C ⥤ D) extends ReflectsLimit K F where
8080
class CreatesLimitsOfShape (J : Type w) [Category.{w'} J] (F : C ⥤ D) where
8181
CreatesLimit : ∀ {K : J ⥤ C}, CreatesLimit K F := by infer_instance
8282

83-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
84-
the shape universes in `CreatesLimitsOfSize` and `CreatesColimitsOfSize` would default to
85-
universe output parameters.
86-
See Note [universe output parameters and typeclass caching]. -/
8783
-- This should be used with explicit universe variables.
8884
/-- `F` creates limits if it creates limits of shape `J` for any `J`. -/
85+
-- After https://github.com/leanprover/lean4/pull/12286 and
86+
-- https://github.com/leanprover/lean4/pull/12423, the shape universes in
87+
-- `CreatesLimitsOfSize` and `CreatesColimitsOfSize` would default to universe output parameters.
88+
-- See Note [universe output parameters and typeclass caching].
8989
@[univ_out_params, nolint checkUnivs, pp_with_univ]
9090
class CreatesLimitsOfSize (F : C ⥤ D) where
9191
CreatesLimitsOfShape : ∀ {J : Type w} [Category.{w'} J], CreatesLimitsOfShape J F := by

Mathlib/CategoryTheory/Limits/Filtered.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ section
6969

7070
variable (C)
7171

72-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
73-
the shape universes in `HasCofilteredLimitsOfSize` and `HasFilteredColimitsOfSize` would default
74-
to universe output parameters.
75-
See Note [universe output parameters and typeclass caching]. -/
7672
/-- Class for having all cofiltered limits of a given size. -/
73+
-- After https://github.com/leanprover/lean4/pull/12286 and
74+
-- https://github.com/leanprover/lean4/pull/12423, the shape universes in
75+
-- `HasCofilteredLimitsOfSize` and `HasFilteredColimitsOfSize` would default to universe
76+
-- output parameters. See Note [universe output parameters and typeclass caching].
7777
@[univ_out_params, pp_with_univ]
7878
class HasCofilteredLimitsOfSize : Prop where
7979
/-- For all filtered types of size `w`, we have limits -/

Mathlib/CategoryTheory/Limits/HasLimits.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ class HasLimitsOfShape : Prop where
101101
/-- All functors `F : J ⥤ C` from `J` have limits -/
102102
has_limit : ∀ F : J ⥤ C, HasLimit F := by infer_instance
103103

104-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
105-
the shape universes `v₁, u₁` would default to universe output parameters.
106-
See Note [universe output parameters and typeclass caching]. -/
107104
/-- `C` has all limits of size `v₁ u₁` (`HasLimitsOfSize.{v₁ u₁} C`)
108105
if it has limits of every shape `J : Type u₁` with `[Category.{v₁} J]`.
109106
-/
107+
-- After https://github.com/leanprover/lean4/pull/12286 and
108+
-- https://github.com/leanprover/lean4/pull/12423, the shape universes `v₁, u₁` would default
109+
-- to universe output parameters. See Note [universe output parameters and typeclass caching].
110110
@[univ_out_params, pp_with_univ]
111111
class HasLimitsOfSize (C : Type u) [Category.{v} C] : Prop where
112112
/-- All functors `F : J ⥤ C` from all small `J` have limits -/
@@ -626,12 +626,12 @@ class HasColimitsOfShape : Prop where
626626
/-- All `F : J ⥤ C` have colimits for a fixed `J` -/
627627
has_colimit : ∀ F : J ⥤ C, HasColimit F := by infer_instance
628628

629-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
630-
the shape universes `v₁, u₁` would default to universe output parameters.
631-
See Note [universe output parameters and typeclass caching]. -/
632629
/-- `C` has all colimits of size `v₁ u₁` (`HasColimitsOfSize.{v₁ u₁} C`)
633630
if it has colimits of every shape `J : Type u₁` with `[Category.{v₁} J]`.
634631
-/
632+
-- After https://github.com/leanprover/lean4/pull/12286 and
633+
-- https://github.com/leanprover/lean4/pull/12423, the shape universes `v₁, u₁` would default
634+
-- to universe output parameters. See Note [universe output parameters and typeclass caching].
635635
@[univ_out_params, pp_with_univ]
636636
class HasColimitsOfSize (C : Type u) [Category.{v} C] : Prop where
637637
/-- All `F : J ⥤ C` have colimits for all small `J` -/

Mathlib/CategoryTheory/Limits/Preserves/Basic.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,14 @@ class PreservesLimitsOfShape (J : Type w) [Category.{w'} J] (F : C ⥤ D) : Prop
7272
class PreservesColimitsOfShape (J : Type w) [Category.{w'} J] (F : C ⥤ D) : Prop where
7373
preservesColimit : ∀ {K : J ⥤ C}, PreservesColimit K F := by infer_instance
7474

75-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
76-
the shape universes `w, w'` in `PreservesLimitsOfSize`, `PreservesColimitsOfSize`,
77-
`ReflectsLimitsOfSize`, and `ReflectsColimitsOfSize` would default to universe output
78-
parameters. See Note [universe output parameters and typeclass caching]. -/
7975
-- This should be used with explicit universe variables.
8076
/-- `PreservesLimitsOfSize.{v u} F` means that `F` sends all limit cones over any
8177
diagram `J ⥤ C` to limit cones, where `J : Type u` with `[Category.{v} J]`. -/
78+
-- After https://github.com/leanprover/lean4/pull/12286 and
79+
-- https://github.com/leanprover/lean4/pull/12423, the shape universes `w, w'` in
80+
-- `PreservesLimitsOfSize`, `PreservesColimitsOfSize`, `ReflectsLimitsOfSize`, and
81+
-- `ReflectsColimitsOfSize` would default to universe output parameters.
82+
-- See Note [universe output parameters and typeclass caching].
8283
@[univ_out_params, nolint checkUnivs, pp_with_univ]
8384
class PreservesLimitsOfSize (F : C ⥤ D) : Prop where
8485
preservesLimitsOfShape : ∀ {J : Type w} [Category.{w'} J], PreservesLimitsOfShape J F := by

Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ section FilteredColimits
4040

4141
section Preserves
4242

43-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
44-
the shape universes in `PreservesFilteredColimitsOfSize`, `ReflectsFilteredColimitsOfSize`,
45-
`PreservesCofilteredLimitsOfSize`, and `ReflectsCofilteredLimitsOfSize` would default to
46-
universe output parameters.
47-
See Note [universe output parameters and typeclass caching]. -/
4843
-- This should be used with explicit universe variables.
4944
/-- `PreservesFilteredColimitsOfSize.{w', w} F` means that `F` sends all colimit cocones over any
5045
filtered diagram `J ⥤ C` to colimit cocones, where `J : Type w` with `[Category.{w'} J]`. -/
46+
-- After https://github.com/leanprover/lean4/pull/12286 and
47+
-- https://github.com/leanprover/lean4/pull/12423, the shape universes in
48+
-- `PreservesFilteredColimitsOfSize`, `ReflectsFilteredColimitsOfSize`,
49+
-- `PreservesCofilteredLimitsOfSize`, and `ReflectsCofilteredLimitsOfSize` would default to
50+
-- universe output parameters. See Note [universe output parameters and typeclass caching].
5151
@[univ_out_params, nolint checkUnivs, pp_with_univ]
5252
class PreservesFilteredColimitsOfSize (F : C ⥤ D) : Prop where
5353
preserves_filtered_colimits :

Mathlib/CategoryTheory/Localization/SmallHom.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ section
4040

4141
variable (L : C ⥤ D) [L.IsLocalization W] (X Y Z : C)
4242

43-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
44-
the universe `w` would default to a universe output parameter.
45-
See Note [universe output parameters and typeclass caching]. -/
4643
/-- This property holds if the type of morphisms between `X` and `Y`
4744
in the localized category with respect to `W : MorphismProperty C`
4845
is small. -/
46+
-- After https://github.com/leanprover/lean4/pull/12286 and
47+
-- https://github.com/leanprover/lean4/pull/12423, the universe `w` would default to a
48+
-- universe output parameter. See Note [universe output parameters and typeclass caching].
4949
@[univ_out_params]
5050
class HasSmallLocalizedHom : Prop where
5151
small : Small.{w} (W.Q.obj X ⟶ W.Q.obj Y)

Mathlib/CategoryTheory/Sites/Continuous.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ variable (F F' : C ⥤ D) (τ : F ⟶ F') (e : F ≅ F') (G : D ⥤ E)
118118
abbrev PreservesOneHypercovers :=
119119
∀ {X : C} (E : GrothendieckTopology.OneHypercover.{w} J X), E.IsPreservedBy F K
120120

121-
#adaptation_note /-- After https://github.com/leanprover/lean4/pull/12286,
122-
the sheaf type universe `t` would default to a universe output parameter,
123-
causing failures when a lemma needs `IsContinuous` at two different universe levels.
124-
See Note [universe output parameters and typeclass caching]. -/
125121
/-- A functor `F` is continuous if the precomposition with `F.op` sends sheaves of `Type t`
126122
to sheaves. -/
123+
-- After https://github.com/leanprover/lean4/pull/12286 and
124+
-- https://github.com/leanprover/lean4/pull/12423, the sheaf type universe `t` would default
125+
-- to a universe output parameter, causing failures when a lemma needs `IsContinuous` at two
126+
-- different universe levels. See Note [universe output parameters and typeclass caching].
127127
@[univ_out_params]
128128
class IsContinuous : Prop where
129129
op_comp_isSheaf_of_types (G : Sheaf K (Type t)) : Presieve.IsSheaf J (F.op ⋙ G.val)

0 commit comments

Comments
 (0)