Definition optSwap (A : Set)(opt : option (A * A)) :=
  match opt with
    | None => None
    | Some (a1, a2) =>
      Some (a2, a1)
  end.

Theorem list_pred_listReplace : forall n (A B : Set) P (lsa : list A)(lsb : list B), list_pred P lsa lsb -> forall a b defa defb, P a b -> P defa defb -> list_pred P (listReplace lsa n a defa) (listReplace lsb n b defb).