在COQ中,有没有办法方便地证明假设的前提?
我有h:p - > q
在我的证明上下文中,我需要q
完成我的证明,但是我没有任何p:
是否有策略或其他任何可以 使前提p
一个新目标,然后替换p - > Q
带有q
在证明目标p
之后。 然后,我可以直接使用Q
来证明原始目标。
但是,我也可以使用断言(HP:P)
然后使用(HP)
获取Q
,但是我必须手动复制p
,这是不便的(尤其是当>
时p
是长的,h:p - > q
仍然存在)。
我阅读 this 那。
I have H : P -> Q
in my proof context, and I need Q
to complete my proof, but I don't have any evidence of P:
Is there a tactic or anything else that can
make the premise P
a new goal, then replace P -> Q
with Q
after the goal P
was proved.
Then I can use Q
directly to prove the original goal.
However, I can also use assert (HP : P)
then use (H HP)
to get a Q
, but I have to copy P
by hand, it is inconvenient (especially when P
is long, and H : P -> Q
is still there).
I read this but got nothing useful, maybe I miss that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在寻找的是Tactic
应用
。I think that what you are looking for is the tactic
apply
.我同意Pierre Jouvelot的观点,您正在寻找
应用
tactic(我邀请您接受他的答案)。为了补充这个答案,我将在您的问题所暗示的那样提出一些更接近前进的推理。您不需要了解以下内容,但它定义了执行您想要的 forward 策略:
然后,您可以应用
forward h
来生成p的目标
。在最初的目标中,h:p - > Q
被h:q
取代。I agree with Pierre Jouvelot that you are looking for the
apply
tactic (and I invite you to accept his answer). To complement this answer, I will propose something closer to forward reasoning as your question implies.You don't need to understand the following but it defines a
forward
tactic that does what you want:Then you can apply
forward H
to generate a goal forP
. In the original goal,H : P -> Q
is replaced byH : Q
.