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 app_eq_refl_nil:
forall {A:Type} (xs ys : list A),
xs = xs ++ ys ->
ys = nil.