简体   繁体   English

如何证明所有人(pq:Prop),〜p->〜((p-> q)-> p) 使用coq

[英]How to prove forall (p q:Prop), ~p->~((p ->q) ->p). using coq

I am completely new to coq programming and unable to prove below theorem. 我对coq编程完全陌生,无法在定理下进行证明。 I need help on steps how to solve below construct? 我需要有关如何解决以下构造的步骤的帮助吗?

Theorem PeirceContra: forall (pq:Prop), ~p->~((p ->q) ->p). 定理PeirceContra:forall(pq:Prop),〜p->〜((p-> q)-> p)。

I tried the proof below way. 我尝试了以下方式的证明。 Given axiom as Axiom classic : forall P:Prop, P \\/ ~ P. 公理为Axiom classic : forall P:Prop, P \\/ ~ P.

Theorem PeirceContra: forall (p q:Prop), ~ p -> ~((p  -> q)  -> p).
Proof.
  unfold not.
  intros.
  apply H.
  destruct (classic p) as [ p_true | p_not_true].
  - apply p_true.
  - elimtype False. apply H.
Qed.

Getting subgoal after using elimtype and apply H as 使用elimtype后获得子目标并将H用作

1 subgoal
p, q : Prop
H : p -> False
H0 : (p -> q) -> p
p_not_true : ~ p
______________________________________(1/1)
p

But now I am stuck here because I am unable to prove P using p_not_true construct of given axiom......Please suggest some help...... I am not clear how to use the given axiom to prove logic................ 但是现在我被困在这里,因为我无法使用给定公理的p_not_true构造来证明P……请提出一些帮助……我不清楚如何使用给定公理来证明逻辑。 ..............

This lemma can be proved constructively. 这个引理可以得到建设性的证明。 If you think about what can be done at each step to make progress the lemma proves itself: 如果您考虑在取得进步的每个步骤中可以做什么,则引理证明了自己:

Lemma PeirceContra :
  forall P Q, ~P -> ~((P -> Q) -> P).
Proof.
  intros P Q np.
  unfold "~".
  intros pq_p.
  apply np.     (* this is pretty much the only thing we can do at this point *)
  apply pq_p.   (* this is almost inevitable too *)

  (* the rest should be easy *)
(* 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? 我如何证明所有 PQ:Prop, ((((P -> Q) -> P) -> P) -> Q) ->Q。 在考克? - how do I prove forall P Q : Prop, ((((P -> Q) -> P) -> P) -> Q) ->Q. in coq? 如何在 Coq 中证明 (~Q -&gt; ~P) - &gt; (P -&gt; Q) - How to prove (~Q -> ~P) - > (P -> Q) in Coq 如何在Coq中证明(p-&gt; q)-&gt;(〜p \\ / q) - How to prove (p -> q) -> (~ 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))? 如何在coq中证明引理“(P \\ / Q)/ \\ ~P - &gt; Q.” - How to prove the lemma “(P \/ Q) /\ ~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 Proof Assistant证明(p-&gt; q)-&gt;(〜q-&gt;〜p) - Proving (p->q)->(~q->~p) using Coq Proof Assistant 如何证明 (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 <q or p>=q</q> - Coq proof that p<q or p>=q
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM