Can destruct used in implication in Coq?

2019-07-17 16:37发布

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条回答
干净又极端
2楼-- · 2019-07-17 17:04

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.
查看更多
登录 后发表回答