(* 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_I_in : forall (A B : Set)(lsa : list A)(lsb : list B), length lsa = length lsb -> list_pred (fun a b => In a lsa /\ In b lsb) lsa lsb.