简体   繁体   English

证明(~A - > ~B) - >(~A - > B) - > Coq中的A.

[英]Proving (~A -> ~B)-> (~A -> B) -> A in Coq

I have been trying to prove the following tautology in Coq. 我一直在努力证明Coq中的以下重言式。

Theorem Axiom3: forall A B: Prop, (~A -> ~B)-> ((~A -> B) -> A).

My plan was the to do following 我的计划是做以下事情

Theorem Axiom3: forall A B: Prop, (~A -> ~B)-> ((~A -> B) -> A).
Proof.
  intros A B.
  unfold not.
  intros nA_implies_nB.
  intros nA_implies_B.
  pose (proof_of_False := nA_implies_nB nA_implies_B).
  case proof_of_False.
Qed.

However, the following is where my issues lies. 但是,以下是我的问题所在。

 pose (proof_of_False := nA_implies_nB nA_implies_B).

I cannot simply compose together the following to get a proof for false. 我不能简单地将以下内容组合在一起以获得虚假证据。

nA_implies_nB : (A -> False) -> B -> False
nA_implies_B : (A -> False) -> B

Can my proof be adapted to make or correct or is there an easy way to prove this theorem? 我的证据可以改编成或纠正,还是有一种简单的方法可以证明这个定理?

This statement is equivalent to the principle of the excluded middle , which says that A \\/ ~A holds for any proposition A . 这个陈述等同于被排除的中间原则,即A \\/ ~A适用于任何命题A The excluded middle is notorious for its absence in Coq and other systems based on constructive mathematics. 被排除在外的中间因其在Coq和基于建设性数学的其他系统中的缺席而臭名昭着。 To prove the statement in Coq, you must explicitly declare that you want to assume non-constructive reasoning. 要证明Coq中的语句,您必须明确声明您要假设非建设性推理。

Require Import Coq.Logic.Classical.

Theorem Axiom3: forall A B: Prop, (~A -> ~B)-> ((~A -> B) -> A).
Proof. intros A B. tauto. Qed.

If you comment out the first line, you will see that the proof fails, because Coq will not attempt to use the excluded middle in the proof. 如果您注释掉第一行,您将看到证明失败,因为Coq不会尝试在证明中使用排除的中间值。

In case you are curious, here is a more explicit proof of how Axiom3 implies the excluded middle: 如果你很好奇,这里有一个更明确的证据证明Axiom3如何暗示被排除的中间:

Axiom Axiom3: forall A B: Prop, (~A -> ~B)-> ((~A -> B) -> A).

Lemma classical : forall A : Prop, A \/ ~ A.
Proof.
intros A.
apply (Axiom3 (A \/ ~A) (A \/ ~A)).
- trivial.
- intros H. exfalso.
  assert (H' : ~ ~ A).
  { intros HA. apply H. right. trivial. }
  apply H'. intros HA. apply H. left. trivial.
Qed.

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

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