(* There is nth_error in the Coq library, but it seems to return something in Type. *)
Fixpoint nth_option(A : Set)(ls : list A)(i : nat) :=
  match ls with 
    | nil => None
    | a :: ls' =>
      match i with
        | O => Some a
        | S i' =>
          nth_option ls' i'
          end
  end.

Theorem map_ne_same_ex : forall (A B : Set)(f1 f2 : A -> B)(ls : list A), eq_dec B -> map f1 ls <> map f2 ls -> exists a, In a ls /\ f1 a <> f2 a.