Instance RatRel_trans : 
  forall (R : Rat -> Rat -> Prop),
    RatRel R -> Transitive R.Instance RatRel_flip : 
  forall R,
    RatRel R ->
    RatRel (Basics.flip R).(* The class includes equality and inequality. *)

Instance eqRat_RatRel : RatRel eqRat.Instance leRat_RatRel : RatRel leRat.

(* Specifications: *)
Theorem evalDist_assoc : forall rel (A : Set)(c1 : Comp A)(B C : Set)(c2 : A -> Comp B)(c3 : B -> Comp C) x, RatRel rel -> rel (evalDist (Bind (Bind c1 c2) c3) x) (evalDist (Bind c1 (fun a => (Bind (c2 a) c3))) x).
Lemma rel_sumList_compat : forall (A : Set)(f1 f2 : A -> Rat) ls rel, RatRel rel -> (forall a, In a ls -> rel (f1 a) (f2 a)) -> rel (sumList ls f1) (sumList ls f2).
Lemma rel_sumList_factor_r : forall (A : Set) (f : A -> Rat) (ls : list A) c rel, RatRel rel -> rel (sumList ls (fun a => (f a) * c)) ((sumList ls f) * c).
Theorem evalDist_irr_l : forall (A B : Set)(c : Comp A)(f : A -> Comp B)(y : B) rel v, RatRel rel -> well_formed_comp c -> (forall x, In x (getSupport c) -> rel (evalDist (f x) y) v) -> rel (evalDist (Bind c f) y) v.
Lemma rel_sumList_factor_r_r : forall (A : Set) (f : A -> Rat) (ls : list A) c rel, RatRel rel -> rel ((sumList ls f) * c) (sumList ls (fun a => (f a) * c)).
Theorem evalDist_irr_r : forall (A B : Set)(c : Comp A)(f : A -> Comp B)(y : B) rel v, RatRel rel -> well_formed_comp c -> (forall x, In x (getSupport c) -> rel v (evalDist (f x) y)) -> rel v (evalDist (Bind c f) y).
Theorem oc_comp_invariant : forall (A B C : Set)(c : OracleComp A B C)(S : Set)(P : S -> Prop) (eqds : EqDec S) (o : S -> A -> Comp (B * S))(s : S), (forall a b c d, In (a, b) (getSupport (o c d)) -> P c -> P b) -> P s -> forall a b, In (a, b) (getSupport (c _ _ o s)) -> P b.
Theorem oc_comp_invariant_f : forall (A B C : Set)(c : OracleComp A B C)(S : Set)(f : S -> bool) (eqds : EqDec S) (o : S -> A -> Comp (B * S))(s : S), (forall a b c d, In (a, b) (getSupport (o c d)) -> f c = true -> f b = true) -> f s = true -> forall a b, In (a, b) (getSupport (c _ _ o s)) -> f b = true.
Theorem oc_comp_wf : forall (A B C : Set)(c : OracleComp A B C), well_formed_oc c -> forall (S : Set)(eqds : EqDec S)(o : S -> A -> Comp (B * S))(s : S), (forall a b, well_formed_comp (o a b)) -> well_formed_comp (c _ _ o s).