[英]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.