(* misc expec *)

Add Parametric Morphism (A: Set): (@expec A)
  with signature (@ext_eq A nat) ==> (@ext_eq (ne_tree.T A) R)
  as expec_ext_morph.

(* Specifications: *)
Lemma expec_ext (T: Set) (f g: T -> nat) (e: ext_eq f g): forall x, expec f x = expec g x.
Lemma Rmult_INR1_id: ext_eq (Rmult (INR 1)) (@id R).
Lemma mult_1_id: ext_eq (mult 1) (@id nat).
Lemma expec_plus (T: Set) (f g: T -> nat) (t: ne_tree.T T): expec (fun x => plus (f x) (g x)) t = expec f t + expec g t.
Lemma expec_nonneg (T: Set) (m: ne_tree_monad.M T) (f: T -> nat): 0 <= expec f m.
Lemma expec_le (X: Set) (f g: X -> nat) (t: ne_tree.T X): (forall x, ne_tree.In x t -> (f x <= g x)%nat) -> expec f t <= expec g t.
Lemma expec_0_inv (T: Set) (f: T -> nat) (t: ne_tree.T T): expec f t = 0 -> forall x, ne_tree.In x t -> f x = 0%nat.
Lemma expec_constant (T: Set) (f: T -> nat) (c: nat) (t: ne_tree_monad.M T): (forall x, ne_tree.In x t -> f x = c) -> expec f t = INR c.