intros.
generalize dependent i.
generalize dependent v.
induction xs;
intros.
rewrite Coqlib.nth_error_nil in H.
discriminate.
destruct i; simpl in *;
now auto.
Qed.

Lemma nth_error_app:
forall {A:Type} i (ys xs : list A),
nth_error xs i = nth_error (ys ++ xs) (length ys + i).