HOL icon indicating copy to clipboard operation
HOL copied to clipboard

Name in namedCases should not be renamed if it already exists

Open dnezam opened this issue 5 months ago • 2 comments

Consider the following proof state:

P x
-----
y

Assuming that y is an option, namedCases_on ‘y’ ["", "x"] currently results in something like

P x
-----
SOME x'

Note that despite picking x as the name, it ended up being x'. I'd argue a more intuitive behavior would be for the x in the assumptions to be renamed instead.

dnezam avatar Jul 11 '25 09:07 dnezam

The free variables of the assumptions are the result of earlier (explicit or implicit) naming choices. In general, names chosen later should respect those chosen earlier. But if those earlier choices are getting in the way, then rename1 and friends are available.

konrad-slind avatar Aug 06 '25 23:08 konrad-slind

This is an interesting one. I eventually want to subsume this awful soup (namedCases, pairCases urge) into a more potent Cases_on tactic, but I think if the user has gone to the trouble of specifying names, then that can be treated as a subsidiary invocation of something like rename, and can thus be viewed as taking precedence over earlier naming choices.

mn200 avatar Aug 06 '25 23:08 mn200