aboutsummaryrefslogtreecommitdiff
path: root/src/Util/ListUtil.v
diff options
context:
space:
mode:
authorGravatar Jade Philipoom <jadep@google.com>2018-04-11 17:48:36 +0200
committerGravatar Jade Philipoom <jadep@google.com>2018-04-11 17:48:36 +0200
commit0bdfa57b5c24a34f6fafe8a97c1ce6453ce2cd83 (patch)
treefe41880182b0403cd9be4c62da50079b40e30371 /src/Util/ListUtil.v
parent76618a902f770c092529c53b8b7cb98d5bd11e41 (diff)
add a list lemma
Diffstat (limited to 'src/Util/ListUtil.v')
-rw-r--r--src/Util/ListUtil.v9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Util/ListUtil.v b/src/Util/ListUtil.v
index 2aab77aca..92c648725 100644
--- a/src/Util/ListUtil.v
+++ b/src/Util/ListUtil.v
@@ -966,6 +966,15 @@ Proof.
Qed.
Hint Rewrite @combine_nil_r : push_combine.
+Lemma combine_snoc {A B} xs : forall ys x y,
+ length xs = length ys ->
+ @combine A B (xs ++ (x :: nil)) (ys ++ (y :: nil)) = combine xs ys ++ ((x, y) :: nil).
+Proof.
+ induction xs; intros; destruct ys; distr_length; cbn;
+ try rewrite IHxs by omega; reflexivity.
+Qed.
+Hint Rewrite @combine_snoc using (solve [distr_length]) : push_combine.
+
Lemma skipn_combine : forall {A B} n (xs:list A) (ys:list B),
skipn n (combine xs ys) = combine (skipn n xs) (skipn n ys).
Proof.