intuition.
case_eq ( hasDups eqd ls1); intuition.
apply hasDups_true_not_NoDup in H0.
intuition.
case_eq (hasDups eqd ls2); intuition.
apply hasDups_false_NoDup in H1; intuition.
exfalso.
eapply H0.
eapply permutation_NoDup.
eapply Permutation_sym.
eauto.
trivial.
eapply hasDups_false_NoDup in H0; intuition.
case_eq (hasDups eqd ls2); intuition.
apply hasDups_true_not_NoDup in H1.
exfalso.
apply H1.
eapply permutation_NoDup;
eauto.
Qed.
Section DupProb.
Variable A B : Set.
Hypothesis eqdb : EqDec B.
Variable eta : nat.

(* Specifications: *)
Theorem dupProb :
forall (ls : list A),
Pr[x <-$ compMap _ (fun _ => {0, 1}^eta) ls; ret (hasDups _ x)] <=
(length ls ^ 2 / 2 ^ eta).