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] - feat: make MulOpposite and AddOpposite structures #1036

Closed
wants to merge 8 commits into from

Conversation

kbuzzard
Copy link
Member

@kbuzzard kbuzzard commented Dec 15, 2022

This refactor makes αᵐᵒᵖ and αᵃᵒᵖ into structures with one field, an idea more appropriate in Lean 4 than the Lean 3 approach of type synonyms.

@@ -343,8 +351,10 @@ theorem op_div [Div α] (a b : α) : op (a / b) = op a / op b :=
rfl
#align add_opposite.op_div AddOpposite.op_div

-- porting note: this lemma looked wrong to me -- is it wrong in mathlib3?
Copy link
Member

Choose a reason for hiding this comment

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

I agree, this is wrong in mathlib3. We didn't notice this because / is the same operation on αᵃᵒᵖ and α and so it still works as a simp 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.

@kbuzzard
Copy link
Member Author

@semorrison semorrison added the awaiting-author A reviewer has asked the author a question or requested changes label Dec 17, 2022
@kbuzzard
Copy link
Member Author

For now I'm marking the failing simpComm linter declaration as nolint, as per Gabriel's suggestion here. I've opened an issue here.

@kbuzzard kbuzzard added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Dec 18, 2022
@semorrison
Copy link
Contributor

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Dec 20, 2022
bors bot pushed a commit that referenced this pull request Dec 20, 2022
This refactor makes `αᵐᵒᵖ` and `αᵃᵒᵖ` into structures with one field, an idea more appropriate in Lean 4 than the Lean 3 approach of type synonyms.
@bors
Copy link

bors bot commented Dec 20, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: make MulOpposite and AddOpposite structures [Merged by Bors] - feat: make MulOpposite and AddOpposite structures Dec 20, 2022
@bors bors bot closed this Dec 20, 2022
@bors bors bot deleted the kbuzzard-refactor-opposites branch December 20, 2022 05:52
bors bot pushed a commit that referenced this pull request May 23, 2023
It turns out to be convenient to have `MulOpposite α = AddOpposite α` true by definition, in the same way that it is convenient to have `Additive α = α`; this means that we also get the defeq `AddOpposite (Additive α) = MulOpposite α`, which is convenient when working with quotients.
This is a compromise between making `MulOpposite α = AddOpposite α = α` (what we had in Lean 3) and
having no defeqs within those three types (which we had as of #1036).

This is motivated by #3333
qawbecrdtey pushed a commit to qawbecrdtey/greedoid-mathlib4 that referenced this pull request Jun 12, 2023
It turns out to be convenient to have `MulOpposite α = AddOpposite α` true by definition, in the same way that it is convenient to have `Additive α = α`; this means that we also get the defeq `AddOpposite (Additive α) = MulOpposite α`, which is convenient when working with quotients.
This is a compromise between making `MulOpposite α = AddOpposite α = α` (what we had in Lean 3) and
having no defeqs within those three types (which we had as of leanprover-community#1036).

This is motivated by leanprover-community#3333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants