proposition: Lemma r_uniform_bij : ∀ {A₀ A₁ : ord_choiceType} i j `{Positive i} `{Positive j} pre post f (c₀ : _ → raw_code A₀) (c₁ : _ → raw_code A₁), bijective f → (∀ x, ⊢ ⦃ pre ⦄ c₀ x ≈ c₁ (f x) ⦃ post ⦄) → ⊢ ⦃ pre ⦄ x ← sample uniform i ;; c₀ x ≈ x ← sample uniform j ;; c₁ x ⦃ post ⦄.
proof: Proof. intros A₀ A₁ i j pi pj pre post f c₀ c₁ bijf h. eapply from_sem_jdg. change (repr (sampler (uniform ?i) ?k)) with (bindrFree (@Uniform_F (mkpos i) heap_choiceType) (λ x, repr (k x))). eapply bind_rule_pp. - eapply Uniform_bij_rule. eauto. - intros a₀ a₁. simpl. eapply to_sem_jdg. eapply rpre_hypothesis_rule. intros s₀ s₁ [hs e]. move: e => /eqP e. subst. eapply rpre_weaken_rule. 1: eapply h. intros h₀ h₁. simpl. intros [? ?]. 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)