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

feat(algebra): commuting elements #1089

Merged
merged 41 commits into from
Oct 4, 2019

Conversation

NeilStrickland
Copy link
Contributor

@NeilStrickland NeilStrickland commented May 28, 2019

  1. Add basic theory of commuting pairs of elements in not-necessarily-commutative monoids, groups and rings.
  2. Generalise binomial theorem and (a * b) ^ n = a ^ n * b ^ n to this context.
  3. Prove geometric sum formula for a ^ n - b ^ n when a and b commute. (Previously we only had this for b = 1.) Refactor uses of the b = 1 case slightly.
  4. Move the above result out of big_operators.lean to geom_sum.lean, to avoid issues with order of imports.

Note: a few days ago I submitted a PR dealing with various properties of elements in commutative rings. It was suggested that some parts should be generalised to the noncommutative case. I closed that PR because of some git-related problems, but will resubmit it latter in smaller chunks. This PR is intended to support the requested generalisation.

@NeilStrickland NeilStrickland requested a review from a team as a code owner May 28, 2019 11:59
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.

Some minor comments. I haven't read the long proofs yet.

src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/geom_sum.lean Outdated Show resolved Hide resolved
src/algebra/geom_sum.lean Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
@urkud
Copy link
Member

urkud commented Jun 9, 2019

Hi,
I want to have this PR finalized and merged. I'm going to use it for End ℝ in formalization of rotation numbers. Can I help somehow?

src/algebra/big_operators.lean Outdated Show resolved Hide resolved
src/algebra/big_operators.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
@semorrison
Copy link
Collaborator

Where are up to with this PR?

(Neil, if you click the "resolve conversation" button as well as (or even instead of) saying "Done", it's easier for later reviewers to see the status. I've gone through and clicked resolve on a bunch.)

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.

I think this is almost ready to go. Some minor changes suggested.

src/algebra/big_operators.lean Outdated Show resolved Hide resolved
src/data/nat/choose.lean Outdated Show resolved Hide resolved
Copy link
Member

@ChrisHughes24 ChrisHughes24 left a comment

Choose a reason for hiding this comment

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

A few minor changes

src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
@robertylewis robertylewis added the needs-documentation This PR is missing required documentation label Jul 25, 2019
src/algebra/commute.lean Outdated Show resolved Hide resolved
@urkud
Copy link
Member

urkud commented Sep 28, 2019

@jcommelin @ChrisHughes24 I reordered theorems to avoid repeating ourselves, and added lemmas like commute.smul and commute.gsmul.

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.

@robertylewis All the defs now have a docstring, as does the binomial theorem. All the other lemmas are trivialities. I don't think we should require all of those to have a docstring as well, do we?

src/data/nat/choose.lean Show resolved Hide resolved
Copy link
Member

@robertylewis robertylewis left a comment

Choose a reason for hiding this comment

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

All the other lemmas are trivialities. I don't think we should require all of those to have a docstring as well, do we?

The guidelines we came up with say that all defs and "important" lemmas should have doc strings.

src/algebra/geom_sum.lean Show resolved Hide resolved
@urkud urkud removed the needs-documentation This PR is missing required documentation label Oct 1, 2019
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
src/algebra/commute.lean Outdated Show resolved Hide resolved
@ChrisHughes24 ChrisHughes24 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-author A reviewer has asked the author a question or requested changes labels Oct 4, 2019
@mergify mergify bot merged commit 494132e into leanprover-community:master Oct 4, 2019
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
* Not sure how this works

* Small refactor of geometric sums

* Properties of commuting elements

* Geometric sums moved to geom_sum.lean

* Geometric sums, two commuting variables

* Import geom_sum.lean

* Cover commuting elements of noncommutative rings

* Whitespace

* Add file headers

* Delete stray file

* Sum/prod over range 0, range 1

* Add simp lemmas

* Various changes from PR review

* Add semigroup case

* Changes from PR review

* Corrected all_commute to commute.all

* Minor changes from PR review

* Change line endings back to unix

* `@[to_additive]` can't be a `local attribute`

* Rename `add_pow_comm` to `add_pow_of_commute` as suggested by @jcommelin

* Add a few missing instances

* DRY

* Notation for `gsmul` should go into `add_group`, not `group`

* Prove `gsmul_one`

* Reorder `algebra/commute`, add more lemmas

* Add docs, rename `geom_sum₂_mul_add_comm` to `commute.geom_sum₂_mul_add`.

* Rename, add a docstring

* Fix a typo spotted by @ChrisHughes24

* Move common args to `variables`

* Rename `commute.mul` to `commute.mul_right` etc.

* Add some `@[simp]` attributes.

* More `@[simp]`

* Add some `_iff` versions
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