-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - chore(*): to_additive related cleanup #11559
Conversation
@@ -813,6 +813,8 @@ by simp [finset.mul_def] | |||
@[to_additive, mono] lemma mul_subset_mul (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : s₁ * t₁ ⊆ s₂ * t₂ := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess mono, to_additive
doesn't work? Can we teach to_additive
to copy mono
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is, add it to:
mathlib/src/algebra/group/to_additive.lean
Lines 524 to 526 in c72e709
[`reducible, `_refl_lemma, `simp, `norm_cast, `instance, `refl, `symm, `trans, | |
`elab_as_eliminator, `no_rsimp, `continuity, `ext, `ematch, `measurability, `alias, | |
`_ext_core, `_ext_lemma_core, `nolint], |
and
mathlib/src/algebra/group/to_additive.lean
Lines 329 to 334 in c72e709
The following attributes are supported and should be applied correctly by `to_additive` to | |
the new additivized declaration, if they were present on the original one: | |
``` | |
reducible, _refl_lemma, simp, norm_cast, instance, refl, symm, trans, elab_as_eliminator, no_rsimp, | |
continuity, ext, ematch, measurability, alias, _ext_core, _ext_lemma_core, nolint | |
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there's a warning about that here that you added in #9790:
mathlib/src/algebra/group/to_additive.lean
Lines 343 to 344 in c72e709
Additionally the `mono` attribute is not handled by `to_additive` and should be applied afterwards | |
to both the original and additivized lemma. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah its unfortunately non-trivial to make to_additive handle mono, because it stores some data in a reflected format, so some fairly significant additions would have to be made to handle that sort of data in a user attribute.
It would also be nice to have to_additive handle classes/structures, which I would consider even higher priority than mono, but that requires more functions to be exposed from lean to add structures to the environment :(.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors d+
It would be nice to teach to_additive
about mono, but there's no need for that to happen in this PR. Your call.
✌️ alexjbest can now approve this pull request. To approve and merge a pull request, simply reply with |
bors merge since CI is happy |
A few to_additive related cleanups * Move measurability before to_additive to avoid having to manually do it later (or forget). * Ensure anything tagged to_additive, mono has the additive version also mono'd * Move simp before to_additive
Pull request successfully merged into master. Build succeeded: |
A few to_additive related cleanups