3

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?

Anton Trunov
  • 15,074
  • 2
  • 23
  • 43
1ang
  • 321
  • 2
  • 3
  • 11

1 Answers1

4

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.
Arthur Azevedo De Amorim
  • 23,012
  • 3
  • 33
  • 39
  • thanks for the answer, by the way, what's a inductive type? – 1ang Oct 07 '15 at 21:44
  • An inductive type in Coq is a data type defined with the `Inductive` keyword. These include things like natural numbers, pairs, lists, trees, etc., but also some propositions, like `True`, `False`, and others. – Arthur Azevedo De Amorim Oct 07 '15 at 22:45