Skip to content

[Merged by Bors] - refactor(Rat): Streamline basic theory#11504

Closed
YaelDillies wants to merge 33 commits intomasterfrom
streamline_rat
Closed

[Merged by Bors] - refactor(Rat): Streamline basic theory#11504
YaelDillies wants to merge 33 commits intomasterfrom
streamline_rat

Conversation

@YaelDillies
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies commented Mar 19, 2024

Rat has a long history in (and before) mathlib and as such its development is full of cruft. Now that NNRat is a thing, there is a need for the theory of Rat to be mimickable to yield the theory of NNRat, which is not currently the case.

Broadly, this PR aims at mirroring the Rat and NNRat declarations. It achieves this by:

  • Relying more on Rat.num and Rat.den, and less on the structure representation of Rat
  • Abandoning the vestigial Rat.Nonneg (which was replaced in Std by a new development of the order on Rat)
  • Renaming many Rat lemmas with dubious names. This creates quite a lot of conflicts with Std lemmas, whose names are themselves dubious. I am priming the relevant new mathlib names and leaving TODOs to fix the Std names.
  • Handling most of the Rat porting notes

Reduce the diff of #11203


Open in Gitpod

These lemmas are needed to define the semifield structure on `NNRat`, hence I am repurposing `Algebra.Order.Field.Defs` from avoiding a timeout (which I believe was solved long ago) to avoiding to import random stuff in the definition of the semifield structure on `NNRat` (although this PR doesn't actually reduce imports there, it will be in a later PR).

Reduce the diff of #11203
`Rat` has a long history in (and before) mathlib and as such its development is full of cruft. Now that `NNRat` is a thing, there is a need for the theory of `Rat` to be mimickable to yield the theory of `NNRat`, which is not currently the case.

Broadly, this PR aims at mirroring the `Rat` and `NNRat` declarations. It achieves this by:
* Relying more on `Rat.num` and `Rat.den`, and less on the structure representation of `Rat`
* Abandoning the vestigial `Rat.Nonneg` (which was replaced in Std by a new development of the order on `Rat`)
* Renaming many `Rat` lemmas with dubious names. This creates quite a lot of conflicts with Std lemmas, whose names are themselves dubious. I am priming the relevant new mathlib names and leaving TODOs to fix the Std names.
* Handling most of the `Rat` porting notes
@YaelDillies YaelDillies added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) 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) t-order Order theory labels Mar 19, 2024
YaelDillies and others added 2 commits March 19, 2024 15:34
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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 Mar 19, 2024
@YaelDillies YaelDillies changed the base branch from move_inv_nonneg to master March 19, 2024 15:55
These lemmas can be defined earlier, ridding us of an import in `Algebra.GroupPower.Order`
@YaelDillies YaelDillies removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Mar 19, 2024
@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 Mar 19, 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 Mar 19, 2024
@ghost ghost removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Mar 20, 2024
@ghost
Copy link
Copy Markdown

ghost commented Mar 20, 2024

@ghost ghost added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Apr 6, 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 Apr 6, 2024
@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 Apr 7, 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 Apr 7, 2024
@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 Apr 7, 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 Apr 14, 2024
Copy link
Copy Markdown
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.

LGTM

bors d+


/-!
# Notation for the rational numbers -/
# Definition of the rational numbers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well... It's not really defined in this file...
Is this title strictly better than the old one?

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Apr 15, 2024

✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Apr 15, 2024
@YaelDillies
Copy link
Copy Markdown
Contributor Author

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Apr 15, 2024
`Rat` has a long history in (and before) mathlib and as such its development is full of cruft. Now that `NNRat` is a thing, there is a need for the theory of `Rat` to be mimickable to yield the theory of `NNRat`, which is not currently the case.

Broadly, this PR aims at mirroring the `Rat` and `NNRat` declarations. It achieves this by:
* Relying more on `Rat.num` and `Rat.den`, and less on the structure representation of `Rat`
* Abandoning the vestigial `Rat.Nonneg` (which was replaced in Std by a new development of the order on `Rat`)
* Renaming many `Rat` lemmas with dubious names. This creates quite a lot of conflicts with Std lemmas, whose names are themselves dubious. I am priming the relevant new mathlib names and leaving TODOs to fix the Std names.
* Handling most of the `Rat` porting notes

Reduce the diff of #11203
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Apr 15, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title refactor(Rat): Streamline basic theory [Merged by Bors] - refactor(Rat): Streamline basic theory Apr 15, 2024
@mathlib-bors mathlib-bors bot closed this Apr 15, 2024
@mathlib-bors mathlib-bors bot deleted the streamline_rat branch April 15, 2024 15:25
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
`Rat` has a long history in (and before) mathlib and as such its development is full of cruft. Now that `NNRat` is a thing, there is a need for the theory of `Rat` to be mimickable to yield the theory of `NNRat`, which is not currently the case.

Broadly, this PR aims at mirroring the `Rat` and `NNRat` declarations. It achieves this by:
* Relying more on `Rat.num` and `Rat.den`, and less on the structure representation of `Rat`
* Abandoning the vestigial `Rat.Nonneg` (which was replaced in Std by a new development of the order on `Rat`)
* Renaming many `Rat` lemmas with dubious names. This creates quite a lot of conflicts with Std lemmas, whose names are themselves dubious. I am priming the relevant new mathlib names and leaving TODOs to fix the Std names.
* Handling most of the `Rat` porting notes

Reduce the diff of #11203
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
`Rat` has a long history in (and before) mathlib and as such its development is full of cruft. Now that `NNRat` is a thing, there is a need for the theory of `Rat` to be mimickable to yield the theory of `NNRat`, which is not currently the case.

Broadly, this PR aims at mirroring the `Rat` and `NNRat` declarations. It achieves this by:
* Relying more on `Rat.num` and `Rat.den`, and less on the structure representation of `Rat`
* Abandoning the vestigial `Rat.Nonneg` (which was replaced in Std by a new development of the order on `Rat`)
* Renaming many `Rat` lemmas with dubious names. This creates quite a lot of conflicts with Std lemmas, whose names are themselves dubious. I am priming the relevant new mathlib names and leaving TODOs to fix the Std names.
* Handling most of the `Rat` porting notes

Reduce the diff of #11203
callesonne pushed a commit that referenced this pull request Apr 22, 2024
`Rat` has a long history in (and before) mathlib and as such its development is full of cruft. Now that `NNRat` is a thing, there is a need for the theory of `Rat` to be mimickable to yield the theory of `NNRat`, which is not currently the case.

Broadly, this PR aims at mirroring the `Rat` and `NNRat` declarations. It achieves this by:
* Relying more on `Rat.num` and `Rat.den`, and less on the structure representation of `Rat`
* Abandoning the vestigial `Rat.Nonneg` (which was replaced in Std by a new development of the order on `Rat`)
* Renaming many `Rat` lemmas with dubious names. This creates quite a lot of conflicts with Std lemmas, whose names are themselves dubious. I am priming the relevant new mathlib names and leaving TODOs to fix the Std names.
* Handling most of the `Rat` porting notes

Reduce the diff of #11203
Jun2M pushed a commit that referenced this pull request Apr 24, 2024
`Rat` has a long history in (and before) mathlib and as such its development is full of cruft. Now that `NNRat` is a thing, there is a need for the theory of `Rat` to be mimickable to yield the theory of `NNRat`, which is not currently the case.

Broadly, this PR aims at mirroring the `Rat` and `NNRat` declarations. It achieves this by:
* Relying more on `Rat.num` and `Rat.den`, and less on the structure representation of `Rat`
* Abandoning the vestigial `Rat.Nonneg` (which was replaced in Std by a new development of the order on `Rat`)
* Renaming many `Rat` lemmas with dubious names. This creates quite a lot of conflicts with Std lemmas, whose names are themselves dubious. I am priming the relevant new mathlib names and leaving TODOs to fix the Std names.
* Handling most of the `Rat` porting notes

Reduce the diff of #11203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-algebra Algebra (groups, rings, fields, etc) t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants