proposition: Theorem rif_rule : ∀ {A₀ A₁ : ord_choiceType} (c₀ c₀' : raw_code A₀) (c₁ c₁' : raw_code A₁) {b₀ b₁} {pre : precond} {post : postcond A₀ A₁}, (∀ s, pre s → b₀ = b₁) → ⊢ ⦃ λ s, pre s ∧ b₀ = true ⦄ c₀ ≈ c₁ ⦃ post ⦄ → ⊢ ⦃ λ s, pre s ∧ b₀ = false ⦄ c₀' ≈ c₁' ⦃ post ⦄ → ⊢ ⦃ pre ⦄ if b₀ then c₀ else c₀' ≈ if b₁ then c₁ else c₁' ⦃ post ⦄.
proof: Proof. intros A₀ A₁ c₀ c₀' c₁ c₁' b₀ b₁ pre post hb ht hf. eapply from_sem_jdg. eapply to_sem_jdg in ht, hf. rewrite !repr_if. eapply if_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)