Fixpoint hasDups (A : Set)(eqd : EqDec A)(ls : list A) :=
  match ls with
    | nil => false
    | a :: ls' =>
      if (in_dec (EqDec_dec _) a ls') then true else
        (hasDups _ ls')
  end.

(* Specifications: *)
Theorem hasDups_false_NoDup : forall (A : Set)(eqd : EqDec A)(ls : list A), hasDups _ ls = false <-> NoDup ls.
Theorem hasDups_true_not_NoDup : forall (A : Set)(eqd : EqDec A)(ls : list A), hasDups eqd ls = true <-> (~ NoDup ls).
Theorem hasDups_inj_equiv : forall (A B : Set)(eqda : EqDec A)(eqdb : EqDec B)(lsa : list A)(inj : A -> B), (forall a1 a2, inj a1 = inj a2 -> a1 = a2) -> hasDups _ lsa = hasDups _ (map inj lsa).
Theorem Permutation_hasDups : forall (A : Set)(eqd : EqDec A)(ls1 ls2 : list A), Permutation ls1 ls2 -> hasDups eqd ls1 = hasDups eqd ls2.