Set Implicit Arguments.
Require ne_tree.
Require arith_lems.
Require ne_tree_monad.
Open Scope R_scope.
Definition expec (T: Set) (f: T -> nat): ne_tree.T T -> R :=
TRavg ∘ ne_tree.map (INR ∘ f).
(* note: currently specialized for discrete measures (hence the nat and INR) *)
Definition expec_sum (T U: Set) (f: U -> nat) (g: T -> ne_tree_monad.M U): list T -> R :=
Rsum ∘ map (expec f ∘ g).
Section expec_ctors.
Variables (T: Set) (f: T -> nat).

(* Specifications: *)
Lemma expec_Leaf t: expec f (ne_tree.Leaf t) = INR (f t).
End expec_ctors.