Skip to content

Commit

Permalink
chore(category_theory/abelian): backport removal of abelian.has_finit…
Browse files Browse the repository at this point in the history
…e_biproducts instance (#18740)

This backports a proposed removal of the `abelian.has_finite_biproducts` global instance, instead enabling it locally in the files that need it.

The reason for removing it is that it triggers the ~~dreaded~~ leanprover/lean4#2055 during the simpNF linter in leanprover-community/mathlib4#2769, the mathlib4 port of `category_theory.abelian.basic`.

This backport verifies that we won't run into further problems downstream if we (hopefully temporarily) remove these instances in mathlib4. 





Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
  • Loading branch information
semorrison and semorrison committed Apr 28, 2023
1 parent b17e272 commit a5ff45a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/category_theory/abelian/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,15 @@ namespace category_theory.abelian
variables {C : Type u} [category.{v} C] [abelian C]

/-- An abelian category has finite biproducts. -/
@[priority 100]
instance has_finite_biproducts : has_finite_biproducts C :=
-- Porting note: this should be an instance,
-- but triggers https://github.com/leanprover/lean4/issues/2055
-- We set it as a local instance instead.
-- @[priority 100] instance
theorem has_finite_biproducts : has_finite_biproducts C :=
limits.has_finite_biproducts.of_has_finite_products

local attribute [instance] has_finite_biproducts

@[priority 100]
instance has_binary_biproducts : has_binary_biproducts C :=
limits.has_binary_biproducts_of_finite_biproducts _
Expand Down
5 changes: 5 additions & 0 deletions src/category_theory/abelian/opposite.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ variables (C : Type*) [category C] [abelian C]
local attribute [instance]
has_finite_limits_of_has_equalizers_and_finite_products
has_finite_colimits_of_has_coequalizers_and_finite_coproducts
-- Porting note:
-- This should have been a global instance,
-- but triggers https://github.com/leanprover/lean4/issues/2055
-- when ported to mathlib4.
abelian.has_finite_biproducts

instance : abelian Cᵒᵖ :=
{ normal_mono_of_mono := λ X Y f m, by exactI
Expand Down

0 comments on commit a5ff45a

Please sign in to comment.