diff options
author | Jason Gross <jagro@google.com> | 2016-07-08 10:12:56 -0700 |
---|---|---|
committer | Jason Gross <jagro@google.com> | 2016-07-08 10:12:56 -0700 |
commit | 2b0f1a2f67a2788d1e6a4163398f629f2f4c5f29 (patch) | |
tree | d62112e99cbe6921d4a346eb531506cae98b4bfb /src/Util/ListUtil.v | |
parent | 7b34335b795fd3f27cb33526fb2dbe8677e67d6a (diff) |
Add a ListUtil lemma
Diffstat (limited to 'src/Util/ListUtil.v')
-rw-r--r-- | src/Util/ListUtil.v | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Util/ListUtil.v b/src/Util/ListUtil.v index 705407836..dded8f224 100644 --- a/src/Util/ListUtil.v +++ b/src/Util/ListUtil.v @@ -986,6 +986,13 @@ Qed. Hint Rewrite @sum_firstn_succ using congruence : simpl_sum_firstn. +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. +Proof. + intros; erewrite sum_firstn_succ by eassumption; omega. +Qed. + Lemma nth_default_map2 : forall {A B C} (f : A -> B -> C) ls1 ls2 i d d1 d2, nth_default d (map2 f ls1 ls2) i = if lt_dec i (min (length ls1) (length ls2)) |