intuition.
eapply NoDup_Permutation.
apply filter_NoDup; trivial.
apply filter_NoDup; trivial.
unfold intersect in *.
intuition.
apply filter_In.
apply filter_In in H1.
intuition.
destruct (in_dec eqd x ls1); intuition.
discriminate.
destruct (in_dec eqd x ls2); intuition.
apply filter_In.
apply filter_In in H1.
intuition.
destruct (in_dec eqd x ls2); intuition.
discriminate.
destruct (in_dec eqd x ls1); intuition.
Qed.

Theorem fundamental_lemma_h : forall (A : Set)(eqda : EqDec A)(c1 c2 : Comp (A * bool)),
(evalDist (Bind c1 (fun x => ret snd x)) true == evalDist (Bind c2 (fun x => ret snd x)) true) ->
(forall a, evalDist c1 (a, false) == evalDist c2 (a, false)) ->
forall a,
ratDistance (evalDist (Bind c1 (fun x => ret (fst x))) a) (evalDist (Bind c2 (fun x => ret (fst x))) a) <=
evalDist (Bind c1 (fun x => ret snd x)) true.