Skip to content

Commit 52e9692

Browse files
committed
chore(CategoryTheory/Presentable/Basic): remove bad instance (leanprover-community#41660)
The instance `HasCardinalFilteredColimits.hasColimitsOfShape` is bad because it has no way to infer the value of `κ`. Almost 2 years ago there was a change to type classes, which caused Lean to not give a warning about this, in leanprover/lean4#5376 and I think that is an issue. This PR is a copy of leanprover-community#27941. In the meantime, this instance has accidentally been added again in leanprover-community#30533.
1 parent a570e2c commit 52e9692

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

Mathlib/CategoryTheory/Presentable/Adjunction.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ lemma isCardinalLocallyPresentable [IsCardinalLocallyPresentable C κ]
8686
lemma isCardinalAccessibleCategory [IsCardinalAccessibleCategory C κ]
8787
[G.IsCardinalAccessible κ] [G.Full] [G.Faithful] :
8888
IsCardinalAccessibleCategory D κ where
89-
toHasCardinalFilteredColimits := ⟨fun _ _ _ ↦
89+
toHasCardinalFilteredColimits := ⟨fun J _ _ ↦
9090
let : Reflective G := ⟨_, adj⟩
91+
have := HasCardinalFilteredColimits.hasColimitsOfShape C κ J
9192
hasColimitsOfShape_of_reflective G⟩
9293
toHasCardinalFilteredGenerator := adj.hasCardinalFilteredGenerator κ
9394

Mathlib/CategoryTheory/Presentable/Basic.lean

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,17 +344,15 @@ end
344344

345345
section
346346

347-
variable (C) (κ : Cardinal.{w}) [Fact κ.IsRegular]
348-
349347
/-- A category has `κ`-filtered colimits if it has colimits of shape `J`
350348
for any `κ`-filtered category `J`. -/
351-
class HasCardinalFilteredColimits : Prop where
352-
hasColimitsOfShape (J : Type w) [SmallCategory J] [IsCardinalFiltered J κ] :
349+
class HasCardinalFilteredColimits (C : Type u₁) [Category.{v₁} C]
350+
(κ : Cardinal.{w}) [Fact κ.IsRegular] : Prop where
351+
hasColimitsOfShape (C) (J : Type w) [SmallCategory J] [IsCardinalFiltered J κ] :
353352
HasColimitsOfShape J C := by intros; infer_instance
354353

355-
attribute [instance] HasCardinalFilteredColimits.hasColimitsOfShape
356-
357-
instance [HasColimitsOfSize.{w, w} C] : HasCardinalFilteredColimits.{w} C κ where
354+
instance (κ : Cardinal.{w}) [Fact κ.IsRegular] [HasColimitsOfSize.{w, w} C] :
355+
HasCardinalFilteredColimits.{w} C κ where
358356

359357
end
360358

Mathlib/CategoryTheory/Presentable/OrthogonalReflection.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ lemma MorphismProperty.isCardinalAccessible_ι_isLocal
9999
W.isLocal.ι.IsCardinalAccessible κ where
100100
preservesColimitOfShape J _ _ := by
101101
have := W.isClosedUnderColimitsOfShape_isLocal J κ hW
102+
have := HasCardinalFilteredColimits.hasColimitsOfShape C κ J
102103
infer_instance
103104

104105
namespace OrthogonalReflection

0 commit comments

Comments
 (0)