Coq: How do I replace terms like “n + 1” with “S n”?

元气小坏坏 提交于 2019-12-11 05:16:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!