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

Theorem nth_listReplace_nil_eq : forall (A : Set) i (a def1 def2 : A), nth i (listReplace nil i a def1) def2 = a.