-
Notifications
You must be signed in to change notification settings - Fork 297
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] - refactor(algebra/group/basic): rework lemmas on inv and neg #17483
Conversation
You don't need to actually put anything in the PR, just create a blank PR with a todo comment. You can then make the mathlib4 PR properly once this is merged and mathport has done the work for you. |
Thanks for reminding me. As I don't think this has high priority, my current plan is to wait until the teaching period here is over (mid-February). Then I will have more time for Lean-related things; in particular, I plan to familiarize myself with Lean 4, and dealing with the corresponding PR for mathlib4 will be a good opportunity to get started. (But if somebody else wants to go ahead with this, feel free to do so.) |
Why do you need this given that we have |
Because |
Would you mind changing |
I agree that the existing lemma swapping the sides is annoying; as @YaelDillies says, probably just replacing it with one that doesn't is a good move. |
It looks like in most cases, proofs would simplify slightly when changing the statement as suggested (and in the other cases, there would be no change), so it certainly would make sense to just replace On the other hand, this would make the whole thing quite a bit more involved (touching eight files instead of one, some of which are ported and some not). So my feeling is that it is perhaps better to do this after the port, in particular as there is no urgency whatsoever attached to this change. |
If only 2-3 files are touched by the port, and they all involve only trivial rewriting of existing proofs, I think that's alright. |
Right now, there is a one-way implications with swapped sides ( So, just to make sure I understand correctly what the suggestion is:
|
(I just realized there are two versions of the |
Ahah! I knew it was there somewhere. Up to you on whether you want to uniformise the API. |
I just noticed that the additive versions of the two lemmas occur even more often... (including four occurrences of the one-way version).
So this would touch more than 30 files in the end. Do you still think it makes sense to do this now? |
Up to you, really! I think touching 30 files isn't so bad, but also I don't know how many are ported already. |
OK, I have now made the change (including all necessary changes downstream). |
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.
This looks great to me, thanks for pushing through with it.
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.
Thanks for powering through!
bors merge |
This PR adds the following lemma (and its additive equivalent). ```lean theorem inv_eq_iff_eq_inv : a⁻¹ = b ↔ a = b⁻¹ ``` and removes `eq_inv_of_eq_inv`, `eq_inv_iff_eq_inv` and `inv_eq_iff_inv_eq` (and their additive equivalents).
Pull request successfully merged into master. Build succeeded: |
This forward ports the changes introduced by leanprover-community/mathlib#17483 No change is needed to `Mathlib.Data.EReal` as the proofs have been golfed in a different way. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
This PR adds the following lemma (and its additive equivalent).
and removes
eq_inv_of_eq_inv
,eq_inv_iff_eq_inv
andinv_eq_iff_inv_eq
(and their additive equivalents).Note: As several files that are touched by this PR have already been ported to mathlib4, this needs a parallel mathlib4 PR.
I'll try to do that eventually, but if somebody else wants to go ahead with this, they are very welcome!