Skip to content

[Merged by Bors] - refactor: Delete Algebra.GroupPower.Lemmas #9411

Closed
YaelDillies wants to merge 30 commits intomasterfrom
kill_algebra_group_power_lemmas
Closed

[Merged by Bors] - refactor: Delete Algebra.GroupPower.Lemmas #9411
YaelDillies wants to merge 30 commits intomasterfrom
kill_algebra_group_power_lemmas

Conversation

@YaelDillies
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies commented Jan 3, 2024

Algebra.GroupPower.Lemmas used to be a big bag of lemmas that made it there on the criterion that they needed "more imports". This was completely untrue, as all lemmas could be moved to earlier files in PRs:

There are several reasons for this:

  • Necessary lemmas have been moved to earlier files since lemmas were dumped in Algebra.GroupPower.Lemmas
  • In the Lean 3 → Lean 4 transition, Std acquired basic Int and Nat lemmas which let us shortcircuit the part of the algebraic order hierarchy on which the corresponding general lemmas rest
  • Some proofs were overpowered
  • Some earlier files were tangled and I have untangled them

This PR finishes the job by moving the last few lemmas out of Algebra.GroupPower.Lemmas, which is therefore deleted.


Open in Gitpod

@YaelDillies YaelDillies added WIP Work in progress t-algebra Algebra (groups, rings, fields, etc) t-order Order theory labels Jan 3, 2024
YaelDillies and others added 2 commits January 3, 2024 16:42
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@ericrbg
Copy link
Copy Markdown
Contributor

ericrbg commented Jan 3, 2024

Can you put some comments / split up commits to make this reviewable when it is done? What is the motivation?

@PatrickMassot
Copy link
Copy Markdown
Member

I guess this PR requires a huge changelog in the commit message.

@YaelDillies
Copy link
Copy Markdown
Contributor Author

Yes, sorry. I can't do anything more before overmorrow, so I've put the PR out to have a big scary diff to point people to when they want to add lemmas and for @alexjbest to try out Leaff.

I will split off PRs and write some prose in the description in due time.

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 3, 2024
YaelDillies added a commit that referenced this pull request Jan 4, 2024
These lemmas aren't really proved any faster using units, and I will soon need them not to be proved using units.

Part of #9411
YaelDillies added a commit that referenced this pull request Jan 4, 2024
These lemmas can actually be proved much earlier than they were.

Part of #9411
YaelDillies added a commit that referenced this pull request Jan 4, 2024
`Data.Int.Basic` is currently made of two things:
* Basic lemmas that continue the theory in Std (and could belong there, really)
* Basic algebraic order instances

I need the first ones earlier in the algebraic order hierarchy, hence the split.

Part of #9411
mathlib-bors bot pushed a commit that referenced this pull request Jan 4, 2024
These lemmas aren't really proved any faster using units, and I will soon need them not to be proved using units.

Part of #9411
mathlib-bors bot pushed a commit that referenced this pull request Jan 4, 2024
These lemmas can actually be proved much earlier than they were.

Part of #9411
YaelDillies added a commit that referenced this pull request Jan 5, 2024
YaelDillies added a commit that referenced this pull request Jan 5, 2024
The first versions for ordered semirings do not need to import so much but:
* they have no obvious place to go
* nobody needs them that early (in particular, it seems nobody needs them without also needing the ordered field version)

Part of #9411
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 5, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 14, 2024
YaelDillies added a commit that referenced this pull request Jan 14, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jan 16, 2024
This allows more files to not depend on `Algebra.GroupPower.Lemmas`, which will soon stop existing.

Part of #9411
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 16, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 16, 2024
linesthatinterlace pushed a commit that referenced this pull request Jan 16, 2024
The current design for `abs` is flawed:
* The `Abs` notation typeclass has exactly two instances: one for `[Neg α] [Sup α]`, one for `[Inv α] [Sup α]`. This means that:
  * We can't write a meaningful hover for `Abs.abs`
  * Fields have two `Abs` instances!
* We have the multiplicative definition but:
  * All the lemmas in `Algebra.Order.Group.Abs` are about the additive version.
  * The only lemmas about the multiplicative version are in `Algebra.Order.Group.PosPart`, and they get additivised to duplicates of the lemmas in `Algebra.Order.Group.Abs`!

This PR changes the notation typeclass with two new definitions (related through `to_additive`): `mabs` and `abs`. `abs` inherits the `|a|` notation and `mabs` gets `|a|ₘ` instead.

The first half of `Algebra.Order.Group.Abs` gets multiplicativised. A later PR will multiplicativise the second half,  and another one will deduplicate the lemmas in `Algebra.Order.Group.PosPart`.

Part of #9411.




Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
mathlib-bors bot pushed a commit that referenced this pull request Jan 16, 2024
These lemmas can be proved much earlier with little to no change to their proofs.

Part of #9411
mathlib-bors bot pushed a commit that referenced this pull request Jan 16, 2024
This changes the typeclass notation approach with plain functions.

Followup to #9553. Part of #9411
@ghost ghost removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jan 16, 2024
YaelDillies added a commit that referenced this pull request Jan 17, 2024
These lemmas can be proved earlier.

Part of #9411
YaelDillies added a commit that referenced this pull request Jan 17, 2024
These can be defined earlier for free.

Part of #9411
@ghost ghost added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jan 17, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jan 18, 2024
These lemmas can be proved earlier.

Part of #9411




Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 18, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jan 20, 2024
These can be defined earlier for free.

Part of #9411
@ghost
Copy link
Copy Markdown

ghost commented Jan 20, 2024

This PR/issue depends on:

@jcommelin
Copy link
Copy Markdown
Member

Thanks 🎉

bors merge

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 30, 2024

Build failed (retrying...):

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 30, 2024

Pull request successfully merged into master.

Build succeeded:

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) t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants