2015-10-07 28 views
1

destruct可用於在Coq。中拆分,。但它似乎也可以用於暗示? 例如,我要證明~~(~~P -> P)Coq中蘊含的可以破壞嗎?

Lemma test : ~~(~~P -> P). 
unfold not. 
intro pffpf. 
apply pffpf. 
intro pff. 
destruct pff. 
intro p. 
apply pffpf. 
intro pff. 
exact p. 
Qed. 
destruct pff.它工作正常

,但我不知道爲什麼?任何人都可以爲我解釋嗎?

回答

2

destruct策略對隱含的結論是否爲歸納(或共誘導)類型有影響。因此,它適用於您的示例,因爲False是歸納定義的。但是,如果我們想出了False的不同定義,它可能不一定有效。例如,以下腳本在destruct pff行失敗:

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. 
+0

感謝您的答案,順便說一下,什麼是歸納類型? – 1ang

+0

Coq中的歸納類型是使用'Inductive'關鍵字定義的數據類型。這些包括自然數,對,列表,樹等等,還有一些命題,如「真」,「假」等等。 –

+0

謝謝!!!!!!!!!! – 1ang