-
Notifications
You must be signed in to change notification settings - Fork 892
[Merged by Bors] - feat: NNRat.cast
#11203
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YaelDillies
commented
Mar 6, 2024
eric-wieser
reviewed
Mar 8, 2024
11 tasks
eric-wieser
reviewed
Mar 9, 2024
This was referenced Mar 18, 2024
YaelDillies
added a commit
that referenced
this pull request
Mar 19, 2024
…atCast` Reduce the diff of #11203
3 tasks
YaelDillies
added a commit
that referenced
this pull request
Mar 19, 2024
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
This was referenced Mar 19, 2024
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
eric-wieser
reviewed
Apr 22, 2024
YaelDillies
added a commit
that referenced
this pull request
Apr 23, 2024
This is the parts of the diff of #11203 which don't mention `NNRat.cast`. * Use more `where` notation. * Write `qsmul := _` instead of `qsmul := qsmulRec _`. * Move `qsmul` before `ratCast_def` in instance declarations. * Name more instances. * Rename `rat_smul` to `qsmul`. *
mathlib-bors bot
pushed a commit
that referenced
this pull request
Apr 23, 2024
This is the parts of the diff of #11203 which don't mention `NNRat.cast`. * Use more `where` notation. * Write `qsmul := _` instead of `qsmul := qsmulRec _` to make the instances more robust to definition changes. * Delete `qsmulRec`. * Move `qsmul` before `ratCast_def` in instance declarations. * Name more instances. * Rename `rat_smul` to `qsmul`.
Collaborator
Ruben-VandeVelde
approved these changes
Apr 23, 2024
Collaborator
Ruben-VandeVelde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine, assuming this is a change we want.
maintainer merge
|
🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde. |
Contributor
|
Pull request successfully merged into master. Build succeeded: |
NNRat.castNNRat.cast
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
Jun2M
pushed a commit
that referenced
this pull request
Apr 24, 2024
This is the parts of the diff of #11203 which don't mention `NNRat.cast`. * Use more `where` notation. * Write `qsmul := _` instead of `qsmul := qsmulRec _` to make the instances more robust to definition changes. * Delete `qsmulRec`. * Move `qsmul` before `ratCast_def` in instance declarations. * Name more instances. * Rename `rat_smul` to `qsmul`.
Jun2M
pushed a commit
that referenced
this pull request
Apr 24, 2024
callesonne
pushed a commit
that referenced
this pull request
May 16, 2024
This is the parts of the diff of #11203 which don't mention `NNRat.cast`. * Use more `where` notation. * Write `qsmul := _` instead of `qsmul := qsmulRec _` to make the instances more robust to definition changes. * Delete `qsmulRec`. * Move `qsmul` before `ratCast_def` in instance declarations. * Name more instances. * Rename `rat_smul` to `qsmul`.
callesonne
pushed a commit
that referenced
this pull request
May 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
maintainer-merge
A reviewer has approved the changed; awaiting maintainer approval.
t-algebra
Algebra (groups, rings, fields, etc)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Define the canonical coercion from the nonnegative rationals to any division semiring.
From LeanAPAP
GroupWithZero#11202MulOpposite/AddOpposite#11485nat_cast/int_cast/rat_casttonatCast/intCast/ratCast#11486coe_nat/coe_int/coe_rattonatCast/intCast/ratCast#11499pow_lt_pow_succtoAlgebra.Order.WithZero#11507Field's fields docstrings #11508Ratinternals in the definition ofField#11639NNRat.cast#12360