Fixpoint forNats(n : nat) :=
  match n with
      | 0 => nil
      | S n' =>
        cons n' (forNats n')
  end.

Lemma flatten_NoDup : forall (A : Set)(ls : list (list A)), NoDup ls -> (forall x, In x ls -> NoDup x) -> (forall x1 x2, In x1 ls -> In x2 ls -> x1 <> x2 -> NoDup (x1 ++ x2)) -> NoDup (flatten ls).