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

Lemma map_eq_nth : forall (A B C : Set) i def1 def2 (f1 : A -> C)(f2 : B -> C)(lsa : list A)(lsb : list B), length lsa = length lsb -> map f1 lsa = map f2 lsb -> i < length lsa -> f1 (nth i lsa def1) = f2 (nth i lsb def2).