简体   繁体   中英

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. I don't know what to introduce. So being specific like (Ex. intros p q.) would be very helpful.

Fortunately, your goal can be automatically solved by the auto tactic. If you use its variant info_auto , Coq tells you which steps lead to the solution.

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

 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. 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM