3

I am trying to prove the equivalence of P \/ Q and ~ P -> Q, under the assumption of Excluded Middle,

Theorem eq_of_or :
  excluded_middle ->
  forall P Q : Prop,
    (P \/ Q) <-> (~ P -> Q).

where the Excluded Middle is the following.

Definition excluded_middle := forall P : Prop, P \/ ~ P.

Actually, the proof of one direction does not require the Excluded Middle. In my attempt at proving the other direction, I get stuck when I am trying to utilize the Excluded Middle among the hypotheses,

Proof.
  intros EM P Q. split.
  { intros [H | H]. intros HNP. 
    - unfold not in HNP. exfalso.
      apply HNP. apply H.
    - intros HNP. apply H. }
  { intros H. unfold excluded_middle in EM.
    unfold not in EM. unfold not in H.
  }

where the current environment is the following:

1 subgoal
EM : forall P : Prop, P \/ (P -> False)
P, Q : Prop
H : (P -> False) -> Q
______________________________________(1/1)
P \/ Q

I understand that under such circumstance, what we need to do next is to do something like the "case analysis" of P, including the use of tactics left and right, if my proof makes sense till now.

Thanks in advance for any advice and suggestion!

user285827
  • 35
  • 1
  • 3

1 Answers1

2

You can instantiate EM : forall P : Prop, P \/ ~ P with any proposition (I instantiated it with P below and destructed it immediately), since EM is essentially a function that takes an arbitrary proposition P and returns a proof of either P or ~ P.

Theorem eq_of_or' :
  excluded_middle ->
  forall P Q : Prop, (~ P -> Q) -> P \/ Q.
Proof.
  intros EM P Q.
  destruct (EM P) as [p | np].     (* <- the key part is here *)
  - left. apply p.
  - right.
    apply (H np).
    (* or, equivalently, *)
    Undo.
    apply H.
    apply np.
    Undo 2.
    (* we can also combine two `apply` into one: *)
    apply H, np.
Qed.
Anton Trunov
  • 15,074
  • 2
  • 23
  • 43
  • Thank you for your solution! I am really a beginner in Coq, and I haven't learnt how to use the tactic `Undo` yet. However, inspired by your explanation, I have managed to finish my proof by adding these three lines: `destruct (EM P) as [H' | H']. - left. apply H'.- right. apply H. apply H'.` – user285827 Jul 06 '17 at 09:48
  • 1
    `Undo` is not a tactic, it's a piece of Vernacular, which reverts actions of previous tactics. So, `apply (H np).` actually finishes the proof. I added the other two versions just in case. Just step through the proof and you'll get it. – Anton Trunov Jul 06 '17 at 11:08