-
Notifications
You must be signed in to change notification settings - Fork 729
fix: do not crash in mkAuxTheorem #10704
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
Conversation
There is a known bug here, which can cause mkValueTypeClosure to reorder dependent variables leaving behind stray fvars. This change falls back on not using an auxiliary declaration at all, rather than creating a kernel error. It leaves behind a panic so that this bug is not forgotten.
4e06e5e to
bbae87a
Compare
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
|
changelog-language |
|
@nomeata, would you be in favor of keeping this just in case? The check is cheap, and unless you're certain the new code is correct this increases the chance of detecting further issues. |
|
Indeed the check is cheap. But in that case make it a plain |
|
Done in #10954 |
|
I assume this can be closed now, please complain if I am wrong. |
This PR ensures that
mkAuxTheoremcannot attempt to add a term with strayfvarsto the environment.Cases that would previously raise kernel errors now instead skip the performance optimizationfor which
mkAuxTheoremintended.This fixes kernel errors in tactics like
grindandomegawhich usemkAuxTheoreminternally, as reported in #10705.The underlying bug in
mkValueTypeClosurewhere it reorders dependent variables in an illegal way, leaving behind stray fvars, is still present. This change falls back on not using an auxiliary declaration at all when these fvars are present, rather than raising a kernel error. It leaves behind a panic so that this bug is not forgotten.