我目前对如何证明以下定理感到困惑:
Theorem excluded_middle2 :
(forall P Q : Prop, (P -> Q) -> (~P \/ Q)) -> (forall P, P \/ ~P).
我被困在这里了:
Theorem excluded_middle2 :
(forall P Q : Prop, (P -> Q) -> (~P \/ Q)) -> (forall P, P \/ ~P).
Proof.
intros.
evar (Q : Prop).
specialize H with (P : Prop) (Q : Prop).
我知道在coq中简单地证明排中律是不可能的,但是我很想知道用这个定理是否可以证明排中律?
是的,可以。一种方法是使用 ssreflect,如下所示(可能还有更短的方法):
Lemma orC P Q : P \/ Q -> Q \/ P.
Proof. by case; [right | left]. Qed.
Theorem excluded_middle2 :
(forall P Q : Prop, (P -> Q) -> (~ P \/ Q)) -> (forall P, P \/ ~ P).
Proof.
move=> orasimply P.
have pp : P -> P by [].
move: (orasimply P P pp).
exact: orC.
Qed.
更短并且不需要 ssreflect (如当前接受的答案):
Theorem excluded_middle2 :
(forall P Q : Prop, (P -> Q) -> (~P \/ Q)) -> (forall P, P \/ ~P).
intros.
destruct H with (P := P) (Q := P); auto.
Qed.