(* Copyright 2012-2015 by Adam Petcher.				* * Use of this source code is governed by the license described	* * in the LICENSE file at the root of the source tree.		*)
Set Implicit Arguments.
Local Open Scope list_scope.
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.
induction ls; intuition; simpl in *.
econstructor.
destruct (in_dec (EqDec_dec eqd) a ls).
discriminate.
econstructor; intuition.
inversion H1; clear H1; subst.
destruct (in_dec (EqDec_dec eqd) a ls);
intuition.
Qed.

Theorem hasDups_true_not_NoDup :
forall (A : Set)(eqd : EqDec A)(ls : list A),
hasDups eqd ls = true <-> (~ NoDup ls).