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/ring/basic): define non-unital, non-associative rings #6786

Closed
wants to merge 78 commits into from

Conversation

ocfnash
Copy link
Collaborator

@ocfnash ocfnash commented Mar 20, 2021

This introduces the following typeclasses beneath semiring:

  • non_unital_non_assoc_semiring
  • non_unital_semiring
  • non_assoc_semiring

The goal is to use these to support a non-unital, non-associative
algebras.

The typeclass requirements of subring, subsemiring, and ring_hom are relaxed from semiring to non_assoc_semiring.

Instances of these new typeclasses are added for:

  • alias types:
    • opposite
    • ulift
  • convolutive types:
    • (add_)monoid_algebra
    • direct_sum
    • set_semiring
    • hahn_series
  • elementwise types:
    • locally_constant
    • pi
    • prod
    • finsupp

The changes here aim to be the uncontroversial part of #6591

Open in Gitpod

They key changes here are the introduction of the following:
  * `non_unital_non_assoc_semiring`
  * `non_unital_semiring`
  * `non_assoc_semiring`

The goal is to use these to support a non-unital, non-associative
algebras.
@bryangingechen bryangingechen added the awaiting-review The author would like community review of the PR label Mar 20, 2021
@semorrison semorrison 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 Mar 20, 2021
I decided to make one last attempt at this. Let's see if it builds.
I _pray_ that this doesn't send me down another rabbit hole of failed builds.
@ocfnash ocfnash 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 Mar 21, 2021
@semorrison
Copy link
Collaborator

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 Mar 22, 2021
@eric-wieser
Copy link
Member

CI looks happy now - I'll look over this once more tomorrow, but i think it's ready to go

@semorrison semorrison 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 Jun 2, 2021
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jun 2, 2021
This isn't a complete generalization of all lemmas, but at least puts the instances in place
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jun 2, 2021
Comment on lines 318 to 332
section domain
variables {Γ' : Type*} [partial_order Γ']

lemma emb_domain_add (f : Γ ↪o Γ') (x y : hahn_series Γ R) :
emb_domain f (x + y) = emb_domain f x + emb_domain f y :=
begin
ext g,
by_cases hg : g ∈ set.range f,
{ obtain ⟨a, rfl⟩ := hg,
simp },
{ simp [emb_domain_notin_range, hg] }
end

end domain

Copy link
Member

Choose a reason for hiding this comment

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

This change is #7802, which is probably worth merging first just to keep the history manageable

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

CI needs to run again, but I think I cleaned up all the distrib instances that can now be non_unital_non_assoc_semiring instances.

@eric-wieser eric-wieser added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 2, 2021
@github-actions github-actions bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 2, 2021
@eric-wieser eric-wieser added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 3, 2021
@github-actions github-actions bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 3, 2021
@@ -77,7 +77,9 @@ begin
refine s.induction_on _ _,
{ simp },
{ assume a s ih,
simp [ih, add_mul, mul_comm, mul_left_comm, mul_assoc, sum_map_mul_left.symm],
have := @sum_map_mul_left α β _,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
have := @sum_map_mul_left α β _,

@jcommelin
Copy link
Member

Great accomplishment!

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 Jun 7, 2021
bors bot pushed a commit that referenced this pull request Jun 7, 2021
…6786)

This introduces the following typeclasses beneath `semiring`:
  * `non_unital_non_assoc_semiring`
  * `non_unital_semiring`
  * `non_assoc_semiring`

The goal is to use these to support a non-unital, non-associative
algebras.

The typeclass requirements of `subring`, `subsemiring`, and `ring_hom` are relaxed from `semiring` to `non_assoc_semiring`.

Instances of these new typeclasses are added for:
* alias types:
  * `opposite`
  * `ulift`
* convolutive types:
  * `(add_)monoid_algebra`
  * `direct_sum`
  * `set_semiring`
  * `hahn_series`
* elementwise types: 
  * `locally_constant`
  * `pi`
  * `prod`
  * `finsupp`



Co-authored-by: Gabriel Ebner <gebner@gebner.org>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@bors
Copy link

bors bot commented Jun 7, 2021

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Jun 7, 2021
…6786)

This introduces the following typeclasses beneath `semiring`:
  * `non_unital_non_assoc_semiring`
  * `non_unital_semiring`
  * `non_assoc_semiring`

The goal is to use these to support a non-unital, non-associative
algebras.

The typeclass requirements of `subring`, `subsemiring`, and `ring_hom` are relaxed from `semiring` to `non_assoc_semiring`.

Instances of these new typeclasses are added for:
* alias types:
  * `opposite`
  * `ulift`
* convolutive types:
  * `(add_)monoid_algebra`
  * `direct_sum`
  * `set_semiring`
  * `hahn_series`
* elementwise types: 
  * `locally_constant`
  * `pi`
  * `prod`
  * `finsupp`



Co-authored-by: Gabriel Ebner <gebner@gebner.org>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@eric-wieser
Copy link
Member

If this fails again it will probably do so in half an hour - we should punt this off the queue at that point, since the likelihood of it being the cause is high.

@bors
Copy link

bors bot commented Jun 7, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(algebra/ring/basic): define non-unital, non-associative rings [Merged by Bors] - feat(algebra/ring/basic): define non-unital, non-associative rings Jun 7, 2021
@bors bors bot closed this Jun 7, 2021
@bors bors bot deleted the non_unital_assoc_rings branch June 7, 2021 20:55
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

7 participants