proposition: Lemma selectE s : select s = fmap (fun xy => (xy.1, tval xy.2)) (tselect s).
proof: Proof. elim: s => [|h [|h' t] IH]. - by rewrite fmapE bindfailf. - by rewrite tselect1 fmapE bindretf /= bindfailf altmfail. - rewrite {1}/select -/(select (h' :: t)) IH [in RHS]alt_fmapDr. rewrite [in X in _ = X [~] _]fmapE bindretf; congr (_ [~] _). rewrite bind_fmap fmap_bind; bind_ext => -[x1 x2]. by rewrite fcompE fmapE bindretf. Qed.
imports: mathcomp(all_ssreflect) monae_lib HB(structures) hierarchy monad_lib Equations(Equations)