intuition.
destruct H; intuition.
assert (forall p, In p (getSupport x) -> comp_spec P (f1 (fst p)) (f2 (snd p))).
intuition.
eapply H0.
eapply in_support_marginal_l; eauto.
eapply in_support_marginal_r; eauto.
eauto.
clear H0.
pose proof H2.
apply (list_choice) in H2.
destruct H2.
exists (Bind x x0).
intuition.
rewrite evalDist_seq_step.
eapply eqRat_trans.
eapply sumList_body_eq.
intros.
eapply ratMult_eqRat_compat.
eauto.
eapply eqRat_refl.
unfold marginal_l.
eapply eqRat_trans.
eapply sumList_body_eq.
intros.
eapply ratMult_eqRat_compat.
eapply evalDist_seq_step.
eapply eqRat_refl.
eapply eqRat_trans.
eapply sumList_body_eq.
intros.
symmetry.
eapply sumList_factor_constant_r.
rewrite sumList_comm.
dist_inline_first.
rewrite evalDist_seq_step.
eapply sumList_body_eq.
intros.
rewrite (@sumList_exactly_one _ (fst a)).
assert (Pr  [ret eqb (fst a) (fst a) ]  == 1).
dist_compute.
rewrite H5.
rewrite ratMult_1_r.
eapply ratMult_eqRat_compat; intuition.
specialize (H2 a).
intuition.
rewrite H2.
unfold marginal_l.
intuition.
eapply getSupport_NoDup.
eapply in_support_marginal_l; eauto.
intuition.
dist_compute.
rewrite evalDist_seq_step.
eapply eqRat_trans.
eapply sumList_body_eq.
intros.
eapply ratMult_eqRat_compat.
eauto.
eapply eqRat_refl.
unfold marginal_r.
eapply eqRat_trans.
eapply sumList_body_eq.
intros.
eapply ratMult_eqRat_compat.
eapply evalDist_seq_step.
eapply eqRat_refl.
eapply eqRat_trans.
eapply sumList_body_eq.
intros.
symmetry.
eapply sumList_factor_constant_r.
rewrite sumList_comm.
dist_inline_first.
rewrite evalDist_seq_step.
eapply sumList_body_eq.
intros.
rewrite (@sumList_exactly_one _ (snd a)).
assert (Pr  [ret eqb (snd a) (snd a) ] == 1).
dist_compute.
rewrite H5.
rewrite ratMult_1_r.
eapply ratMult_eqRat_compat; intuition.
specialize (H2 a); intuition.
rewrite H6.
unfold marginal_r; intuition.
eapply getSupport_NoDup.
eapply in_support_marginal_r; eauto.
intuition.
dist_compute.
simp_in_support.
specialize (H2 x1); intuition.
unfold eq_dec; intuition.
eapply (EqDec_dec _).
eapply (ret (c, d)).
Qed.
Ltac despec :=
match goal with
| [H : comp_spec _ _ _  |- _] => destruct H
end.

Theorem comp_spec_consequence :
forall (A B : Set){eqda1 eqda2 : EqDec A}{eqdb1 eqdb2 : EqDec B}(p1 p2 : A -> B -> Prop) c1 c2,
(@comp_spec _ _ eqda1 eqdb1 p1 c1 c2) ->
(forall a b, p1 a b -> p2 a b) ->
(@comp_spec  _ _ eqda2 eqdb2 p2 c1 c2).