Nat.add n 0
expressions appear when unfolding with simp
(but not with rw
)
#3022
Labels
bug
Something isn't working
Description
When using
unfold
orsimp
to unfold a recursive function, the expressionNat.add n 0
appears inside the body of the unfolded function rather thann
. In the following example, you can uncomment theunfold
orsimp
lines to see the given goal state. In contrast,rw
results in the wanted state.Expected behavior: In each of these three commented out lines, the goal state becomes
⊢ foo n = 2
.Actual behavior: Only the
rw
tactic results in the expected goal state.Context
When using a custom eliminator in the
induction
orcases
tactic forNat
that uses0
andn + 1
rather thanNat.zero
andNat.succ n
, expressions such asfoo (n + 1)
occur. If this is a proof aboutfoo
, then it is natural to unfold it. However, usingunfold
orsimp
results in expressions withNat.add n 0
. Eliminating these requires further application of lemmas such asNat.add_eq
andadd_zero
to clean up the expression.This is an obstruction to the "beautiful
induction
forNat
" project. We do not want users to seeNat.add
expressions.Versions
MacOS arm64
Additional Information
[Additional information, configuration or data that might be necessary to reproduce the issue]
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: