Skip to content

[Merged by Bors] - chore(CategoryTheory): remove backward options using implicit_reducible - #42161

Closed
JovanGerb wants to merge 2 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-implicit_reducible-CategoryTheory
Closed

JovanGerb wants to merge 2 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-implicit_reducible-CategoryTheory

Conversation

@JovanGerb

@JovanGerb JovanGerb commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

This PR removes a lot of the transparency related set_option. I did this by using #defeq_abuse in to determine which definition was not being unfolded, and then tagging such definitions with implicit_reducible.

In particular backward.isDefEq.respectTransparency can almost always be removed like this, but backward.defeqAttrib.useBackward is still sometimes tricky to remove.

Presumably, the changes from this PR will let us remove many more set_option in further files that this PR doesn't touch.


Open in Gitpod

@github-actions github-actions Bot added the tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip label Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

PR summary 480516ab37

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 480516a).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


Decrease in strong tech debt: (relative, absolute) = (23.93, 0.08)
Current number Change Type (strong)
388 -3 adaptation notes
4374 -129 backward.defeqAttrib.useBackward
7016 -100 backward.isDefEq.respectTransparency
4040 -101 backward.isDefEq.respectTransparency.types
No changes to weak technical debt.

Current commit 480516ab37
Reference commit d732046e27

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.sh 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 Jul 27, 2026
@JovanGerb
JovanGerb requested a review from robin-carlier July 27, 2026 23:36
@Whysoserioushah

Copy link
Copy Markdown
Collaborator

!radar

@leanprover-radar

leanprover-radar commented Jul 28, 2026 •

Copy link
Copy Markdown

Benchmark results for 798faae against d732046 are in. There are significant results. @Whysoserioushah

  • 🟥 build//instructions: +20.0G (+0.01%)

Large changes (1🟥)

  • 🟥 build/module/Mathlib.AlgebraicGeometry.Group.Affine//instructions: +34.2G (+31.43%)

Small changes (3✅)

  • ✅ build/module/Mathlib.Algebra.Category.CoalgCat.ComonEquivalence//instructions: -1.5G (-2.84%)
  • ✅ build/module/Mathlib.CategoryTheory.Localization.Predicate//instructions: -2.0G (-10.16%)
  • ✅ build/module/Mathlib.CategoryTheory.Localization.Trifunctor//instructions: -1.1G (-3.55%)

@robin-carlier robin-carlier left a comment

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.

Thanks! The only added set_option backward.defeqAttrib.useBackward true that seems a bit painful to remove is the one on compUliftCoyonedaIso. it is possible (but untested) that Equiv.ulift, CategoryTheory.uliftYoneda, and Equiv.toIso need to be implicit_reducible for this one.

Comment thread Mathlib/CategoryTheory/Opposites.lean Resolved
Comment thread Mathlib/CategoryTheory/Equivalence.lean Resolved
Comment thread Mathlib/CategoryTheory/Equivalence.lean Resolved
Comment thread Mathlib/CategoryTheory/Equivalence.lean Resolved
Comment thread Mathlib/CategoryTheory/Equivalence.lean Resolved
@robin-carlier robin-carlier added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 28, 2026
@JovanGerb

Copy link
Copy Markdown
Contributor Author

Thanks for the review!

@JovanGerb JovanGerb removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 28, 2026

@robin-carlier robin-carlier left a comment

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.

Thanks!

maintainer merge

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by robin-carlier.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 28, 2026
@joelriou

Copy link
Copy Markdown
Contributor

Thanks!

bors merge

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

This PR removes a lot of the transparency related `set_option`. I did this by using `#defeq_abuse in` to determine which definition was not being unfolded, and then tagging such definitions with `implicit_reducible`.

In particular `backward.isDefEq.respectTransparency` can almost always be removed like this, but `backward.defeqAttrib.useBackward` is still sometimes tricky to remove.

Presumably, the changes from this PR will let us remove many more `set_option` in further files that this PR doesn't touch.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Jul 31, 2026
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 31, 2026
@mathlib-bors

mathlib-bors Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title chore(CategoryTheory): remove backward options using implicit_reducible [Merged by Bors] - chore(CategoryTheory): remove backward options using implicit_reducible Jul 31, 2026
@mathlib-bors mathlib-bors Bot closed this Jul 31, 2026
JovanGerb added a commit to JovanGerb/mathlib4 that referenced this pull request Aug 18, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Aug 30, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Aug 30, 2026
This PR removes some adaptation notes that I forgot to remove in #42161.
attilavjda pushed a commit to attilavjda/mathlib4 that referenced this pull request Sep 5, 2026
joelriou pushed a commit to joelriou/mathlib4 that referenced this pull request Sep 5, 2026
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.

5 participants