你如何理解 coq 量词 `forall P: Set -> Prop`?
How do you read the coq quantifier `forall P: Set -> Prop`?
我是 Coq 的新手,正在阅读 Mike Nahas 的教程:nahas_tutorial.v。具体来说,我无法理解下面给出的陈述:
Theorem forall_exists : (forall P : Set -> Prop, (forall x, ~(P x)) -> ~(exists x, P x)).
以上是我的解读,欢迎指正。
命题Set -> Prop
是一个可以展开为forall s: Set, Prop
的命题,我理解为"for every proof (read instance) of a Set
, we also have a proof (instance) of a Prop
"。
因此forall P : Set -> Prop
可以大致读作"for every proof that a set gives rise to a proposition"。
然后对于 (forall x, ~(P x))
,我的猜测是 x
被 Coq 推断为 Set
类型,并且它被读取为 "every set gives rise to an unprovable/false proposition".
而对于 ~(exists x, P x)
,我读到因为不存在暗示 P 下真命题存在的集合。
这些在逻辑上似乎是等价的。我只是在努力学习语言。 P
可以解释为从集合 space 映射到命题 space 的函数吗?我使用了短语 "give rise to" 和 "imply existence of";这个对吗?有没有更正确的表述方式?
感谢所有帮助!
编辑:对于任何有类似问题的人,我的困惑主要是对 Curry-Howard 同构的无知。
我的解释(也许仍然有点不稳定)现在定理显示为 "For every predicate (boolean-valued function) P
ranging over elements of type Set
, if the image of every set under P
is false, then there's no set for which P
yields True
."
Set -> Prop
属于Type
,不属于Prop
。当你在 Type
时,X -> Y
应该被读作从 X
到 Y
的函数,而当你在 Prop
时,它应该是读作 X
意味着 Y
(尽管 Curry-Howard 认为它们是相同的)。
当函数 returns 为 Prop
时,它通常被视为谓词或 属性。所以 forall P : Set -> Prop
可以读作 "for every Set
-valued property..."
我是 Coq 的新手,正在阅读 Mike Nahas 的教程:nahas_tutorial.v。具体来说,我无法理解下面给出的陈述:
Theorem forall_exists : (forall P : Set -> Prop, (forall x, ~(P x)) -> ~(exists x, P x)).
以上是我的解读,欢迎指正。
命题Set -> Prop
是一个可以展开为forall s: Set, Prop
的命题,我理解为"for every proof (read instance) of a Set
, we also have a proof (instance) of a Prop
"。
因此forall P : Set -> Prop
可以大致读作"for every proof that a set gives rise to a proposition"。
然后对于 (forall x, ~(P x))
,我的猜测是 x
被 Coq 推断为 Set
类型,并且它被读取为 "every set gives rise to an unprovable/false proposition".
而对于 ~(exists x, P x)
,我读到因为不存在暗示 P 下真命题存在的集合。
这些在逻辑上似乎是等价的。我只是在努力学习语言。 P
可以解释为从集合 space 映射到命题 space 的函数吗?我使用了短语 "give rise to" 和 "imply existence of";这个对吗?有没有更正确的表述方式?
感谢所有帮助!
编辑:对于任何有类似问题的人,我的困惑主要是对 Curry-Howard 同构的无知。
我的解释(也许仍然有点不稳定)现在定理显示为 "For every predicate (boolean-valued function) P
ranging over elements of type Set
, if the image of every set under P
is false, then there's no set for which P
yields True
."
Set -> Prop
属于Type
,不属于Prop
。当你在 Type
时,X -> Y
应该被读作从 X
到 Y
的函数,而当你在 Prop
时,它应该是读作 X
意味着 Y
(尽管 Curry-Howard 认为它们是相同的)。
当函数 returns 为 Prop
时,它通常被视为谓词或 属性。所以 forall P : Set -> Prop
可以读作 "for every Set
-valued property..."