proposition: Theorem rpost_conclusion_rule_cmd : ∀ {A₀ A₁ B : ord_choiceType} {pre : precond} {c₀ : command A₀} {c₁ : command A₁} (f₀ : A₀ → B) (f₁ : A₁ → B), ⊢ ⦃ pre ⦄ x₀ ← cmd c₀ ;; ret x₀ ≈ x₁ ← cmd c₁ ;; ret x₁ ⦃ λ '(a₀, s₀) '(a₁, s₁), s₀ = s₁ ∧ f₀ a₀ = f₁ a₁ ⦄ → ⊢ ⦃ pre ⦄ x₀ ← cmd c₀ ;; ret (f₀ x₀) ≈ x₁ ← cmd c₁ ;; ret (f₁ x₁) ⦃ eq ⦄.
proof: Proof. intros A₀ A₁ B pre c₀ c₁ f₀ f₁ h. eapply from_sem_jdg. eapply to_sem_jdg in h. rewrite !repr_cmd_bind in h. rewrite !repr_cmd_bind. eapply bind_rule_pp. - simpl (repr (ret _)) in h. rewrite !bindrFree_ret in h. exact h. - intros a₀ a₁. eapply to_sem_jdg. eapply rpre_hypothesis_rule. intros s s' [? e]. subst s'. rewrite e. eapply rpre_weaken_rule. 1: eapply rreflexivity_rule. cbn. intros ? ? [? ?]. subst. reflexivity. 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)