(* end semReturnSize *)
Instance unsizedReturn {A} (x : A) : Unsized (returnGen x).

(* Specifications: *)
Lemma semBindSize_subset_compat {A B : Type} (g g' : G A) (f f' : A -> G B) :
(forall s, semGenSize g s \subset semGenSize g' s) ->
(forall x s, semGenSize (f x) s \subset semGenSize (f' x) s) ->
(forall s, semGenSize (bindGen g f) s \subset semGenSize (bindGen g' f') s).
Lemma semBindSizeOpt_subset_compat {A B : Type} (g g' : G A) (f f' : A -> G (option B)) :
(forall s, semGenSize g s \subset semGenSize g' s) ->
(forall x s, isSome :&: semGenSize (f x) s \subset isSome :&: semGenSize (f' x) s) ->
(forall s, isSome :&: semGenSize (bindGen g f) s \subset isSome :&: semGenSize (bindGen g' f') s).
Lemma monad_leftid A B (a : A) (f : A -> G B) :
semGen (bindGen (returnGen a) f) <--> semGen (f a).
Lemma monad_rightid A (g : G A) : semGen (bindGen g returnGen) <--> semGen g.
Lemma monad_assoc A B C (ga : G A) (fb : A -> G B) (fc : B -> G C) :
semGen (bindGen (bindGen ga fb) fc) <-->
semGen (bindGen ga (fun a => bindGen (fb a) fc)).