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

Theorem nth_NoDup : forall (A : Set)(ls : list (list A)) i, (forall e, In e ls -> NoDup e) -> NoDup (nth i ls nil).