Can destruct used in implication in Coq?

痞子三分冷 提交于 2019-12-10 23:26:09

问题


destruct can be used to split and, or in Coq. But it seems can also be used in implication? For example, I want to prove ~~(~~P -> P)

Lemma test P : ~~(~~P -> P).
Proof.
unfold not.
intro pffpf.
apply pffpf.
intro pff.
destruct pff.
intro p.
apply pffpf.
intro pff.
exact p.
Qed.

when destruct pff. it works fine, but I don't know why? Can anyone explain it for me?


回答1:


The destruct tactic works on implications if the conclusion of the implication is of inductive (or co-inductive) type. Hence it works on your example, because False is defined inductively. However, if we came up with a different definition of False, it might not necessarily work. For instance, the following script fails at the destruct pff line:

Definition False : Prop := forall A : Prop, A.
Definition not (P : Prop) : Prop := P -> False.

Lemma test P : not (not (not (not P) -> P)).
unfold not.
intro pffpf.
apply pffpf.
intro pff.
destruct pff. (* Fails here *)
intro p.
apply pffpf.
intro pff.
exact p.
Qed.


来源:https://stackoverflow.com/questions/32999244/can-destruct-used-in-implication-in-coq

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