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

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