Definition deterministic (X: Set) (x: M X) (v: X): Prop := x = ne_tree.Leaf v.

(* Specifications: *)
Lemma deterministic_ret (A: Set) (a: A): deterministic (ret a) a.
Lemma ex_deterministic_ret (X: Set) (x: X): exists u, deterministic (ret x) u.
Lemma In_bind_inv (X Y: Set) (f: X -> M Y) (x: M X) r: ne_tree.In r (bind x f) -> exists z, ne_tree.In z x /\ ne_tree.In r (f z).
Lemma bind_eq (X X' Y XM: Set) (f: X -> M Y) (f': X' -> M Y) (xm: X -> XM) (xm': X' -> XM): (forall p q, xm p = xm' q -> f p = f' q) -> forall (x: M X) (x': M X'), ne_tree.map xm x = ne_tree.map xm' x' -> bind x f = bind x' f'.
Lemma map_bind (X Y Z: Set) (f: Y -> Z) (g: X -> M Y) (x: M X): ne_tree.map f (bind x g) = bind x (fun xx => ne_tree.map f (g xx)).