proposition: Lemma inversion_valid_bind : ∀ {A B} {c : raw_code A} {k : A → raw_code B}, ValidCode (bind c k) → ValidCode c.
proof: Proof. intros A B c k h. unfold ValidCode in *. induction c. - constructor. - simpl in h. apply inversion_valid_opr in h. destruct h as [h1 h2]. constructor. all: eauto. - simpl in h. apply inversion_valid_getr in h. constructor. all: intuition eauto. - simpl in h. apply inversion_valid_putr in h. constructor. all: intuition eauto. - simpl in h. constructor. intro. eapply inversion_valid_sampler in h. eauto. Qed.
imports: Coq(Utf8) Relational(OrderEnrichedCategory OrderEnrichedRelativeMonadExamples) mathcomp(ssreflect eqtype choice seq ssrfun ssrbool) extructures(ord fset fmap) Mon(SPropBase) Crypt(Prelude Axioms ChoiceAsOrd RulesStateProb StateTransformingLaxMorph choice_type) Equations.Prop.DepElim Equations(Equations)