Documentation

GaudisCrypt.Lib.EC.Strong_RP_RF

EasyCrypt's PRP/PRF switching lemma (theories/crypto/prp_prf/Strong_RP_RF.eca) #

The abstract theory's types D, K and operators uD, dK, q are section variables (with their axioms as hypotheses where used), so a clone is an application. Only what ported developments use is here: ARP, DBounder and the statement of Conclusion.

The PRPi clone (clone import RP as PRPi with op dD <- uD rename "RP" as "PRPi") is PRP.RP.RP D uD. Module variables (PRPi.m, ARP.coll …) are parameters: a clone of this theory declares its own global_vars and passes them.

Distinguishers are EasyCrypt-like modules #

(Exception E2 of the SHA-3 port is a theorem here.)

Every Distinguisher is representable over f and fi (Module.representable_of_firstOrder).

A Distinguisher is EasyCrypt-like as soon as it has finitely many globals.

@[reducible, inline]

clone import RP as PRPi with op dD <- uD rename "RP" as "PRPi", with its module variables PRPi.m, PRPi.mi passed by the clone.

Equations
Instances For

    ARP's module variables coll, m, mi are parameters (see PRP.lean).

    @[simp]
    theorem GaudisCrypt.EC.Strong_RP_RF.ARP.init.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :
    init D uD coll m mi = Module.proc (procedure D uD coll m mi)

    @[simp]: ARP.init = Module.proc ARP.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.

    theorem GaudisCrypt.EC.Strong_RP_RF.ARP.f.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) (holeArgs✝ : HoleSigs.empty.Instantiation) :
    (procedure D uD coll m mi).instantiate holeArgs✝ = proc (x : D) : D { var y : D; if (!decide ((§m).dom §x)) { y <$ uD; coll <- §coll || decide ((§m).rng §y); m <- (§m).set §x §y; mi <- (§mi).set §y §x; } return oget ((§m).get §x) }

    Instantiating the holes of ARP.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

    Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [ARP.f.procedure.apply_simp]).

    noncomputable def GaudisCrypt.EC.Strong_RP_RF.ARP.init.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :

    The body of proc init of module ARP, as a procedure of its own: it calls no module parameter, so it has no holes.

    A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see ARP.init.procedure.apply_simp) rather than run. Use ARP.init for this procedure as a module.

    Equations
    Instances For
      noncomputable def GaudisCrypt.EC.Strong_RP_RF.ARP.f (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :

      proc f of module ARP as a module: Module.proc ARP.f.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — ARP.f.apply_simp says exactly that.

      Equations
      Instances For
        noncomputable def GaudisCrypt.EC.Strong_RP_RF.ARP.fi.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :

        The body of proc fi of module ARP, as a procedure of its own: it calls no module parameter, so it has no holes.

        A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see ARP.fi.procedure.apply_simp) rather than run. Use ARP.fi for this procedure as a module.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem GaudisCrypt.EC.Strong_RP_RF.ARP.init.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) (holeArgs✝ : HoleSigs.empty.Instantiation) :
          (procedure D uD coll m mi).instantiate holeArgs✝ = proc () : Unit { m <- FMap.empty; mi <- FMap.empty; coll <- false; return () }

          Instantiating the holes of ARP.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

          Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [ARP.init.procedure.apply_simp]).

          noncomputable def GaudisCrypt.EC.Strong_RP_RF.ARP.f.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :

          The body of proc f of module ARP, as a procedure of its own: it calls no module parameter, so it has no holes.

          A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see ARP.f.procedure.apply_simp) rather than run. Use ARP.f for this procedure as a module.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[simp]
            theorem GaudisCrypt.EC.Strong_RP_RF.ARP.f.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :
            f D uD coll m mi = Module.proc (procedure D uD coll m mi)

            @[simp]: ARP.f = Module.proc ARP.f.procedure — true by definition, proc f using no module parameter and so having no holes to fill.

            noncomputable def GaudisCrypt.EC.Strong_RP_RF.ARP.init (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :

            proc init of module ARP as a module: Module.proc ARP.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — ARP.init.apply_simp says exactly that.

            Equations
            Instances For
              @[simp]
              theorem GaudisCrypt.EC.Strong_RP_RF.ARP.fi.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :
              fi D uD coll m mi = Module.proc (procedure D uD coll m mi)

              @[simp]: ARP.fi = Module.proc ARP.fi.procedure — true by definition, proc fi using no module parameter and so having no holes to fill.

              theorem GaudisCrypt.EC.Strong_RP_RF.ARP.fi.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) (holeArgs✝ : HoleSigs.empty.Instantiation) :
              (procedure D uD coll m mi).instantiate holeArgs✝ = proc (y : D) : D { var x : D; if (!decide ((§mi).dom §y)) { x <$ uD; coll <- §coll || decide ((§mi).rng §x); m <- (§m).set §x §y; mi <- (§mi).set §y §x; } return oget ((§mi).get §y) }

              Instantiating the holes of ARP.fi.procedure with a tuple holeArgs of procedures: the body of proc fi as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

              Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [ARP.fi.procedure.apply_simp]).

              noncomputable def GaudisCrypt.EC.Strong_RP_RF.ARP (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :

              The module declared by module ARP: the record of its procedures ARP.init, ARP.f, ARP.fi.

              The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no ARP.apply_simp to apply it with.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def GaudisCrypt.EC.Strong_RP_RF.ARP.fi (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (coll : Lens Bool VariableAssignment) (m mi : Lens (FMap D D) VariableAssignment) :

                proc fi of module ARP as a module: Module.proc ARP.fi.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — ARP.fi.apply_simp says exactly that.

                Equations
                Instances For

                  To factor out the difficult step, the PRP is parameterized by a procedure that samples its output (EC's Sample_t), with two instantiations.

                  def GaudisCrypt.EC.Strong_RP_RF.Sample_t (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] :

                  The module type declared by moduletype Sample_t, with fields sample: the type Module Sample_t.typeRep of modules that are a right-nested tuple of the field types.

                  Build one from a record of its fields with Sample_t.mk, read a single field off one with the accessors Sample_t.sample, and get the whole record back with Sample_t.structure.

                  Equations
                  Instances For
                    @[simp]
                    theorem GaudisCrypt.EC.Strong_RP_RF.Sample_t.destruct_mk (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (theModule✝ : Sample_t D) :
                    mk D («structure» D theModule✝) = theModule✝

                    @[simp]: Sample_t.mk (Sample_t.structure m) = m — rebuilding a module from its own fields gives that module back.

                    The ModuleTypeRep underlying Sample_t, the module type declared by moduletype Sample_t: the right-nested product of its 1 field types, in declaration order.

                    Sample_t is by definition Module Sample_t.typeRep.

                    Equations
                    Instances For
                      structure GaudisCrypt.EC.Strong_RP_RF.Sample_t.Structure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] :

                      The record of the fields of a module of type Sample_t: the fields sample, one per moduletype field, each of that field's own module type.

                      Sample_t.mk turns such a record into a Sample_t, Sample_t.structure turns a Sample_t back into one.

                      Instances For
                        noncomputable def GaudisCrypt.EC.Strong_RP_RF.Sample_t.sample (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] :
                        Sample_t D → procmod (D → Prop) → D

                        The field sample of a module of type Sample_t: the projection onto component 0 of the right-nested tuple Sample_t.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

                        Sample_t.sample.mk_simp reads this field back off a module built by Sample_t.mk; Sample_t.sample.utilities has the accessor as a module, and the lemmas about it.

                        Its parameters are named X, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).

                        Equations
                        Instances For
                          @[reducible]
                          noncomputable def GaudisCrypt.EC.Strong_RP_RF.Sample_t.mk (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] :

                          Builds a module of type Sample_t from the record Sample_t.Structure of its fields, as a right-nested Module.pair'. @[reducible].

                          Inverse of Sample_t.structure (Sample_t.mk_destruct, Sample_t.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas Sample_t.sample.mk_simp.

                          Equations
                          Instances For
                            noncomputable def GaudisCrypt.EC.Strong_RP_RF.Sample_t.structure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] :

                            The record of a module's fields: Sample_t.structure m is Sample_t.Structure.mk applied to Sample_t.sample of m.

                            Inverse of Sample_t.mk (Sample_t.mk_destruct, Sample_t.destruct_mk).

                            Equations
                            Instances For
                              @[simp]
                              theorem GaudisCrypt.EC.Strong_RP_RF.Sample_t.mk_destruct (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (theRecord✝ : Structure D) :
                              «structure» D (mk D theRecord✝) = theRecord✝

                              @[simp]: Sample_t.structure (Sample_t.mk r) = r — destructing a module built from a record gives that record back.

                              @[implicit_reducible]
                              instance GaudisCrypt.EC.Strong_RP_RF.instIsModuleSample_t (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] :

                              The IsModule Sample_t instance: Sample_t is a module type, with representation Sample_t.typeRep.

                              It is what lets the name Sample_t stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module Sample_t.typeRep would do on its own but Sample_t, a plain (non-reducible) def, would not.

                              Equations
                              noncomputable def GaudisCrypt.EC.Strong_RP_RF.Sample_t.sample.utilities (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] :

                              What is derivable about the accessor Sample_t.sample, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

                              • Sample_t.sample.utilities.accessorModule : Sample_t →ₘ … — the accessor as a module, a projection being a module morphism;
                              • Sample_t.sample.utilities.apply_simp — Module.app Sample_t.sample.utilities.accessorModule m = Sample_t.sample m: applying that module is the accessor;
                              • Sample_t.sample.utilities.expression_eq — the same at the level of expressions: (Sample_t.sample m).expression = (Sample_t.sample.utilities.proj m.expression).reduce.
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                @[simp]
                                theorem GaudisCrypt.EC.Strong_RP_RF.Sample_t.sample.mk_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (theRecord✝ : Structure D) :
                                sample D (mk D theRecord✝) = theRecord✝.sample

                                @[simp]: reading the field sample back off a module built from a record — Sample_t.sample (Sample_t.mk r) = r.sample.

                                It is what carries the right-hand side of an X.apply_simp (which is an Sample_t.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.sample.apply_simp.

                                noncomputable def GaudisCrypt.EC.Strong_RP_RF.Direct.sample (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) :

                                proc sample of module Direct as a module: Module.proc Direct.sample.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Direct.sample.apply_simp says exactly that.

                                Equations
                                Instances For
                                  noncomputable def GaudisCrypt.EC.Strong_RP_RF.Direct (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) :

                                  The module declared by module Direct: the record of its procedures Direct.sample.

                                  The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no Direct.apply_simp to apply it with.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem GaudisCrypt.EC.Strong_RP_RF.Direct.sample.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) :

                                    @[simp]: Direct.sample = Module.proc Direct.sample.procedure — true by definition, proc sample using no module parameter and so having no holes to fill.

                                    noncomputable def GaudisCrypt.EC.Strong_RP_RF.Direct.sample.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) :

                                    The body of proc sample of module Direct, as a procedure of its own: it calls no module parameter, so it has no holes.

                                    A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Direct.sample.procedure.apply_simp) rather than run. Use Direct.sample for this procedure as a module.

                                    Equations
                                    Instances For
                                      theorem GaudisCrypt.EC.Strong_RP_RF.Direct.sample.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                      (procedure D uD).instantiate holeArgs✝ = proc (X : D → Prop) : D { var r : D; r <$ dexcepted uD §X; return §r }

                                      Instantiating the holes of Direct.sample.procedure with a tuple holeArgs of procedures: the body of proc sample as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                      Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [Direct.sample.procedure.apply_simp]).

                                      noncomputable def GaudisCrypt.EC.Strong_RP_RF.Indirect.sample (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) :

                                      proc sample of module Indirect as a module: Module.proc Indirect.sample.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Indirect.sample.apply_simp says exactly that.

                                      Equations
                                      Instances For
                                        @[simp]
                                        theorem GaudisCrypt.EC.Strong_RP_RF.Indirect.sample.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) :

                                        @[simp]: Indirect.sample = Module.proc Indirect.sample.procedure — true by definition, proc sample using no module parameter and so having no holes to fill.

                                        noncomputable def GaudisCrypt.EC.Strong_RP_RF.Indirect (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) :

                                        The module declared by module Indirect: the record of its procedures Indirect.sample.

                                        The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no Indirect.apply_simp to apply it with.

                                        Equations
                                        Instances For
                                          theorem GaudisCrypt.EC.Strong_RP_RF.Indirect.sample.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                          (procedure D uD).instantiate holeArgs✝ = proc (X : D → Prop) : D { var r : D; r <$ uD; if (decide (§X §r)) { r <$ dexcepted uD §X; } return §r }

                                          Instantiating the holes of Indirect.sample.procedure with a tuple holeArgs of procedures: the body of proc sample as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                          Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [Indirect.sample.procedure.apply_simp]).

                                          noncomputable def GaudisCrypt.EC.Strong_RP_RF.Indirect.sample.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) :

                                          The body of proc sample of module Indirect, as a procedure of its own: it calls no module parameter, so it has no holes.

                                          A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Indirect.sample.procedure.apply_simp) rather than run. Use Indirect.sample for this procedure as a module.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            PRPi' uses the PRPi clone's variables PRPi.m, PRPi.mi, parameters (see PRP.lean).

                                            @[simp]
                                            theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'.f.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (S : Sample_t D) :
                                            Module.app (f D uD PRPi_m PRPi_mi) S = Module.proc ((procedure D uD PRPi_m PRPi_mi).instantiate (Sample_t.sample D S).procedure)

                                            @[simp]: applying PRPi'.f to the parameters proc f uses (S) is Module.proc (PRPi'.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                            theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'.fi.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (holeArgs✝ : (HoleSigs.cons (procsig (D → Prop) → D) HoleSigs.empty).Instantiation) :
                                            (procedure D uD PRPi_m PRPi_mi).instantiate holeArgs✝ = proc (x : D) : D { var r : D; if (!decide ((§PRPi_mi).dom §x)) { r <- call (holeArgs✝.lookup HoleIndex.zero) ((§PRPi_mi).rng); PRPi_mi <- (§PRPi_mi).set §x §r; PRPi_m <- (§PRPi_m).set (oget ((§PRPi_mi).get §x)) §x; } return oget ((§PRPi_mi).get §x) }

                                            Instantiating the holes of PRPi'.fi.procedure with a tuple holeArgs of procedures: the body of proc fi as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                            Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [PRPi'.fi.procedure.apply_simp]).

                                            noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRPi' (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) :

                                            The module declared by module PRPi', abstracted over its single parameter S, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.

                                            Applied to such a tuple it is the record of its procedures PRPi'.init, PRPi'.f, PRPi'.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma PRPi'.apply_simp says.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'.f.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (holeArgs✝ : (HoleSigs.cons (procsig (D → Prop) → D) HoleSigs.empty).Instantiation) :
                                              (procedure D uD PRPi_m PRPi_mi).instantiate holeArgs✝ = proc (x : D) : D { var r : D; if (!decide ((§PRPi_m).dom §x)) { r <- call (holeArgs✝.lookup HoleIndex.zero) ((§PRPi_m).rng); PRPi_m <- (§PRPi_m).set §x §r; PRPi_mi <- (§PRPi_mi).set (oget ((§PRPi_m).get §x)) §x; } return oget ((§PRPi_m).get §x) }

                                              Instantiating the holes of PRPi'.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                              Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [PRPi'.f.procedure.apply_simp]).

                                              noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRPi'.fi (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) :

                                              proc fi of module PRPi' as a module, abstracted over the module parameters it uses (S, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                              Apply it with the @[simp] lemma PRPi'.fi.apply_simp, which fills the holes of PRPi'.fi.procedure with the callees the body called.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                @[simp]
                                                theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (S : Sample_t D) :
                                                Module.app (PRPi' D uD PRPi_m PRPi_mi) S = PRP.StrongPRP.PRP.mk D { init := init D uD PRPi_m PRPi_mi, f := Module.app (f D uD PRPi_m PRPi_mi) S, fi := Module.app (fi D uD PRPi_m PRPi_mi) S }

                                                @[simp]: applying PRPi' to a tuple of its single parameter S — the record of its procedures PRPi'.init, PRPi'.f, PRPi'.fi, each applied to the parameters it uses.

                                                This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with PRPi'.init.apply_simp, PRPi'.f.apply_simp, PRPi'.fi.apply_simp to fill that procedure's holes.

                                                theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'.init.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                (procedure D uD PRPi_m PRPi_mi).instantiate holeArgs✝ = proc () : Unit { call (PRP.StrongPRP.PRP.init D (PRPi.PRPi D uD PRPi_m PRPi_mi)).procedure (); return () }

                                                Instantiating the holes of PRPi'.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [PRPi'.init.procedure.apply_simp]).

                                                @[simp]
                                                theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'.init.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) :
                                                init D uD PRPi_m PRPi_mi = Module.proc (procedure D uD PRPi_m PRPi_mi)

                                                @[simp]: PRPi'.init = Module.proc PRPi'.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.

                                                noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRPi'.fi.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) :

                                                The body of proc fi of module PRPi', as a procedure of its own: the one call it makes to a module parameter (S) is its single hole.

                                                A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see PRPi'.fi.procedure.apply_simp) rather than run. Use PRPi'.fi for this procedure as a module.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRPi'.f.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) :

                                                  The body of proc f of module PRPi', as a procedure of its own: the one call it makes to a module parameter (S) is its single hole.

                                                  A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see PRPi'.f.procedure.apply_simp) rather than run. Use PRPi'.f for this procedure as a module.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRPi'.f (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) :

                                                    proc f of module PRPi' as a module, abstracted over the module parameters it uses (S, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                                    Apply it with the @[simp] lemma PRPi'.f.apply_simp, which fills the holes of PRPi'.f.procedure with the callees the body called.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      @[simp]
                                                      theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'.fi.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (S : Sample_t D) :
                                                      Module.app (fi D uD PRPi_m PRPi_mi) S = Module.proc ((procedure D uD PRPi_m PRPi_mi).instantiate (Sample_t.sample D S).procedure)

                                                      @[simp]: applying PRPi'.fi to the parameters proc fi uses (S) is Module.proc (PRPi'.fi.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                                      noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRPi'.init.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) :

                                                      The body of proc init of module PRPi', as a procedure of its own: it calls no module parameter, so it has no holes.

                                                      A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see PRPi'.init.procedure.apply_simp) rather than run. Use PRPi'.init for this procedure as a module.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRPi'.init (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) :

                                                        proc init of module PRPi' as a module: Module.proc PRPi'.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — PRPi'.init.apply_simp says exactly that.

                                                        Equations
                                                        Instances For

                                                          EC's lossless lemmas (notin_supportIP, excepted_lossless, Indirect_ll, PRPi'_Indirect_f_ll, PRPi'_Indirect_fi_ll): only excepted_lossless is used downstream (ConcreteF); uD's fullness (uD_full) is part of EC's axiom uD_uf_fu.

                                                          theorem GaudisCrypt.EC.Strong_RP_RF.uD_full (D : Type) (uD : SubProbability D) (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (x : D) :
                                                          ↑uD {x} ≠ 0

                                                          uD is full (EC's is_full, part of uD_uf_fu): lossless and uniform, no point has probability 0.

                                                          theorem GaudisCrypt.EC.Strong_RP_RF.excepted_lossless (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (m : FMap D D) (h : ∃ (x : D), ¬m.dom x) :

                                                          lemma excepted_lossless (m : (D,D) fmap): uD \ rng m is lossless when m misses a key.

                                                          The section Upto, with declare module D <: Distinguisher {-PRPi, -ARP} #

                                                          The local module's variable PRP_indirect_bad.bad is the lens parameter PRP_indirect_bad_bad (exception E6 of the SHA-3 port).

                                                          @[simp]
                                                          theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.sample.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :
                                                          sample D uD PRPi_m PRPi_mi PRP_indirect_bad_bad = Module.proc (procedure D uD PRPi_m PRPi_mi PRP_indirect_bad_bad)

                                                          @[simp]: PRP_indirect_bad.sample = Module.proc PRP_indirect_bad.sample.procedure — true by definition, proc sample using no module parameter and so having no holes to fill.

                                                          noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.sample (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                          proc sample of module PRP_indirect_bad as a module: Module.proc PRP_indirect_bad.sample.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — PRP_indirect_bad.sample.apply_simp says exactly that.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                            The module declared by module PRP_indirect_bad: the record of its procedures PRP_indirect_bad.init, PRP_indirect_bad.sample, PRP_indirect_bad.f, PRP_indirect_bad.fi.

                                                            The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no PRP_indirect_bad.apply_simp to apply it with.

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              @[simp]
                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.f.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :
                                                              f D uD PRPi_m PRPi_mi PRP_indirect_bad_bad = Module.proc (procedure D uD PRPi_m PRPi_mi PRP_indirect_bad_bad)

                                                              @[simp]: PRP_indirect_bad.f = Module.proc PRP_indirect_bad.f.procedure — true by definition, proc f using no module parameter and so having no holes to fill.

                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.sample.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                              (procedure D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).instantiate holeArgs✝ = proc (X : D → Prop) : D { var r : D; r <$ uD; if (decide (§X §r)) { PRP_indirect_bad_bad <- true; r <$ dexcepted uD §X; } return §r }

                                                              Instantiating the holes of PRP_indirect_bad.sample.procedure with a tuple holeArgs of procedures: the body of proc sample as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                              Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [PRP_indirect_bad.sample.procedure.apply_simp]).

                                                              noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.f.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                              The body of proc f of module PRP_indirect_bad, as a procedure of its own: it calls no module parameter, so it has no holes.

                                                              A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see PRP_indirect_bad.f.procedure.apply_simp) rather than run. Use PRP_indirect_bad.f for this procedure as a module.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.init.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                                The body of proc init of module PRP_indirect_bad, as a procedure of its own: it calls no module parameter, so it has no holes.

                                                                A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see PRP_indirect_bad.init.procedure.apply_simp) rather than run. Use PRP_indirect_bad.init for this procedure as a module.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.fi (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                                  proc fi of module PRP_indirect_bad as a module: Module.proc PRP_indirect_bad.fi.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — PRP_indirect_bad.fi.apply_simp says exactly that.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.f (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                                    proc f of module PRP_indirect_bad as a module: Module.proc PRP_indirect_bad.f.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — PRP_indirect_bad.f.apply_simp says exactly that.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.init (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                                      proc init of module PRP_indirect_bad as a module: Module.proc PRP_indirect_bad.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — PRP_indirect_bad.init.apply_simp says exactly that.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For
                                                                        theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.fi.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                        (procedure D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).instantiate holeArgs✝ = proc (y : D) : D { var r : D; if (!decide ((§PRPi_mi).dom §y)) { r <- call (sample D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure ((§PRPi_mi).rng); PRPi_mi <- (§PRPi_mi).set §y §r; PRPi_m <- (§PRPi_m).set (oget ((§PRPi_mi).get §y)) §y; } return oget ((§PRPi_mi).get §y) }

                                                                        Instantiating the holes of PRP_indirect_bad.fi.procedure with a tuple holeArgs of procedures: the body of proc fi as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                                        Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [PRP_indirect_bad.fi.procedure.apply_simp]).

                                                                        @[simp]
                                                                        theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.init.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :
                                                                        init D uD PRPi_m PRPi_mi PRP_indirect_bad_bad = Module.proc (procedure D uD PRPi_m PRPi_mi PRP_indirect_bad_bad)

                                                                        @[simp]: PRP_indirect_bad.init = Module.proc PRP_indirect_bad.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.

                                                                        theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.f.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                        (procedure D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).instantiate holeArgs✝ = proc (x : D) : D { var r : D; if (!decide ((§PRPi_m).dom §x)) { r <- call (sample D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure ((§PRPi_m).rng); PRPi_m <- (§PRPi_m).set §x §r; PRPi_mi <- (§PRPi_mi).set (oget ((§PRPi_m).get §x)) §x; } return oget ((§PRPi_m).get §x) }

                                                                        Instantiating the holes of PRP_indirect_bad.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                                        Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [PRP_indirect_bad.f.procedure.apply_simp]).

                                                                        noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.fi.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                                        The body of proc fi of module PRP_indirect_bad, as a procedure of its own: it calls no module parameter, so it has no holes.

                                                                        A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see PRP_indirect_bad.fi.procedure.apply_simp) rather than run. Use PRP_indirect_bad.fi for this procedure as a module.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.init.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                          (procedure D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).instantiate holeArgs✝ = proc () : Unit { call (PRP.StrongPRP.PRP.init D (PRPi.PRPi D uD PRPi_m PRPi_mi)).procedure (); PRP_indirect_bad_bad <- false; return () }

                                                                          Instantiating the holes of PRP_indirect_bad.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                                          Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [PRP_indirect_bad.init.procedure.apply_simp]).

                                                                          noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.sample.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                                          The body of proc sample of module PRP_indirect_bad, as a procedure of its own: it calls no module parameter, so it has no holes.

                                                                          A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see PRP_indirect_bad.sample.procedure.apply_simp) rather than run. Use PRP_indirect_bad.sample for this procedure as a module.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            @[simp]
                                                                            theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.fi.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :
                                                                            fi D uD PRPi_m PRPi_mi PRP_indirect_bad_bad = Module.proc (procedure D uD PRPi_m PRPi_mi PRP_indirect_bad_bad)

                                                                            @[simp]: PRP_indirect_bad.fi = Module.proc PRP_indirect_bad.fi.procedure — true by definition, proc fi using no module parameter and so having no holes to fill.

                                                                            noncomputable def GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad.asPRP (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) :

                                                                            PRP_indirect_bad at the module type PRP.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad_f_ARP_f (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) :
                                                                              prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ (¬PRP_indirect_bad_bad.get g₁ = true ∧ PRPi_m.get g₁ = ARP_m.get g₂ ∧ PRPi_mi.get g₁ = ARP_mi.get g₂) ∧ ¬ARP_coll.get g₂ = true) (PRP_indirect_bad.f D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure (PRP.StrongPRP.PRP.f D (ARP D uD ARP_coll ARP_m ARP_mi)).procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => ARP_coll.get g₂ = true ∧ (PRP_indirect_bad_bad.get g₁ = true ↔ ARP_coll.get g₂ = true) ∨ r₁ = r₂ ∧ (¬PRP_indirect_bad_bad.get g₁ = true ∧ PRPi_m.get g₁ = ARP_m.get g₂ ∧ PRPi_mi.get g₁ = ARP_mi.get g₂) ∧ ¬ARP_coll.get g₂ = true

                                                                              The f bullet of EC's call (_: ARP.coll, !PRP_indirect_bad.bad{1} /\\ ={m,mi}(PRPi,ARP), (PRP_indirect_bad.bad{1} <=> ARP.coll{2})) in pr_PRPi'_Indirect_ARP (EC's proc; if; inline *; swap{1} 1; seq 1 4 …; sp; if{1}): before the bad event ARP.coll, the oracles agree; the bad event comes with PRP_indirect_bad.bad (excepted_lossless for the resampling).

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad_fi_ARP_fi (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) :
                                                                              prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ (¬PRP_indirect_bad_bad.get g₁ = true ∧ PRPi_m.get g₁ = ARP_m.get g₂ ∧ PRPi_mi.get g₁ = ARP_mi.get g₂) ∧ ¬ARP_coll.get g₂ = true) (PRP_indirect_bad.fi D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure (PRP.StrongPRP.PRP.fi D (ARP D uD ARP_coll ARP_m ARP_mi)).procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => ARP_coll.get g₂ = true ∧ (PRP_indirect_bad_bad.get g₁ = true ↔ ARP_coll.get g₂ = true) ∨ r₁ = r₂ ∧ (¬PRP_indirect_bad_bad.get g₁ = true ∧ PRPi_m.get g₁ = ARP_m.get g₂ ∧ PRPi_mi.get g₁ = ARP_mi.get g₂) ∧ ¬ARP_coll.get g₂ = true

                                                                              The fi bullet of that call, as PRP_indirect_bad_f_ARP_f.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad_f_bad (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] :
                                                                              hoareProc (fun (x : (procsig (D) → D).ParamType) (g : VariableAssignment) => PRP_indirect_bad_bad.get g = true) (PRP_indirect_bad.f D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure fun (x : (procsig (D) → D).ret) (g : VariableAssignment) => PRP_indirect_bad_bad.get g = true

                                                                              EC's PRP_indirect_bad.bad ==> PRP_indirect_bad.bad for f (the left oracle keeps invQ once ARP.coll holds).

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad_fi_bad (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] :
                                                                              hoareProc (fun (x : (procsig (D) → D).ParamType) (g : VariableAssignment) => PRP_indirect_bad_bad.get g = true) (PRP_indirect_bad.fi D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure fun (x : (procsig (D) → D).ret) (g : VariableAssignment) => PRP_indirect_bad_bad.get g = true

                                                                              PRP_indirect_bad_f_bad for fi.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.ARP_f_coll (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] (b : Bool) :
                                                                              hoareProc (fun (x : (procsig (D) → D).ParamType) (g : VariableAssignment) => ARP_coll.get g = true ∧ (b = true ↔ ARP_coll.get g = true)) (PRP.StrongPRP.PRP.f D (ARP D uD ARP_coll ARP_m ARP_mi)).procedure fun (x : (procsig (D) → D).ret) (g : VariableAssignment) => ARP_coll.get g = true ∧ (b = true ↔ ARP_coll.get g = true)

                                                                              ARP.f keeps ARP.coll and invQ (EC's move=> &1; proc; if; auto).

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.ARP_fi_coll (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] (b : Bool) :
                                                                              hoareProc (fun (x : (procsig (D) → D).ParamType) (g : VariableAssignment) => ARP_coll.get g = true ∧ (b = true ↔ ARP_coll.get g = true)) (PRP.StrongPRP.PRP.fi D (ARP D uD ARP_coll ARP_m ARP_mi)).procedure fun (x : (procsig (D) → D).ret) (g : VariableAssignment) => ARP_coll.get g = true ∧ (b = true ↔ ARP_coll.get g = true)

                                                                              ARP_f_coll for fi.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.ARP_f_ll (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) (huD : is_lossless uD) :
                                                                              (PRP.StrongPRP.PRP.f D (ARP D uD ARP_coll ARP_m ARP_mi)).procedure.IsLossless

                                                                              ARP.f is lossless.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.ARP_fi_ll (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) (huD : is_lossless uD) :
                                                                              (PRP.StrongPRP.PRP.fi D (ARP D uD ARP_coll ARP_m ARP_mi)).procedure.IsLossless

                                                                              ARP.fi is lossless.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad_f_ll (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) :
                                                                              (PRP_indirect_bad.f D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure.IsLossless

                                                                              PRP_indirect_bad.f is lossless (EC: seq 2: (X = rng PRPi.m /\\ x \\notin PRPi.m) …, excepted_lossless).

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRP_indirect_bad_fi_ll (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) :
                                                                              (PRP_indirect_bad.fi D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure.IsLossless

                                                                              PRP_indirect_bad.fi is lossless.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.fvP_ARP (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] :
                                                                              FVP.fvP (ARP D uD ARP_coll ARP_m ARP_mi) ≤ ARP_coll.footprint ⊔ (ARP_m.footprint ⊔ ARP_mi.footprint)
                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.fvP_PRP_indirect_bad_asPRP (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] :
                                                                              FVP.fvP (PRP_indirect_bad.asPRP D uD PRPi_m PRPi_mi PRP_indirect_bad_bad) ≤ PRPi_m.footprint ⊔ (PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint)
                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.fvP_ARP_f (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] :
                                                                              FVP.fvP (PRP.StrongPRP.PRP.f D (ARP D uD ARP_coll ARP_m ARP_mi)) ≤ ARP_coll.footprint ⊔ (ARP_m.footprint ⊔ ARP_mi.footprint)
                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.fvP_ARP_fi (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] :
                                                                              FVP.fvP (PRP.StrongPRP.PRP.fi D (ARP D uD ARP_coll ARP_m ARP_mi)) ≤ ARP_coll.footprint ⊔ (ARP_m.footprint ⊔ ARP_mi.footprint)
                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.fvP_PRP_indirect_bad_f (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] :
                                                                              FVP.fvP (PRP.StrongPRP.PRP.f D (PRP_indirect_bad.asPRP D uD PRPi_m PRPi_mi PRP_indirect_bad_bad)) ≤ PRPi_m.footprint ⊔ (PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint)
                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.fvP_PRP_indirect_bad_fi (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] :
                                                                              FVP.fvP (PRP.StrongPRP.PRP.fi D (PRP_indirect_bad.asPRP D uD PRPi_m PRPi_mi PRP_indirect_bad_bad)) ≤ PRPi_m.footprint ⊔ (PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint)
                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'_Indirect_f_bad_f (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] :
                                                                              prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ PRP_indirect_bad_bad.equal_outside g₁ g₂ ∧ True) PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)).f.procedure (PRP_indirect_bad.f D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ PRP_indirect_bad_bad.equal_outside g₁ g₂ ∧ True

                                                                              The f oracle of EC's PRPi'_Indirect_eq (inline *; sim): PRPi'(Indirect).f and PRP_indirect_bad.f agree, the states equal except on PRP_indirect_bad.bad.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'_Indirect_fi_bad_fi (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] :
                                                                              prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ PRP_indirect_bad_bad.equal_outside g₁ g₂ ∧ True) PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)).fi.procedure (PRP_indirect_bad.fi D uD PRPi_m PRPi_mi PRP_indirect_bad_bad).procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ PRP_indirect_bad_bad.equal_outside g₁ g₂ ∧ True

                                                                              The fi oracle of EC's PRPi'_Indirect_eq.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'_Indirect_eq_equiv (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] (Dist : PRP.StrongPRP.Distinguisher D) (hDd : FVP.fvP Dist ≤ PRP_indirect_bad_bad.footprintᶜ) :
                                                                              prhlProc (fun (x : (procsig () → Bool).ParamType) (g₁ : VariableAssignment) (x_1 : (procsig () → Bool).ParamType) (g₂ : VariableAssignment) => g₁ = g₂) PRP.StrongPRP.IND(D, PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)), Dist).main.procedure PRP.StrongPRP.IND(D, (PRP_indirect_bad.asPRP D uD PRPi_m PRPi_mi PRP_indirect_bad_bad), Dist).main.procedure fun (r₁ : (procsig () → Bool).ret) (x : VariableAssignment) (r₂ : (procsig () → Bool).ret) (x_1 : VariableAssignment) => r₁ = r₂

                                                                              The byequiv of EC's local lemma PRPi'_Indirect_eq (proc; inline *; sim): the distinguisher called with the two oracles, the states equal except on PRP_indirect_bad.bad (prhlProc_abstract_call_equal_outside_module).

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.pr_PRPi'_Indirect_ARP_equiv (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_m] [PRPi_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_coll] [PRPi_mi.Disjoint ARP_m] [PRPi_mi.Disjoint ARP_mi] [PRPi_mi.Disjoint ARP_coll] [PRP_indirect_bad_bad.Disjoint ARP_m] [PRP_indirect_bad_bad.Disjoint ARP_mi] [PRP_indirect_bad_bad.Disjoint ARP_coll] (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (hfs : (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint).FinitelySupported) (Dist : PRP.StrongPRP.Distinguisher D) (G : Footprint VariableAssignment) (hDG : FVP.fvP Dist ≤ G) (hG : G ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint)ᶜ) (D_ll : ∀ (O : PRP.StrongPRP.SPRP_Oracles D), (FVP.fvP O).FinitelySupported → FVP.fvP O ≤ Gᶜ → (PRP.StrongPRP.SPRP_Oracles.f D O).procedure.IsLossless → (PRP.StrongPRP.SPRP_Oracles.fi D O).procedure.IsLossless → (Module.app Dist O).procedure.IsLossless) :
                                                                              prhlProc (fun (x : (procsig () → Bool).ParamType) (g₁ : VariableAssignment) (x_1 : (procsig () → Bool).ParamType) (g₂ : VariableAssignment) => g₁ = g₂) PRP.StrongPRP.IND(D, (PRP_indirect_bad.asPRP D uD PRPi_m PRPi_mi PRP_indirect_bad_bad), Dist).main.procedure PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), Dist).main.procedure fun (r₁ : (procsig () → Bool).ret) (g₁ : VariableAssignment) (r₂ : (procsig () → Bool).ret) (g₂ : VariableAssignment) => ARP_coll.get g₂ = true ∧ (PRP_indirect_bad_bad.get g₁ = true ↔ ARP_coll.get g₂ = true) ∨ r₁ = r₂ ∧ ¬PRP_indirect_bad_bad.get g₁ = true ∧ ¬ARP_coll.get g₂ = true

                                                                              The byequiv: PRP_indirect_bad.bad of EC's pr_PRPi'_Indirect_ARP: EC's call (_: ARP.coll, !PRP_indirect_bad.bad{1} /\\ ={m,mi}(PRPi,ARP), (PRP_indirect_bad.bad{1} <=> ARP.coll{2})) (prhlProc_abstract_call_upto_module, the oracle state of both sides as one lens, ={glob D} framed syntactically: prhlProc_upto_of_writesKeep; D lossless with both oracles by D_ll, exception E11), then inline *; auto.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.PRPi'_Indirect_eq (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad : Lens Bool VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] (Dist : PRP.StrongPRP.Distinguisher D) (hDd : FVP.fvP Dist ≤ PRP_indirect_bad_bad.footprintᶜ) (m : VariableAssignment) :
                                                                              (PRP.StrongPRP.IND(D, PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)), Dist).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true) = PRP.StrongPRP.IND(D, (PRP_indirect_bad.asPRP D uD PRPi_m PRPi_mi PRP_indirect_bad_bad), Dist).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true

                                                                              EC's local lemma PRPi'_Indirect_eq &m.

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.pr_PRPi'_Indirect_ARP_of_region (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_m] [PRPi_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_coll] [PRPi_mi.Disjoint ARP_m] [PRPi_mi.Disjoint ARP_mi] [PRPi_mi.Disjoint ARP_coll] [PRP_indirect_bad_bad.Disjoint ARP_m] [PRP_indirect_bad_bad.Disjoint ARP_mi] [PRP_indirect_bad_bad.Disjoint ARP_coll] (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (hfs : (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint).FinitelySupported) (Dist : PRP.StrongPRP.Distinguisher D) (G : Footprint VariableAssignment) (hDG : FVP.fvP Dist ≤ G) (hG : G ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint)ᶜ) (D_ll : ∀ (O : PRP.StrongPRP.SPRP_Oracles D), (FVP.fvP O).FinitelySupported → FVP.fvP O ≤ Gᶜ → (PRP.StrongPRP.SPRP_Oracles.f D O).procedure.IsLossless → (PRP.StrongPRP.SPRP_Oracles.fi D O).procedure.IsLossless → (Module.app Dist O).procedure.IsLossless) (m : VariableAssignment) :
                                                                              |↑(PRP.StrongPRP.IND(D, PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)), Dist).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true) - ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), Dist).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true)| ≤ ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), Dist).main.procedure.Pr () m fun (x : (procsig () → Bool).ret) (g : VariableAssignment) => ARP_coll.get g = true)

                                                                              EC's pr_PRPi'_Indirect_ARP, for a distinguisher whose globals are in a region G outside the oracles' variables, lossless with oracles outside G (G = glob D is EC's statement; a region lets PartialConclusion apply it to DBounder(D), whose glob is not D's).

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.pr_PRPi'_Indirect_ARP (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (PRP_indirect_bad_bad ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] [PRP_indirect_bad_bad.Disjoint PRPi_m] [PRP_indirect_bad_bad.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_m] [PRPi_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_coll] [PRPi_mi.Disjoint ARP_m] [PRPi_mi.Disjoint ARP_mi] [PRPi_mi.Disjoint ARP_coll] [PRP_indirect_bad_bad.Disjoint ARP_m] [PRP_indirect_bad_bad.Disjoint ARP_mi] [PRP_indirect_bad_bad.Disjoint ARP_coll] (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (hfs : (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint).FinitelySupported) (Dist : PRP.StrongPRP.Distinguisher D) (hDg : (FVP.fvP Dist).glob ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ PRP_indirect_bad_bad.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint)ᶜ) (D_ll : ∀ (O : PRP.StrongPRP.SPRP_Oracles D), (FVP.fvP O).FinitelySupported → FVP.fvP O ≤ (FVP.fvP Dist).globᶜ → (PRP.StrongPRP.SPRP_Oracles.f D O).procedure.IsLossless → (PRP.StrongPRP.SPRP_Oracles.fi D O).procedure.IsLossless → (Module.app Dist O).procedure.IsLossless) (m : VariableAssignment) :
                                                                              |↑(PRP.StrongPRP.IND(D, PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)), Dist).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true) - ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), Dist).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true)| ≤ ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), Dist).main.procedure.Pr () m fun (x : (procsig () → Bool).ret) (g : VariableAssignment) => ARP_coll.get g = true)

                                                                              EC's lemma pr_PRPi'_Indirect_ARP &m, for declare module D <: Distinguisher {-PRPi, -ARP} with the axiom D_ll (the restriction stated against glob D, exception E7; the module variables are lens parameters, disjoint, exception E8).

                                                                              DBounder.FBounder's module variable c is a parameter (see PRP.lean).

                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.DBounder.FBounder.fi.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (q : ℤ) (c : Lens ℤ VariableAssignment) (holeArgs✝ : (HoleSigs.cons (procsig (D) → D) HoleSigs.empty).Instantiation) :
                                                                              (procedure D q c).instantiate holeArgs✝ = proc (x : D) : D { var r : D; r <- default; if (decide (§c < q)) { r <- call (holeArgs✝.lookup HoleIndex.zero) (§x); c <- §c + 1; } return §r }

                                                                              Instantiating the holes of DBounder.FBounder.fi.procedure with a tuple holeArgs of procedures: the body of proc fi as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                                              Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [DBounder.FBounder.fi.procedure.apply_simp]).

                                                                              noncomputable def GaudisCrypt.EC.Strong_RP_RF.DBounder.FBounder.fi.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (q : ℤ) (c : Lens ℤ VariableAssignment) :

                                                                              The body of proc fi of module DBounder.FBounder, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.

                                                                              A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see DBounder.FBounder.fi.procedure.apply_simp) rather than run. Use DBounder.FBounder.fi for this procedure as a module.

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                @[simp]

                                                                                @[simp]: applying DBounder.FBounder.f to the parameters proc f uses (F) is Module.proc (DBounder.FBounder.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                                                                The module declared by module DBounder.FBounder, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.

                                                                                Applied to such a tuple it is the record of its procedures DBounder.FBounder.f, DBounder.FBounder.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DBounder.FBounder.apply_simp says.

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For

                                                                                  proc fi of module DBounder.FBounder as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                                                                  Apply it with the @[simp] lemma DBounder.FBounder.fi.apply_simp, which fills the holes of DBounder.FBounder.fi.procedure with the callees the body called.

                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    theorem GaudisCrypt.EC.Strong_RP_RF.DBounder.FBounder.f.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (q : ℤ) (c : Lens ℤ VariableAssignment) (holeArgs✝ : (HoleSigs.cons (procsig (D) → D) HoleSigs.empty).Instantiation) :
                                                                                    (procedure D q c).instantiate holeArgs✝ = proc (x : D) : D { var r : D; r <- default; if (decide (§c < q)) { r <- call (holeArgs✝.lookup HoleIndex.zero) (§x); c <- §c + 1; } return §r }

                                                                                    Instantiating the holes of DBounder.FBounder.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                                                    Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [DBounder.FBounder.f.procedure.apply_simp]).

                                                                                    proc f of module DBounder.FBounder as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                                                                    Apply it with the @[simp] lemma DBounder.FBounder.f.apply_simp, which fills the holes of DBounder.FBounder.f.procedure with the callees the body called.

                                                                                    Equations
                                                                                    • One or more equations did not get rendered due to their size.
                                                                                    Instances For
                                                                                      @[simp]

                                                                                      @[simp]: applying DBounder.FBounder.fi to the parameters proc fi uses (F) is Module.proc (DBounder.FBounder.fi.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                                                                      @[simp]

                                                                                      @[simp]: applying DBounder.FBounder to a tuple of its single parameter F — the record of its procedures DBounder.FBounder.f, DBounder.FBounder.fi, each applied to the parameters it uses.

                                                                                      This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with DBounder.FBounder.f.apply_simp, DBounder.FBounder.fi.apply_simp to fill that procedure's holes.

                                                                                      noncomputable def GaudisCrypt.EC.Strong_RP_RF.DBounder.FBounder.f.procedure (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (q : ℤ) (c : Lens ℤ VariableAssignment) :

                                                                                      The body of proc f of module DBounder.FBounder, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.

                                                                                      A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see DBounder.FBounder.f.procedure.apply_simp) rather than run. Use DBounder.FBounder.f for this procedure as a module.

                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For
                                                                                        @[simp]
                                                                                        theorem GaudisCrypt.EC.Strong_RP_RF.DBounder.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (q : ℤ) (c : Lens ℤ VariableAssignment) (Dist : PRP.StrongPRP.Distinguisher D) (F : PRP.StrongPRP.SPRP_Oracles D) :
                                                                                        DBounder(D, q, c, Dist, F).distinguish = Module.app (distinguish D q c Dist) F

                                                                                        @[simp]: applying DBounder to a tuple of its single parameter F — the record of its procedures DBounder.distinguish, each applied to the parameters it uses.

                                                                                        This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with DBounder.distinguish.apply_simp to fill that procedure's holes.

                                                                                        The module declared by module DBounder, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.

                                                                                        Applied to such a tuple it is the record of its procedures DBounder.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DBounder.apply_simp says.

                                                                                        Equations
                                                                                        Instances For
                                                                                          theorem GaudisCrypt.EC.Strong_RP_RF.DBounder.distinguish.procedure.apply_simp (D : Type) [_gaudiParam0 : DecidableEq D] [_gaudiParam1 : Inhabited D] (q : ℤ) (c : Lens ℤ VariableAssignment) (Dist : PRP.StrongPRP.Distinguisher D) (holeArgs✝ : (HoleSigs.cons (procsig () → Bool) HoleSigs.empty).Instantiation) :
                                                                                          (procedure D q c Dist).instantiate holeArgs✝ = proc () : Bool { var b : Bool; c <- 0; b <- call (holeArgs✝.lookup HoleIndex.zero) (); return §b }

                                                                                          Instantiating the holes of DBounder.distinguish.procedure with a tuple holeArgs of procedures: the body of proc distinguish as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                                                          Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [DBounder.distinguish.procedure.apply_simp]).

                                                                                          The body of proc distinguish of module DBounder, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.

                                                                                          A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see DBounder.distinguish.procedure.apply_simp) rather than run. Use DBounder.distinguish for this procedure as a module.

                                                                                          Equations
                                                                                          Instances For

                                                                                            proc distinguish of module DBounder as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                                                                            Apply it with the @[simp] lemma DBounder.distinguish.apply_simp, which fills the holes of DBounder.distinguish.procedure with the callees the body called.

                                                                                            Equations
                                                                                            • One or more equations did not get rendered due to their size.
                                                                                            Instances For
                                                                                              @[simp]

                                                                                              @[simp]: applying DBounder.distinguish to the parameters proc distinguish uses (F) is Module.proc (DBounder.distinguish.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                                                                              DBounder(D) touches D's variables and its counter.

                                                                                              DBounder.FBounder(O).f is lossless if O.f is (EC: proc; sp; if; wp; call O_f_ll).

                                                                                              DBounder(D) is lossless with O if D is with DBounder.FBounder(O) (EC's call (D_ll (<: DBounder(D,O).FBounder) _ _) in PartialConclusion).

                                                                                              The section CollisionProbability #

                                                                                              With declare module D <: Distinguisher {-ARP, -DBounder}.

                                                                                              EC's local module FEL(D) (DBounder with EC's invariant built into its oracles) is not ported: the potential below carries the invariant (see IND_ARP_DBounder_potential).

                                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.expected_mono_le {γ : Type} {μ : SubProbability γ} {f g : γ → ENNReal} (h : ∀ (a : γ), f a ≤ g a) :
                                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.expected_const_le_self {γ : Type} (μ : SubProbability γ) (c : ENNReal) :
                                                                                              (μ.expected fun (x : γ) => c) ≤ c
                                                                                              theorem GaudisCrypt.EC.Strong_RP_RF.expected_rng_le (D : Type) [DecidableEq D] [Inhabited D] {d : SubProbability D} (hfu : is_funiform d) (m : FMap D D) :
                                                                                              (d.expected fun (a : D) => indicatorE (m.rng a)) ≤ ↑m.fdom.card * ↑d {default}

                                                                                              A uniform draw lands in the range of m with probability at most |dom m| · μ.

                                                                                              noncomputable def GaudisCrypt.EC.Strong_RP_RF.collPotential (D : Type) (q : ℤ) (μ : ENNReal) (s : ℤ × FMap D D × FMap D D × Bool) :

                                                                                              The potential of EC's fel 2 in pr_PRFi_collision, on (c, ARP.m, ARP.mi, ARP.coll): 1 once ARP.coll, the bound still to pay for the queries from c on while |dom ARP.m|, |dom ARP.mi| ≤ c (EC's invariant), ⊤ otherwise.

                                                                                              Equations
                                                                                              • One or more equations did not get rendered due to their size.
                                                                                              Instances For
                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.card_fdom_set_le (D : Type) [DecidableEq D] (m : FMap D D) (x y : D) :
                                                                                                ↑(m.set x y).fdom.card ≤ ↑m.fdom.card + 1
                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.collPotential_step (D : Type) [DecidableEq D] [Inhabited D] {d : SubProbability D} (hfu : is_funiform d) (q b : ℤ) (m mi : FMap D D) (coll : Bool) (Q : Prop) [Decidable Q] (m' mi' : D → FMap D D) (hm' : ∀ (a : D), ↑(m' a).fdom.card ≤ ↑m.fdom.card + 1) (hmi' : ∀ (a : D), ↑(mi' a).fdom.card ≤ ↑mi.fdom.card + 1) (R : FMap D D) (hR : R = m ∨ R = mi) :
                                                                                                (if b < q then if Q then d.expected fun (a : D) => collPotential D q (↑d {default}) (b + 1, m' a, mi' a, coll || decide (R.rng a)) else collPotential D q (↑d {default}) (b + 1, m, mi, coll) else collPotential D q (↑d {default}) (b, m, mi, coll)) ≤ collPotential D q (↑d {default}) (b, m, mi, coll)

                                                                                                The step of EC's fel 2, at a query x of f from the potential's state (c, m, mi, coll): the potential does not increase in expectation.

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.DBounder_ARP_f_potential (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (q : ℤ) (c : Lens ℤ VariableAssignment) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [c.Disjoint ARP_m] [c.Disjoint ARP_mi] [c.Disjoint ARP_coll] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] (hfu : is_funiform uD) :
                                                                                                phoareProc (fun (x : (procsig (D) → D).ParamType) (x_1 : VariableAssignment) => True) DBounder.FBounder(D, q, c, (ARP D uD ARP_coll ARP_m ARP_mi)).f.procedure (fun (x : (procsig (D) → D).ret) (g : VariableAssignment) => collPotential D q (↑uD {default}) (c.get g, ARP_m.get g, ARP_mi.get g, ARP_coll.get g)) (fun (x1 x2 : ENNReal) => x1 ≤ x2) fun (x : (procsig (D) → D).ParamType) (g : VariableAssignment) => collPotential D q (↑uD {default}) (c.get g, ARP_m.get g, ARP_mi.get g, ARP_coll.get g)

                                                                                                The oracle premise of EC's fel 2 for f: a query of DBounder(ARP).f does not increase the potential in expectation (collPotential_step, EC's rnd (rng ARP.m) and mu_mem_le).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.DBounder_ARP_fi_potential (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (q : ℤ) (c : Lens ℤ VariableAssignment) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [c.Disjoint ARP_m] [c.Disjoint ARP_mi] [c.Disjoint ARP_coll] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] (hfu : is_funiform uD) :
                                                                                                phoareProc (fun (x : (procsig (D) → D).ParamType) (x_1 : VariableAssignment) => True) DBounder.FBounder(D, q, c, (ARP D uD ARP_coll ARP_m ARP_mi)).fi.procedure (fun (x : (procsig (D) → D).ret) (g : VariableAssignment) => collPotential D q (↑uD {default}) (c.get g, ARP_m.get g, ARP_mi.get g, ARP_coll.get g)) (fun (x1 x2 : ENNReal) => x1 ≤ x2) fun (x : (procsig (D) → D).ParamType) (g : VariableAssignment) => collPotential D q (↑uD {default}) (c.get g, ARP_m.get g, ARP_mi.get g, ARP_coll.get g)

                                                                                                The oracle premise for fi.

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.IND_ARP_DBounder_potential (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (q : ℤ) (c : Lens ℤ VariableAssignment) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [Countable D] [c.Disjoint ARP_m] [c.Disjoint ARP_mi] [c.Disjoint ARP_coll] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] (hfu : is_funiform uD) (Dist : PRP.StrongPRP.Distinguisher D) (hDd : FVP.fvP Dist ≤ (ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ c.footprint)ᶜ) :
                                                                                                phoareProc (fun (x : (procsig () → Bool).ParamType) (x_1 : VariableAssignment) => True) PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), (DBounder D q c Dist)).main.procedure (fun (x : (procsig () → Bool).ret) (g : VariableAssignment) => indicatorE (ARP_coll.get g = true)) (fun (x1 x2 : ENNReal) => x1 ≤ x2) fun (x : (procsig () → Bool).ParamType) (x_1 : VariableAssignment) => ∑ i ∈ Finset.Ico (Int.toNat 0) q.toNat, ↑i * ↑uD {default}

                                                                                                EC's fel 2 FEL.c (fun x, x%r * mu uD (pred1 witness)) q ARP.coll … in pr_PRFi_collision, as a supermartingale over the distinguisher (Module.ewp_app_le). The potential is ⊤ off EC's invariant card (fdom ARP.m) <= c /\\ card (fdom ARP.mi) <= c, so it applies to IND(ARP, DBounder(D)) directly: EC's two haves through c <= q and the local module FEL (which restates DBounder with that invariant) are not needed.

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.pr_PRFi_collision (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (q : ℤ) (c : Lens ℤ VariableAssignment) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) [Countable D] [c.Disjoint ARP_m] [c.Disjoint ARP_mi] [c.Disjoint ARP_coll] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] (hfu : is_funiform uD) (Dist : PRP.StrongPRP.Distinguisher D) (hDd : FVP.fvP Dist ≤ (ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ c.footprint)ᶜ) (m : VariableAssignment) :
                                                                                                ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), (DBounder D q c Dist)).main.procedure.Pr () m fun (x : (procsig () → Bool).ret) (g : VariableAssignment) => ARP_coll.get g = true) ≤ ↑(q ^ 2 - q) / 2 * (↑uD {default}).toReal

                                                                                                EC's lemma pr_PRFi_collision &m, for declare module D <: Distinguisher {-ARP, -DBounder} (EC's D_ll is not needed; q of either sign, EC's ge0_q not needed either).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.PartialConclusion_of_region (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (q : ℤ) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) (FBounder_c : Lens ℤ VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_m] [PRPi_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_coll] [PRPi_mi.Disjoint ARP_m] [PRPi_mi.Disjoint ARP_mi] [PRPi_mi.Disjoint ARP_coll] [FBounder_c.Disjoint PRPi_m] [FBounder_c.Disjoint PRPi_mi] [FBounder_c.Disjoint ARP_m] [FBounder_c.Disjoint ARP_mi] [FBounder_c.Disjoint ARP_coll] (hfs : (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ FBounder_c.footprint).FinitelySupported) (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (Dist : PRP.StrongPRP.Distinguisher D) (hD : Module.ECModule Dist (SPRP_Oracles.ext D)) (G GF : Footprint VariableAssignment) (hGF : GF.FinitelySupported) (hGGF : G ≤ GF.glob) (hDG : FVP.fvP Dist ≤ G) (hG : G ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ FBounder_c.footprint)ᶜ) (D_ll : ∀ (O : PRP.StrongPRP.SPRP_Oracles D), (FVP.fvP O).FinitelySupported → FVP.fvP O ≤ Gᶜ → (PRP.StrongPRP.SPRP_Oracles.f D O).procedure.IsLossless → (PRP.StrongPRP.SPRP_Oracles.fi D O).procedure.IsLossless → (Module.app Dist O).procedure.IsLossless) (m : VariableAssignment) :
                                                                                                |↑(PRP.StrongPRP.IND(D, PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)), (DBounder D q FBounder_c Dist)).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true) - ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), (DBounder D q FBounder_c Dist)).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true)| ≤ ↑(q ^ 2 - q) / 2 * (↑uD {default}).toReal

                                                                                                PartialConclusion with D's losslessness over a region G containing D and outside the module variables (exception E14 of the SHA-3 port), G inside the glob of a finitely supported GF (for the fresh choice of the section Upto's local variable).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.PartialConclusion (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (q : ℤ) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (ARP_coll : Lens Bool VariableAssignment) (ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) (FBounder_c : Lens ℤ VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_m] [PRPi_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_coll] [PRPi_mi.Disjoint ARP_m] [PRPi_mi.Disjoint ARP_mi] [PRPi_mi.Disjoint ARP_coll] [FBounder_c.Disjoint PRPi_m] [FBounder_c.Disjoint PRPi_mi] [FBounder_c.Disjoint ARP_m] [FBounder_c.Disjoint ARP_mi] [FBounder_c.Disjoint ARP_coll] (hfs : (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ FBounder_c.footprint).FinitelySupported) (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (Dist : PRP.StrongPRP.Distinguisher D) (hD : Module.ECModule Dist (SPRP_Oracles.ext D)) (hDg : (FVP.fvP Dist).glob ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ FBounder_c.footprint)ᶜ) (D_ll : ∀ (O : PRP.StrongPRP.SPRP_Oracles D), (FVP.fvP O).FinitelySupported → FVP.fvP O ≤ (FVP.fvP Dist).globᶜ → (PRP.StrongPRP.SPRP_Oracles.f D O).procedure.IsLossless → (PRP.StrongPRP.SPRP_Oracles.fi D O).procedure.IsLossless → (Module.app Dist O).procedure.IsLossless) (m : VariableAssignment) :
                                                                                                |↑(PRP.StrongPRP.IND(D, PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)), (DBounder D q FBounder_c Dist)).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true) - ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), (DBounder D q FBounder_c Dist)).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true)| ≤ ↑(q ^ 2 - q) / 2 * (↑uD {default}).toReal

                                                                                                EC's lemma PartialConclusion (D <: Distinguisher {-PRPi, -ARP, -DBounder}) &m. The section Upto's local variable PRP_indirect_bad.bad is chosen fresh (exception E6), outside glob D too; pr_PRPi'_Indirect_ARP is applied to DBounder(D) at the region glob D ⊔ DBounder.c.

                                                                                                The section PRPi_PRPi'_Indirect #

                                                                                                local clone include Dexcepted.TwoStepSampling with type i <- unit, type t <- D, op dt _ <- uD is dexcepted_indirect (Lib/EC/Dexcepted.lean).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.eq_Direct_Indirect (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (huD : is_lossless uD) :
                                                                                                prhlProc (fun (a₁ : (procsig (D → Prop) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D → Prop) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ g₁ = g₂) (Direct.sample D uD).procedure (Indirect.sample D uD).procedure fun (r₁ : (procsig (D → Prop) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D → Prop) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ g₁ = g₂

                                                                                                EC's equiv eq_Direct_Indirect : Direct.sample ~ Indirect.sample : ={X} ==> ={res} (of the section PRPi_PRPi'_Indirect; here before it, as PRPi' follows), with ={glob} kept (EC's call rule frames it; uD lossless, EC's dD_ll of the TwoStepSampling clone). The right side's run is a sampling from uD \ X (dexcepted_indirect), coupled by the identity (equiv_rnd_run).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.eq_PRPi_PRPi'_f_Direct (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) [PRPi_m.Disjoint PRPi_mi] :
                                                                                                prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ g₁ = g₂) (PRP.StrongPRP.PRP.f D (PRPi.PRPi D uD PRPi_m PRPi_mi)).procedure PRPi'(D, uD, PRPi_m, PRPi_mi, (Direct D uD)).f.procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ g₁ = g₂

                                                                                                The first half of EC's transitivity PRPi'(Direct).f in eq_PRPi_PRPi'_f_Indirect: PRPi.f ~ PRPi'(Direct).f (EC's proc; inline *; if; auto).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.eq_PRPi'_f_Direct_Indirect (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (huD : is_lossless uD) :
                                                                                                prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ g₁ = g₂) PRPi'(D, uD, PRPi_m, PRPi_mi, (Direct D uD)).f.procedure PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)).f.procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ g₁ = g₂

                                                                                                The second half: PRPi'(Direct).f ~ PRPi'(Indirect).f (EC's proc; if; wp; call eq_Direct_Indirect).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.eq_PRPi_PRPi'_fi_Direct (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) [PRPi_m.Disjoint PRPi_mi] :
                                                                                                prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ g₁ = g₂) (PRP.StrongPRP.PRP.fi D (PRPi.PRPi D uD PRPi_m PRPi_mi)).procedure PRPi'(D, uD, PRPi_m, PRPi_mi, (Direct D uD)).fi.procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ g₁ = g₂

                                                                                                eq_PRPi_PRPi'_f_Direct for fi.

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.eq_PRPi'_fi_Direct_Indirect (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) (huD : is_lossless uD) :
                                                                                                prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ g₁ = g₂) PRPi'(D, uD, PRPi_m, PRPi_mi, (Direct D uD)).fi.procedure PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)).fi.procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ g₁ = g₂

                                                                                                eq_PRPi'_f_Direct_Indirect for fi.

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.eq_PRPi_PRPi'_f_Indirect (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) [PRPi_m.Disjoint PRPi_mi] (huD : is_lossless uD) :
                                                                                                prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ g₁ = g₂) (PRP.StrongPRP.PRP.f D (PRPi.PRPi D uD PRPi_m PRPi_mi)).procedure PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)).f.procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ g₁ = g₂

                                                                                                EC's local equiv eq_PRPi_PRPi'_f_Indirect : PRPi.f ~ PRPi'(Indirect).f : ={x, PRPi.m, PRPi.mi} ==> ={res, PRPi.m, PRPi.mi}, at equal states (the invariant of the abstract call below), by EC's transitivity PRPi'(Direct).f (prhlProc.trans).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.eq_PRPi_PRPi'_fi_Indirect (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) [PRPi_m.Disjoint PRPi_mi] (huD : is_lossless uD) :
                                                                                                prhlProc (fun (a₁ : (procsig (D) → D).ParamType) (g₁ : VariableAssignment) (a₂ : (procsig (D) → D).ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ g₁ = g₂) (PRP.StrongPRP.PRP.fi D (PRPi.PRPi D uD PRPi_m PRPi_mi)).procedure PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)).fi.procedure fun (r₁ : (procsig (D) → D).ret) (g₁ : VariableAssignment) (r₂ : (procsig (D) → D).ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ g₁ = g₂

                                                                                                EC's local equiv eq_PRPi_PRPi'_fi_Indirect, as eq_PRPi_PRPi'_f_Indirect.

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.pr_PRPi_PRPi'_Indirect_equiv (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] (huD : is_lossless uD) (Dist : PRP.StrongPRP.Distinguisher D) (hDd : FVP.fvP Dist ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint)ᶜ) :
                                                                                                prhlProc (fun (x : (procsig () → Bool).ParamType) (g₁ : VariableAssignment) (x_1 : (procsig () → Bool).ParamType) (g₂ : VariableAssignment) => g₁ = g₂) PRP.StrongPRP.IND(D, (PRPi.PRPi D uD PRPi_m PRPi_mi), Dist).main.procedure PRP.StrongPRP.IND(D, PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)), Dist).main.procedure fun (r₁ : (procsig () → Bool).ret) (x : VariableAssignment) (r₂ : (procsig () → Bool).ret) (x_1 : VariableAssignment) => r₁ = r₂

                                                                                                The byequiv of EC's pr_PRPi_PRPi'_Indirect: IND(PRPi, D) ~ IND(PRPi'(Indirect), D), by EC's call (_: ={PRPi.m, PRPi.mi}) (prhlProc_abstract_call_equal_outside_module with I equality; [Countable D] for the rule, exception E8).

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.pr_PRPi_PRPi'_Indirect (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (PRPi_m PRPi_mi : Lens (FMap D D) VariableAssignment) [Countable D] [PRPi_m.Disjoint PRPi_mi] (huD : is_lossless uD) (Dist : PRP.StrongPRP.Distinguisher D) (hDd : FVP.fvP Dist ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint)ᶜ) (m : VariableAssignment) :
                                                                                                (PRP.StrongPRP.IND(D, (PRPi.PRPi D uD PRPi_m PRPi_mi), Dist).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true) = PRP.StrongPRP.IND(D, PRPi'(D, uD, PRPi_m, PRPi_mi, (Indirect D uD)), Dist).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true

                                                                                                EC's pr_PRPi_PRPi'_Indirect &m, for declare module D <: Distinguisher {-PRPi}.

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.Conclusion_of_region (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (q : ℤ) [Countable D] (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (PRPi_m PRPi_mi ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) (ARP_coll : Lens Bool VariableAssignment) (FBounder_c : Lens ℤ VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_m] [PRPi_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_coll] [PRPi_mi.Disjoint ARP_m] [PRPi_mi.Disjoint ARP_mi] [PRPi_mi.Disjoint ARP_coll] [FBounder_c.Disjoint PRPi_m] [FBounder_c.Disjoint PRPi_mi] [FBounder_c.Disjoint ARP_m] [FBounder_c.Disjoint ARP_mi] [FBounder_c.Disjoint ARP_coll] (hfs : (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ FBounder_c.footprint).FinitelySupported) (Dist : PRP.StrongPRP.Distinguisher D) (hD : (FVP.fvP Dist).FinitelySupported) (G GF : Footprint VariableAssignment) (hGF : GF.FinitelySupported) (hGGF : G ≤ GF.glob) (hDG : FVP.fvP Dist ≤ G) (hG : G ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ FBounder_c.footprint)ᶜ) (m : VariableAssignment) :
                                                                                                (∀ (O : PRP.StrongPRP.SPRP_Oracles D), (FVP.fvP O).FinitelySupported → FVP.fvP O ≤ Gᶜ → (PRP.StrongPRP.SPRP_Oracles.f D O).procedure.IsLossless → (PRP.StrongPRP.SPRP_Oracles.fi D O).procedure.IsLossless → (Module.app Dist O).procedure.IsLossless) → |↑(PRP.StrongPRP.IND(D, (PRPi.PRPi D uD PRPi_m PRPi_mi), (DBounder D q FBounder_c Dist)).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true) - ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), (DBounder D q FBounder_c Dist)).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true)| ≤ ↑(q ^ 2 - q) / 2 * (↑uD {default}).toReal

                                                                                                Conclusion with D's losslessness over a region G containing D and outside the module variables (exception E14 of the SHA-3 port), G inside the glob of a finitely supported GF.

                                                                                                theorem GaudisCrypt.EC.Strong_RP_RF.Conclusion (D : Type) [DecidableEq D] [Inhabited D] (uD : SubProbability D) (q : ℤ) [Countable D] (uD_uf_fu : ↑uD Set.univ = 1 ∧ ∀ (x y : D), ↑uD {x} = ↑uD {y}) (PRPi_m PRPi_mi ARP_m ARP_mi : Lens (FMap D D) VariableAssignment) (ARP_coll : Lens Bool VariableAssignment) (FBounder_c : Lens ℤ VariableAssignment) [PRPi_m.Disjoint PRPi_mi] [ARP_coll.Disjoint ARP_m] [ARP_coll.Disjoint ARP_mi] [ARP_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_m] [PRPi_m.Disjoint ARP_mi] [PRPi_m.Disjoint ARP_coll] [PRPi_mi.Disjoint ARP_m] [PRPi_mi.Disjoint ARP_mi] [PRPi_mi.Disjoint ARP_coll] [FBounder_c.Disjoint PRPi_m] [FBounder_c.Disjoint PRPi_mi] [FBounder_c.Disjoint ARP_m] [FBounder_c.Disjoint ARP_mi] [FBounder_c.Disjoint ARP_coll] (hfs : (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ FBounder_c.footprint).FinitelySupported) (Dist : PRP.StrongPRP.Distinguisher D) (hD : (FVP.fvP Dist).FinitelySupported) (_hD : (FVP.fvP Dist).glob ≤ (PRPi_m.footprint ⊔ PRPi_mi.footprint ⊔ ARP_coll.footprint ⊔ ARP_m.footprint ⊔ ARP_mi.footprint ⊔ FBounder_c.footprint)ᶜ) (m : VariableAssignment) :
                                                                                                (∀ (O : PRP.StrongPRP.SPRP_Oracles D), (FVP.fvP O).FinitelySupported → FVP.fvP O ≤ (FVP.fvP Dist).globᶜ → (PRP.StrongPRP.SPRP_Oracles.f D O).procedure.IsLossless → (PRP.StrongPRP.SPRP_Oracles.fi D O).procedure.IsLossless → (Module.app Dist O).procedure.IsLossless) → |↑(PRP.StrongPRP.IND(D, (PRPi.PRPi D uD PRPi_m PRPi_mi), (DBounder D q FBounder_c Dist)).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true) - ↑(PRP.StrongPRP.IND(D, (ARP D uD ARP_coll ARP_m ARP_mi), (DBounder D q FBounder_c Dist)).main.procedure.Pr () m fun (r : (procsig () → Bool).ret) (x : VariableAssignment) => r = true)| ≤ ↑(q ^ 2 - q) / 2 * (↑uD {default}).toReal

                                                                                                EC's Conclusion, for D <: Distinguisher {-PRPi, -ARP, -DBounder}, under the theory's axiom uD_uf_fu (uD uniform, lossless and full). mu uD (pred1 witness) is the probability of default. The restriction is stated against glob D (exception E7); the module variables are lens parameters, disjoint and finitely supported (exceptions E6, E8; a clone with global_vars discharges these); D's representation is a theorem (Distinguisher.ecModule).