proposition: Theorem hyb_security_based_on_prf LA A q: ValidPackage LA [interface #val #[query]: 'unit → 'word × 'word ] A_export A -> fdisjoint LA ( EVAL_locs_tt :|: EVAL_locs_ff :|: GEN_HYB_locs ) -> AdvantageE (GEN_HYB_pkg 0) (GEN_HYB_pkg q) A <= \sum_(i < q) prf_epsilon (A ∘ GEN_HYB_EVAL_pkg i).
proof: Proof. move=> vA H. elim: q => [|q IHq]. 1: by rewrite big_ord0 /AdvantageE GRing.subrr normr0. ssprove triangle (GEN_HYB_pkg 0) [:: pack (GEN_HYB_pkg q) ; GEN_HYB_EVAL_pkg q ∘ EVAL true ; GEN_HYB_EVAL_pkg q ∘ EVAL false ] (GEN_HYB_pkg q.+1) A as ineq. apply: le_trans. 1: by apply: ineq. rewrite !fdisjointUr in H. move: H => /andP [/andP [H1 H2] H3]. move: {ineq H1 H2 H3} (H1, H2, H3) => H. rewrite GEN_GEN_HYB_equiv ?fdisjointUr ?H // GRing.addr0. rewrite GEN_GEN_HYB_EVAL_equiv ?fdisjointUr ?H // GRing.addr0. rewrite big_ord_recr ler_add //. by rewrite /prf_epsilon Advantage_E Advantage_link Advantage_sym. Qed.
imports: Relational(OrderEnrichedCategory GenericRulesSimple) mathcomp(all_ssreflect all_algebra reals distr realsum ssrnat ssreflect ssrfun ssrbool ssrnum eqtype choice seq) Mon(SPropBase) Crypt(Axioms ChoiceAsOrd SubDistr Couplings UniformDistrLemmas FreeProbProg Theta_dens RulesStateProb pkg_core_definition choice_type pkg_composition pkg_rhl Package Prelude) extructures(ord fset fmap) Equations(Equations)