(*Definition Mmake {A B:Type} (f:A→B) x:= Mreturn (f x).*)
Definition Mupdate (f:nat→nat) := (λ st, ((f st),tt)):monad unit.

(* Specifications: *)
Lemma lt_Mupdate_lt (f:nat→nat):
(∀ n, n < f n) → Mlt (Mupdate f).
Lemma Mnew_fun_mono: Mmono Mnew_fun.
Definition Mmap2 {A B C:Type} (f:A→B→C) (ma:monad A) (mb:monad B):=
(λ s0, let (s1,a) := ma s0 in let (s2,b) := mb s1 in (s2,(f a b))):monad C.
Lemma le_lt_Mmap2_lt {A B C:Type} (f:A→B→C) (ma:monad A) (mb:monad B):
Mle ma → Mlt mb → Mlt (Mmap2 f ma mb).
Lemma lt_le_Mmap2_lt {A B C:Type} (f:A→B→C) (ma:monad A) (mb:monad B):
Mlt ma → Mle mb → Mlt (Mmap2 f ma mb).
Lemma eq_eq_Mmap2_eq {A B C:Type} (f:A→B→C) (ma:monad A) (mb:monad B):
Meq ma → Meq mb → Meq (Mmap2 f ma mb).
Lemma lt_lt_Mmap2_lt {A B C:Type} (f:A→B→C) (ma:monad A) (mb:monad B):
Mlt ma → Mlt mb → Mlt (Mmap2 f ma mb).
Lemma mono_mono_Mmap2_mono {A B C:Type} (f: A → B → C) ma mb:
Mmono ma → Mmono mb → Mmono (Mmap2 f ma mb).