proposition: Lemma r_bind_assertD : ∀ (A B : choice_type) b k1 (k2 : _ → raw_code B), ⊢ ⦃ λ '(h₀, h₁), h₀ = h₁ ⦄ x ← (@assertD A b (λ z, k1 z)) ;; k2 x ≈ @assertD B b (λ z, x ← k1 z ;; k2 x) ⦃ eq ⦄.
proof: Proof. intros A B b k1 k2. destruct b. - simpl. apply rreflexivity_rule. - simpl. unfold fail. eapply from_sem_jdg. intros [s₀ s₁]. hnf. intro P. hnf. intros [hpre hpost]. simpl. exists dnull. split. + unfold coupling. split. * unfold lmg. apply distr_ext. intro. unfold dfst. rewrite dlet_null. unfold SDistr_bind. rewrite dlet_null. reflexivity. * unfold rmg. apply distr_ext. intro. unfold dsnd. rewrite dlet_null. unfold SDistr_bind. rewrite dlet_null. reflexivity. + intros [? ?] [? ?]. rewrite dnullE. rewrite order.Order.POrderTheory.ltxx. discriminate. Qed.
imports: Coq(Utf8) Relational(OrderEnrichedCategory OrderEnrichedRelativeMonadExamples) mathcomp(ssrnat ssreflect ssrfun ssrbool ssrnum eqtype choice reals distr seq all_algebra fintype realsum) extructures(ord fset fmap) Mon(SPropBase) Crypt(Prelude Axioms ChoiceAsOrd SubDistr Couplings RulesStateProb UniformStateProb UniformDistrLemmas StateTransfThetaDens StateTransformingLaxMorph choice_type pkg_core_definition pkg_notation pkg_tactics pkg_composition pkg_heap pkg_semantics pkg_lookup pkg_advantage pkg_invariants pkg_distr) Equations.Prop.DepElim Equations(Equations) Crypt(FreeProbProg)