Definition map_fst (A B C: Set) (f: A -> B) (p: A * C): B * C := (f (fst p), snd p).

(* Specifications: *)
Lemma monoid_expec_sum_ext (T U: Set) (f g: T -> MonoidMonadTrans.M m ne_tree_monad.ext U): ext_eq f g -> ext_eq (monoid_expec_sum f) (monoid_expec_sum g).
Lemma monoid_expec_Node_map (A B: Set) (f: A -> MonoidMonadTrans.M m ne_tree_monad.ext B) (l: ne_list.L A): monoid_expec (ne_tree.Node (ne_list.map f l)) = monoid_expec_sum f l / INR (length l).
Lemma monoid_expec_ret (A: Set) (a: A): monoid_expec (ret a) = 0.
Lemma monoid_expec_bind_leaf_plus (X Y: Set) (f: X -> MonoidMonadTrans.M m ne_tree_monad.ext Y) (n: prod m X): monoid_expec (@bind (MonoidMonadTrans.M m ne_tree_monad.ext) _ _ (ne_tree.Leaf n) f) = INR (ms (fst n)) + monoid_expec (f (snd n)).
Lemma monoid_expec_map_fst_monoid_mult (A: Set) (g: m) (t: MonoidMonadTrans.M m ne_tree_monad.ext A): monoid_expec (ne_tree.map (map_fst (monoid_mult m g)) t) = INR (ms g) + monoid_expec t.