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

Lemma map_eq_inv : forall (A B : Set)(f1 f2 : A -> B)(ls : list A), map f1 ls = map f2 ls -> forall a, In a ls -> f1 a = f2 a.