![](/img/trans.png)
[英]How to prove forall x, (R x \/ ~ R x) [in the Coq proof assistant]?
[英]How to prove (forall x, P x /\ Q x) -> (forall x, P x)
如何在 Coq 中证明 (forall x, P x /\\ Q x) -> (forall x, P x)? 已经尝试了几个小时,但不知道如何分解 Coq 可以消化的东西的前因。 (我是新手,显然:)
你可以通过应用 H 来更快地完成它,但是这个脚本应该更清晰。
Lemma foo : forall (A:Type) (P Q: A-> Prop), (forall x, P x /\ Q x) -> (forall x, P x).
intros.
destruct (H x).
exact H0.
Qed.
Assume ForAll x: P(x) /\ Q(x)
var x;
P(x) //because you assumed it earlier
ForAll x: P(x)
(ForAll x: P(x) /\ Q(x)) => (ForAll x: P(x))
直观地说,如果对于所有 x,P(x) AND Q(x) 成立,那么对于所有 x,P(x) 成立。
尝试
elim (H x).
实际上,当我发现这个时,我想出了这个:
在第 5 课中,他解决了完全相同的问题,并使用“cut (P x /\\ Q x)”将目标从“P x”重写为“P x /\\ Q x -> P x”。 从那里您可以进行一些操作,当目标只是“P x /\\ Q x”时,您可以应用“forall x : P x /\\ Q x”,其余的很简单。
这是答案:
Lemma fa_dist_and (A : Set) (P : A -> Prop) (Q: A -> Prop):
(forall x, P x) /\ (forall x, Q x) <-> (forall x : A, P x /\ Q x).
Proof.
split.
intro H.
(destruct H).
intro H1.
split.
(apply H).
(apply H0).
intro H.
split.
intro H1.
(apply H).
intro H1.
(apply H).
Qed.
您可以在此文件中找到其他已解决的练习: https : //cse.buffalo.edu/~knepley/classes/cse191/ClassNotes.pdf
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.