相关疑难解决方法(0)

证明唯一的零长度向量为零

我有一个类型定义为

Inductive bits : nat -> Set :=
| bitsNil : bits 0
| bitsCons : forall {l}, bool -> bits l -> bits (S l).
Run Code Online (Sandbox Code Playgroud)

我试图证明:

Lemma emptyIsAlwaysNil : forall {a: bits 0}, a = bitsNil.
Run Code Online (Sandbox Code Playgroud)

之后intros,我已经试过constructor 1case aintuition,无济于事。case a似乎是最接近的,但它得到一个错误:

Abstracting over the terms "0" and "a" leads to a term
fun (n : nat) (a0 : bits n) => a0 = bitsNil
which is ill-typed.
Reason is: Illegal …
Run Code Online (Sandbox Code Playgroud)

coq dependent-type

5
推荐指数
1
解决办法
194
查看次数

标签 统计

coq ×1

dependent-type ×1