简体   繁体   English

如何证明从典型类型到“Prop”的所有函数 P、Q,“forall a, b, P(a) or Q(b) 成立”当且仅当“forall a, P(a), or, forall b, Q (b),持有”?

[英]How to prove for all functions P, Q from typical type to `Prop`, “forall a, b, P(a) or Q(b) holds” iff “forall a, P(a), or, forall b, Q(b), holds”?

Lemma forall_P_Q_a_b_notPa_or_notPb_iff_forall_a_notPa_or_forall_b_notPb : forall (T : Type) (P Q : T->Prop),
  (forall a b, P a \/ Q b) <-> ((forall a, P a) \/ (forall b, Q b))
.
Proof.
  intros. split; intros.
  - admit.
  - destruct H; auto.
Admitted.

I proved the one side easily, but couldn't find a way to prove the other side.我很容易证明了一方,但找不到证明另一方的方法。 edestruct didn't work for me due to the scope.由于edestruct ,edestruct 对我不起作用。 How should I prove the theorem?我应该如何证明这个定理?

I believe this requires classical logic:我相信这需要经典逻辑:

Require Import Coq.Logic.Classical.

Lemma forall_P_Q_a_b_notPa_or_notPb_iff_forall_a_notPa_or_forall_b_notPb : forall (T : Type) (P Q : T->Prop),
  (forall a b, P a \/ Q b) <-> ((forall a, P a) \/ (forall b, Q b))
.
Proof.
  intros T P Q. split; intros H.
  - destruct (classic (forall a, P a)) as [HP|HP]; auto. (* Classical reasoning *)
    destruct (not_all_ex_not _ _ HP) as [a Ha]. (* Also here *)
    right; intros b.
    specialize (H a b). tauto.
  - destruct H; auto.
Qed.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Coq 中如何证明或证伪 `forall (PQ : Prop), (P -&gt; Q) -&gt; (Q -&gt; P) -&gt; P = Q.`? - How or is that possible to prove or falsify `forall (P Q : Prop), (P -> Q) -> (Q -> P) -> P = Q.` in Coq? 如何用给定的假设证明排除中间(forall PQ: Prop, (P -&gt; Q) -&gt; (~P \/ Q))? - How can I prove excluded middle with the given hypothesis (forall P Q : Prop, (P -> Q) -> (~P \/ Q))? 如何证明所有人(pq:Prop),〜p-&gt;〜((p-&gt; q)-&gt; p) 使用coq - How to prove forall (p q:Prop), ~p->~((p ->q) ->p). using coq 如何证明 (forall x, P x /\\ Q x) -&gt; (forall x, P x) - How to prove (forall x, P x /\ Q x) -> (forall x, P x) 如何在Coq中证明(p-&gt; q)-&gt;(〜p \\ / q) - How to prove (p -> q) -> (~ p \/ q) in Coq 如何在 Coq 中证明 (~Q -&gt; ~P) - &gt; (P -&gt; Q) - How to prove (~Q -> ~P) - > (P -> Q) in Coq 在 Coq 中提供示例,其中 (AB: Prop), P: Prop -&gt; Type,这样 A &lt;-&gt; B,但不能用 PB 替换 PA - Provide example in Coq where (A B: Prop), P: Prop -> Type, such that A <-> B, but one cannot replace P A with P B 如何在coq中证明引理“(P \\ / Q)/ \\ ~P - &gt; Q.” - How to prove the lemma “(P \/ Q) /\ ~P -> Q.” in coq? 你如何阅读 coq 量词`forall P: Set -&gt; Prop`? - How do you read the coq quantifier `forall P: Set -> Prop`? 我怎样才能证明forall ab,a &lt;=? b = true -&gt; a &lt;=? S b = 在 Coq 中为真 - How can I proove forall a b, a <=? b = true -> a <=? S b = true in Coq
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM