【发布时间】:2022-05-13 18:38:26
【问题描述】:
我有一个看起来像这样的环境:
P: list nat -> Prop
Hnil: P []
...
xs, xp: list nat
Hex: xp = a :: xs
Hnilcons: xp <> []
===================
P xp
我想将目标重写为
P ((removelast xp)++[last xp 0])
正如我在上下文中证明 xp 不是 nil 一样,我尝试使用 app_removelast_last:
Lemma app_removelast_last :
forall l d, l <> [] -> l = removelast l ++ [last l d].
但是当我尝试
rewrite (app_removelast_last xp 0 Hnilcons).
我收到一条晦涩的错误消息:
The term "Hnilcons" has type
"not (@eq (list nat) xp (@nil nat))"
while it is expected to have type
"not
(@eq (list (list nat)) ?l
(@nil (list nat)))"
(cannot unify "list (list nat)" and
"list nat").
显然,我不明白如何使用列表不是 [] 的证明。
有人可以帮我澄清如何进行重写吗?
谢谢 !!
【问题讨论】:
标签: coq