diff options
author | Jason Gross <jagro@google.com> | 2016-07-08 10:16:09 -0700 |
---|---|---|
committer | Jason Gross <jagro@google.com> | 2016-07-08 10:16:09 -0700 |
commit | 51b40b8e143b85b96479be1400016b08699565a3 (patch) | |
tree | cbe5d466b793e5a81f4c8953894efb984f4a1bf0 /src/Util/ListUtil.v | |
parent | 2b0f1a2f67a2788d1e6a4163398f629f2f4c5f29 (diff) |
Add a ListUtil lemma
Diffstat (limited to 'src/Util/ListUtil.v')
-rw-r--r-- | src/Util/ListUtil.v | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Util/ListUtil.v b/src/Util/ListUtil.v index dded8f224..8260058f1 100644 --- a/src/Util/ListUtil.v +++ b/src/Util/ListUtil.v @@ -986,6 +986,12 @@ Qed. Hint Rewrite @sum_firstn_succ using congruence : simpl_sum_firstn. +Lemma sum_firstn_succ_default_rev : forall l i, + sum_firstn l i = (sum_firstn l (S i) - nth_default 0 l i)%Z. +Proof. + intros; rewrite sum_firstn_succ_default; omega. +Qed. + Lemma sum_firstn_succ_rev : forall l i x, nth_error l i = Some x -> sum_firstn l i = (sum_firstn l (S i) - x)%Z. |