问题
For using reflexivity
, I must somehow transform n + 1
to (S n)
.
This should be a rather simple transformation, but I don't know how to tell Coq to do it.
How do I proceed?
回答1:
Since they are not equal, just equivalent, you can use replace (n + 1) with (S n)
which will ask you to prove that fact. Or you can use rewrite
with the correct lemma from the std lib, which is add_1_r
iirc.
来源:https://stackoverflow.com/questions/40614082/coq-how-do-i-replace-terms-like-n-1-with-s-n