Skip to content

[Merged by Bors] - chore: Move power lemmas earlier#12736

Closed
YaelDillies wants to merge 5 commits intomasterfrom
move_pow_two
Closed

[Merged by Bors] - chore: Move power lemmas earlier#12736
YaelDillies wants to merge 5 commits intomasterfrom
move_pow_two

Conversation

@YaelDillies
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies commented May 7, 2024

Move a bunch of pow lemmas from Algebra.Group.Commute.Defs and Algebra.GroupPower.Basic to Algebra.Group.Defs and Algebra.Group.Basic with little to no changes to their proofs.


I would like some opinions on what should go in Algebra.Group.Defs vs Algebra.Group.Basic.

Open in Gitpod

Move a bunch of `pow` lemmas from `Algebra.Group.Commute.Defs` and `Algebra.GroupPower.Basic` to `Algebra.Group.Defs` and `Algebra.Group.Basic` with little to no changes to their proofs.
@YaelDillies YaelDillies added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. t-algebra Algebra (groups, rings, fields, etc) labels May 7, 2024
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label May 7, 2024
Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

So if I have it right, the split is essentially:

  • lemmas about pow and monoid operations go to Defs
  • lemmas about zpow or group operations go to Basic

? I suppose that is as good a criterion as any.

Again I'm not convinced that making a huge Group.Basic / Group.Defs file is the best way to go but I agree that moving the power lemmas upstream is a good idea. So I'm still willing to be convinced. Is the reason that you want to put these lemmas there because that ensures everyone imports them, or something else?

@Vierkantor Vierkantor added awaiting-author A reviewer has asked the author a question or requested changes. and removed awaiting-review labels May 8, 2024
@YaelDillies
Copy link
Copy Markdown
Contributor Author

YaelDillies commented May 8, 2024

So if I have it right, the split is essentially:

  • lemmas about pow and monoid operations go to Defs
  • lemmas about zpow or group operations go to Basic

? I suppose that is as good a criterion as any.

I don't really think that's true. If anything, the pow/zpow split is a result of zpow lemmas generally being harder to prove than their pow counterpart and are less "foundational" (in that they show up in fewer proofs of basic stuff, in particular default structure fields and forgetful inheritance instances). The actual way I did the split was to put in Defs results that looked like existing lemmas from Defs so long as they didn't require lemmas in Basic, and the rest went to Basic. I'm not super happy with the reasoning, but rearranging Defs and Basic is probably a job for another PR.

Is the reason that you want to put these lemmas there because that ensures everyone imports them, or something else?

Basically yes. More precisely, I want mul and pow to be on an equal footing import-wise because they mathematically are and because the current situation pushes people to consider pow to be a more advanced concept and reflect that in their file structure further downstream: See all the files called Power and the folder Algebra.GroupPower. For now, I am waging war against the latter, because it is the mother of almost all import oddities I have found in the past two months, eg what I am fixing in #11863 or the import that @grunweg tried removing in #12714.

I'm not convinced that making a huge Group.Basic / Group.Defs file is the best way to go

To me, that's a second-order problem. Once we have put mul and pow on an equal footing import-wise, we can think about stratifying the files about them, but not along the mul vs pow axis. I don't have a specific suggestion there, but that thread gave a few ideas. All I want is for this brain-storming to happen after I have annihilated Algebra.GroupPower, so that we don't overfit the file structure to a powerless library.

@YaelDillies YaelDillies added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes. labels May 8, 2024
YaelDillies added a commit that referenced this pull request May 11, 2024
After #12736, `powMonoidHom` and `zpowGroupHom` can move to `Algebra.Group.Hom.Basic` at no cost. This PR moves them and deletes the now empty `Algebra.GroupPower.Hom`.
YaelDillies added a commit that referenced this pull request May 11, 2024
After #12736, all lemmas in `Algebra.GroupWithZero.Power` can move to the earlier files where they belong. The changes to their proofs are minimal. It's just a matter of using the new Lean 4 `Nat`- and `Int`-specific lemmas instead of the generic algebraic order ones.
Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Alright. Your follow-up PRs have convinced me this is a good idea overall (although I hope that cleaning up Group.Defs and Group.Basic isn't an empty idea!)

bors r+

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels May 13, 2024
mathlib-bors bot pushed a commit that referenced this pull request May 13, 2024
Move a bunch of `pow` lemmas from `Algebra.Group.Commute.Defs` and `Algebra.GroupPower.Basic` to `Algebra.Group.Defs` and `Algebra.Group.Basic` with little to no changes to their proofs.
@YaelDillies YaelDillies removed the request for review from Ruben-VandeVelde May 13, 2024 10:03
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented May 13, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: Move power lemmas earlier [Merged by Bors] - chore: Move power lemmas earlier May 13, 2024
@mathlib-bors mathlib-bors bot closed this May 13, 2024
@mathlib-bors mathlib-bors bot deleted the move_pow_two branch May 13, 2024 11:07
mathlib-bors bot pushed a commit that referenced this pull request May 13, 2024
After #12736, all lemmas in `Algebra.GroupWithZero.Power` can move to the earlier files where they belong. The changes to their proofs are minimal. It's just a matter of using the new Lean 4 `Nat`- and `Int`-specific lemmas instead of the generic algebraic order ones.
mathlib-bors bot pushed a commit that referenced this pull request May 13, 2024
After #12736, `powMonoidHom` and `zpowGroupHom` can move to `Algebra.Group.Hom.Basic` at no cost. This PR moves them and deletes the now empty `Algebra.GroupPower.Hom`.
callesonne pushed a commit that referenced this pull request May 16, 2024
Move a bunch of `pow` lemmas from `Algebra.Group.Commute.Defs` and `Algebra.GroupPower.Basic` to `Algebra.Group.Defs` and `Algebra.Group.Basic` with little to no changes to their proofs.
callesonne pushed a commit that referenced this pull request May 16, 2024
After #12736, all lemmas in `Algebra.GroupWithZero.Power` can move to the earlier files where they belong. The changes to their proofs are minimal. It's just a matter of using the new Lean 4 `Nat`- and `Int`-specific lemmas instead of the generic algebraic order ones.
callesonne pushed a commit that referenced this pull request May 16, 2024
After #12736, `powMonoidHom` and `zpowGroupHom` can move to `Algebra.Group.Hom.Basic` at no cost. This PR moves them and deletes the now empty `Algebra.GroupPower.Hom`.
grunweg pushed a commit that referenced this pull request May 17, 2024
Move a bunch of `pow` lemmas from `Algebra.Group.Commute.Defs` and `Algebra.GroupPower.Basic` to `Algebra.Group.Defs` and `Algebra.Group.Basic` with little to no changes to their proofs.
grunweg pushed a commit that referenced this pull request May 17, 2024
After #12736, all lemmas in `Algebra.GroupWithZero.Power` can move to the earlier files where they belong. The changes to their proofs are minimal. It's just a matter of using the new Lean 4 `Nat`- and `Int`-specific lemmas instead of the generic algebraic order ones.
grunweg pushed a commit that referenced this pull request May 17, 2024
After #12736, `powMonoidHom` and `zpowGroupHom` can move to `Algebra.Group.Hom.Basic` at no cost. This PR moves them and deletes the now empty `Algebra.GroupPower.Hom`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants