Skip to content

[Merged by Bors] - chore(CategoryTheory/Comma): more implicit_reducible definitions - #42762

Closed
joelriou wants to merge 3 commits into
leanprover-community:masterfrom
joelriou:comma-fix
Closed

joelriou wants to merge 3 commits into
leanprover-community:masterfrom
joelriou:comma-fix

Conversation

@joelriou

@joelriou joelriou commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

More definitions are made implicit_reducible, so that no more set_option are required in the PR #41068 about the accessibility of comma categories.

--

I found a strange interaction of to_dual with simps/implicit_reducible attributes at the change https://github.com/joelriou/mathlib4/blob/b350d5034346aa2666e14d57a5b64916640a3b98/Mathlib/CategoryTheory/Comma/Basic.lean#L160: when doing attr := simps, implicit_reducible, it seems the lemmas are not marked as defeq while they are if we do attr := implicit_reducible, simps.


Open in Gitpod

@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

PR summary 7411709412

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 7411709).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.

No changes to weak technical debt.

Current commit 7411709412
Reference commit 7c673ccc1c

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

@joelriou
joelriou requested a review from JovanGerb August 14, 2026 08:17
@JovanGerb

Copy link
Copy Markdown
Contributor

strange interaction of to_dual with simps/implicit_reducible attributes

What is going on is that there are 3 times at which attributes can be added: beforeElaboration, afterTypeChecking and afterCompilation. These happen at these 3 different times, so they happen in this order. implicit_reducible is afterTypeChecking, while simps is afterCompilation, so implicit_reducible automatically runs first. However, to_dual has to apply all attributes at the same time, so it doesn't respect this order. I should make it so that the attributes in to_dual are reordered based on their application time.

@JovanGerb

Copy link
Copy Markdown
Contributor

I have made #42765 which fixes this in to_dual

@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 Aug 15, 2026
@joelriou

Copy link
Copy Markdown
Contributor Author

Thanks @JovanGerb for the reviews and the explanation of these intricacies!

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

Copy link
Copy Markdown
Contributor

Thanks!

maintainer merge

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by JovanGerb.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Aug 15, 2026
@sgouezel

Copy link
Copy Markdown
Contributor

bors r+

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Aug 15, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Aug 15, 2026
)

More definitions are made `implicit_reducible`, so that no more `set_option` are required in the PR #41068 about the accessibility of comma categories.

-- 

I found a strange interaction of `to_dual` with `simps/implicit_reducible` attributes at the change https://github.com/joelriou/mathlib4/blob/b350d5034346aa2666e14d57a5b64916640a3b98/Mathlib/CategoryTheory/Comma/Basic.lean#L160: when doing `attr := simps, implicit_reducible`, it seems the lemmas are not marked as `defeq` while they are if we do `attr := implicit_reducible, simps`.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Aug 15, 2026
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Aug 15, 2026
@mathlib-bors

mathlib-bors Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title chore(CategoryTheory/Comma): more implicit_reducible definitions [Merged by Bors] - chore(CategoryTheory/Comma): more implicit_reducible definitions Aug 15, 2026
@mathlib-bors mathlib-bors Bot closed this Aug 15, 2026
attilavjda pushed a commit to attilavjda/mathlib4 that referenced this pull request Sep 5, 2026
…nprover-community#42762)

More definitions are made `implicit_reducible`, so that no more `set_option` are required in the PR leanprover-community#41068 about the accessibility of comma categories.

-- 

I found a strange interaction of `to_dual` with `simps/implicit_reducible` attributes at the change https://github.com/joelriou/mathlib4/blob/b350d5034346aa2666e14d57a5b64916640a3b98/Mathlib/CategoryTheory/Comma/Basic.lean#L160: when doing `attr := simps, implicit_reducible`, it seems the lemmas are not marked as `defeq` while they are if we do `attr := implicit_reducible, simps`.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants