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(algebra/direct_sum/module) : coe and internal #10004

Closed
wants to merge 12 commits into from

Conversation

jjaassoonn
Copy link
Collaborator

@jjaassoonn jjaassoonn commented Oct 27, 2021

This extracts the following defs from within the various is_internal properties:

  • direct_sum.add_submonoid_coe
  • direct_sum.add_subgroup_coe
  • direct_sum.submodule_coe

Packing these into a def makes things more concise, and avoids some annoying elaboration issues.

Co-authored-by: Eric Wieser wieser.eric@gmail.com


Open in Gitpod

@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Oct 27, 2021
jjaassoonn and others added 2 commits October 27, 2021 18:43
@jjaassoonn jjaassoonn removed the awaiting-author A reviewer has asked the author a question or requested changes label Oct 27, 2021
jjaassoonn and others added 3 commits October 27, 2021 23:14
@eric-wieser
Copy link
Member

This looks good to me now, thanks.

@kbuzzard, @jcommelin: do these names look reasonable to you?

@eric-wieser eric-wieser added the awaiting-review The author would like community review of the PR label Oct 28, 2021
src/algebra/direct_sum/basic.lean Outdated Show resolved Hide resolved
src/algebra/direct_sum/basic.lean Outdated Show resolved Hide resolved
src/algebra/direct_sum/module.lean Outdated Show resolved Hide resolved
jjaassoonn and others added 3 commits October 28, 2021 13:44
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -172,13 +172,23 @@ protected def id (M : Type v) (ι : Type* := punit) [add_comm_monoid M] [unique
right_inv := λ x, to_add_monoid_of _ _ _,
..direct_sum.to_add_monoid (λ _, add_monoid_hom.id M) }

/-- The canonical embedding from `⨁ i, A i` to `M`-/
Copy link
Member

Choose a reason for hiding this comment

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

I think that this docstring should mention that the A i are submonoids of M.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the suggestion

Comment on lines 178 to 183
direct_sum.to_add_monoid (λ i, (A i).subtype)

@[simp] lemma add_submonoid_coe_of {M : Type*} [decidable_eq ι] [add_comm_monoid M]
(A : ι → add_submonoid M) (i : ι) (x : A i) :
direct_sum.add_submonoid_coe A (direct_sum.of (λ i, A i) i x) = x :=
direct_sum.to_add_monoid_of _ _ _
Copy link
Member

Choose a reason for hiding this comment

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

Aren't you in the direct_sum namespace? So I guess you can remove some (all?) of these direct_sum. prefixes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the suggestion

@@ -188,13 +198,23 @@ begin
exact function.bijective.surjective h,
end

/-- The canonical embedding from `⨁ i, A i` to `M`-/
Copy link
Member

Choose a reason for hiding this comment

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

Idem.

@@ -194,6 +194,17 @@ lemma component.of (i j : ι) (b : M j) :
if h : j = i then eq.rec_on h b else 0 :=
dfinsupp.single_apply

/-- The canonical embedding from `⨁ i, A i` to `M`-/
Copy link
Member

Choose a reason for hiding this comment

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

Idem.

@jcommelin jcommelin added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Oct 28, 2021
@jjaassoonn jjaassoonn 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 Oct 28, 2021
Copy link
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 1, 2021
bors bot pushed a commit that referenced this pull request Nov 1, 2021
This extracts the following `def`s from within the various `is_internal` properties:
* `direct_sum.add_submonoid_coe`
* `direct_sum.add_subgroup_coe`
* `direct_sum.submodule_coe`

Packing these into a def makes things more concise, and avoids some annoying elaboration issues.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>



Co-authored-by: jjaassoonn <jujian.zhang1998@out.com>
@bors
Copy link

bors bot commented Nov 1, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(algebra/direct_sum/module) : coe and internal [Merged by Bors] - feat(algebra/direct_sum/module) : coe and internal Nov 1, 2021
@bors bors bot closed this Nov 1, 2021
@bors bors bot deleted the direct_sum.add_subgroup_coe branch November 1, 2021 07:47
ericrbg pushed a commit that referenced this pull request Nov 9, 2021
This extracts the following `def`s from within the various `is_internal` properties:
* `direct_sum.add_submonoid_coe`
* `direct_sum.add_subgroup_coe`
* `direct_sum.submodule_coe`

Packing these into a def makes things more concise, and avoids some annoying elaboration issues.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>



Co-authored-by: jjaassoonn <jujian.zhang1998@out.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

None yet

3 participants