简体   繁体   中英

Proving (~A -> ~B)-> (~A -> B) -> A in Coq

I have been trying to prove the following tautology in 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 . The excluded middle is notorious for its absence in Coq and other systems based on constructive mathematics. To prove the statement in Coq, you must explicitly declare that you want to assume non-constructive reasoning.

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.

In case you are curious, here is a more explicit proof of how Axiom3 implies the excluded middle:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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