【发布时间】:2016-09-29 11:39:55
【问题描述】:
Coq 的 Finite_sets 库有一个归纳类型,指定某个集成是有限的:
Inductive Finite : Ensemble U -> Prop :=
| Empty_is_finite : Finite (Empty_set U)
| Union_is_finite :
forall A:Ensemble U,
Finite A -> forall x:U, ~ In U A x -> Finite (Add U A x).
我试图证明有限集合中的成员资格可按如下方式确定:
Lemma Finite_dec (A:Type) : forall f:Ensemble A, Finite A f ->
forall x:A, {In A f x} + {~In A f x}.
Proof.
intros.
induction H.
但是,Coq 会产生以下错误消息:
Cannot find the elimination combinator Finite_rec, the
elimination of the inductive definition Finite on sort Set is
probably not allowed.
我的问题是,为什么 Coq 不能为 Finite 生成消除组合器?要使这成为可能,需要什么归纳类型?
注意:我需要一个用于不同类型的消除组合器,它与 Finite 非常相似,但不知道如何构造它。
【问题讨论】:
-
在这种情况下,特殊的问题是
Finiteinductive 是 prop 类型,因此您无法从中提取“真实”信息,而您的可判定性是。如果您将目标更改为In A f x \/ ~In A f x,它将通过。您可以通过不同的假设获得结果,但我会特别使用其他方法,即将我的有限集编码为带有商的列表。 -
谢谢,但我需要 sumbool 才能在我定义的函数中使用引理,因此仅对命题证明它是不够的。
标签: coq