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] - refactor(algebra/lie): replace local instance with type synonym #16154

Closed
wants to merge 3 commits into from

Conversation

Vierkantor
Copy link
Collaborator

A Lie ring can be viewed as a non_unital_non_assoc_semiring by using its bracket operator as the multiplication. Defining this as an instance causes diamonds because all rings are also Lie rings, so there are two incompatible multiplications on the same type.

Instead of the previous approach, of making this a def and only locally enabling the instance being careful not to cause diamonds, we use a type synonym that is guaranteed to have only one multiplication operator.

Someone who knows more about Lie theory should definitely check that the changes make mathematical sense.

Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.60lie_ring.2Eto_non_unital_non_assoc_semiring.60


Open in Gitpod

A Lie ring can be viewed as a `non_unital_non_assoc_semiring` by using its bracket operator as the multiplication. Defining this as an instance causes diamonds because all rings are also Lie rings, so there are two incompatible multiplications on the same type.

Instead of the previous approach, of making this a `def` and only locally enabling the instance being careful not to cause diamonds, we use a type synonym that is guaranteed to have only one multiplication operator.

Someone who knows more about Lie theory should definitely check that the changes make mathematical sense.

Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.60lie_ring.2Eto_non_unital_non_assoc_semiring.60
@Vierkantor Vierkantor added awaiting-review The author would like community review of the PR awaiting-CI The author would like to see what CI has to say before doing more work. t-algebra Algebra (groups, rings, fields etc) labels Aug 19, 2022
Copy link
Collaborator

@ocfnash ocfnash left a comment

Choose a reason for hiding this comment

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

Very neat, thanks!

One minor remark about the doc string.

bors d+

src/algebra/lie/non_unital_non_assoc_algebra.lean Outdated Show resolved Hide resolved
@bors
Copy link

bors bot commented Aug 19, 2022

✌️ Vierkantor 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 delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Aug 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 Aug 22, 2022
@Vierkantor
Copy link
Collaborator Author

bors merge

@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 Aug 22, 2022
bors bot pushed a commit that referenced this pull request Aug 22, 2022
A Lie ring can be viewed as a `non_unital_non_assoc_semiring` by using its bracket operator as the multiplication. Defining this as an instance causes diamonds because all rings are also Lie rings, so there are two incompatible multiplications on the same type.

Instead of the previous approach, of making this a `def` and only locally enabling the instance being careful not to cause diamonds, we use a type synonym that is guaranteed to have only one multiplication operator.

Someone who knows more about Lie theory should definitely check that the changes make mathematical sense.

Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.60lie_ring.2Eto_non_unital_non_assoc_semiring.60
@bors
Copy link

bors bot commented Aug 22, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title refactor(algebra/lie): replace local instance with type synonym [Merged by Bors] - refactor(algebra/lie): replace local instance with type synonym Aug 22, 2022
@bors bors bot closed this Aug 22, 2022
@bors bors bot deleted the commutator_ring-synonym branch August 22, 2022 20:33
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+`.) t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants