-
Notifications
You must be signed in to change notification settings - Fork 421
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
decreasing_by goals leak wf implementation details #4928
Comments
So after
we have
If we now run
which is
which isn’t great. We’d have to throw in
I can thow them into the simp arguments, but this is of course optimizing for the special case of So one fix would be to change |
Previously, the tactic state shown at `decreasing_by` would leak lots of details about the translation, and mention `invImage`, `PSigma` etc. This is not nice. So this introduces `clean_wf`, which is like `simp_wf` but using `simp`'s `only` mode, and runs this unconditionally. This should clean up the goal to a reasonable extent. Previously `simp_wf` was an unrestricted `simp […]` call, but we probably don’t want arbitrary simplification to happen at this point, so this now became `simp only` call. For backwards compatibility, `decreasing_with` begins with `try simp`. The `simp_wf` tactic is still available to not break too much existing code; it’s docstring suggests to no longer use it. With `set_option cleanDecreasingByGoal false` one can disable the use of `clean_wf`. I hope this is only needed for debugging and understanding. Migration advise: If your `decreasing_by` proof begins with `simp_wf`, either remove that (if the proof still goes through), or replace with `simp`. I am a bit anxious about running even `simp only` unconditionally here, as it may do more than some user might want, e.g. because of options like `zetaDelta := true`. We'll see if we need to reign in this tactic some more. I wonder if in corner cases the `simp_wf` tactic might be able to close the goal, and if that is a problem. If so, we may have to promote simp’s internal `mayCloseGoal` parameter to a simp configuration option and use that here. fixes #4928
The goals shown by
decreasing_by
can contain scary implementation details, especially thePSigma/PSum
due to non-unary functions and mutual recursion.The
simp_wf
tactic is typically used to clean that up, but, as it runs unrestrictedsimp
, may do too much.It seems desirable that after
decreasing_by
the goal shown to the user is exactly what they expect based on what they wrote – no implementation details visible, but also no additional proof steps taken.There is a similar issue in the
FunInd
code, where Lean.Tactic.FunInd.cleanPackedArgs is used to clean this up; this can be inspiration.Versions
v4.11.0-rc1
Additional Information
Zulip discussion at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.60simp_wf.60.20in.20.60decreasing_by.60
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: