Skip to content

refactor(CategoryTheory/Limits): use compEvaluation in limitIsoFlipCompLim - #43568

Open
kim-em wants to merge 1 commit into
leanprover-community:masterfrom
kim-em:comp-evaluation
Open

refactor(CategoryTheory/Limits): use compEvaluation in limitIsoFlipCompLim#43568
kim-em wants to merge 1 commit into
leanprover-community:masterfrom
kim-em:comp-evaluation

Conversation

@kim-em

@kim-em kim-em commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This PR inserts HasLimit.isoOfNatIso (compEvaluation F k) into the components of limitIsoFlipCompLim and colimitIsoFlipCompColim, which currently identify F ⋙ (evaluation K C).obj k with F.flip.obj k by unfolding, and adapts the two proofs (colimitLimitToLimitColimitCone and yonedaYonedaColimit_app_inv) that relied on that unfolding.

It is extracted from Paul Reichert's experiment making Functor.comp and Functor.id instance_reducible (master...leanprover-community:mathlib4-nightly-testing:datokrat/functorcomp, discussed at https://leanprover.zulipchat.com/#narrow/channel/113488-general/topic/backward.2EisDefEq.2ErespectTransparency); the associator and unitor fixes are in #43566.

🤖 Prepared with Claude Code

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

PR summary 12df66b4a1

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

No declarations were harmed in the making of this PR! 🐙

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 12df66b).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit 12df66b4a1
Reference commit 572e4d091b

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 t-category-theory Category theory label Sep 8, 2026
…mpLim

limitIsoFlipCompLim and colimitIsoFlipCompColim identified
F ⋙ (evaluation K C).obj k with F.flip.obj k by unfolding; insert
HasLimit.isoOfNatIso (compEvaluation F k) instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@[simps!]
def limitIsoFlipCompLim [HasLimitsOfShape J C] (F : J ⥤ K ⥤ C) : limit F ≅ F.flip ⋙ lim :=
NatIso.ofComponents (limitObjIsoLimitCompEvaluation F)
NatIso.ofComponents (fun k =>

@joelriou joelriou Sep 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This proof uses Functor.comp_map. Then, I do not understand why not just doing the following because cat_disch (just a combination of intros, ext, simp) proves the goal:

  NatIso.ofComponents (fun k =>
    limitObjIsoLimitCompEvaluation F k ≪≫ HasLimit.isoOfNatIso (compEvaluation F k))

@joelriou joelriou added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. t-category-theory Category theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants