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/euclidean_domain): Unify occurences of div_add_mod and mod_add_div #5884

Closed
wants to merge 11 commits into from

Conversation

Julian-Kuelshammer
Copy link
Collaborator

@Julian-Kuelshammer Julian-Kuelshammer commented Jan 25, 2021

Adding the corresponding commutative version at several places (euclidean domain, nat, pnat, int) whenever there is the other version.

In subsequent PRs other proofs in the library which now use some version of add_comm, exact div_add_mod or add_comm, exact mod_add_div should be golfed.

Trying to address issue #1534


@Julian-Kuelshammer Julian-Kuelshammer added the WIP Work in progress label Jan 25, 2021
… for int, but not for pnat because of some coercion
@shingtaklam1324
Copy link
Collaborator

Are a % b + (a / b) * b and (a / b) * b + a % b = a in mathlib? If not they might be worth adding as well.

@Julian-Kuelshammer
Copy link
Collaborator Author

Are a % b + (a / b) * b and (a / b) * b + a % b = a in mathlib? If not they might be worth adding as well.

They are not, see the issue. Do you have a suggestion for a better name than just 'priming' everything?

@eric-wieser
Copy link
Member

eric-wieser commented Jan 25, 2021

Do you have a suggestion for a better name than just 'priming' everything?

Add in the word mul to indicate the order

  • mul_div_add_mod
  • div_mul_add_mod
  • mod_add_mul_div
  • mod_add_div_mul

@Julian-Kuelshammer
Copy link
Collaborator Author

I suggest to leave the PR like that and do the potential other two versions, potential renaming, and golfing of proofs for other PRs as it is always very slow to edit such basic files as nat and int.

@Julian-Kuelshammer Julian-Kuelshammer added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Jan 26, 2021
src/data/pnat/basic.lean Outdated Show resolved Hide resolved
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
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 Jan 27, 2021
bors bot pushed a commit that referenced this pull request Jan 27, 2021
…od_add_div (#5884)

Adding the corresponding commutative version at several places (euclidean domain, nat, pnat, int) whenever there is the other version. 

In subsequent PRs other proofs in the library which now use some version of `add_comm, exact div_add_mod` or `add_comm, exact mod_add_div` should be golfed.

Trying to address issue #1534



Co-authored-by: Julian-Kuelshammer <68201724+Julian-Kuelshammer@users.noreply.github.com>
@bors
Copy link

bors bot commented Jan 27, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(algebra/euclidean_domain): Unify occurences of div_add_mod and mod_add_div [Merged by Bors] - feat(algebra/euclidean_domain): Unify occurences of div_add_mod and mod_add_div Jan 27, 2021
@bors bors bot closed this Jan 27, 2021
@bors bors bot deleted the div_add_mod branch January 27, 2021 12:13
b-mehta pushed a commit that referenced this pull request Apr 2, 2021
…od_add_div (#5884)

Adding the corresponding commutative version at several places (euclidean domain, nat, pnat, int) whenever there is the other version. 

In subsequent PRs other proofs in the library which now use some version of `add_comm, exact div_add_mod` or `add_comm, exact mod_add_div` should be golfed.

Trying to address issue #1534



Co-authored-by: Julian-Kuelshammer <68201724+Julian-Kuelshammer@users.noreply.github.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

4 participants