Skip to content

[Merged by Bors] - feat(Algebra/Homology): pseudofunctorial behaviour of Functor.mapDerivedCategory - #43089

Closed
joelriou wants to merge 29 commits into
leanprover-community:masterfrom
joelriou:ext-adjunction-0
Closed

joelriou wants to merge 29 commits into
leanprover-community:masterfrom
joelriou:ext-adjunction-0

Conversation

@joelriou

@joelriou joelriou commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

In this PR, we do not construct a pseudofunctor from the bicategory of abelian categories and exact functors to the bicategory of triangulated categories which sends an abelian category to its derived category: we show part of the corresponding compatibilites (those that are required for #43086).


I had to replace an implicit_reducible def by an abbrev at https://github.com/joelriou/mathlib4/blob/7fa46d31af3ddc735d7e996cbfbf856b4b8709ac/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean#L42 to prevent some breakage. I am not completely sure what is going on :-(

Open in Gitpod

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

PR summary 563b376a95

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ Q_map_single_map
+ comp_mapExactFunctor
+ id_mapExactFunctor
+ instance (R : Type*) [Ring R] [CategoryTheory.Linear R C₁] [CategoryTheory.Linear R C₂]
+ instance (τ : F ⟶ G) : NatTrans.CommShift τ.mapDerivedCategory ℤ
+ instance : NatTrans.CommShift (Lifting.iso L W L (𝟭 D)).hom A := by
+ instance : NatTrans.CommShift (mapDerivedCategoryCompIso F G).hom ℤ := by
+ instance : NatTrans.CommShift (mapDerivedCategoryIdIso C₁).hom ℤ
+ instance : NatTrans.CommShift (mapHomologicalComplexIdIso C (.up ℤ)).hom ℤ
+ instance {E : Type*} [Category* E] [Preadditive E] {G : D ⥤ E} {H : C ⥤ E}
+ instance {G : C ⥤ D} [G.Additive] (τ : F ⟶ G) :
+ isoRefl_hom
+ liftNatTrans
+ mapDerivedCategory
+ mapDerivedCategoryCompIso
+ mapDerivedCategoryCompIso_hom_app_Q_obj
+ mapDerivedCategoryCompIso_hom_app_comp_mapDerivedCategorySingleFunctor_hom_app
+ mapDerivedCategoryIdIso
+ mapDerivedCategoryIdIso_hom_app
+ mapDerivedCategoryIdIso_hom_app_singleFunctor_obj
+ mapDerivedCategoryIdIso_inv_app_singleFunctor_obj
+ mapDerivedCategorySingleFunctor_inv_app_comp_mapDerivedCategoryCompIso_inv_app
+ mapDerivedCategory_app_Q_obj
+ mapDerivedCategory_app_singleFunctor_obj
+ mapExactFunctor_comp_mk₀_natTransApp
+ natTransMapHomologicalComplex_app_single_obj
+ singleMapHomologicalComplex_comp_hom_app
+ singleMapHomologicalComplex_comp_inv_app
+ singleMapHomologicalComplex_id_hom_app
+ singleMapHomologicalComplex_id_inv_app
+++++ instance :
- instance [F.Linear R] : F.mapDerivedCategory.Linear R := by

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 563b376).

  • +46 new declarations
  • −1 removed declarations
+CategoryTheory.Abelian.Ext.comp_mapExactFunctor
+CategoryTheory.Abelian.Ext.id_mapExactFunctor
+CategoryTheory.Abelian.Ext.mapExactFunctor_comp_mk₀_natTransApp
+CategoryTheory.Functor.instCommShiftCochainComplexIntDerivedCategoryHomIsoQQuasiIsoUpCompHomologicalComplexMapHomologicalComplexMapDerivedCategory
+CategoryTheory.Functor.instCommShiftCochainComplexIntDerivedCategoryHomIsoQQuasiIsoUpCompHomologicalComplexMapHomologicalComplexMapDerivedCategory_1
+CategoryTheory.Functor.instCommShiftCochainComplexIntDerivedCategoryHomIsoQQuasiIsoUpMapDerivedCategoryId
+CategoryTheory.Functor.instCommShiftDerivedCategoryHomMapDerivedCategoryCompIsoInt
+CategoryTheory.Functor.instCommShiftDerivedCategoryHomMapDerivedCategoryIdIsoInt
+CategoryTheory.Functor.instCommShiftHomologicalComplexIntUpHomMapHomologicalComplexCompIso
+CategoryTheory.Functor.instCommShiftHomologicalComplexIntUpHomMapHomologicalComplexIdIso
+CategoryTheory.Functor.instCommShiftHomologicalComplexIntUpMapHomologicalComplex
+CategoryTheory.Functor.instLiftingCochainComplexIntDerivedCategoryQQuasiIsoUpCompHomologicalComplexMapHomologicalComplexMapDerivedCategory_1
+CategoryTheory.Functor.instLiftingCochainComplexIntDerivedCategoryQQuasiIsoUpMapDerivedCategoryId
+CategoryTheory.Functor.mapDerivedCategoryCompIso
+CategoryTheory.Functor.mapDerivedCategoryCompIso_hom_app_Q_obj
+CategoryTheory.Functor.mapDerivedCategoryCompIso_hom_app_comp_mapDerivedCategorySingleFunctor_hom_app
+CategoryTheory.Functor.mapDerivedCategoryCompIso_hom_app_comp_mapDerivedCategorySingleFunctor_hom_app_assoc
+CategoryTheory.Functor.mapDerivedCategoryIdIso
+CategoryTheory.Functor.mapDerivedCategoryIdIso_hom_app
+CategoryTheory.Functor.mapDerivedCategoryIdIso_hom_app_assoc
+CategoryTheory.Functor.mapDerivedCategoryIdIso_hom_app_singleFunctor_obj
+CategoryTheory.Functor.mapDerivedCategoryIdIso_inv_app_singleFunctor_obj
+CategoryTheory.Functor.mapDerivedCategorySingleFunctor_hom_app
+CategoryTheory.Functor.mapDerivedCategorySingleFunctor_inv_app
+CategoryTheory.Functor.mapDerivedCategorySingleFunctor_inv_app_comp_mapDerivedCategoryCompIso_inv_app
+CategoryTheory.Functor.mapDerivedCategorySingleFunctor_inv_app_comp_mapDerivedCategoryCompIso_inv_app_assoc
+CategoryTheory.NatTrans.CommShift.instHomFunctorIsoId
+CategoryTheory.NatTrans.CommShift.isoRefl_hom
+CategoryTheory.NatTrans.CommShift.liftNatTrans
+CategoryTheory.NatTrans.instCommShiftDerivedCategoryMapDerivedCategoryInt
+CategoryTheory.NatTrans.mapDerivedCategory
+CategoryTheory.NatTrans.mapDerivedCategory_app_Q_obj
+CategoryTheory.NatTrans.mapDerivedCategory_app_Q_obj_assoc
+CategoryTheory.NatTrans.mapDerivedCategory_app_singleFunctor_obj
+CategoryTheory.NatTrans.mapDerivedCategory_app_singleFunctor_obj_assoc
-CochainComplex.singleFunctors.congr_simp
+DerivedCategory.Q_map_single_map
+DerivedCategory.singleFunctorIsoCompQ_hom_app
+DerivedCategory.singleFunctorIsoCompQ_inv_app
+HomologicalComplex.natTransMapHomologicalComplex_app_single_obj
+HomologicalComplex.natTransMapHomologicalComplex_app_single_obj_assoc
+HomologicalComplex.singleMapHomologicalComplex_comp_hom_app
+HomologicalComplex.singleMapHomologicalComplex_comp_hom_app_assoc
+HomologicalComplex.singleMapHomologicalComplex_comp_inv_app
+HomologicalComplex.singleMapHomologicalComplex_comp_inv_app_assoc
+HomologicalComplex.singleMapHomologicalComplex_id_hom_app
+HomologicalComplex.singleMapHomologicalComplex_id_inv_app

Decrease in strong tech debt: (relative, absolute) = (7.19, 0.01)
Current number Change Type (strong)
backward.defeqAttrib.useBackward 4276 -10
backward.isDefEq.respectTransparency 4801 -16
backward.isDefEq.respectTransparency.types 2482 -1
No changes to weak technical debt.

Current commit 563b376a95
Reference commit 981fa8f557

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip label Aug 25, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Aug 25, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

attribute, as the generated lemmas would not be very useful.) -/
@[implicit_reducible]
noncomputable def singleFunctors : SingleFunctors C (CochainComplex C ℤ) ℤ where
noncomputable abbrev singleFunctors : SingleFunctors C (CochainComplex C ℤ) ℤ where

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a heuristic for this change?

@joelriou joelriou Sep 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, no. On a just slightly older mathlib, it seems this change was not necessary. Trying to keep an implicit_reducible def broke a few other files, so that making this an abbrev is the solution with the minimum diff. If you have a strong preference, I can try to make this again an implicit_reducible def, and fix the downstream breakages...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The amount of backwards-compat options that are being removed in this PR is very encouraging.
It would be great if we can rationalize (post-rationalize 🙈) a good explanation for why abbrev is the best choice here.

But I don't necessarily want to block on that.

bors d+

@jcommelin jcommelin added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 1, 2026
@joelriou joelriou removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 1, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✌️ joelriou can now approve this pull request until 2026-09-15 09:03 UTC (in 2 weeks). To approve and merge, reply with bors r+. More detailed instructions are available here.

⚠️ This delegation only covers changes within Archive/**, Counterexamples/**, docs/**, DownstreamTest/**, Mathlib/**, MathlibTest/**, Wanted/**, widget/**, Archive.lean, Counterexamples.lean, docs.lean, Mathlib.lean, Wanted.lean; an author commit touching anything else will revoke it. Bors also revokes it if a later push changes too many files for it to check the full list — even if it stays within scope.

@mathlib-bors mathlib-bors Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Sep 1, 2026
@joelriou

joelriou commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks!

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Sep 1, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 1, 2026
…ivedCategory` (#43089)

In this PR, we do not construct a pseudofunctor from the bicategory of abelian categories and exact functors to the bicategory of triangulated categories which sends an abelian category to its derived category: we show part of the corresponding compatibilites (those that are required for #43086).
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 1, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This PR was included in a batch that was canceled, it will be automatically retried

@mathlib-bors mathlib-bors Bot removed the bors-staging This PR is currently being built by bors on the staging branch. label Sep 1, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 1, 2026
…ivedCategory` (#43089)

In this PR, we do not construct a pseudofunctor from the bicategory of abelian categories and exact functors to the bicategory of triangulated categories which sends an abelian category to its derived category: we show part of the corresponding compatibilites (those that are required for #43086).
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 1, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(Algebra/Homology): pseudofunctorial behaviour of Functor.mapDerivedCategory [Merged by Bors] - feat(Algebra/Homology): pseudofunctorial behaviour of Functor.mapDerivedCategory Sep 1, 2026
@mathlib-bors mathlib-bors Bot closed this Sep 1, 2026
@mathlib-bors mathlib-bors Bot removed the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Sep 1, 2026
joelriou added a commit to joelriou/mathlib4 that referenced this pull request Sep 5, 2026
…ivedCategory` (leanprover-community#43089)

In this PR, we do not construct a pseudofunctor from the bicategory of abelian categories and exact functors to the bicategory of triangulated categories which sends an abelian category to its derived category: we show part of the corresponding compatibilites (those that are required for leanprover-community#43086).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors. t-category-theory Category theory tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants