只是在coq证明中普遍量化的假设

时间:2013-09-27 14:51:42

标签: universal coq quantifiers

另一个目标(当然对我而言)如下:

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

我完全不知道我能做什么。如果我介绍一些东西,我会在小说中得到一个通用量词,然后我就无法用它做任何事情。

我认为它存在一种管理此类情况的标准方式,但我无法找到它。

2 个答案:

答案 0 :(得分:2)

要在该证明中取得进展,您必须展示P的实例和Q的实例,以便您的假设产生矛盾。

一个简单的方法是使用:

P : fun x => x = 0
Q : fun x => x = 1

为了处理引入的假设,您可能想要使用策略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)).

它允许您在某些输入上应用您的一个假设(当假设是函数时)。从现在开始,你应该能够轻易地找出矛盾。

除了specialize之外,你也可以这样做:

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

这将保留H并为您提供另一个术语Happlied(您选择名称)。

答案 1 :(得分:0)

Ptival的答案奏效了。以下是完整证据的代码:

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.

谢谢!