(* 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 list_pred_fst_split_eq_l : forall (A B : Set)(a : list (A * B))(b : list A), list_pred (fun a0 b0 => fst a0 = b0) a b -> b = fst (split a).