Documentation

GaudisCrypt.Examples.SHA3.Sponge

The sponge construction (EasyCrypt proof/Sponge.ec) — EC-fidelity port #

Ported on the strict tactics: Sponge_is_StdSponge (EC l. 99); the whole theory HybridIRO (EC l. 256–1909; l. 1188–1282, the modules BlockSpongeTrans and BlockGen, are the first port's); Sponge_Raise_BlockSponge_f (EC l. 1922), which was the second tactic experiment and is described below; and the final section with conclusion (EC l. 1913–2163).

Translation:

Gap list (batch-fix later, see TRANSFER_SKILL.md §1.6):

Sponge_Raise_BlockSponge_f in EC's form — the second tactic experiment #

A procedure-level equivalence with two-sided loops, EC's inline M.f, seq n m : P, rcondt{i}, case, call (_ : ={glob Perm}) on a concrete module and auto, over the old port's declarations (section FirstPort below). It drove stmt_inline (M.f) (Logic/ECInline.lean), EC's equiv_seq positions (Logic/ECSeq.lean), equiv_auto, equiv_call (_ : ={glob P}) on a concrete callee, and the closers of hoare_auto/equiv_auto.

Deviations, all from the old declarations or the closers:

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):

Indifferentiability: `clone include Indifferentiability with type p <- block * capacity, #

type f_in <- bool list * int, type f_out <- bool list rename [module] "Indif" as "Experiment" [module] "GReal" as "RealIndif" [module] "GIdeal" as "IdealIndif"`

@[implicit_reducible]

EC's subtyping PRIMITIVE <: DPRIMITIVE (its f, fi).

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

EC's subtyping FUNCTIONALITY <: DFUNCTIONALITY (its f).

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

BlockSponge's PRIMITIVE where the bit sponge's DPRIMITIVE is expected (one module type in EC: both are Indifferentiability's at block * capacity).

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

The ideal functionality: `clone import IRO as BIRO with type from <- bool list, #

type to <- bool, op valid <- valid_toplevel, op dto <- dbool`

instance GaudisCrypt.SHA3.Sponge.BIRO.instIsGlobalVarFMapProdListBoolIntMpMk :
IRO.mp.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Sponge.BIRO.IRO.mp" (EC.FMap (List Bool × ℤ) Bool))

The clone's module variable BIRO.IRO.mp.

Equations
Instances For

    BIRO.IRO as the functionality it is used as (its procedures init and f).

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

      The sponge construction #

      @[simp]

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

      The module declared by module StdSponge, 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 StdSponge.init, StdSponge.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma StdSponge.apply_simp says.

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

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

        proc f of module StdSponge 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 StdSponge.f.apply_simp, which fills the holes of StdSponge.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 StdSponge.f to the parameters proc f uses (P) is Module.proc (StdSponge.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 body of proc f of module StdSponge, 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 StdSponge.f.procedure.apply_simp) rather than run. Use StdSponge.f 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 init of module StdSponge, 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 StdSponge.init.procedure.apply_simp) rather than run. Use StdSponge.init for this procedure as a module.

            Equations
            Instances For

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

              theorem GaudisCrypt.SHA3.Sponge.StdSponge.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : (HoleSigs.cons (procsig (Common.block × Common.capacity) → Common.block × Common.capacity) HoleSigs.empty).Instantiation) :
              procedure.instantiate holeArgs✝ = proc (x : List Bool × ℤ) : (List Bool) { var bs : List Bool, n : ℤ, z : List Bool, sa : Common.block, sc : Common.capacity, finished : Bool, xs : List Common.block; bs, n <- §x; z <- []; sa, sc <- (Common.b0, Common.c0); finished <- false; xs <- Common.pad2blocks §bs; while (!(§xs).isEmpty) { sa, sc <- call (holeArgs✝.lookup HoleIndex.zero) (§sa +^ EC.head Common.b0 §xs, §sc); xs <- EC.behead §xs; } while (!§finished) { z <- §z ++ Common.ofblock §sa; if (decide (EC.size §z < §n)) { sa, sc <- call (holeArgs✝.lookup HoleIndex.zero) (§sa, §sc); } else { finished <- true; } } return EC.take §n §z }

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

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

              Equations
              Instances For

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

                @[simp]

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

                @[simp]

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

                theorem GaudisCrypt.SHA3.Sponge.Sponge.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : (HoleSigs.cons (procsig (Common.block × Common.capacity) → Common.block × Common.capacity) HoleSigs.empty).Instantiation) :
                procedure.instantiate holeArgs✝ = proc (x : List Bool × ℤ) : (List Bool) { var bs : List Bool, n : ℤ, z : List Bool, sa : Common.block, sc : Common.capacity, i : ℤ, xs : List Common.block; bs, n <- §x; z <- []; sa, sc <- (Common.b0, Common.c0); i <- 0; xs <- Common.pad2blocks §bs; while (!(§xs).isEmpty) { sa, sc <- call (holeArgs✝.lookup HoleIndex.zero) (§sa +^ EC.head Common.b0 §xs, §sc); xs <- EC.behead §xs; } while (decide (§i < (§n + Common.r - 1) / Common.r)) { z <- §z ++ Common.ofblock §sa; i <- §i + 1; if (decide (§i < (§n + Common.r - 1) / Common.r)) { sa, sc <- call (holeArgs✝.lookup HoleIndex.zero) (§sa, §sc); } } return EC.take §n §z }

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

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

                Equations
                Instances For

                  proc f of module Sponge 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 Sponge.f.apply_simp, which fills the holes of Sponge.f.procedure with the callees the body called.

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

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

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

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

                      Equations
                      Instances For
                        @[simp]

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

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

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

                          Simulator and distinguisher constructions #

                          proc f of module LowerFun 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 LowerFun.f.apply_simp, which fills the holes of LowerFun.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 LowerFun to a tuple of its single parameter F — the record of its procedures LowerFun.f, 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 LowerFun.f.apply_simp to fill that procedure's holes.

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

                            @[simp]

                            @[simp]: applying LowerFun.f to the parameters proc f uses (F) is Module.proc (LowerFun.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 body of proc f of module LowerFun, 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 LowerFun.f.procedure.apply_simp) rather than run. Use LowerFun.f 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 LowerFun, 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 LowerFun.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma LowerFun.apply_simp says.

                              Equations
                              Instances For

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

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

                                  proc f of module RaiseFun 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 RaiseFun.f.apply_simp, which fills the holes of RaiseFun.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 RaiseFun to a tuple of its single parameter F — the record of its procedures RaiseFun.f, 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 RaiseFun.f.apply_simp to fill that procedure's holes.

                                    @[simp]

                                    @[simp]: applying RaiseFun.f to the parameters proc f uses (F) is Module.proc (RaiseFun.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.

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

                                    The module declared by module RaiseFun, 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 RaiseFun.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma RaiseFun.apply_simp says.

                                    Equations
                                    Instances For
                                      @[simp]

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

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

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

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

                                        Equations
                                        Instances For

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

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

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

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

                                            @[simp]

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

                                            module RaiseSim (S : BlockSponge.SIMULATOR, F : DFUNCTIONALITY) = S(LowerFun(F)), used as RaiseSim(S) : SIMULATOR.

                                            Equations
                                            Instances For

                                              The abstract theory of hybrid IROs (abstract theory HybridIRO) #

                                              Hybrid IROs map a block list and an index to a bit. The theory has no parameters and is cloned once (HIRO, in the last section): its declarations are the clone's.

                                              @[reducible]

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

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

                                              Equations
                                              Instances For

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

                                                • HYBRID_IRO.f.utilities.accessorModule : HYBRID_IRO →ₘ … — the accessor as a module, a projection being a module morphism;
                                                • HYBRID_IRO.f.utilities.apply_simp — Module.app HYBRID_IRO.f.utilities.accessorModule m = HYBRID_IRO.f m: applying that module is the accessor;
                                                • HYBRID_IRO.f.utilities.expression_eq — the same at the level of expressions: (HYBRID_IRO.f m).expression = (HYBRID_IRO.f.utilities.proj m.expression).reduce.
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  @[simp]

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

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

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

                                                  Equations
                                                  Instances For
                                                    @[simp]

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

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

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

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

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

                                                    Equations
                                                    Instances For
                                                      @[implicit_reducible]

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

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

                                                      Equations

                                                      The record of a module's fields: HYBRID_IRO.structure m is HYBRID_IRO.Structure.mk applied to HYBRID_IRO.init, HYBRID_IRO.f of m.

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

                                                      Equations
                                                      Instances For

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

                                                        HYBRID_IRO is by definition Module HYBRID_IRO.typeRep.

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

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

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

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

                                                          It takes no parameters (recorded in @[gaudiProcParamNames]).

                                                          Equations
                                                          Instances For
                                                            @[simp]

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

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

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

                                                            • HYBRID_IRO.init.utilities.accessorModule : HYBRID_IRO →ₘ … — the accessor as a module, a projection being a module morphism;
                                                            • HYBRID_IRO.init.utilities.apply_simp — Module.app HYBRID_IRO.init.utilities.accessorModule m = HYBRID_IRO.init m: applying that module is the accessor;
                                                            • HYBRID_IRO.init.utilities.expression_eq — the same at the level of expressions: (HYBRID_IRO.init m).expression = (HYBRID_IRO.init.utilities.proj m.expression).reduce.
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For

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

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

                                                              Instances For
                                                                @[reducible, inline]

                                                                module type HYBRID_IRO_DIST (HI : HYBRID_IRO) = { proc distinguish() : bool {HI.f} }: distinguisher for hybrid IROs.

                                                                Equations
                                                                Instances For
                                                                  @[reducible, inline]

                                                                  The oracle procedure a HYBRID_IRO_DIST may call (EasyCrypt's {HI.f}): HI.f. The hole of its representation (Module.Representable, exception E2).

                                                                  Equations
                                                                  Instances For

                                                                    The body of proc main of module HybridIROExper, as a procedure of its own: the 2 calls it makes to module parameters (HI, D) are its holes, in the order the body makes them.

                                                                    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 HybridIROExper.main.procedure.apply_simp) rather than run. Use HybridIROExper.main for this procedure as a module.

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

                                                                      @[simp]: applying HybridIROExper to a tuple of its 2 parameters HI, D — the record of its procedures HybridIROExper.main, 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 HybridIROExper.main.apply_simp to fill that procedure's holes.

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

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

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

                                                                        Apply it with the @[simp] lemma HybridIROExper.main.apply_simp, which fills the holes of HybridIROExper.main.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 HybridIROExper.main to the parameters proc main uses (HI, D) is Module.proc (HybridIROExper.main.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 HybridIROExper.main.procedure with a tuple holeArgs of procedures: the body of proc main 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 [HybridIROExper.main.procedure.apply_simp]).

                                                                          EC's HybridIROLazy.mp.

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

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

                                                                            Instantiating the holes of HybridIROLazy.fill_in.procedure with a tuple holeArgs of procedures: the body of proc fill_in 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 [HybridIROLazy.fill_in.procedure.apply_simp]).

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

                                                                            Equations
                                                                            Instances For

                                                                              The module declared by module HybridIROLazy: the record of its procedures HybridIROLazy.init, HybridIROLazy.fill_in, HybridIROLazy.f.

                                                                              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 HybridIROLazy.apply_simp to apply it with.

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                theorem GaudisCrypt.SHA3.Sponge.HybridIRO.HybridIROLazy.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                                procedure.instantiate holeArgs✝ = proc (xs : List Common.block, n : ℤ) : (List Bool) { var i : ℤ, bs : List Bool, b : Bool; i <- 0; bs <- []; if (decide (Common.valid_block §xs)) { while (decide (§i < §n)) { b <- call fill_in.procedure (§xs, §i); bs <- EC.rcons §bs §b; i <- §i + 1; } } return §bs }

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

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

                                                                                  Equations
                                                                                  Instances For
                                                                                    @[simp]

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

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

                                                                                    Equations
                                                                                    Instances For

                                                                                      The body of proc f of module HybridIROLazy, 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 HybridIROLazy.f.procedure.apply_simp) rather than run. Use HybridIROLazy.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 HybridIROLazy.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 [HybridIROLazy.init.procedure.apply_simp]).

                                                                                        @[simp]

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

                                                                                        HybridIROLazy at its type HYBRID_IRO.

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

                                                                                          EC's HybridIROEager.mp.

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

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

                                                                                            The body of proc f of module HybridIROEager, 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 HybridIROEager.f.procedure.apply_simp) rather than run. Use HybridIROEager.f 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 HybridIROEager as a module: Module.proc HybridIROEager.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROEager.init.apply_simp says exactly that.

                                                                                              Equations
                                                                                              Instances For

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

                                                                                                Equations
                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                Instances For
                                                                                                  theorem GaudisCrypt.SHA3.Sponge.HybridIRO.HybridIROEager.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                                                  procedure.instantiate holeArgs✝ = proc (xs : List Common.block, n : ℤ) : (List Bool) { var m : ℤ, i : ℤ, bs : List Bool, b : Bool; m <- (§n + Common.r - 1) / Common.r * Common.r; i <- 0; bs <- []; if (decide (Common.valid_block §xs)) { while (decide (§i < §n)) { b <- call fill_in.procedure (§xs, §i); bs <- EC.rcons §bs §b; i <- §i + 1; } while (decide (§i < §m)) { call fill_in.procedure (§xs, §i); i <- §i + 1; } } return §bs }

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

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

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

                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    @[simp]

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

                                                                                                    The module declared by module HybridIROEager: the record of its procedures HybridIROEager.init, HybridIROEager.fill_in, HybridIROEager.f.

                                                                                                    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 HybridIROEager.apply_simp to apply it with.

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

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

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

                                                                                                      Equations
                                                                                                      Instances For

                                                                                                        Instantiating the holes of HybridIROEager.fill_in.procedure with a tuple holeArgs of procedures: the body of proc fill_in 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 [HybridIROEager.fill_in.procedure.apply_simp]).

                                                                                                        HybridIROEager at its type HYBRID_IRO.

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

                                                                                                          Lazy = eager: EasyCrypt's section with `declare module D <: HYBRID_IRO_DIST #

                                                                                                          {-HybridIROEager, -HybridIROLazy}`

                                                                                                          local clone import PROM.FullRO as ERO with type in_t <- block list * int, type out_t <- bool, op dout _ <- dbool, type d_in_t <- unit, type d_out_t <- bool: the namespace ERO of PROM.FullRO at the clone's types, its module variables global_vars.

                                                                                                          The clone's module variable ERO.RO.m.

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

                                                                                                            The clone's module variable ERO.FRO.m.

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

                                                                                                                  @[simp]: applying EROExper.main to the parameters proc main uses (O, D) is Module.proc (EROExper.main.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 EROExper.main.procedure with a tuple holeArgs of procedures: the body of proc main 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 [EROExper.main.procedure.apply_simp]).

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

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

                                                                                                                    @[simp]: applying EROExper to a tuple of its 2 parameters O, D — the record of its procedures EROExper.main, 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 EROExper.main.apply_simp to fill that procedure's holes.

                                                                                                                    The body of proc main of module EROExper, as a procedure of its own: the 2 calls it makes to module parameters (O, D) are its holes, in the order the body makes them.

                                                                                                                    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 EROExper.main.procedure.apply_simp) rather than run. Use EROExper.main for this procedure as a module.

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

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

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

                                                                                                                      Equations
                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                      Instances For
                                                                                                                        theorem GaudisCrypt.SHA3.Sponge.HybridIRO.HIRO.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : (HoleSigs.cons (procsig (List Common.block × ℤ) → Bool) (HoleSigs.cons (procsig (List Common.block × ℤ) → Unit) HoleSigs.empty)).Instantiation) :
                                                                                                                        procedure.instantiate holeArgs✝ = proc (xs : List Common.block, n : ℤ) : (List Bool) { var m : ℤ, i : ℤ, bs : List Bool, b : Bool; m <- (§n + Common.r - 1) / Common.r * Common.r; i <- 0; bs <- []; if (decide (Common.valid_block §xs)) { while (decide (§i < §n)) { b <- call (holeArgs✝.lookup HoleIndex.zero) (§xs, §i); bs <- EC.rcons §bs §b; i <- §i + 1; } while (decide (§i < §m)) { call (holeArgs✝.lookup HoleIndex.zero.succ) (§xs, §i); i <- §i + 1; } } return §bs }

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

                                                                                                                        @[simp]

                                                                                                                        @[simp]: applying HIRO.init to the parameters proc init uses (RO) is Module.proc (HIRO.init.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 body of proc init of module HIRO, as a procedure of its own: the one call it makes to a module parameter (RO) 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 HIRO.init.procedure.apply_simp) rather than run. Use HIRO.init for this procedure as a module.

                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          @[simp]

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

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

                                                                                                                          @[simp]

                                                                                                                          @[simp]: applying HIRO.f to the parameters proc f uses (RO) is Module.proc (HIRO.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.

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

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

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

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

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

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

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

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

                                                                                                                                The body of proc f of module HIRO, as a procedure of its own: the 2 calls it makes to module parameters (RO) are its holes, in the order the body makes them.

                                                                                                                                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 HIRO.f.procedure.apply_simp) rather than run. Use HIRO.f 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 distinguish of module RODist, as a procedure of its own: the one call it makes to a module parameter (RO) 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 RODist.distinguish.procedure.apply_simp) rather than run. Use RODist.distinguish for this procedure as a module.

                                                                                                                                  Equations
                                                                                                                                  Instances For
                                                                                                                                    @[simp]

                                                                                                                                    @[simp]: applying RODist.distinguish to the parameters proc distinguish uses (RO) is Module.proc (RODist.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 RODist.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 [RODist.distinguish.procedure.apply_simp]).

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

                                                                                                                                    Apply it with the @[simp] lemma RODist.distinguish.apply_simp, which fills the holes of RODist.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 RODist to a tuple of its single parameter RO — the record of its procedures RODist.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 RODist.distinguish.apply_simp to fill that procedure's holes.

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

                                                                                                                                      Equations
                                                                                                                                      Instances For

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

                                                                                                                                        @[simp]

                                                                                                                                        @[simp]: applying RaiseHybridIRO.f to the parameters proc f uses (HI) is Module.proc (RaiseHybridIRO.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.

                                                                                                                                        @[simp]

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

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

                                                                                                                                        Apply it with the @[simp] lemma RaiseHybridIRO.init.apply_simp, which fills the holes of RaiseHybridIRO.init.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 RaiseHybridIRO.init to the parameters proc init uses (HI) is Module.proc (RaiseHybridIRO.init.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 RaiseHybridIRO, abstracted over its single parameter HI, 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 RaiseHybridIRO.init, RaiseHybridIRO.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma RaiseHybridIRO.apply_simp says.

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

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

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

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

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

                                                                                                                                                Equations
                                                                                                                                                Instances For

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

                                                                                                                                                  @[simp]

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

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

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

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

                                                                                                                                                    The body of proc f of module LowerHybridIRO, as a procedure of its own: the one call it makes to a module parameter (HI) 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 LowerHybridIRO.f.procedure.apply_simp) rather than run. Use LowerHybridIRO.f 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 LowerHybridIRO, abstracted over its single parameter HI, 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 LowerHybridIRO.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma LowerHybridIRO.apply_simp says.

                                                                                                                                                      Equations
                                                                                                                                                      Instances For

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

                                                                                                                                                        @[simp]

                                                                                                                                                        @[simp]: applying LowerHybridIRO.f to the parameters proc f uses (HI) is Module.proc (LowerHybridIRO.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.

                                                                                                                                                        Invariant relating the maps of BIRO.IRO and HybridIROLazy.

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

                                                                                                                                                          Invariant relating the maps of BlockSponge.BIRO.IRO and HybridIROEager.

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

                                                                                                                                                              j / r = i for j in the ith block of bits. Not an EC lemma (EC: divzDl, divz_small).

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

                                                                                                                                                                Equations
                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                Instances For
                                                                                                                                                                  theorem GaudisCrypt.SHA3.Sponge.HybridIRO.HybridIROEagerTrans.loop.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                                                                                                                  procedure.instantiate holeArgs✝ = proc (n : ℤ, xs : List Common.block) : (ℤ × List Bool) { var i : ℤ, bs : List Bool, b : Bool; i <- 0; bs <- []; while (decide (§i < §n * Common.r)) { b <- call HybridIROEager.fill_in.procedure (§xs, §i); bs <- EC.rcons §bs §b; i <- §i + 1; } return (§i, §bs) }

                                                                                                                                                                  Instantiating the holes of HybridIROEagerTrans.loop.procedure with a tuple holeArgs of procedures: the body of proc loop 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 [HybridIROEagerTrans.loop.procedure.apply_simp]).

                                                                                                                                                                  The module declared by module HybridIROEagerTrans: the record of its procedures HybridIROEagerTrans.next_block, HybridIROEagerTrans.next_block_split, HybridIROEagerTrans.loop.

                                                                                                                                                                  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 HybridIROEagerTrans.apply_simp to apply it with.

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

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

                                                                                                                                                                    Equations
                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                    Instances For
                                                                                                                                                                      theorem GaudisCrypt.SHA3.Sponge.HybridIRO.HybridIROEagerTrans.next_block_split.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                                                                                                                      procedure.instantiate holeArgs✝ = proc (xs : List Common.block, i : ℤ, m : ℤ, bs : List Bool) : (List Bool × ℤ) { var j : ℤ, cs : List Bool; if (decide ((§HybridIROEager.mp).dom (§xs, §i))) { while (decide (§i < §m)) { (localVarLens "b" Bool) <- EC.oget ((§HybridIROEager.mp).get (§xs, §i)); bs <- EC.rcons §bs §(localVarLens "b" Bool); i <- §i + 1; } } else { j <- 0; cs <- []; while (decide (§j < Common.r)) { (localVarLens "b" Bool) <$ EC.dbool; cs <- EC.rcons §cs §(localVarLens "b" Bool); j <- §j + 1; } bs <- §bs ++ §cs; while (decide (§i < §m)) { HybridIROEager.mp <- (§HybridIROEager.mp).set (§xs, §i) (EC.nth true §bs §i); i <- §i + 1; } } return (§bs, §i) }

                                                                                                                                                                      Instantiating the holes of HybridIROEagerTrans.next_block_split.procedure with a tuple holeArgs of procedures: the body of proc next_block_split 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 [HybridIROEagerTrans.next_block_split.procedure.apply_simp]).

                                                                                                                                                                      theorem GaudisCrypt.SHA3.Sponge.HybridIRO.HybridIROEagerTrans.next_block.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                                                                                                                      procedure.instantiate holeArgs✝ = proc (xs : List Common.block, i : ℤ, m : ℤ, bs : List Bool) : (List Bool × ℤ) { var b : Bool; while (decide (§i < §m)) { b <- call HybridIROEager.fill_in.procedure (§xs, §i); bs <- EC.rcons §bs §b; i <- §i + 1; } return (§bs, §i) }

                                                                                                                                                                      Instantiating the holes of HybridIROEagerTrans.next_block.procedure with a tuple holeArgs of procedures: the body of proc next_block 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 [HybridIROEagerTrans.next_block.procedure.apply_simp]).

                                                                                                                                                                      @[simp]

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

                                                                                                                                                                      Two maps are the same except (perhaps) on a range of bits for a single block list.

                                                                                                                                                                      Equations
                                                                                                                                                                      Instances For
                                                                                                                                                                        theorem GaudisCrypt.SHA3.Sponge.HybridIRO.eager_eq_except_maps_eq [SLCommon.Params] [BlockSponge.Params] (xs : List Common.block) (i j : ℤ) (_y : Bool) (mp1 mp2 : EC.FMap (List Common.block × ℤ) Bool) :
                                                                                                                                                                        i ≤ j → eager_eq_except xs i j mp1 mp2 → (∀ (k : ℤ), i ≤ k ∧ k < j → mp1.get (xs, k) = mp2.get (xs, k)) → mp1 = mp2

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

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

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

                                                                                                                                                                            The module declared by module BlockSpongeTrans: the record of its procedures BlockSpongeTrans.next_block, BlockSpongeTrans.loop.

                                                                                                                                                                            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 BlockSpongeTrans.apply_simp to apply it with.

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

                                                                                                                                                                              Instantiating the holes of BlockSpongeTrans.loop.procedure with a tuple holeArgs of procedures: the body of proc loop 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 [BlockSpongeTrans.loop.procedure.apply_simp]).

                                                                                                                                                                              Instantiating the holes of BlockSpongeTrans.next_block.procedure with a tuple holeArgs of procedures: the body of proc next_block 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 [BlockSpongeTrans.next_block.procedure.apply_simp]).

                                                                                                                                                                              clone Program as Prog with type t = bool, op d = {0,1} (the Program abstract theory of DList)

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

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

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

                                                                                                                                                                                Equations
                                                                                                                                                                                Instances For

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

                                                                                                                                                                                  Equations
                                                                                                                                                                                  Instances For
                                                                                                                                                                                    @[simp]

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

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

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

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

                                                                                                                                                                                      The module declared by module BlockGen: the record of its procedures BlockGen.loop, BlockGen.direct.

                                                                                                                                                                                      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 BlockGen.apply_simp to apply it with.

                                                                                                                                                                                      Equations
                                                                                                                                                                                      Instances For
                                                                                                                                                                                        theorem GaudisCrypt.SHA3.Sponge.HybridIRO.BlockGen.loop.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                                                                                                                                        procedure.instantiate holeArgs✝ = proc () : Common.block { var j : ℤ, cs : List Bool, b : Bool; j <- 0; cs <- []; while (decide (§j < Common.r)) { b <$ EC.dbool; cs <- EC.rcons §cs §b; j <- §j + 1; } return Common.mkblock §cs }

                                                                                                                                                                                        Instantiating the holes of BlockGen.loop.procedure with a tuple holeArgs of procedures: the body of proc loop 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 [BlockGen.loop.procedure.apply_simp]).

                                                                                                                                                                                        Instantiating the holes of BlockGen.direct.procedure with a tuple holeArgs of procedures: the body of proc direct 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 [BlockGen.direct.procedure.apply_simp]).

                                                                                                                                                                                        The main result: EasyCrypt's section with `declare module BlockSim <: BlockSponge.SIMULATOR #

                                                                                                                                                                                        {-IRO, -BlockSponge.BIRO.IRO}anddeclare module Dist <: DISTINGUISHER {-Perm, -BlockSim, -IRO, -BlockSponge.BIRO.IRO}`

                                                                                                                                                                                        local clone HybridIRO as HIRO: the clone is local, so its module variables HIRO.HybridIROLazy.mp, HIRO.HybridIROEager.mp are the lens parameters HIRO_Lazy_mp, HIRO_Eager_mp of the local declarations that mention them, fresh by hypothesis (HIRO_fresh, exception E6). HIRO.X is HybridIRO.X at these lenses.

                                                                                                                                                                                        The ideal side #

                                                                                                                                                                                        theorem GaudisCrypt.SHA3.Sponge.HybridIRODist.distinguish.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] (BlockSim : BlockSponge.SIMULATOR) (Dist : DISTINGUISHER) (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → Bool) HoleSigs.empty)).Instantiation) :
                                                                                                                                                                                        (procedure BlockSim Dist).instantiate holeArgs✝ = proc () : Bool { var b : Bool; call (holeArgs✝.lookup HoleIndex.zero) (); b <- call (holeArgs✝.lookup HoleIndex.zero.succ) (); return §b }

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

                                                                                                                                                                                        @[simp]

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

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

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

                                                                                                                                                                                          The body of proc distinguish of module HybridIRODist, as a procedure of its own: the 2 calls it makes to module parameters (HI) are its holes, in the order the body makes them.

                                                                                                                                                                                          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 HybridIRODist.distinguish.procedure.apply_simp) rather than run. Use HybridIRODist.distinguish for this procedure as a module.

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

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

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

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

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

                                                                                                                                                                                              The sponge construction (EC l. 28–127) #

                                                                                                                                                                                              StdSponge, Sponge and loop_cond are the first port's.

                                                                                                                                                                                              EC derives this inline in each of the three branches of the squeezing loop of Sponge_is_StdSponge (rewrite size_cat size_block=> -> …; by rewrite -(mulzDr r i 1) loop_cond /#): one more block, and the two loops' tests agree.

                                                                                                                                                                                              EC's equiv Sponge_is_StdSponge (P <: DPRIMITIVE): StdSponge(P).f ~ Sponge(P).f: ={glob P, bs, n} ==> ={glob P, res}.

                                                                                                                                                                                              EC's script. (bs, n) is the one parameter x of the first port's modules, so each side has one more statement, bs, n <- x (EC's seq 5 5 is equiv_seq 6 6). The fact EC derives inline in the three branches of the squeezing loop is size_cat_block.

                                                                                                                                                                                              @[implicit_reducible]

                                                                                                                                                                                              EC's subtyping: a FUNCTIONALITY where a DFUNCTIONALITY is expected (the first port's view).

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

                                                                                                                                                                                              The theory HybridIRO (EC l. 256–1909) #

                                                                                                                                                                                              EC's local clone import PROM.FullRO as ERO with type in_t <- block list * int, type out_t <- bool, op dout _ <- dbool, type d_in_t <- unit, type d_out_t <- bool: the namespace ERO of the section FirstPort.

                                                                                                                                                                                              EC's local lemma LRO_RO (D <: ERO.RO_Distinguisher{-ERO.RO, -ERO.FRO}) &m : Pr[EROExper(LRO, D).main() @ &m : res] = Pr[EROExper(ERO.RO, D).main() @ &m : res].

                                                                                                                                                                                              EC's local lemma HybridIROLazy_HIRO_LRO_init : equiv[HybridIROLazy.init ~ HIRO(LRO).init : true ==> HybridIROLazy.mp{1} = ERO.RO.m{2}].

                                                                                                                                                                                              EC's local lemma HybridIROLazy_fill_in_LRO_get : equiv[HybridIROLazy.fill_in ~ LRO.get : (xs, i){1} = x{2} /\ HybridIROLazy.mp{1} = ERO.RO.m{2} ==> ={res} /\ HybridIROLazy.mp{1} = ERO.RO.m{2}].

                                                                                                                                                                                              EC's local lemma HybridIROLazy_HIRO_LRO_f : equiv[HybridIROLazy.f ~ HIRO(LRO).f : ={xs, n} /\ HybridIROLazy.mp{1} = ERO.RO.m{2} ==> ={res} /\ HybridIROLazy.mp{1} = ERO.RO.m{2}].

                                                                                                                                                                                              EC's local lemma HIRO_RO_HybridIROEager_init : equiv[HIRO(ERO.RO).init ~ HybridIROEager.init : true ==> ={res} /\ ERO.RO.m{1} = HybridIROEager.mp{2}].

                                                                                                                                                                                              EC's local lemma RO_get_HybridIROEager_fill_in : equiv[ERO.RO.get ~ HybridIROEager.fill_in : x{1} = (xs, i){2} /\ ERO.RO.m{1} = HybridIROEager.mp{2} ==> ={res} /\ ERO.RO.m{1} = HybridIROEager.mp{2}].

                                                                                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.Sponge.HybridIRO.RO_sample_HybridIROEager_fill_in [SLCommon.Params] [BlockSponge.Params] :
                                                                                                                                                                                              prhlProc (fun (args₁ : List Common.block × ℤ) (σ₁ : VariableAssignment) (args₂ : List Common.block × typeListToTuple [ℤ]) (σ₂ : VariableAssignment) => have params_1 := GaudiExpr[ args₁ ]; have x_1 := GaudiExpr[ Lens.id.get args₁ ]; have params_2 := GaudiExpr[ args₂ ]; have xs_2 := GaudiExpr[ Lens.id.ofst.get args₂ ]; have i_2 := GaudiExpr[ Lens.id.osnd.get args₂ ]; §x_1 = (§xs_2, §i_2) ∧ §ERO.RO.m = §HybridIROEager.mp) (EC.PROM.FullRO.RO_T.sample (List Common.block × ℤ) Bool ERO.RO).procedure HybridIROEager.fill_in.procedure fun (r₁ : PUnit.{1}) (σ₁ : VariableAssignment) (r₂ : Bool) (σ₂ : VariableAssignment) => have res_1 := GaudiExpr[ r₁ ]; have res_2 := GaudiExpr[ r₂ ]; §ERO.RO.m = §HybridIROEager.mp

                                                                                                                                                                                              EC's local lemma RO_sample_HybridIROEager_fill_in : equiv[ERO.RO.sample ~ HybridIROEager.fill_in : x{1} = (xs, i){2} /\ ERO.RO.m{1} = HybridIROEager.mp{2} ==> ERO.RO.m{1} = HybridIROEager.mp{2}].

                                                                                                                                                                                              EC's local lemma HIRO_RO_HybridIROEager_f : equiv[HIRO(ERO.RO).f ~ HybridIROEager.f : ={xs, n} /\ ERO.RO.m{1} = HybridIROEager.mp{2} ==> ={res} /\ ERO.RO.m{1} = HybridIROEager.mp{2}].

                                                                                                                                                                                              EC's lemma HybridIROExper_Lazy_Eager (D <: HYBRID_IRO_DIST{-HybridIROEager, -HybridIROLazy}) &m : Pr[HybridIROExper(HybridIROLazy, D).main() @ &m : res] = Pr[HybridIROExper(HybridIROEager, D).main() @ &m : res]; the local clone ERO's variables in D's restriction (fresh in EC).

                                                                                                                                                                                              Raising and lowering hybrid IROs; the lazy invariant (EC l. 553–763) #

                                                                                                                                                                                              RaiseHybridIRO, LowerHybridIRO, lazy_invar and its lemmas are the first port's.

                                                                                                                                                                                              EC derives this inline (have {2}<- := unpadBlocksK xs0{2}; first by rewrite (some_oget (unpad_blocks xs0{2}))): a valid block list is the padding of what it unpads to.

                                                                                                                                                                                              EC's lemma LowerFun_IRO_HybridIROLazy_f : equiv[LowerFun(IRO).f ~ LowerHybridIRO(HybridIROLazy).f : ={xs, n} /\ lazy_invar IRO.mp{1} HybridIROLazy.mp{2} ==> ={res} /\ lazy_invar IRO.mp{1} HybridIROLazy.mp{2}].

                                                                                                                                                                                              EC's script; where EC passes the first assignments by seq 0 1 … ; first auto, sp takes all of them, so the conditionals EC reaches by position (rcondt{1} 3, rcondt{2} 4, rcondt{1} 7) are first.

                                                                                                                                                                                              EC's lemma IRO_RaiseHybridIRO_HybridIROLazy_f : equiv[IRO.f ~ RaiseHybridIRO(HybridIROLazy).f : ={n} /\ x{1} = bs{2} /\ lazy_invar IRO.mp{1} HybridIROLazy.mp{2} ==> ={res} /\ lazy_invar IRO.mp{1} HybridIROLazy.mp{2}].

                                                                                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.Sponge.HybridIRO.Lower_HybridIROEager_f [SLCommon.Params] [BlockSponge.Params] :
                                                                                                                                                                                              prhlProc (fun (args₁ : List Common.block × ℤ) (σ₁ : VariableAssignment) (args₂ : List Common.block × typeListToTuple [ℤ]) (σ₂ : VariableAssignment) => have params_1 := GaudiExpr[ args₁ ]; have x_1 := GaudiExpr[ Lens.id.get args₁ ]; have params_2 := GaudiExpr[ args₂ ]; have xs_2 := GaudiExpr[ Lens.id.ofst.get args₂ ]; have n_2 := GaudiExpr[ Lens.id.osnd.get args₂ ]; (§x_1).1 = §xs_2 ∧ §HybridIROEager.mp = §HybridIROEager.mp ∧ (§x_1).2 * Common.r = §n_2) Sponge.HybridIRO.LowerHybridIRO(HybridIROEager).f.procedure HybridIROEager.f.procedure fun (r₁ : List Common.block) (σ₁ : VariableAssignment) (r₂ : List Bool) (σ₂ : VariableAssignment) => have res_1 := GaudiExpr[ r₁ ]; have res_2 := GaudiExpr[ r₂ ]; §res_1 = Common.bits2blocks §res_2 ∧ §HybridIROEager.mp = §HybridIROEager.mp

                                                                                                                                                                                              EC's lemma Lower_HybridIROEager_f : equiv[LowerHybridIRO(HybridIROEager).f ~ HybridIROEager.f : ={xs, HybridIROEager.mp} /\ n{1} * r = n{2} ==> res{1} = bits2blocks res{2} /\ ={HybridIROEager.mp}].

                                                                                                                                                                                              HybridIROEagerTrans (EC l. 904–1186) #

                                                                                                                                                                                              The module is declared in the section FirstPort.

                                                                                                                                                                                              EC's lemma HybridIROEagerTrans_next_block_split : equiv[HybridIROEagerTrans.next_block ~ HybridIROEagerTrans.next_block_split : ={i, m, xs, bs, HybridIROEager.mp} /\ m{1} = i{1} + r /\ size bs{1} = i{1} /\ block_bits_dom_all_in_or_out xs{1} i{1} HybridIROEager.mp{1} ==> ={res, HybridIROEager.mp}].

                                                                                                                                                                                              EC's script for the program steps. The goals EC closes by progress and a list of smts (the invariants of the three loops) are closed by hand, each in one block: the conjuncts by omega and the eager_eq_except lemmas, the two quantified ones by cases on the updated key.

                                                                                                                                                                                              HybridIROEagerTrans.next_block and BlockSpongeTrans.next_block (EC l. 1188–1505) #

                                                                                                                                                                                              EC l. 1188–1282 (BlockSpongeTrans, Prog, PrLoopSnoc_sample, iter_mul_one_half_pos, BlockGen) are the first port's.

                                                                                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.Sponge.HybridIRO.nth_change_dfl {α : Type} (x0 x1 : α) (s : List α) (n : ℤ) (h : 0 ≤ n ∧ n < EC.size s) :
                                                                                                                                                                                              EC.nth x1 s n = EC.nth x0 s n

                                                                                                                                                                                              EC's nth_change_dfl (List.ec; to move to Lib/EC/ListLemmas.lean with the next batch).

                                                                                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.Sponge.HybridIRO.next_block_split_BlockSpongeTrans [SLCommon.Params] [BlockSponge.Params] (i2 : ℤ) :
                                                                                                                                                                                              prhlProc (fun (args₁ : List Common.block × typeListToTuple [ℤ, ℤ, List Bool]) (σ₁ : VariableAssignment) (args₂ : List Common.block × typeListToTuple [ℤ, List Common.block]) (σ₂ : VariableAssignment) => have params_1 := GaudiExpr[ args₁ ]; have xs_1 := GaudiExpr[ Lens.id.ofst.get args₁ ]; have i_1 := GaudiExpr[ Lens.id.ofst.osnd.get args₁ ]; have m_1 := GaudiExpr[ Lens.id.ofst.osnd.osnd.get args₁ ]; have bs_1 := GaudiExpr[ Lens.id.osnd.osnd.osnd.get args₁ ]; have params_2 := GaudiExpr[ args₂ ]; have x_2 := GaudiExpr[ Lens.id.ofst.get args₂ ]; have i_2 := GaudiExpr[ Lens.id.ofst.osnd.get args₂ ]; have bs_2 := GaudiExpr[ Lens.id.osnd.osnd.get args₂ ]; i2 = §i_2 ∧ 0 ≤ §i_2 ∧ §xs_1 = §x_2 ∧ §i_1 = §i_2 * Common.r ∧ §m_1 - §i_1 = Common.r ∧ EC.size §bs_2 = i2 ∧ §bs_1 = Common.blocks2bits §bs_2 ∧ Sponge.HybridIRO.eager_invar §BlockSponge.BIRO.IRO.mp §HybridIROEager.mp) HybridIROEagerTrans.next_block_split.procedure Sponge.HybridIRO.BlockSpongeTrans.next_block.procedure fun (r₁ : List Bool × ℤ) (σ₁ : VariableAssignment) (r₂ : List Common.block × ℤ) (σ₂ : VariableAssignment) => have res_1 := GaudiExpr[ r₁ ]; have res_2 := GaudiExpr[ r₂ ]; (§res_1).1 = Common.blocks2bits (§res_2).1 ∧ (§res_1).2 = (§res_2).2 * Common.r ∧ (§res_2).2 = i2 + 1 ∧ EC.size (§res_2).1 = i2 + 1 ∧ Sponge.HybridIRO.eager_invar §BlockSponge.BIRO.IRO.mp §HybridIROEager.mp

                                                                                                                                                                                              The second judgment of EC's transitivity HybridIROEagerTrans.next_block_split … in HybridIROEagerTrans_BlockSpongeTrans_next_block (EC l. 1332–1505: proc=> /=; inline*; sp; wp. to qed). It is its own lemma because procedure-level transitivity is a rule here, not a tactic (GAP 8).

                                                                                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.Sponge.HybridIRO.HybridIROEagerTrans_BlockSpongeTrans_next_block [SLCommon.Params] [BlockSponge.Params] (i2 : ℤ) :
                                                                                                                                                                                              prhlProc (fun (args₁ : List Common.block × typeListToTuple [ℤ, ℤ, List Bool]) (σ₁ : VariableAssignment) (args₂ : List Common.block × typeListToTuple [ℤ, List Common.block]) (σ₂ : VariableAssignment) => have params_1 := GaudiExpr[ args₁ ]; have xs_1 := GaudiExpr[ Lens.id.ofst.get args₁ ]; have i_1 := GaudiExpr[ Lens.id.ofst.osnd.get args₁ ]; have m_1 := GaudiExpr[ Lens.id.ofst.osnd.osnd.get args₁ ]; have bs_1 := GaudiExpr[ Lens.id.osnd.osnd.osnd.get args₁ ]; have params_2 := GaudiExpr[ args₂ ]; have x_2 := GaudiExpr[ Lens.id.ofst.get args₂ ]; have i_2 := GaudiExpr[ Lens.id.ofst.osnd.get args₂ ]; have bs_2 := GaudiExpr[ Lens.id.osnd.osnd.get args₂ ]; i2 = §i_2 ∧ 0 ≤ §i_2 ∧ §xs_1 = §x_2 ∧ §i_1 = §i_2 * Common.r ∧ §m_1 - §i_1 = Common.r ∧ §bs_1 = Common.blocks2bits §bs_2 ∧ EC.size §bs_2 = §i_2 ∧ Sponge.HybridIRO.eager_invar §BlockSponge.BIRO.IRO.mp §HybridIROEager.mp) HybridIROEagerTrans.next_block.procedure Sponge.HybridIRO.BlockSpongeTrans.next_block.procedure fun (r₁ : List Bool × ℤ) (σ₁ : VariableAssignment) (r₂ : List Common.block × ℤ) (σ₂ : VariableAssignment) => have res_1 := GaudiExpr[ r₁ ]; have res_2 := GaudiExpr[ r₂ ]; (§res_1).1 = Common.blocks2bits (§res_2).1 ∧ (§res_1).2 = (§res_2).2 * Common.r ∧ (§res_2).2 = i2 + 1 ∧ EC.size (§res_2).1 = i2 + 1 ∧ Sponge.HybridIRO.eager_invar §BlockSponge.BIRO.IRO.mp §HybridIROEager.mp

                                                                                                                                                                                              EC's lemma HybridIROEagerTrans_BlockSpongeTrans_next_block (i2 : int) (EC l. 1307).

                                                                                                                                                                                              EC: transitivity HybridIROEagerTrans.next_block_split (…) (…)=> //., the rule prhlProc_trans_ec here (GAP 8): its two side conditions (EC's exists HybridIROEager.mp{1} (x{2}, i{1}, m{1}, blocks2bits bs{2}), and the postconditions composed), then HybridIROEagerTrans_next_block_split and next_block_split_BlockSpongeTrans.

                                                                                                                                                                                              HybridIROEagerTrans.loop and BlockSpongeTrans.loop (EC l. 1507–1612) #

                                                                                                                                                                                              HybridIROEager.fill_in touches HybridIROEager.mp. Not an EC lemma (EC reads a concrete module's globals off its code, for call (_ : ={HybridIROEager.mp})).

                                                                                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.Sponge.HybridIRO.HybridIROEagerTrans_BlockSpongeTrans_loop [SLCommon.Params] [BlockSponge.Params] (n' : ℤ) :
                                                                                                                                                                                              prhlProc (fun (args₁ : ℤ × typeListToTuple [List Common.block]) (σ₁ : VariableAssignment) (args₂ : ℤ × typeListToTuple [List Common.block]) (σ₂ : VariableAssignment) => have params_1 := GaudiExpr[ args₁ ]; have n_1 := GaudiExpr[ Lens.id.ofst.get args₁ ]; have xs_1 := GaudiExpr[ Lens.id.osnd.get args₁ ]; have params_2 := GaudiExpr[ args₂ ]; have n_2 := GaudiExpr[ Lens.id.ofst.get args₂ ]; have xs_2 := GaudiExpr[ Lens.id.osnd.get args₂ ]; (§xs_1 = §xs_2 ∧ §n_1 = §n_2) ∧ n' = §n_1 ∧ 0 ≤ n' ∧ Sponge.HybridIRO.eager_invar §BlockSponge.BIRO.IRO.mp §HybridIROEager.mp) HybridIROEagerTrans.loop.procedure Sponge.HybridIRO.BlockSpongeTrans.loop.procedure fun (r₁ : ℤ × List Bool) (σ₁ : VariableAssignment) (r₂ : ℤ × List Common.block) (σ₂ : VariableAssignment) => have res_1 := GaudiExpr[ r₁ ]; have res_2 := GaudiExpr[ r₂ ]; (§res_1).1 = n' * Common.r ∧ (§res_2).1 = n' ∧ EC.size (§res_2).2 = n' ∧ (§res_1).2 = Common.blocks2bits (§res_2).2 ∧ Sponge.HybridIRO.eager_invar §BlockSponge.BIRO.IRO.mp §HybridIROEager.mp

                                                                                                                                                                                              EC's lemma HybridIROEagerTrans_BlockSpongeTrans_loop (n' : int) (EC l. 1507).

                                                                                                                                                                                              EC's script. elim n' is induction n', ge0_n' using Int.le_induction, after proc as in EC, so the hypothesis is about the two bodies and conseq IH fits. A middle memory (EC's exists HybridIROEager.mp{1} n' xs{2}) is one side's memory with n set, and simp_reads reads through it. The callee goals of call (_ : ={HybridIROEager.mp}) and call (_ : ={BlockSponge.BIRO.IRO.mp}) (EC: if=> //; wp; rnd; auto) are closed by the tactic; EC's smts on the split loop's guard are splitwhile_guard.

                                                                                                                                                                                              HybridIROEager.f and BlockSponge.BIRO.IRO.f (EC l. 1614–1871) #

                                                                                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.Sponge.HybridIRO.HybridIROEager_f_BlockIRO_f [SLCommon.Params] [BlockSponge.Params] (n1 : ℤ) (x2 : List Common.block) :
                                                                                                                                                                                              prhlProc (fun (args₁ : List Common.block × typeListToTuple [ℤ]) (σ₁ : VariableAssignment) (args₂ : List Common.block × ℤ) (σ₂ : VariableAssignment) => have params_1 := GaudiExpr[ args₁ ]; have xs_1 := GaudiExpr[ Lens.id.ofst.get args₁ ]; have n_1 := GaudiExpr[ Lens.id.osnd.get args₁ ]; have params_2 := GaudiExpr[ args₂ ]; have xn_2 := GaudiExpr[ Lens.id.get args₂ ]; n1 = §n_1 ∧ x2 = (§xn_2).1 ∧ §xs_1 = (§xn_2).1 ∧ (§xn_2).2 = (§n_1 + Common.r - 1) / Common.r ∧ Sponge.HybridIRO.eager_invar §BlockSponge.BIRO.IRO.mp §HybridIROEager.mp) HybridIROEager.f.procedure BlockSponge.BIRO.IRO.f.procedure fun (r₁ : List Bool) (σ₁ : VariableAssignment) (r₂ : List Common.block) (σ₂ : VariableAssignment) => have res_1 := GaudiExpr[ r₁ ]; have res_2 := GaudiExpr[ r₂ ]; Sponge.HybridIRO.eager_invar §BlockSponge.BIRO.IRO.mp §HybridIROEager.mp ∧ (Common.valid_block x2 → (n1 ≤ 0 → §res_1 = [] ∧ §res_2 = []) ∧ (0 < n1 → §res_1 = EC.take n1 (Common.blocks2bits §res_2) ∧ EC.size §res_2 = (n1 + Common.r - 1) / Common.r)) ∧ (¬Common.valid_block x2 → §res_1 = [] ∧ §res_2 = [])

                                                                                                                                                                                              EC's lemma HybridIROEager_f_BlockIRO_f (n1 : int) (x2 : block list) (EC l. 1614).

                                                                                                                                                                                              EC's script. The right procedure takes its parameters as one pair xn, assigned to x, n first, so EC's seq 3 2 is equiv_seq 3 3. EC's conseq (_ : P ==> Q) _ (_ : size bs = n - 1 ==> size bs = n) is equiv_conseq (: P ==> Q) _ (: … ==> …) (Logic/ECConseqHoare.lean). The leaves EC closes by smt are closed by hand; the guards the splitwhiles leave are the lemmas splitwhile_guard_left, _right, _le.

                                                                                                                                                                                              LowerHybridIRO(HybridIROEager).f and BlockSponge.BIRO.IRO.f (EC l. 1873–1909) #

                                                                                                                                                                                              EC's lemma HybridIROEager_BlockIRO_f (EC l. 1873), the last of the theory HybridIRO.

                                                                                                                                                                                              EC: transitivity HybridIROEager.f (…) (…), the rule prhlProc_trans_ec here (GAP 8), so the two judgments come first (h₁: conseq Lower_HybridIROEager_f; h₂: exists*, then conseq (HybridIROEager_f_BlockIRO_f n1 xs')), then EC's two side conditions. The middle memory (EC: exists HybridIROEager.mp{1} BlockSponge.BIRO.IRO.mp{2} (xs{1}, n{1} * r)) is the left globals with BlockSponge.BIRO.IRO.mp set to the right one's. Both procedures take one pair: xs{1} = x{2} /\ ={n} is about its components.

                                                                                                                                                                                              Sponge_Raise_BlockSponge_f (EC l. 1922), the second tactic experiment #

                                                                                                                                                                                              @[implicit_reducible]

                                                                                                                                                                                              Perm (EC's RP, a PRP) where a DPRIMITIVE is expected: its f, fi.

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

                                                                                                                                                                                              Perm where a BlockSponge.DPRIMITIVE is expected.

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

                                                                                                                                                                                              BlockSponge.Sponge(Perm), as stmt_inline names the callee.

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

                                                                                                                                                                                                EC's local lemma Sponge_Raise_BlockSponge_f : equiv[Sponge(Perm).f ~ RaiseFun(BlockSponge.Sponge(Perm)).f : ={bs, n, glob Perm} ==> ={res, glob Perm}], its proof EC's (see the module docstring).

                                                                                                                                                                                                Footprints of the concrete modules of the final section #

                                                                                                                                                                                                EC reads a concrete module's globals off its code; the frame rules ask fp_le for a bound on a concrete callee, which it has for the modules it can read and otherwise takes from the lemmas stated here (@[fp_bound]), each proved by fp_module. They are what the frames of call H, conseq H and proc (I) below are found from. Not EC lemmas.

                                                                                                                                                                                                The main result (EC l. 1913–2146) #

                                                                                                                                                                                                local clone HybridIRO as HIRO: the clone's variables are those of HybridIRO above; they are fresh for the declared modules in EC, and named in their restrictions here. Dist is restricted against BlockSim: the region form (with glob R, E14).

                                                                                                                                                                                                EC's call (_ : true) on BlockSim(F).init ~ BlockSim(F').init: init calls no oracle (BlockSim_rep), so the two sides run the same code, which keeps ={glob BlockSim} (and ={glob Dist}, which it does not touch). Not an EC lemma.

                                                                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.Sponge.Ideal_IRO_Experiment_HybridLazy [SLCommon.Params] [BlockSponge.Params] (BlockSim : BlockSponge.SIMULATOR) [Module.Declared BlockSim (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob BlockSim R] [R.Restricted (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (Dist : Sponge.DISTINGUISHER) [Module.Declared Dist (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ R ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (BlockSim_rep : Indifferentiability.SIMULATOR.Representable (Common.block × Common.capacity) (List Common.block × ℤ) (List Common.block) BlockSim) (m : VariableAssignment) :

                                                                                                                                                                                                EC's local lemma Ideal_IRO_Experiment_HybridLazy &m : Pr[IdealIndif(IRO, RaiseSim(BlockSim), Dist).main() @ &m : res] = Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROLazy), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROLazy)), Dist).main() @ &m : res].

                                                                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.Sponge.Experiment_HybridIROExper_Lazy [SLCommon.Params] [BlockSponge.Params] (BlockSim : BlockSponge.SIMULATOR) [Module.Declared BlockSim (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob BlockSim R] [R.Restricted (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (Dist : Sponge.DISTINGUISHER) [Module.Declared Dist (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ R ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (BlockSim_rep : Indifferentiability.SIMULATOR.Representable (Common.block × Common.capacity) (List Common.block × ℤ) (List Common.block) BlockSim) (m : VariableAssignment) :

                                                                                                                                                                                                EC's local lemma Experiment_HybridIROExper_Lazy &m : Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROLazy), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROLazy)), Dist).main() @ &m : res] = Pr[HIRO.HybridIROExper(HIRO.HybridIROLazy, HybridIRODist).main() @ &m : res].

                                                                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.Sponge.HybridIROExper_Experiment_Eager [SLCommon.Params] [BlockSponge.Params] (BlockSim : BlockSponge.SIMULATOR) [Module.Declared BlockSim (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob BlockSim R] [R.Restricted (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (Dist : Sponge.DISTINGUISHER) [Module.Declared Dist (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ R ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (BlockSim_rep : Indifferentiability.SIMULATOR.Representable (Common.block × Common.capacity) (List Common.block × ℤ) (List Common.block) BlockSim) (m : VariableAssignment) :

                                                                                                                                                                                                EC's local lemma HybridIROExper_Experiment_Eager &m : Pr[HIRO.HybridIROExper(HIRO.HybridIROEager, HybridIRODist).main() @ &m : res] = Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROEager), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROEager)), Dist).main() @ &m : res].

                                                                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.Sponge.Experiment_Hybrid_Lazy_Eager [SLCommon.Params] [BlockSponge.Params] (BlockSim : BlockSponge.SIMULATOR) [Module.Declared BlockSim (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob BlockSim R] [R.Restricted (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (Dist : Sponge.DISTINGUISHER) [Module.Declared Dist (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ R ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (BlockSim_rep : Indifferentiability.SIMULATOR.Representable (Common.block × Common.capacity) (List Common.block × ℤ) (List Common.block) BlockSim) (m : VariableAssignment) :

                                                                                                                                                                                                EC's local lemma Experiment_Hybrid_Lazy_Eager &m : Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROLazy), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROLazy)), Dist).main() @ &m : res] = Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROEager), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROEager)), Dist).main() @ &m : res].

                                                                                                                                                                                                HIRO.HybridIROExper_Lazy_Eager is applied to HybridIRODist, which satisfies its restriction: EC checks that when the lemma is applied, here it is the instance stated first.

                                                                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.Sponge.Experiment_HybridEager_Ideal_BlockIRO [SLCommon.Params] [BlockSponge.Params] (BlockSim : BlockSponge.SIMULATOR) [Module.Declared BlockSim (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob BlockSim R] [R.Restricted (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (Dist : Sponge.DISTINGUISHER) [Module.Declared Dist (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ R ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (BlockSim_rep : Indifferentiability.SIMULATOR.Representable (Common.block × Common.capacity) (List Common.block × ℤ) (List Common.block) BlockSim) (m : VariableAssignment) :

                                                                                                                                                                                                EC's local lemma Experiment_HybridEager_Ideal_BlockIRO &m : Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROEager), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROEager)), Dist).main() @ &m : res] = Pr[BlockSponge.IdealIndif(BlockSponge.BIRO.IRO, BlockSim, LowerDist(Dist)).main () @ &m : res].

                                                                                                                                                                                                EC's local lemma IdealIndif_IRO_BlockIRO &m : Pr[IdealIndif(IRO, RaiseSim(BlockSim), Dist).main() @ &m : res] = Pr[BlockSponge.IdealIndif(BlockSponge.BIRO.IRO, BlockSim, LowerDist(Dist)).main () @ &m : res].

                                                                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.Sponge.conclu [SLCommon.Params] [BlockSponge.Params] (BlockSim : BlockSponge.SIMULATOR) [Module.Declared BlockSim (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob BlockSim R] [R.Restricted (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (Dist : Sponge.DISTINGUISHER) [Module.Declared Dist (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ R ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (BlockSim_rep : Indifferentiability.SIMULATOR.Representable (Common.block × Common.capacity) (List Common.block × ℤ) (List Common.block) BlockSim) (m : VariableAssignment) :

                                                                                                                                                                                                EC's lemma conclu &m : |Pr[RealIndif(Sponge, Perm, Dist).main() @ &m : res] - Pr[IdealIndif(IRO, RaiseSim(BlockSim), Dist).main() @ &m : res]| = |Pr[BlockSponge.RealIndif(BlockSponge.Sponge, Perm, LowerDist(Dist)).main() @ &m : res] - Pr[BlockSponge.IdealIndif(BlockSponge.BIRO.IRO, BlockSim, LowerDist(Dist)).main() @ &m : res]|.

                                                                                                                                                                                                Conclusion (EC l. 2148–2163) #

                                                                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.Sponge.conclusion [SLCommon.Params] [BlockSponge.Params] (BlockSim : BlockSponge.SIMULATOR) [Module.Declared BlockSim (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob BlockSim R] [R.Restricted (Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (Dist : Sponge.DISTINGUISHER) [Module.Declared Dist (Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ R ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ HybridIRO.HybridIROLazy.mp.footprint ⊔ HybridIRO.HybridIROEager.mp.footprint ⊔ HybridIRO.ERO.RO.m.footprint ⊔ HybridIRO.ERO.FRO.m.footprint)] (BlockSim_rep : Indifferentiability.SIMULATOR.Representable (Common.block × Common.capacity) (List Common.block × ℤ) (List Common.block) BlockSim) (m : VariableAssignment) :

                                                                                                                                                                                                EC's lemma conclusion (BlockSim <: BlockSponge.SIMULATOR{-IRO, -BlockSponge.BIRO.IRO}) (Dist <: DISTINGUISHER{-Perm, -BlockSim, -IRO, -BlockSponge.BIRO.IRO}) &m : |Pr[RealIndif(Sponge, Perm, Dist).main() @ &m : res] - Pr[IdealIndif(IRO, RaiseSim(BlockSim), Dist).main() @ &m : res]| = |Pr[BlockSponge.RealIndif(BlockSponge.Sponge, Perm, LowerDist(Dist)).main() @ &m : res] - Pr[BlockSponge.IdealIndif(BlockSponge.BIRO.IRO, BlockSim, LowerDist(Dist)).main() @ &m : res]|.

                                                                                                                                                                                                The restrictions also name the variables of the theory HybridIRO and of its local clone ERO (fresh in EC), Dist's restriction against BlockSim is the region form (with glob R, E14), and the oracle lists of EC's module type SIMULATOR are the hypothesis BlockSim_rep (E2).