考虑到我对列表的索引范围的约束,我可以在这里使用 destruct 吗?

Can I use destruct here given the constraint I have for index range of a list?

我试图证明对于字节列表 a,所有字节都是 x01 从索引 2(n-m-2),其中 na:

的长度
(forall (i : nat), ((i >= 2) /\ (i < ((n - m) - 1))) -> ((nth_error a i) = (Some x01)))

我在上下文中确实有这个:

H : nth_error a ?j =
      nth_error ([x00; x00] ++ repeat x01 (n - m - 2) ++ repeat x00 m)%list  ?j

所以,在 intros i i_range. 之后我有:

i : nat
i_range : is_true (1 < i) /\ is_true (i < n - m - 1)
H : nth_error a ?j =
      nth_error ([x00; x00] ++ repeat x01 (n - m - 2) ++ repeat x00 m)%list  ?j
______________________________________(1/1)
nth_error a i = Some x01

这是破坏 H 的 RHS 以消除前两个字节和最后 m 字节的正确方法吗?如果是这样,我该如何处理 i_range?让我知道我的证明策略是否有缺陷。

提前感谢您的任何建议。

编辑:

最后一个目标的拼写错误已修复。原来是nth_error buff i = Some x01,我改成了nth_error a i = Some x01

如果你能保证H以“forall j”开头,那么目标应该是可证明的。我不确定我理解你建议的策略,但我会重写 ntherror (prefix ++ foo ++ bar) i 到 ntherror foo (i - 2) (使用合适的引理,现有的或可证明的),然后因为 foo 是使用 repeat 定义,将 ntherror (repeat baz x01) 重写为 x01。所有这些引理都有应该成立的算术边条件。