用Coq证明一个矛盾
我试图用用Coq证明一个矛盾,coq,proof,Coq,Proof,我试图用Coq证明一个简单引理,但我遇到了一些麻烦 排除不可行的情况。这是我的引理: Theorem helper : forall (a b : bool), ((negb a) = (negb b)) -> (a = b). Proof. intros a b. intros H. destruct a. - destruct b. + reflexivity. + (** this case is trivially true *) 由于假设H是
Coq
证明一个简单引理,但我遇到了一些麻烦
排除不可行的情况。这是我的引理:
Theorem helper : forall (a b : bool),
((negb a) = (negb b)) -> (a = b).
Proof.
intros a b.
intros H.
destruct a.
- destruct b.
+ reflexivity.
+ (** this case is trivially true *)
由于假设H
是错误的,因此相关的子目标非常正确。我该如何告诉Coq
1 subgoal
H : negb true = negb false
______________________________________(1/1)
true = false
当存在不同构造函数之间相等的假设时(在本例中为
H:false=true
),您可以使用判别。
在其他情况下,当假设为False
时,可以使用矛盾。