简体   繁体   English

如何在 Coq 中证明 ~~(P \/ ~P)

[英]How to prove in Coq ~~(P \/ ~P)

I want to prove ~~(P \/ ~P) in Coq, which sounds somehow trivial... However I do not know where to go since there is not any single hypothesis.我想在 Coq 中证明~~(P \/ ~P) ,这听起来有点微不足道......但是我不知道 go 在哪里,因为没有任何单一的假设。 I have written the following code which is not working, since it is giving the following exception [ltac_use_default] expected after [tactic] (in [tactic_command]).我编写了以下不起作用的代码,因为它在[ltac_use_default] expected after [tactic] (in [tactic_command]).

Parameter P: Prop.

Section r20.
Lemma regra1: ~~(P \/ ~P).
Proof.
  intro.
   - cut P.
   - cut ~P
Qed.
End r20.

It is little tricky one.这是一个有点棘手的问题。 Here is one way to prove it.这是证明它的一种方法。

Parameter P : Prop.

Section r20.
Lemma regra1: ~~(P \/ ~P).
Proof.
  unfold not. intros H1.
  apply H1. right.
  intros H2.
  apply H1. left.
  exact H2.
Qed.
End r20.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM