Coq:我如何替换像“n + 1”这样的术语?与“S n”? [英] Coq: How do I replace terms like "n + 1" with "S n"?
本文介绍了Coq:我如何替换像“n + 1”这样的术语?与“S n”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为了使用 reflexivity
,我必须以某种方式将 n + 1
转换为(S n )
。
For using reflexivity
, I must somehow transform n + 1
to (S n)
.
这应该是一个相当简单的转换,但我不知道如何告诉Coq做到这一点。
This should be a rather simple transformation, but I don't know how to tell Coq to do it.
我该如何继续?
推荐答案
由于它们不相等,就相当于,你可以用替换(n + 1)和(S n)
,这会要求你证明这个事实。或者你可以使用重写
通过正确引理从标准库,这是 add_1_r
IIRC。
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.
这篇关于Coq:我如何替换像“n + 1”这样的术语?与“S n”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文