Documentation

GaudisCrypt.Examples.SHA3.SmartCounter.ConcreteF

From the permutation to a random function (EasyCrypt proof/smart_counter/ConcreteF.eca) — #

EC-fidelity port

The real game with the ideal permutation is close to the same game with PF, a random function with an inverse, up to the PRP/PRF switching bound (Real_Concrete).

Translation (as SmartCounter/SLCommon.lean):

Declarations of the first port #

Definitions and plain lemmas of the first port of this file (2026-10/11) that the proofs below use; its program-logic proofs are gone.

The first port's translation notes (some mention declarations that went with its proofs):

instance GaudisCrypt.SHA3.ConcreteF.instIsGlobalVarFMapStateMMk [SLCommon.Params] :
PF.m.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.ConcreteF.PF.m" (EC.FMap state state))

EC's PF.m.

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

    EC's PF.mi.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      instance GaudisCrypt.SHA3.ConcreteF.instIsGlobalVarFMapStateMiMk [SLCommon.Params] :
      PF.mi.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.ConcreteF.PF.mi" (EC.FMap state state))

      The body of proc init of module PF, 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 PF.init.procedure.apply_simp) rather than run. Use PF.init for this procedure as a module.

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

        The body of proc fi of module PF, 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 PF.fi.procedure.apply_simp) rather than run. Use PF.fi for this procedure as a module.

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

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

          Equations
          Instances For
            @[simp]

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

            theorem GaudisCrypt.SHA3.ConcreteF.PF.f.procedure.apply_simp [SLCommon.Params] (holeArgs✝ : HoleSigs.empty.Instantiation) :
            procedure.instantiate holeArgs✝ = proc (x : state) : state { var y1 : Common.block, y2 : Common.capacity; if (!decide ((§m).dom §x)) { y1 <$ Common.bdistr; y2 <$ Common.cdistr; m <- (§m).set §x (§y1, §y2); mi <- (§mi).set (§y1, §y2) §x; } return EC.oget ((§m).get §x) }

            Instantiating the holes of PF.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 [PF.f.procedure.apply_simp]).

            @[simp]

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

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

            Equations
            Instances For

              The module declared by module PF: the record of its procedures PF.init, PF.f, PF.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 PF.apply_simp to apply it with.

              Equations
              Instances For

                The body of proc f of module PF, 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 PF.f.procedure.apply_simp) rather than run. Use PF.f for this procedure as a module.

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

                  Instantiating the holes of PF.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 [PF.init.procedure.apply_simp]).

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

                  Equations
                  Instances For
                    theorem GaudisCrypt.SHA3.ConcreteF.PF.fi.procedure.apply_simp [SLCommon.Params] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                    procedure.instantiate holeArgs✝ = proc (x : state) : state { var y1 : Common.block, y2 : Common.capacity; if (!decide ((§mi).dom §x)) { y1 <$ Common.bdistr; y2 <$ Common.cdistr; mi <- (§mi).set §x (§y1, §y2); m <- (§m).set (§y1, §y2) §x; } return EC.oget ((§mi).get §x) }

                    Instantiating the holes of PF.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 [PF.fi.procedure.apply_simp]).

                    @[simp]

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

                    @[reducible, inline]

                    EC's state (SLCommonCore's, named here: a root state exists).

                    Equations
                    Instances For
                      @[reducible, inline]

                      module CF(D : DISTINGUISHER) = Indif(SqueezelessSponge(PF), PF, D).

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

                        local clone import Strong_RP_RF as Switching with type D <- state, op uD <- dstate, type K <- unit, op dK <- (MUnit.dunit<:unit> tt), op q <- max_size.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          instance GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.instIsGlobalVarFMapStateMMk [SLCommon.Params] :
                          PRPi.m.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.PRPi.m" (EC.FMap state state))
                          instance GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.instIsGlobalVarFMapStateMiMk [SLCommon.Params] :
                          PRPi.mi.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.PRPi.mi" (EC.FMap state state))
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            Equations
                            Instances For
                              instance GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.instIsGlobalVarBoolCollMk :
                              ARP.coll.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.ARP.coll" Bool)
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                instance GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.instIsGlobalVarFMapStateMMk_1 [SLCommon.Params] :
                                ARP.m.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.ARP.m" (EC.FMap state state))
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  instance GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.instIsGlobalVarFMapStateMiMk_1 [SLCommon.Params] :
                                  ARP.mi.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.ARP.mi" (EC.FMap state state))
                                  instance GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.instIsGlobalVarIntCMk :
                                  DBounder.FBounder.c.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.ConcreteF.Switching.DBounder.FBounder.c" ℤ)
                                  Equations
                                  Instances For
                                    @[reducible, inline]

                                    The clone's PRPi.PRPi (the theory's clone import RP as PRPi).

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

                                      The clone's ARP.

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

                                        The clone's DBounder.

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

                                          The globs of SqueezelessSponge and Perm, which EC reads off their code (Module.GlobBound: instance search derives the restrictions against them). Not EC lemmas.

                                          EC's lemma size_behead (l : 'a list) : l <> [] => size (behead l) = size l - 1.

                                          EC's smt(domE mem_set get_setE take_size cat_take_drop) in DoubleBounding's conseq, the facts smt_close does not find: the query bs₀ added, with its block sa.

                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.db_query_block [SLCommon.Params] (Q : EC.FMap (List Common.block) Common.block) (P R : EC.FMap (List Common.block) state) (bs₀ : List Common.block) (sa : Common.block) (sc : Common.capacity) (x : List Common.block) (hx : (Q.set bs₀ sa).dom x) (hinv : SLCommon.Prefix.prefix_inv Q P) (hPR : ∀ (y : List Common.block), P.dom y → P.get y = R.get y) (hQP : ∀ (y : List Common.block), Q.dom y → P.dom y) (hR : R.get (EC.take (EC.size bs₀) bs₀) = some (sa, sc)) :
                                          EC.oget ((Q.set bs₀ sa).get x) = (EC.oget (R.get x)).1
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.db_query_prefixes [SLCommon.Params] (Q : EC.FMap (List Common.block) Common.block) (P R : EC.FMap (List Common.block) state) (bs₀ : List Common.block) (sa : Common.block) (x : List Common.block) (i : ℤ) (hx : (Q.set bs₀ sa).dom x) (hinv : SLCommon.Prefix.prefix_inv Q P) (hR : ∀ (y : List Common.block), R.dom y ↔ P.dom y ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ EC.size bs₀ ∧ y = EC.take j bs₀) :
                                          R.dom (EC.take i x)
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.db_query_extend [SLCommon.Params] (Q : EC.FMap (List Common.block) Common.block) (P R : EC.FMap (List Common.block) state) (bs₀ : List Common.block) (sa : Common.block) (x : List Common.block) (i : ℤ) (hne : EC.take i x ≠ []) (hdom : R.dom (EC.take i x)) (hinv : SLCommon.Prefix.prefix_inv Q P) (hR : ∀ (y : List Common.block), R.dom y ↔ P.dom y ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ EC.size bs₀ ∧ y = EC.take j bs₀) :
                                          ∃ (l2 : List Common.block), (Q.set bs₀ sa).dom (EC.take i x ++ l2)

                                          EC's smt facts in DoubleBounding's second loop that smt_close does not find: the round adds the prefix take (i+1) p to Redo.prefixes.

                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.db_loop_prefix_closed [SLCommon.Params] (R pref : EC.FMap (List Common.block) state) (p x : List Common.block) (i i' : ℤ) (v : state) (hx : (R.set (EC.take (i + 1) p) v).dom x) (hall : SLCommon.Prefix.all_prefixes R) (hi : 0 ≤ i) (hR : ∀ (y : List Common.block), R.dom y ↔ pref.dom y ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ i ∧ y = EC.take j p) :
                                          (R.set (EC.take (i + 1) p) v).dom (EC.take i' x)
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.db_loop_next [SLCommon.Params] (R : EC.FMap (List Common.block) state) (p : List Common.block) (i : ℤ) (v : state) (h : (R.set (EC.take (i + 1) p) v).dom (EC.take (i + 1 + 1) p)) (hall : SLCommon.Prefix.all_prefixes R) (hi : 0 ≤ i) (hlt : i + 1 < EC.size p) (hn : ¬R.dom (EC.take (i + 1) p)) :
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.db_loop_dom [SLCommon.Params] (R pref : EC.FMap (List Common.block) state) (p y : List Common.block) (i : ℤ) (v : state) (hR : ∀ (y : List Common.block), R.dom y ↔ pref.dom y ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ i ∧ y = EC.take j p) (hi : 0 ≤ i) :
                                          (R.set (EC.take (i + 1) p) v).dom y ↔ pref.dom y ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ i + 1 ∧ y = EC.take j p

                                          EC's facts in DoubleBounding's first loop: the prefixes of bs up to its longest queried prefix are known (prefix_exchange moves the longest prefix from the queries to the prefixes).

                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.db_first_get [SLCommon.Params] (R : EC.FMap (List Common.block) state) (bs : List Common.block) (i : ℤ) (hg : (decide (i < EC.size bs) && decide (R.dom (EC.take (i + 1) bs))) = true) :
                                          R.get (EC.take (i + 1) bs) = some ((EC.oget (R.get (EC.take (i + 1) bs))).1, (EC.oget (R.get (EC.take (i + 1) bs))).2)
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.db_init_dom [SLCommon.Params] {β γ : Type} (v : β) (w : γ) (bs : List Common.block) (i : ℤ) (h : (EC.FMap.empty.set [] w).dom bs) :

                                          EC's smt(mem_set mem_empty) on the initial maps: the keys of {[] ↦ w} are [], so are their prefixes.

                                          EC's facts in Real_Concrete's first step (the new query bs, Redo.prefixes from P to R: P's entries kept, the prefixes of bs added, nothing else), the conseq goals smt_close does not find (EC's progress bullets: two by hand, three smt).

                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.rc_take_in [SLCommon.Params] (R : EC.FMap (List Common.block) state) (bs : List Common.block) (hRin : ∀ (j : ℤ), 0 ≤ j → j ≤ EC.size bs → R.dom (EC.take j bs)) (i : ℤ) :
                                          R.dom (EC.take i bs)
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.rc_query_block [SLCommon.Params] (Q : EC.FMap (List Common.block) Common.block) (P R : EC.FMap (List Common.block) state) (bs : List Common.block) (sa : Common.block) (sc : Common.capacity) (x : List Common.block) (hx : (Q.set bs sa).dom x) (hinv : SLCommon.Prefix.prefix_inv Q P) (hPR : ∀ (l : List Common.block), P.dom l → P.get l = R.get l) (hR : R.get (EC.take (EC.size bs) bs) = some (sa, sc)) :
                                          EC.oget ((Q.set bs sa).get x) = (EC.oget (R.get x)).1
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.rc_query_prefixes [SLCommon.Params] (Q : EC.FMap (List Common.block) Common.block) (P R : EC.FMap (List Common.block) state) (bs : List Common.block) (sa : Common.block) (x : List Common.block) (i : ℤ) (hx : (Q.set bs sa).dom x) (hinv : SLCommon.Prefix.prefix_inv Q P) (hPR : ∀ (l : List Common.block), P.dom l → P.get l = R.get l) (hRin : ∀ (j : ℤ), 0 ≤ j → j ≤ EC.size bs → R.dom (EC.take j bs)) :
                                          R.dom (EC.take i x)
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.rc_query_extend [SLCommon.Params] (Q : EC.FMap (List Common.block) Common.block) (P R : EC.FMap (List Common.block) state) (bs : List Common.block) (sa : Common.block) (x : List Common.block) (i : ℤ) (hne : EC.take i x ≠ []) (hdom : R.dom (EC.take i x)) (hinv : SLCommon.Prefix.prefix_inv Q P) (hRout : ∀ (l : List Common.block), R.dom l → P.dom l ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ EC.size bs ∧ l = EC.take j bs) :
                                          ∃ (l2 : List Common.block), (Q.set bs sa).dom (EC.take i x ++ l2)
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.rc_all_prefixes [SLCommon.Params] (P R : EC.FMap (List Common.block) state) (bs l : List Common.block) (i : ℤ) (hl : R.dom l) (hall : SLCommon.Prefix.all_prefixes P) (hPR : ∀ (l : List Common.block), P.dom l → P.get l = R.get l) (hRin : ∀ (j : ℤ), 0 ≤ j → j ≤ EC.size bs → R.dom (EC.take j bs)) (hRout : ∀ (l : List Common.block), R.dom l → P.dom l ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ EC.size bs ∧ l = EC.take j bs) :
                                          R.dom (EC.take i l)

                                          EC's facts in Real_Concrete's first step, second loop: a round past the longest queried prefix adds take (i+1) p, which was nowhere yet (EC's prefix_exchange).

                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.rc_loop_closed [SLCommon.Params] (Q : EC.FMap (List Common.block) Common.block) (R : EC.FMap (List Common.block) state) (p x : List Common.block) (i i' : ℤ) (v : state) (hx : (R.set (EC.take (i + 1) p) v).dom x) (hall : SLCommon.Prefix.all_prefixes R) (hpre : SLCommon.Prefix.prefix p (SLCommon.Prefix.get_max_prefix p (EC.FSet.elems Q.fdom)) ≤ i) (hRin : ∀ (j : ℤ), 0 ≤ j → j ≤ i → R.dom (EC.take j p)) :
                                          (R.set (EC.take (i + 1) p) v).dom (EC.take i' x)
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.rc_loop_in [SLCommon.Params] (R : EC.FMap (List Common.block) state) (p : List Common.block) (i j : ℤ) (v : state) (hRin : ∀ (j : ℤ), 0 ≤ j → j ≤ i → R.dom (EC.take j p)) (hj0 : 0 ≤ j) (hj : j ≤ i + 1) :
                                          (R.set (EC.take (i + 1) p) v).dom (EC.take j p)
                                          theorem GaudisCrypt.SHA3.Pilot.ConcreteF.rc_loop_out [SLCommon.Params] (Q : EC.FMap (List Common.block) Common.block) (P R : EC.FMap (List Common.block) state) (p l : List Common.block) (i : ℤ) (v : state) (hpre : SLCommon.Prefix.prefix p (SLCommon.Prefix.get_max_prefix p (EC.FSet.elems Q.fdom)) ≤ i) (hRout : ∀ (l : List Common.block), R.dom l → P.dom l ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ i ∧ l = EC.take j p) (hl : (R.set (EC.take (i + 1) p) v).dom l) :
                                          P.dom l ∨ ∃ (j : ℤ), 0 ≤ j ∧ j ≤ i + 1 ∧ l = EC.take j p

                                          EC's facts in Real_Concrete's first step, first loop: it stops exactly at the longest queried prefix (EC's take_get_max_prefix, prefix_exchange).

                                          @[reducible, inline]

                                          local module GReal' = Indif(FC(SqueezelessSponge(Perm)), PC(Perm), D).

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

                                            @[simp]: applying D' to a tuple of its single parameter P' — the record of its procedures D'.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 D'.distinguish.apply_simp to fill that procedure's holes.

                                            The body of proc distinguish of module D', as a procedure of its own: the one call it makes to a module parameter (P') 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 D'.distinguish.procedure.apply_simp) rather than run. Use D'.distinguish for this procedure as a module.

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

                                              The module declared by module D', abstracted over its single parameter P', 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 D'.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma D'.apply_simp says.

                                              Equations
                                              Instances For
                                                @[simp]

                                                @[simp]: applying D'.distinguish to the parameters proc distinguish uses (P') is Module.proc (D'.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.

                                                Instantiating the holes of D'.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 [D'.distinguish.procedure.apply_simp]).

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

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

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

                                                  The first step of EC's Real_Concrete (its have ->:): Pr[RealIndif(SqueezelessSponge, PC(Perm), D).main() @ &m: res /\ C.c <= max_size] = Pr[GReal'.main() @ &m: res /\ C.c <= max_size]; a theorem of its own (EC's proof, step for step).

                                                  The globs of the concrete modules, which EC reads off their code (Module.GlobBound: instance search derives the restrictions against them). Not EC lemmas.

                                                  The clone's lemma Conclusion (D <: Distinguisher {-PRPi, -ARP, -DBounder}) &m: (forall (O <: SPRP_Oracles{-D}), islossless O.f => islossless O.fi => islossless D(O).distinguish) => |Pr[IND(PRPi,DBounder(D)).main() @ &m: res] - Pr[IND(ARP,DBounder(D)).main() @ &m: res]| <= (q^2 - q)%r / 2%r * mu uD (pred1 witness): the library's (Lib/EC/Strong_RP_RF.lean) at the clone's variables. EC's restrictions are on EC's glob D (Module.ECGlob, a local module's globfrom its code):Doutside the clone's variables, the oraclesO <: SPRP_Oracles{-D}` declared against it.

                                                  theorem GaudisCrypt.SHA3.Pilot.ConcreteF.Real_Concrete [SLCommon.Params] (D : SLCommon.DISTINGUISHER) [Module.Declared D (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ Switching.DBounder.FBounder.c.footprint ⊔ Switching.ARP.coll.footprint ⊔ Switching.ARP.m.footprint ⊔ Switching.ARP.mi.footprint ⊔ Switching.PRPi.m.footprint ⊔ Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ Switching.DBounder.FBounder.c.footprint ⊔ Switching.ARP.coll.footprint ⊔ Switching.ARP.m.footprint ⊔ Switching.ARP.mi.footprint ⊔ Switching.PRPi.m.footprint ⊔ Switching.PRPi.mi.footprint)] (D_ll : ∀ (F : SLCommon.DFUNCTIONALITY) [Module.Declared F R] (P : SLCommon.DPRIMITIVE) [Module.Declared P R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block) Common.block P).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block) Common.block P).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block) Common.block F).procedure.IsLossless → (Module.app D (Module.pair F P)).procedure.IsLossless) (m : VariableAssignment) :

                                                  EC's lemma Real_Concrete &m : Pr[GReal(D).main()@ &m: res /\ C.c <= max_size] <= Pr[CF(DRestr(D)).main()@ &m: res] + (max_size ^ 2 - max_size)%r / 2%r * mu dstate (pred1 witness).