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] - chore(data/mv_polynomial): Rename variables #4208
Conversation
While I agree that this should be fixed, I would rather see that the docstring stays the same and the variables in the file get updated to "meaninful" variable names. That seems to be the tendency in mathlib. |
I have a week or two before term so I'm happy to fix it if you prefer all the The ones that use |
Of those five files, one of my PRs fixes |
Alright then. I won't touch |
I did a search-and-replace changing all the Question: There are lemmas which have other (semi)rings |
Yes, that looks good to me. Other common letters for (commutative) rins/algebras are |
Hmm, sorry, addition: I think I would rather use |
Thanks. I'll change those once I figure out why the build broke. |
src/data/mv_polynomial/monad.lean
Outdated
aeval f (bind₂ g φ) = eval₂_hom ((@aeval σ S T f _ _ _ : mv_polynomial σ S →+* T).comp g) f φ := | ||
aeval f (bind₂ g φ) = eval₂_hom ((@aeval S σ _ T f _ _ : mv_polynomial σ S →+* T).comp g) f φ := |
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.
This is a bit annoying, (and I suspect a lot more has been broken). The order of the arguments has been changed in aeval
by my renaming.
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.
Right... this is exactly why we would like to have all the variables renamed, because they were used with very different meanings in different declarations.
src/data/mv_polynomial/basic.lean
Outdated
variables {R : Type u} {A : Type v} {S : Type w} (f : σ → A) | ||
variables [comm_semiring R] [comm_semiring A] [algebra R A] [comm_semiring S] | ||
variables {A : Type v} {S : Type w} (f : σ → A) | ||
variables [comm_semiring A] [algebra R A] [comm_semiring S] |
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.
Reason for the above breakage is this change. As R
was already being used as a variable in this part of the file, when I changed α
to R
, Lean complains that R
already exists, so I deleted the R
from this sections. This then changed the order of arguments for aeval
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.
Ok... It would be good to keep the order of variables as much the same as possible. (Otherwise this refactor might ramify into many other files, which seems undesirable.)
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.
Actually the build succeeded, so there was only one breakage. I think if I rename β
, γ
, δ
etc. then I can get rid of the A
on L821 and the type arguments should be together, and the typeclass ones together. The only change would then be σ S
being changed to S σ
in the previous 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.
Wait, the previous comment isn't right. comm_semiring R
will still come before f
.
The easiest way forward is just to use the original variables
but with new names. Then nothing should be broken. But I'm not sure if that's the right way.
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'll let you do what you think is best (-;
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.
Alright thanks. If there's only one breakage in mathlib then I'm not too concerned about it to be perfectly honest.
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.
Thanks 🎉
bors merge
I renamed `α` to `R` throughout. I also changed the `\sigma` to `σ` in `basic.lean`, see leanprover-community/doc-gen#62
This PR was included in a batch that was canceled, it will be automatically retried |
I renamed `α` to `R` throughout. I also changed the `\sigma` to `σ` in `basic.lean`, see leanprover-community/doc-gen#62
Build failed (retrying...): |
I renamed `α` to `R` throughout. I also changed the `\sigma` to `σ` in `basic.lean`, see leanprover-community/doc-gen#62
Pull request successfully merged into master. Build succeeded: |
I renamed
α
toR
throughout. I also changed the\sigma
toσ
inbasic.lean
, see leanprover-community/doc-gen#62Formerly:
The file usedα
andβ
as thesemiring
s, notR
andS
as suggested by the original module doc string.