Coq 中的简单恒等式
Simple identity in Coq
我可能遗漏了一些基本的东西。
我可以证明以下"identity":
Theorem identity_simple : forall a : Prop, a -> a.
和intro. intro. assumption.
.
然而,我似乎无法证明:
Theorem identity : forall a : Prop, a.
我当然可以做到 intro
,但这让我有:
a : Prop
_________(1/1)
a
我不知道该怎么办。
第一种形式似乎是多余的,声明对于所有 a
,a
意味着 a
.
forall a : Prop, a -> a.
读作 "given the proof of some proposition a
we can construct a proof of the same proposition"。这是真的,因为我们可以 return 原始证明。
让我们用 Coq 验证一下:
Print identity_simple.
(*
output:
identity_simple = fun (a : Prop) (H : a) => H
: forall a : Prop, a -> a
*)
证明项 fun (a : Prop) (H : a) => H
准确表达了所描述的行为。
The first form seems redundant, to state that for all a
, a
implies a
.
从某种意义上说,您是对的 - 很明显。您可以将其视为测试——如果您不能证明它,那么逻辑一定有问题。
forall a : Prop, a.
读作 "we can construct a proof of any proposition"。这是不正确的,因为例如,您无法构造 False
的证明(在空上下文中)。那将是一场灾难——我们不想使用 一切 都是可证明的逻辑。
我可能遗漏了一些基本的东西。
我可以证明以下"identity":
Theorem identity_simple : forall a : Prop, a -> a.
和intro. intro. assumption.
.
然而,我似乎无法证明:
Theorem identity : forall a : Prop, a.
我当然可以做到 intro
,但这让我有:
a : Prop
_________(1/1)
a
我不知道该怎么办。
第一种形式似乎是多余的,声明对于所有 a
,a
意味着 a
.
forall a : Prop, a -> a.
读作 "given the proof of some proposition a
we can construct a proof of the same proposition"。这是真的,因为我们可以 return 原始证明。
让我们用 Coq 验证一下:
Print identity_simple.
(*
output:
identity_simple = fun (a : Prop) (H : a) => H
: forall a : Prop, a -> a
*)
证明项 fun (a : Prop) (H : a) => H
准确表达了所描述的行为。
The first form seems redundant, to state that for all
a
,a
impliesa
.
从某种意义上说,您是对的 - 很明显。您可以将其视为测试——如果您不能证明它,那么逻辑一定有问题。
forall a : Prop, a.
读作 "we can construct a proof of any proposition"。这是不正确的,因为例如,您无法构造 False
的证明(在空上下文中)。那将是一场灾难——我们不想使用 一切 都是可证明的逻辑。