unfold RepeatCore_Adv, DistMult_Adv.
repeat rewrite DM_RC_G1_equiv.
repeat rewrite DM_RC_G2_equiv.
eapply leRat_trans.
eapply ratDistance_le_trans.
eapply DM_RC_G2_G3_close; intuition.
eauto.
rewrite ratDistance_comm.
eapply ratDistance_le_trans.
eapply DM_RC_G2_G3_close; intuition.
eauto.
repeat rewrite DM_RC_G4_equiv.
repeat rewrite DM_RC_G5_equiv.
repeat rewrite DM_RC_G6_equiv.
repeat rewrite DistMult_G_equiv.
eapply leRat_refl.
rewrite <- ratAdd_assoc.
rewrite ratAdd_comm.
rewrite <- ratAdd_assoc.
rewrite ratDistance_comm.
intuition.
intuition.
intuition.
intuition.
intuition.
Qed.
End DistMult_impl_RepeatCore.
Section TrueSingle_impl_Mult.
Variable A B : Set.
Hypothesis B_EqDec : EqDec B.
Variable c : A -> Comp B.
Variable A1 : Comp A.
Variable Q : B -> bool.
Definition TrueSingle_G :=
a <-$ A1;
b <-$ c a;
ret (Q b).
Variable n : nat.
Definition TrueMult_G :=
a <-$ A1;
bs <-$ compMap _ (fun _ => (c a)) (forNats n);
ret (fold_left (fun b x => b || (Q x)) bs false).

(* Specifications: *)
Theorem TrueSingle_impl_Mult :
Pr[TrueMult_G] <= (n / 1) * Pr[TrueSingle_G].