Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

alexjbest
Copy link
Member

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

Open in Gitpod

@alexjbest alexjbest added the awaiting-CI The author would like to see what CI has to say before doing more work. label Jan 19, 2022
@@ -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₂ :=
Copy link
Member

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?

Copy link
Member

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:

[`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
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
```

Copy link
Member

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:

Additionally the `mono` attribute is not handled by `to_additive` and should be applied afterwards
to both the original and additivized lemma.

Copy link
Member Author

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 :(.

Copy link
Member

@eric-wieser eric-wieser left a 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.

@bors
Copy link

bors bot commented Jan 19, 2022

✌️ alexjbest can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the delegated The PR author may merge after reviewing final suggestions. label Jan 19, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Jan 19, 2022
@eric-wieser
Copy link
Member

bors merge

since CI is happy

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Jan 19, 2022
bors bot pushed a commit that referenced this pull request Jan 19, 2022
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
@bors
Copy link

bors bot commented Jan 20, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(*): to_additive related cleanup [Merged by Bors] - chore(*): to_additive related cleanup Jan 20, 2022
@bors bors bot closed this Jan 20, 2022
@bors bors bot deleted the alexjbest/cleanup_to_additive branch January 20, 2022 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants