[英]How do you read the coq quantifier `forall P: Set -> Prop`?
[英]Coq: Prop versus Set in Type(n)
我想考虑以下三个(相关的?)Coq定义。
Inductive nat1: Prop :=
| z1 : nat1
| s1 : nat1 -> nat1.
Inductive nat2 : Set :=
| z2 : nat2
| s2 : nat2 -> nat2.
Inductive nat3 : Type :=
| z3 : nat3
| s3 : nat3 -> nat3.
这三种类型都给出了归纳原则来证明一个命题。
nat1_ind
: forall P : Prop, P -> (nat1 -> P -> P) -> nat1 -> P
nat2_ind
: forall P : nat2 -> Prop,
P z2 -> (forall n : nat2, P n -> P (s2 n)) -> forall n : nat2, P n
nat3_ind
: forall P : nat3 -> Prop,
P z3 -> (forall n : nat3, P n -> P (s3 n)) -> forall n : nat3, P n
set和type版本还包含set和type定义的归纳原则(分别为rec和rect)。 这是我对Prop和Set之间差异的了解程度; Prop的诱导较弱。
我还读到,虽然Set是预测性的,但Prop是不可预测的,但这似乎是属性而不是定义的质量。
虽然Set和Prop之间的一些实际(道德?)差异是明确的,但Set和Prop之间的确切定义差异以及它们适合类型范围的位置尚不清楚(运行检查Prop和Set给出类型(*(设置)+ 1 *)),我不确定如何解释这个...
Type : Type
不一致。
具有排除中间的Impredicative Set
意味着证明不相关,因此具有证明相关性的impredicative Set
,例如true <> false
,驳斥被排除的中间,这是直觉主义不应该做的。
因此,我们在Prop
留下了不可信度,而类型层次结构的其余部分给我们带来了困境。
顺便说说,
forall P : nat1 -> Prop, P z1 -> (forall n : nat1, P n -> P (s1 n)) -> forall n : nat1, P n
是可证明的。 不要问我Coq的好处是什么才能自动证明其他较弱的感应原理......
另外,你读过CPDT的这一章吗?
请在一小时内阅读此内容。 这是因为Coq将假设同一Prop
的两个证明对象相等。 这是一个公理,被称为证明不相关。
https://coq.inria.fr/library/Coq.Logic.ProofIrrelevance.html
它只是认为关于Prop
(这里是P
)的谓词并不需要将一些证据作为其论证(或假设)传递并将其删除。
考虑一下。 因为每个nat1
是相同的,每当我们尝试证明某些属性P
,我们可以只抽象一些nat1
,同时使用公理将其重写为必需的属性。 因此,Coq产生了感应原理的“简化”版本。
要生成“完整”版本,您可以使用
Scheme nat1_ind_full := Induction for nat1 Sort Prop.
REF。 Prop和Type的不同归纳原则
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.