proposition: Theorem r_dead_sample_L : ∀ {A B : choiceType} (op : Op) c₀ c₁ (pre : precond) (post : postcond A B), LosslessOp op → ⊢ ⦃ pre ⦄ c₀ ≈ c₁ ⦃ post ⦄ → ⊢ ⦃ pre ⦄ _ ← sample op ;; c₀ ≈ c₁ ⦃ post ⦄.
proof: Proof. intros A B op c₀ c₁ pre post hop h. change ( ⊢ ⦃ pre ⦄ (_ ← sample op ;; ret Datatypes.tt) ;; c₀ ≈ ret Datatypes.tt ;; c₁ ⦃ post ⦄ ). eapply r_bind with (mid := λ '(b₀, s₀) '(b₁, s₁), pre (s₀, s₁)). - eapply r_dead_sample. all: auto. - intros _ _. eapply rpre_weaken_rule. all: eauto. 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)