proposition: Lemma r_cmd_fail : ∀ A (B : choice_type) (c : command A) (pre : precond) (post : postcond B B), ⊢ ⦃ pre ⦄ fail ≈ c ;' fail ⦃ post ⦄.
proof: Proof. intros A B c pre post. eapply r_transR. - unfold fail. eapply rswap_cmd_eq with (c₀ := cmd_sample _) (c₁ := c). eapply rsamplerC'_cmd with (c := c). - 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)