可以找到一种方法' Reverse'构造函数
我试图证明以下简单的引理:
Lemma wayBack :
forall (a b n:nat) (input:list nat), a <> n -> implist n (a::b::input) -> implist n input.
暗示是如下:
Inductive implist : nat -> list nat -> Prop :=
| GSSingle : forall (n:nat), implist n [n]
| GSPairLeft : forall (a b n:nat) (l:list nat), implist n l -> implist n ([a]++[b]++l)
| GSPairRight : forall (a b n:nat) (l:list nat), implist n l -> implist n (l++[a]++[b]).
有什么想法如何做到这一点?
谢谢 !!
I try to prove the following simple Lemma :
Lemma wayBack :
forall (a b n:nat) (input:list nat), a <> n -> implist n (a::b::input) -> implist n input.
were implist is as follows :
Inductive implist : nat -> list nat -> Prop :=
| GSSingle : forall (n:nat), implist n [n]
| GSPairLeft : forall (a b n:nat) (l:list nat), implist n l -> implist n ([a]++[b]++l)
| GSPairRight : forall (a b n:nat) (l:list nat), implist n l -> implist n (l++[a]++[b]).
Any idea how to do this ?
Thank you !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里是:
这里有两个主要困难:第一个是您要对您的假设进行归纳
inmandist n(a :: b :: input)
>,但是由于a: :b :: input
不仅是一个变量,还需要一些摆弄,该标准归纳
无法做到,而是依赖归纳
程序可以。第二个困难实际上占据了我的大部分证明,它是能够分解您在最后一个情况下获得的平等,即您在开始时而不是在列表结束时添加值。
Here it is:
There are two main difficulties here: the first is that you want to do an induction on you hypothesis
implist n (a::b::input)
, but sincea::b::input
is not just a variable, there is a need for some fiddling, that standardinduction
cannot do, butdependent induction
fromProgram
can.The second difficulty, which actually takes up most of my proof, is to be able to decompose the equality you get in the last case, that where you add values at the beginning rather than at the end of the list.