Just a universally quantified hypotesis in Coq proof
Question
Another hard goal (for me, of course) is the following:
~ (forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x)~ (forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x)
I absolutely have no idea of what could I do. If I introduce something, I get a universal quantifier in the hypotesis, and then I can't do anything with it.
I suppose that it exists a standard way for managing such kind of situations, but I was not able to find it out.
Answer (Ptival)
To progress in that proof, you will have to exhibit an instance of P and an instance of Q such that your hypothesis produces a contradiction.
A simple way to go is to use:
P : fun x => x = 0
Q : fun x => x = 1
In order to work with the hypothesis introduced, you might want to use the tactic specialize:
~ (forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x)~ (forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x)H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q xFalseH: (exists x : nat, (fun x0 : nat => x0 = 0) x) /\ (exists x : nat, (fun x0 : nat => x0 = 1) x) -> exists x : nat, (fun x0 : nat => x0 = 0) x /\ (fun x0 : nat => x0 = 1) xFalse
It allows you to apply one of your hypothesis on some input (when the hypothesis is a function). From now on, you should be able to derive a contradiction easily.
Alternatively to specialize, you can also do:
H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x
Happlied: (exists x : nat, (fun x0 : nat => x0 = 0) x) /\ (exists x : nat, (fun x0 : nat => x0 = 1) x) -> exists x : nat, (fun x0 : nat => x0 = 0) x /\ (fun x0 : nat => x0 = 1) xFalse
Which will conserve H and give you another term Happlied (you choose the name) for the application.
Answer (Matteo Zanchi)
The answer of Ptival did the trick. Here is the code of the complete proof:
~ (forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x)~ (forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x)(forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x) -> FalseH: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q xFalseH: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x(exists x : nat, x = 0) /\ (exists x : nat, x = 1)H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x
x: nat
H0: x = 0 /\ x = 1FalseH: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x(exists x : nat, x = 0) /\ (exists x : nat, x = 1)H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q xexists x : nat, x = 0H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q xexists x : nat, x = 1H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q xexists x : nat, x = 0reflexivity.H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x0 = 0H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q xexists x : nat, x = 1reflexivity.H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x1 = 1H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x
x: nat
H0: x = 0 /\ x = 1FalseH: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x
x: nat
H0: x = 0
H1: x = 1Falseinversion H1. Qed.H: forall P Q : nat -> Prop, (exists x : nat, P x) /\ (exists x : nat, Q x) -> exists x : nat, P x /\ Q x
x: nat
H0: x = 0
H1: 0 = 1False