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

三世轮回 提交于 2019-12-09 03:54:34

问题


I am completely new to coq programming and unable to prove below theorem. I need help on steps how to solve below construct?

Theorem PeirceContra: forall (p q:Prop), ~p->~((p ->q) ->p).

I tried the proof below way. Given axiom as 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

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................


回答1:


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. *)


来源:https://stackoverflow.com/questions/55677841/how-to-prove-forall-p-qprop-p-p-q-p-using-coq

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!