学习Coq,不确定错误意味着NNPP

时间:2019-02-27 02:40:17

标签: coq proof coqide

所以我才刚刚开始学习coq(到目前为止,这太困难了),我正在尝试做一个基本的证明,我很迷失,到目前为止已经找到了一些帮助,但是我想我本来应该做coq会引发错误。所以在我的编辑器部分中,我有:

Section wut.
Variables p q: Prop.
Theorem T1 : (~q->~p)->(p->q).
Proof.
intros.
apply NNPP.
intro.
apply H in H1.
contradiction.
Qed.

在“打样”框中,我有:

1 subgoal
p, q : Prop
H : ~ q -> ~ p
H0 : p
______________________________________(1/1)
q

在错误框中,我有:

The reference NNPP was not found in the current environment.

这意味着在当前环境中找不到它吗?

1 个答案:

答案 0 :(得分:3)

NNPP引理是消除双重否定的原理:它说~ ~ P意味着P。要解决此错误消息,您必须导入定义了NNPP的Coq库:

Require Import Coq.Logic.Classical.

Section wut.
Variables p q: Prop.
Theorem T1 : (~q->~p)->(p->q).
Proof.
intros.
apply NNPP.
intro.
apply H in H1.
contradiction.
Qed.
相关问题