proposition: Lemma r_scheme_bind_spec : ∀ {A B : choiceType} (φ : A → Prop) (pre : precond) (post : postcond B B) s c₀ c₁, ⊢ₛ s ⦃ φ ⦄ → (∀ x, φ x → ⊢ ⦃ pre ⦄ c₀ x ≈ c₁ x ⦃ post ⦄) → ⊢ ⦃ pre ⦄ x ← s ;; c₀ x ≈ x ← s ;; c₁ x ⦃ post ⦄.
proof: Proof. intros A B φ pre post s c₀ c₁ hs hc. eapply r_bind. 1: eapply hs. intros ? x. apply rpre_hypothesis_rule. intuition subst. eapply rpre_weaken_rule. - eapply hc. auto. - simpl. intuition subst. auto. 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)