Skip to content

feat(to_additive): support (attr := reassoc)#38994

Open
JovanGerb wants to merge 3 commits intoleanprover-community:masterfrom
JovanGerb:Jovan-to_additive-reassoc
Open

feat(to_additive): support (attr := reassoc)#38994
JovanGerb wants to merge 3 commits intoleanprover-community:masterfrom
JovanGerb:Jovan-to_additive-reassoc

Conversation

@JovanGerb
Copy link
Copy Markdown
Contributor

This PR uses registerGeneratingAttr, so that to_additive (attr := reassoc) also tags the _assoc lemma with to_additive.

This interacts awkwarly with to_dual (attr := reassoc), because in that case, the reassoc attribute is responsible for handling the to_dual attribute. This is solved by adding a check so that we only insert a new translation if it doesn't already exist (e.g. because reassoc could have added it).


Open in Gitpod

@JovanGerb JovanGerb requested a review from chrisflav May 6, 2026 10:35
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

PR summary 3144a34bda

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ reassocImpl

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.


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

Copy link
Copy Markdown
Member

@chrisflav chrisflav left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good to me, but I am in no way competent to review this.

Comment on lines -150 to -152
set_option linter.existingAttributeWarning false in
attribute [to_additive existing] IsModHom.smul_hom_assoc

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.

There is the same issue in Monoidal/Mon.lean. Could you please also fix that one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants