(** Results about [nth] *)

(* Specifications: *)
Lemma nth_In :
forall (n:nat) (l:list A) (d:A), n < length l -> In (nth n l d) l.
Lemma In_nth l x d : In x l ->
exists n, n < length l /\ nth n l d = x.
Lemma nth_overflow : forall l n d, length l <= n -> nth n l d = d.
Lemma nth_indep :
forall l n d d', n < length l -> nth n l d = nth n l d'.
Lemma app_nth1 :
forall l l' d n, n < length l -> nth n (l++l') d = nth n l d.
Lemma app_nth2 :
forall l l' d n, n >= length l -> nth n (l++l') d = nth (n-length l) l' d.
Lemma app_nth2_plus : forall l l' d n,
nth (length l + n) (l ++ l') d = nth n l' d.
Lemma nth_middle : forall l l' a d,
nth (length l) (l ++ a :: l') d = a.
Lemma nth_split n l d : n < length l ->
exists l1, exists l2, l = l1 ++ nth n l d :: l2 /\ length l1 = n.
Lemma nth_ext : forall l l' d d', length l = length l' ->
(forall n, n < length l -> nth n l d = nth n l' d') -> l = l'.