![](/img/trans.png)
[英]How or is that possible to prove or falsify `forall (P Q : Prop), (P -> Q) -> (Q -> P) -> P = Q.` in Coq?
[英]how do I prove forall P Q : Prop, ((((P -> Q) -> P) -> P) -> Q) ->Q. in coq?
我對 coq 很陌生,所以如果你只說介紹的話。 我不知道要介紹什么。 因此,像 (Ex. intros p q.) 這樣具體會很有幫助。
幸運的是,你的目標可以被auto
策略自動解決。 如果您使用它的變體info_auto
,Coq 會告訴您哪些步驟導致解決方案。
Goal forall P Q : Prop, ((((P -> Q) -> P) -> P) -> Q) -> Q.
info_auto.
然后,你可以自己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.