可以在 Coq 中使用 destruct 吗?
Can destruct used in implication in Coq?
destruct 可用于拆分 Coq 中的 and、or。不过好像也可以用来暗示?
例如,我想证明 ~~(~~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.
当destruct pff.
时它工作正常,但我不知道为什么?谁能帮我解释一下?
如果蕴涵的结论是归纳(或共归纳)类型,则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.
destruct 可用于拆分 Coq 中的 and、or。不过好像也可以用来暗示?
例如,我想证明 ~~(~~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.
当destruct pff.
时它工作正常,但我不知道为什么?谁能帮我解释一下?
如果蕴涵的结论是归纳(或共归纳)类型,则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.