Open sacerdot opened 1 month ago
The "bug" label was added automatically, but this is at most a documentation bug and more a request for improvement.
Thanks for the suggestion. I guess it's more an RFC than a bug
Thanks @sacerdot, I agree this would be a good change and I would like to see this fixed. I probably won't work on it in the short term, but if you or anyone else would like to, I would be happy to review a PR.
Prerequisites
Please put an X between the brackets as you perform the following steps:
Description
This is a request of changing the behavior of the "only" option to solve_by_elim in order to clarify the semantics, bring it in line with similar tactics in other systems (Coq/Matita/...) and make the tactic more useful.
solve_by_elim automatically introduces new hypotheses when proving implications/foralls. These new hypotheses are not automatically added to the set of "only" usable assumptions. Analogous tactics in every other system I am aware of have the opposite behavior, for good reasons that I explain here. First let's show an example
Reasons to change the semantics to always allow hypotheses introduced by the tactic itself:
Context
See also the following conversation of Zulip
https://leanprover.zulipchat.com/#narrow/stream/239415-metaprogramming-.2F-tactics/topic/solve_by_elim.20.3A.20.22only.22weirdness
Steps to Reproduce
Expected behavior: both calls to solve_by_elim should solve the goal
Actual behavior: only the first does because the implementation of the tactic starts introducing an hypothesis "a : A" that is not added to the list of usable hypotheses
Versions
4.9.0-rc3