Skip to content

Conversation

@YaelDillies YaelDillies added WIP Work in progress blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) t-algebra Algebra (groups, rings, fields, etc) labels Mar 6, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Mar 7, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot 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 8, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot 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 8, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot 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 Mar 9, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added blocked-by-other-PR This PR depends on another PR (this label is automatically 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 Mar 17, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Mar 18, 2024
YaelDillies added a commit that referenced this pull request Mar 18, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Mar 18, 2024
YaelDillies added a commit that referenced this pull request Mar 19, 2024
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
YaelDillies added a commit that referenced this pull request 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
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot 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 22, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot 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 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`.
*
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 23, 2024
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`.
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 23, 2024
Copy link
Collaborator

@Ruben-VandeVelde Ruben-VandeVelde left a 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

@github-actions
Copy link

🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Apr 23, 2024
mathlib-bors bot pushed a commit that referenced this pull request Apr 23, 2024
Define the canonical coercion from the nonnegative rationals to any division semiring.

From LeanAPAP
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Apr 24, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: NNRat.cast [Merged by Bors] - feat: NNRat.cast Apr 24, 2024
@mathlib-bors mathlib-bors bot closed this Apr 24, 2024
@mathlib-bors mathlib-bors bot deleted the nnrat_cast branch April 24, 2024 00:10
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
Define the canonical coercion from the nonnegative rationals to any division semiring.

From LeanAPAP
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
Define the canonical coercion from the nonnegative rationals to any division semiring.

From LeanAPAP
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants