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 prod_fun :
forall {A B C : Type}
(f g: A -> (B * C)),
f = g ->
(fun x : A => fst (f x)) =  (fun x : A => fst (g x)) /\
(fun x : A => snd (f x)) = (fun x : A => snd (g x)).