Section contents.
Variables (m: Monoid) (ms: m -> nat).
About MonoidMonadTrans.M .
Definition monoid_expec {A: Set}:
MonoidMonadTrans.M m ne_tree_monad.ext A -> R
:= expec (ms ∘ (fst (B:=_:Set))).

Lemma monoid_expec_bind_leaf (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) =
expec (ms ∘ monoid_mult m (fst n) ∘ (fst (B:=_:Set))) (f (snd n)).