diff options
author | Jason Gross <jagro@google.com> | 2016-08-08 16:15:19 -0700 |
---|---|---|
committer | Jason Gross <jagro@google.com> | 2016-08-08 16:15:30 -0700 |
commit | 1855c01d960b9bf5ddb2225ddc70fc1558ed1b05 (patch) | |
tree | 48ec0532f1f7825d4df05fcfbe85faef8646c1d4 /src/Util/ListUtil.v | |
parent | 805d95d827bd6ddcf8edaee1b7f9c03f1027d98c (diff) |
Add lemma in 8.6 std lib to ListUtil for 8.4
Diffstat (limited to 'src/Util/ListUtil.v')
-rw-r--r-- | src/Util/ListUtil.v | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Util/ListUtil.v b/src/Util/ListUtil.v index 084c2f87e..6c1da1311 100644 --- a/src/Util/ListUtil.v +++ b/src/Util/ListUtil.v @@ -1241,3 +1241,17 @@ Proof. induction ls; simpl; [ | rewrite Bool.andb_true_iff, IHls ]; try tauto. intuition (congruence || eauto). Qed. + +Module Export List. + (* From the 8.6 Standard Library *) + Lemma in_seq len start n : + In n (seq start len) <-> start <= n < start+len. + Proof. + revert start. induction len; simpl; intros. + - rewrite <- plus_n_O. split;[easy|]. + intros (H,H'). apply (Lt.lt_irrefl _ (Lt.le_lt_trans _ _ _ H H')). + - rewrite IHlen, <- plus_n_Sm; simpl; split. + * intros [H|H]; subst; intuition auto with arith. + * intros (H,H'). destruct (Lt.le_lt_or_eq _ _ H); intuition. + Qed. +End List. |