Just a universally quantified hypotesis in coq proof

本小妞迷上赌 提交于 2019-12-11 06:47:12

问题


Another hard goal (for me, of course) is the following:

Goal ~(forall P Q: nat -> Prop,
  (exists x, P x) /\ (exists x, Q x) ->
  (exists x, P x /\ Q x)).
Proof.

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.


回答1:


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:

Goal ~(forall P Q : nat -> Prop,
  (exists x, P x) /\ (exists x, Q x) ->
  (exists x, P x /\ Q x)).
Proof.
  intro H.
  specialize (H (fun x => x = 0) (fun x => x = 1)).

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:

  pose proof (H (fun x => x = 0) (fun x => x = 1)) as Happlied.

Which will conserve H and give you another term Happlied (you choose the name) for the application.




回答2:


The answer of Ptival did the trick. Here is the code of the complete proof:

Goal ~(forall P Q: nat -> Prop,
  (exists x, P x) /\ (exists x, Q x) ->
  (exists x, P x /\ Q x)).
Proof.
  unfold not. intros.
  destruct (H (fun x => x = 0) (fun x => x = 1)).
    split.
      exists 0. reflexivity.
      exists 1. reflexivity.
    destruct H0. rewrite H0 in H1. inversion H1.
Qed.

Thank you!



来源:https://stackoverflow.com/questions/19053778/just-a-universally-quantified-hypotesis-in-coq-proof

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!