proposition: Theorem rsame_head_cmd : ∀ {A B : ord_choiceType} {f₀ f₁ : A → raw_code B} (m : command A) (post : postcond B B), (∀ a, ⊢ ⦃ λ '(h₀, h₁), h₀ = h₁ ⦄ f₀ a ≈ f₁ a ⦃ post ⦄) → ⊢ ⦃ λ '(h₀, h₁), h₀ = h₁ ⦄ x ← cmd m ;; f₀ x ≈ x ← cmd m ;; f₁ x ⦃ post ⦄.
proof: Proof. intros A B f₀ f₁ m post h. eapply from_sem_jdg. rewrite !repr_cmd_bind. eapply (bind_rule_pp (repr_cmd m) (repr_cmd m)). - apply (reflexivity_rule (repr_cmd m)). - intros a₀ a₁. eapply to_sem_jdg. unshelve eapply rpre_weaken_rule. + exact (λ '(h₀, h₁), a₀ = a₁ ∧ h₀ = h₁). + specialize (h a₀). eapply rpre_hypothesis_rule. simpl. intros s₀ s₁ [ea es]. subst. eapply rpre_weaken_rule. 1: exact h. simpl. intros h₀ h₁ [? ?]. subst. reflexivity. + simpl. intros s₀ s₁ e. noconf e. intuition 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)