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
[Merged by Bors] - feat(*): localized R[X]
notation for polynomial R
#11895
Conversation
@@ -53,67 +54,68 @@ The embedding from `R` is called `C`. -/ | |||
structure polynomial (R : Type*) [semiring R] := of_finsupp :: | |||
(to_finsupp : add_monoid_algebra R ℕ) | |||
|
|||
localized "notation R`[X]`:9000 := polynomial R" in polynomial |
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.
Is there anything that should have higher precedence? Should we be setting the precedence of the R
too, perhaps by defining this as postfix
?
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.
I copied the precedence of notation for non zero divisors. That's the only combo notation I've seen so far, and these two values allow for talking about non zero divisors of polynomial R without any parentheses.
If we come up another usage we can play around with the precedence. I also think this works properly with the multiplicative opposite right now.
Thank you so much for doing this; I am very much in favour of this. Given the size of the diff, do you think it would be easy to use https://github.com/leanprover-community/leancrawler to show that this really is only changing notation? A long time ago I did something similar to show that I didn't accidentally change anything while doing a large refactor and it was fairly easy. |
I tried running it an In lieu of that:
adding the open_locale:
replacements:
The 7 lines not covered by the previous examples:
Changes that don't mention
The actual changes:
|
Thanks 🎉 If CI passes, please remove the label bors d+ |
✌️ pechersky can now approve this pull request. To approve and merge a pull request, simply reply with |
bors merge |
I did not change `polynomial (complex_term_here taking args)` in many places because I thought it would be more confusing. Also, in some files that prove things about polynomials incidentally, I also did not include the notation and change the files. Co-authored-by: Johan Commelin <johan@commelin.net>
Pull request successfully merged into master. Build succeeded: |
R[X]
notation for polynomial R
R[X]
notation for polynomial R
I did not change
polynomial (complex_term_here taking args)
in many places because I thought it would be more confusing. Also, in some files that prove things about polynomials incidentally, I also did not include the notation and change the files.