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
Bug in ring tactic #2672
Comments
I'm not really sure why but the problem seems to be https://github.com/leanprover-community/mathlib/blob/master/src//tactic/ring.lean#L569 if the guard statement there is deleted then this doesn't loop but it seems the tests still pass. To debug further I'd need more understanding of the c++ code than I currently have. |
digama0
added a commit
that referenced
this issue
Jan 12, 2021
This occurs because when we name the atoms in `A * B = 2`, `A` is the first and `B` is the second, and once we put it in horner form it ends up as `B * A = 2`; but then when we go to rewrite it again `B` is named atom number 1 and `A` is atom number 2, so we write it the other way around and end up back at `A * B = 2`. The solution implemented here is to retain the atom map across calls to `ring.eval` while simp is driving it, so we end up rewriting it to `B * A = 2` in the first place but in the second pass we still think `B` is the second atom so we stick with the `B * A` order. Fixes #2672
b-mehta
pushed a commit
that referenced
this issue
Jan 16, 2021
This occurs because when we name the atoms in `A * B = 2`, `A` is the first and `B` is the second, and once we put it in horner form it ends up as `B * A = 2`; but then when we go to rewrite it again `B` is named atom number 1 and `A` is atom number 2, so we write it the other way around and end up back at `A * B = 2`. The solution implemented here is to retain the atom map across calls to `ring.eval` while simp is driving it, so we end up rewriting it to `B * A = 2` in the first place but in the second pass we still think `B` is the second atom so we stick with the `B * A` order. Fixes #2672
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'll investigate if/when I find time, teaching is claiming a lot of energy this week though. @digama0 may find it first.
The text was updated successfully, but these errors were encountered: