Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

[Merged by Bors] - refactor(algebra/direct_sum): rework internally-graded objects#10127

Closed
eric-wieser wants to merge 8 commits intomasterfrom
eric-wieser/graded_subobjects
Closed

[Merged by Bors] - refactor(algebra/direct_sum): rework internally-graded objects#10127
eric-wieser wants to merge 8 commits intomasterfrom
eric-wieser/graded_subobjects

Conversation

@eric-wieser
Copy link
Copy Markdown
Member

@eric-wieser eric-wieser commented Nov 2, 2021

This is a replacement for the graded_ring.core typeclass in #10115, which is called set_like.graded_monoid here. The advantage of this approach is that we can use the same typeclass for graded semirings, graded rings, and graded algebras.

Largely, this change replaces a bunch of defs with instances, by bundling up the arguments to those defs to a new typeclass. This seems to make life easier for the few global gmonoid instance we already provide for direct sums of submodules, suggesting this API change is a useful one.

In principle the new [set_like.graded_monoid A] typeclass is useless, as the same effect can be achieved with [set_like.has_graded_one A] [set_like.has_graded_mul A]; pragmatically though this is painfully verbose, and probably results in larger term sizes. We can always remove it later if it causes problems.


This does not fully replace #10115: that PR also provides

class graded_ring extends graded_ring.core R A :=
( decompose : R → ⨁ i, A i)
( left_inv : function.left_inverse decompose (direct_sum.add_subgroup_coe A) )
( right_inv : function.right_inverse decompose (direct_sum.add_subgroup_coe A) )

We still want that class or something similar to it (replacing graded_ring.core with set_like.graded_monoid), but I deliberately leave it out of scope for this PR.

Open in Gitpod

@eric-wieser eric-wieser added the WIP Work in progress label Nov 2, 2021
@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Nov 3, 2021

* `direct_sum.add_submonoid_coe_ring_hom` (a `ring_hom` version of `direct_sum.add_submonoid_coe`)
* `direct_sum.add_subgroup_coe_ring_hom` (a `ring_hom` version of `direct_sum.add_subgroup_coe`)
* `direct_sum.submodule_coe_ring_hom` (an `alg_hom` version of `direct_sum.submodule_coe`)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* `direct_sum.submodule_coe_ring_hom` (an `alg_hom` version of `direct_sum.submodule_coe`)
* `direct_sum.submodule_coe_alg_hom` (an `alg_hom` version of `direct_sum.submodule_coe`)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Whoops, nice catch; don't write docstrings at 2am!

@eric-wieser eric-wieser requested a review from jcommelin November 3, 2021 16:53
Co-authored-by: Johan Commelin <johan@commelin.net>
Copy link
Copy Markdown
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Nov 3, 2021
bors bot pushed a commit that referenced this pull request Nov 3, 2021
This is a replacement for the `graded_ring.core` typeclass in #10115, which is called `set_like.graded_monoid` here. The advantage of this approach is that we can use the same typeclass for graded semirings, graded rings, and graded algebras.

Largely, this change replaces a bunch of `def`s with `instances`, by bundling up the arguments to those defs to a new typeclass. This seems to make life easier for the few global `gmonoid` instance we already provide for direct sums of submodules, suggesting this API change is a useful one.

In principle the new `[set_like.graded_monoid A]` typeclass is useless, as the same effect can be achieved with `[set_like.has_graded_one A] [set_like.has_graded_mul A]`; pragmatically though this is painfully verbose, and probably results in larger term sizes. We can always remove it later if it causes problems.



Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com>
@bors
Copy link
Copy Markdown

bors bot commented Nov 3, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title refactor(algebra/direct_sum): rework internally-graded objects [Merged by Bors] - refactor(algebra/direct_sum): rework internally-graded objects Nov 3, 2021
@bors bors bot closed this Nov 3, 2021
@bors bors bot deleted the eric-wieser/graded_subobjects branch November 3, 2021 22:44
ericrbg pushed a commit that referenced this pull request Nov 9, 2021
This is a replacement for the `graded_ring.core` typeclass in #10115, which is called `set_like.graded_monoid` here. The advantage of this approach is that we can use the same typeclass for graded semirings, graded rings, and graded algebras.

Largely, this change replaces a bunch of `def`s with `instances`, by bundling up the arguments to those defs to a new typeclass. This seems to make life easier for the few global `gmonoid` instance we already provide for direct sums of submodules, suggesting this API change is a useful one.

In principle the new `[set_like.graded_monoid A]` typeclass is useless, as the same effect can be achieved with `[set_like.has_graded_one A] [set_like.has_graded_mul A]`; pragmatically though this is painfully verbose, and probably results in larger term sizes. We can always remove it later if it causes problems.



Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com>
bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request May 17, 2023
Deletes a section that was always content-free, as well as a reference to code that was removed in leanprover-community/mathlib3#10127.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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.

3 participants