proposition: Lemma r_const_sample_R : ∀ {A : choiceType} (op : Op) c₀ c₁ (pre : precond) (post : postcond A A), LosslessOp op → (∀ x, ⊢ ⦃ pre ⦄ c₀ ≈ c₁ x ⦃ post ⦄) → ⊢ ⦃ pre ⦄ c₀ ≈ x ← sample op ;; c₁ x ⦃ post ⦄.
proof: Proof. intros A op c₀ c₁ pre post hop h. eapply r_transL with (x ← sample op ;; (λ _, c₀) x). - apply r_dead_sample_L. 1: auto. apply rreflexivity_rule. - apply (rsame_head_cmd_alt (cmd_sample op)). + eapply rpre_weaken_rule. 1: eapply cmd_sample_preserve_pre. auto. + apply h. 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)