Section OTP.
Variable T : Set.
Hypothesis T_EqDec : EqDec T.
Variable RndT : Comp T.
Variable T_op : T -> T -> T.
Hypothesis op_assoc : forall x y z, T_op (T_op x y) z = T_op x (T_op y z).
Variable T_inverse : T -> T.
Variable T_ident : T.
Hypothesis inverse_l_ident : forall x, T_op (T_inverse x) x = T_ident.
Hypothesis inverse_r_ident : forall x, T_op x (T_inverse x) = T_ident.
Hypothesis ident_l : forall x, T_op T_ident x = x.
Hypothesis ident_r : forall x, T_op x T_ident = x.
Hypothesis RndT_uniform : forall x y, comp_spec (fun a b => a = x <-> b = y) RndT RndT.
intuition.
eapply getSupport_In_evalDist.
intuition.
eapply getSupport_In_evalDist.
eapply H.
rewrite <- H0.
eapply comp_spec_impl_eq.
trivial.
Qed.
intros.
eapply (@comp_spec_eq_trans_l _ _ _ _ RndT (x <-$ RndT; ret x)).
eapply comp_spec_eq_symm.
eapply comp_spec_right_ident.
eapply comp_spec_seq.
trivial.
trivial.
eapply comp_spec_symm.
eapply (comp_spec_iso (T_op x) (T_op (T_inverse x))); intuition.
rewrite <- op_assoc.
rewrite inverse_r_ident.
eauto.
rewrite <- op_assoc.
rewrite inverse_l_ident.
eauto.
eapply all_in_support; eauto.
intuition.
subst.
eapply comp_spec_eq_refl.
Qed.

Theorem OTP_inf_th_sec_r :
forall (x : T),
comp_spec eq RndT (r <-$ RndT; ret (T_op r x)).