Skip to content

[Merged by Bors] - feat: IsROrC.toStarOrderedRing as a scoped instance#6391

Closed
eric-wieser wants to merge 28 commits intomasterfrom
eric-wieser/IsROrC.toStarOrderedRing-no-instance
Closed

[Merged by Bors] - feat: IsROrC.toStarOrderedRing as a scoped instance#6391
eric-wieser wants to merge 28 commits intomasterfrom
eric-wieser/IsROrC.toStarOrderedRing-no-instance

Conversation

@eric-wieser
Copy link
Copy Markdown
Member

@eric-wieser eric-wieser commented Aug 5, 2023

With open scoped ComplexOrder, we current have StarOrderedRing Complex (as well as some other order instances).
With this PR, that scope puts the same order on K where IsROrC K.

There is an ongoing discussion about whether opening the scope should be required, but there is no need to address that concern simultaneously with improving behavior when the scope is already open. There also seems to be fewer downstream instance resolution issues to resolve by leaving it in the scope.


Open in Gitpod

This is a more conservative version of #6210, which does not simultaneously remove the ComplexOrder scope.

@eric-wieser eric-wieser added awaiting-author A reviewer has asked the author a question or requested changes. awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels Aug 5, 2023
@kim-em kim-em added the t-analysis Analysis (normed *, calculus) label Aug 6, 2023
@eric-wieser eric-wieser force-pushed the eric-wieser/IsROrC.toStarOrderedRing-no-instance branch from 8b6cd49 to d044d2e Compare August 6, 2023 08:45
@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 Aug 6, 2023
@eric-wieser eric-wieser added awaiting-review t-algebra Algebra (groups, rings, fields, etc) and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Aug 6, 2023
@eric-wieser eric-wieser requested a review from j-loreaux August 7, 2023 12:41
Copy link
Copy Markdown
Contributor

@j-loreaux j-loreaux left a comment

Choose a reason for hiding this comment

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

I'm content with this while we decide whether we want a globally available partial order on .

However, please add a docstring to the StarOrderedRing ℝ instance in Mathlib.Data.Real.Sqrt saying that it exists separate from the IsROrC instance because that one is blocked behind the ComplexOrder scope and we want it to be availble globally.

namespace IsROrC

open scoped ComplexOrder in
/-- Note this is only an instance with `open scoped ComplexOrder`. -/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be nice to keep this portion of the docstring from the instance:

Suggested change
/-- Note this is only an instance with `open scoped ComplexOrder`. -/
/-- With `z ≤ w` iff `w - z` is real and nonnegative, `IsROrC K` is a star ordered ring.
(That is, a star ring in which the nonnegative elements are those of the form `star z * z`.)
Note this is only an instance with `open scoped ComplexOrder`. -/

@j-loreaux
Copy link
Copy Markdown
Contributor

bors d+

@bors
Copy link
Copy Markdown

bors bot commented Aug 8, 2023

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

@github-actions github-actions bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Aug 8, 2023
@ghost ghost added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) labels Aug 8, 2023
@ghost
Copy link
Copy Markdown

ghost commented Aug 9, 2023

This PR/issue depends on:

@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 Aug 9, 2023
@eric-wieser eric-wieser requested a review from j-loreaux August 9, 2023 21:23
@eric-wieser eric-wieser removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 9, 2023
rw [lt_iff_re_im, map_zero] at hz hw ⊢
simp [mul_re, mul_im, ← hz.2, ← hw.2, mul_pos hz.1 hw.1]
mul_comm := by intros; apply ext <;> ring_nf

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oops, I missed the instance line here

@j-loreaux
Copy link
Copy Markdown
Contributor

This still LGTM after the changes. Feel free to merge.

@eric-wieser
Copy link
Copy Markdown
Member Author

eric-wieser commented Aug 9, 2023

bors merge

I'm pretty confident the instance line won't make any difference to CI

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Aug 9, 2023
bors bot pushed a commit that referenced this pull request Aug 9, 2023
With `open scoped ComplexOrder`, we current have `StarOrderedRing Complex` (as well as some other order instances).
With this PR, that scope puts the same order on `K` where `IsROrC K`.

There is an ongoing discussion about whether opening the scope should be required, but there is no need to address that concern simultaneously with improving behavior when the scope is *already* open. There also seems to be fewer downstream instance resolution issues to resolve by leaving it in the scope.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@bors
Copy link
Copy Markdown

bors bot commented Aug 9, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: IsROrC.toStarOrderedRing as a scoped instance [Merged by Bors] - feat: IsROrC.toStarOrderedRing as a scoped instance Aug 9, 2023
@bors bors bot closed this Aug 9, 2023
@bors bors bot deleted the eric-wieser/IsROrC.toStarOrderedRing-no-instance branch August 9, 2023 23:19
kim-em pushed a commit that referenced this pull request Aug 14, 2023
With `open scoped ComplexOrder`, we current have `StarOrderedRing Complex` (as well as some other order instances).
With this PR, that scope puts the same order on `K` where `IsROrC K`.

There is an ongoing discussion about whether opening the scope should be required, but there is no need to address that concern simultaneously with improving behavior when the scope is *already* open. There also seems to be fewer downstream instance resolution issues to resolve by leaving it in the scope.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
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). ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc) t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants