简体   繁体   English

我如何证明所有 PQ:Prop, ((((P -> Q) -> P) -> P) -> Q) ->Q。 在考克?

[英]how do I prove forall P Q : Prop, ((((P -> Q) -> P) -> P) -> Q) ->Q. in coq?

I am very new to coq so if you only say intros.我对 coq 很陌生,所以如果你只说介绍的话。 I don't know what to introduce.我不知道要介绍什么。 So being specific like (Ex. intros p q.) would be very helpful.因此,像 (Ex. intros p q.) 这样具体会很有帮助。

Fortunately, your goal can be automatically solved by the auto tactic.幸运的是,你的目标可以被auto策略自动解决。 If you use its variant info_auto , Coq tells you which steps lead to the solution.如果您使用它的变体info_auto ,Coq 会告诉您哪些步骤导致解决方案。

Goal  forall P Q : Prop, ((((P -> Q) -> P) -> P) -> Q) -> Q.
  info_auto.

Then, you may replay the proof by yourself, and add comments and explicit variables names to the intros tactics, and you will understand the strategy used by auto (what to do when the conclusion is a forall or an implication, or an atomic proposition).然后,你可以自己replay一下证明,在intros中加上注释和显式变量名,你就会明白auto使用的策略(结论是forall或implication,或atomic proposition时怎么办) .

 Restart. 
  intros P Q H.
  apply H (* no-choice ! *).
  intro H0.         
  apply H0.  (* no other possibility ! *)
  intro p. 
  apply H. (* no alternative ! *)
  intros _. 
  assumption. 
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? 如何在coq中证明引理“(P \\ / Q)/ \\ ~P - &gt; Q.” - How to prove the lemma “(P \/ Q) /\ ~P -> Q.” in coq? 如何证明所有人(pq:Prop),〜p-&gt;〜((p-&gt; q)-&gt; p) 使用coq - How to prove forall (p q:Prop), ~p->~((p ->q) ->p). using 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))? 如何在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 如何证明从典型类型到“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”? Coq 证明 p <q or p>=q</q> - Coq proof that p<q or p>=q 如何证明 (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;R 形式的命题同时应用于两个假设 P 和 Q? - How do I apply the proposition of the form P->Q->R to two hypotheses P and Q simultaneously in Coq?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM