Documentation

GaudisCrypt.Examples.SHA3.SmartCounter.Gconcl_list

From the squeezeless sponge to the block sponge (EasyCrypt proof/smart_counter/Gconcl_list.ec) #

— EC-fidelity port

EC's judgments in EC's scripts, over the old port's declarations (section FirstPort below), as SmartCounter/Gconcl.lean. The plain lemmas (leq_add_nin, …) are the old port's.

Translation:

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

Theory parameters: validity of functionality queries #

EasyCrypt's axioms on valid, parse and format.

Instances

    The squeezing functionality and the distinguisher's adapter #

    @[simp]

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

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

    Equations
    Instances For

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

        @[simp]

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

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

        Equations
        Instances For

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

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem GaudisCrypt.SHA3.Gconcl_list.DSqueeze.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] [Params] (holeArgs✝ : (HoleSigs.cons (procsig (List Common.block) → Common.block) HoleSigs.empty).Instantiation) :
            procedure.instantiate holeArgs✝ = proc (x : List Common.block × ℤ) : (List Common.block) { var p : List Common.block, n : ℤ, lres : List Common.block, b : Common.block, i : ℤ; p, n <- §x; lres <- []; b <- Common.b0; i <- 0; if (valid §p) { b <- call (holeArgs✝.lookup HoleIndex.zero) (§p); while (decide (§i < §n)) { i <- §i + 1; lres <- EC.rcons §lres §b; if (decide (§i < §n)) { b <- call (holeArgs✝.lookup HoleIndex.zero) (BlockSponge.format (§p) (§i + 1)); } } } return §lres }

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

            proc f of module DSqueeze 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 DSqueeze.f.apply_simp, which fills the holes of DSqueeze.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 DSqueeze.f to the parameters proc f uses (F) is Module.proc (DSqueeze.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

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

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

              Equations
              Instances For
                @[simp]

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

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

                The body of proc init of module Squeeze.init_, 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 Squeeze.init_.init.procedure.apply_simp) rather than run. Use Squeeze.init_.init 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 Squeeze.init_ 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 Squeeze.init_.init.apply_simp, which fills the holes of Squeeze.init_.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 Squeeze.init_.init to the parameters proc init uses (F) is Module.proc (Squeeze.init_.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.

                    EC's Squeeze(F : SLCommon.FUNCTIONALITY) : FUNCTIONALITY: proc init, and proc f = DSqueeze(F).f.

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

                      The module declared by module A, 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 A.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma A.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 A, 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 A.distinguish.procedure.apply_simp) rather than run. Use A.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 A.distinguish to the parameters proc distinguish uses (F, P) is Module.proc (A.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.

                          @[simp]

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

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

                          proc distinguish of module A 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 A.distinguish.apply_simp, which fills the holes of A.distinguish.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 NIndif, abstracted over its 3 parameters F, P, 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 NIndif.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma NIndif.apply_simp says.

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

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

                              Apply it with the @[simp] lemma NIndif.main.apply_simp, which fills the holes of NIndif.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 NIndif to a tuple of its 3 parameters F, P, D — the record of its procedures NIndif.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 NIndif.main.apply_simp to fill that procedure's holes.

                                The body of proc main of module NIndif, as a procedure of its own: the 3 calls it makes to module parameters (F, P, 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 NIndif.main.procedure.apply_simp) rather than run. Use NIndif.main 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 NIndif.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 [NIndif.main.procedure.apply_simp]).

                                  @[reducible, inline]

                                  module P = Perm.

                                  Equations
                                  Instances For

                                    clone IRO as BIRO2 with type from <- block list, type to <- block, op valid <- predT, op dto <- bdistr

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

                                    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
                                          @[reducible, inline]
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            @[simp]

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

                                            @[simp]

                                            @[simp]: applying Valid.f to the parameters proc f uses (F) is Module.proc (Valid.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 Valid, 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 Valid.f.procedure.apply_simp) rather than run. Use Valid.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 Valid, 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 Valid.init.procedure.apply_simp) rather than run. Use Valid.init for this procedure as a module.

                                              Equations
                                              Instances For

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

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

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

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

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

                                                  Equations
                                                  Instances For

                                                    proc f of module Valid 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 Valid.f.apply_simp, which fills the holes of Valid.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]: Valid.init = Module.proc Valid.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.

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

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

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

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

                                                        proc f = …; of module SimLast: an alias, EasyCrypt's proc f = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no SimLast.f.procedure: applied with the @[simp] lemma SimLast.f.apply_simp, it is the callee.

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

                                                          @[simp]: the alias SimLast.fi, applied to the parameters its callee uses (F), is its callee, as written in the declaration.

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

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

                                                            @[simp]: the alias SimLast.f, applied to the parameters its callee uses (F), is its callee, as written in the declaration.

                                                            proc init of module SimLast 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 SimLast.init.apply_simp, which fills the holes of SimLast.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 SimLast to a tuple of its single parameter F — the record of its procedures SimLast.init, SimLast.f, SimLast.fi, each applied to the parameters it uses.

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

                                                              proc fi = …; of module SimLast: an alias, EasyCrypt's proc fi = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no SimLast.fi.procedure: applied with the @[simp] lemma SimLast.fi.apply_simp, it is the callee.

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

                                                                clone F as F2: a second random oracle block list -> block, with its own variables

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

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

                                                                  The clone's module variable F2.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
                                                                        @[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

                                                                            The section Ideal #

                                                                            The section's op (<=) (m1 m2 : (block list, 'b) fmap).

                                                                            Equations
                                                                            Instances For
                                                                              theorem GaudisCrypt.SHA3.Gconcl_list.leq_add2 [SLCommon.Params] [BlockSponge.Params] [Params] {β : Type} (m1 m2 : EC.FMap (List Common.block) β) (x : List Common.block) (y : β) :
                                                                              «<=» m1 m2 → ¬m2.dom x → «<=» (m1.set x y) (m2.set x y)

                                                                              bdistr is lossless, as an expectation.

                                                                              @[simp]

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

                                                                              @[simp]

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

                                                                              The body of proc f of module IF2, as a procedure of its own: the 4 calls it makes to module parameters (F, F2) 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 IF2.f.procedure.apply_simp) rather than run. Use IF2.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 IF2, abstracted over its 2 parameters F, F2, 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 IF2.init, IF2.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma IF2.apply_simp says.

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

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

                                                                                  Apply it with the @[simp] lemma IF2.f.apply_simp, which fills the holes of IF2.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 IF2.f to the parameters proc f uses (F, F2) is Module.proc (IF2.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 init of module IF2, as a procedure of its own: the 2 calls it makes to module parameters (F, F2) 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 IF2.init.procedure.apply_simp) rather than run. Use IF2.init for this procedure as a module.

                                                                                    Equations
                                                                                    Instances For

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

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

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

                                                                                      Apply it with the @[simp] lemma IF2.init.apply_simp, which fills the holes of IF2.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 DSqueeze2, as a procedure of its own: the 4 calls it makes to module parameters (F, F2) 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 DSqueeze2.f.procedure.apply_simp) rather than run. Use DSqueeze2.f for this procedure as a module.

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

                                                                                          @[simp]: applying DSqueeze2.f to the parameters proc f uses (F, F2) is Module.proc (DSqueeze2.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 DSqueeze2 as a module, abstracted over the module parameters it uses (F, F2, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                                                                          Apply it with the @[simp] lemma DSqueeze2.f.apply_simp, which fills the holes of DSqueeze2.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 DSqueeze2, abstracted over its 2 parameters F, F2, 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 DSqueeze2.init, DSqueeze2.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DSqueeze2.apply_simp says.

                                                                                            Equations
                                                                                            • One or more equations did not get rendered due to their size.
                                                                                            Instances For
                                                                                              theorem GaudisCrypt.SHA3.Gconcl_list.DSqueeze2.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] [Params] (holeArgs✝ : (HoleSigs.cons (procsig (List Common.block) → Unit) (HoleSigs.cons (procsig (List Common.block) → Common.block) (HoleSigs.cons (procsig (List Common.block) → Unit) (HoleSigs.cons (procsig (List Common.block) → Common.block) HoleSigs.empty)))).Instantiation) :
                                                                                              procedure.instantiate holeArgs✝ = proc (x : List Common.block × ℤ) : (List Common.block) { var p : List Common.block, n : ℤ, lres : List Common.block, b : Common.block, i : ℤ, pp : List Common.block, nn : ℤ; p, n <- §x; lres <- []; b <- Common.b0; i <- 0; pp, nn <- BlockSponge.parse (BlockSponge.format §p §n); if (valid §p) { if (decide (§n ≤ 0)) { call (holeArgs✝.lookup HoleIndex.zero) (§p); } while (decide (§i < §n)) { i <- §i + 1; b <- call (holeArgs✝.lookup HoleIndex.zero.succ) (BlockSponge.format §p §i); lres <- EC.rcons §lres §b; } } else { if (decide (§nn ≤ 0)) { call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§pp); } while (decide (§i < §nn - §n)) { i <- §i + 1; call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (BlockSponge.format §pp §i); } while (decide (§i < §n)) { i <- §i + 1; b <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (BlockSponge.format §pp §i); lres <- EC.rcons §lres §b; } } return §lres }

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

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

                                                                                              Apply it with the @[simp] lemma DSqueeze2.init.apply_simp, which fills the holes of DSqueeze2.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 init of module DSqueeze2, as a procedure of its own: the 2 calls it makes to module parameters (F, F2) 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 DSqueeze2.init.procedure.apply_simp) rather than run. Use DSqueeze2.init for this procedure as a module.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  @[simp]

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

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

                                                                                                  @[simp]

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

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

                                                                                                  @[simp]

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

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      @[simp]

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

                                                                                                      proc f of module FValid 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 FValid.f.apply_simp, which fills the holes of FValid.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 DValid, 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 DValid.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DValid.apply_simp says.

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

                                                                                                          proc distinguish = …; of module DValid: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, P, in declaration order). It has no DValid.distinguish.procedure: applied with the @[simp] lemma DValid.distinguish.apply_simp, it is the callee.

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

                                                                                                            @[simp]: the alias DValid.distinguish, applied to the parameters its callee uses (F, P), is its callee, as written in the declaration.

                                                                                                            @[simp]

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

                                                                                                            @[simp]

                                                                                                            @[simp]: the alias S2.init, applied to the parameters its callee uses (F), is its callee, as written in the declaration.

                                                                                                            proc init = …; of module S2: an alias, EasyCrypt's proc init = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no S2.init.procedure: applied with the @[simp] lemma S2.init.apply_simp, it is the callee.

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

                                                                                                              proc f = …; of module S2: an alias, EasyCrypt's proc f = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no S2.f.procedure: applied with the @[simp] lemma S2.f.apply_simp, it is the callee.

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

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

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

                                                                                                                @[simp]

                                                                                                                @[simp]: the alias S2.f, applied to the parameters its callee uses (F), is its callee, as written in the declaration.

                                                                                                                proc fi = …; of module S2: an alias, EasyCrypt's proc fi = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no S2.fi.procedure: applied with the @[simp] lemma S2.fi.apply_simp, it is the callee.

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

                                                                                                                  @[simp]: the alias S2.fi, applied to the parameters its callee uses (F), is its callee, as written in the declaration.

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

                                                                                                                  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

                                                                                                                      The section Real #

                                                                                                                      Instances For
                                                                                                                        Instances For
                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.INV_Real_addm_mi [SLCommon.Params] [BlockSponge.Params] [Params] (c1 c2 : ℤ) (m mi : EC.FMap state state) (p : EC.FMap (List Common.block) state) (x y : state) :
                                                                                                                          INV_Real c1 c2 m mi p → ¬m.dom x → ¬m.rng y → INV_Real c1 c2 (m.set x y) (mi.set y x) p
                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.lemma_3 [SLCommon.Params] [BlockSponge.Params] [Params] (c1 c2 : ℤ) (m mi : EC.FMap state state) (p : EC.FMap (List Common.block) state) (bl : List Common.block) (b sa : Common.block) (sc : Common.capacity) :
                                                                                                                          INV_Real c1 c2 m mi p → m.dom (sa +^ b, sc) → ¬p.dom (EC.rcons bl b) → p.get bl = some (sa, sc) → INV_Real c1 c2 m mi (p.set (EC.rcons bl b) (EC.oget (m.get (sa +^ b, sc))))

                                                                                                                          EC's local lemma lemma_3. Deviation: the prefixes of rcons bl b by cases on the position; EC's script is a chain of smt calls (size_take, take_cat, nth_cat, get_setE).

                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.lemma2' [SLCommon.Params] [BlockSponge.Params] [Params] (c1 c2 : ℤ) (m mi : EC.FMap state state) (p : EC.FMap (List Common.block) state) (bl : List Common.block) (i : ℤ) (sa : Common.block) (sc : Common.capacity) :
                                                                                                                          INV_Real c1 c2 m mi p → 1 < i → valid bl = true → m.dom (sa, sc) → ¬p.dom (BlockSponge.format bl i) → p.get (BlockSponge.format bl (i - 1)) = some (sa, sc) → INV_Real c1 c2 m mi (p.set (BlockSponge.format bl i) (EC.oget (m.get (sa, sc))))

                                                                                                                          EC's lemma2'. Deviation: from lemma_3 (EC's later lemma, here before it), as format bl i = rcons (format bl (i - 1)) b0; EC goes through the prefixes of format bl i directly.

                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.take_nseq {α : Type} (a : α) (i j : ℤ) :
                                                                                                                          EC.take j (EC.nseq i a) = if j ≤ i then EC.nseq j a else EC.nseq i a

                                                                                                                          EC's local lemma take_nseq (a : 'a) i j : take j (nseq i a) = if j <= i then nseq j a else nseq i a. Deviation: EC goes through eq_from_nth; here List.take_replicate.

                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.lemma4 [SLCommon.Params] [BlockSponge.Params] [Params] (c c' : ℤ) (m mi : EC.FMap state state) (p : EC.FMap (List Common.block) state) (bl : List Common.block) (i : ℤ) (sa : Common.block) (sc : Common.capacity) :
                                                                                                                          INV_Real c c' m mi p → 0 < i → p.get (BlockSponge.format bl i) = some (sa, sc) → p.dom (BlockSponge.format bl (i + 1)) → p.get (BlockSponge.format bl (i + 1)) = m.get (sa, sc)

                                                                                                                          EC's local lemma lemma4. Deviation: through format bl (i + 1) = format bl i ++ [b0]; EC goes through take_format, nth_cat, nth_nseq with an smt at each step.

                                                                                                                          format p (j + 1) is format p j and one more b0.

                                                                                                                          The first k blocks of format p (j + 1) are those of format p j, for k <= size (format p j).

                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.decide_lt_size_drop {α : Type} (l : List α) (i : ℤ) (h : 0 ≤ i) :

                                                                                                                          The absorbing loops' guards agree: i < size l iff drop i l is not empty.

                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.head_drop_nth {α : Type} [Inhabited α] (x0 : α) (l : List α) (i : ℤ) (h : 0 ≤ i ∧ i < EC.size l) :

                                                                                                                          head x0 (drop i l) = nth default l i within l.

                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.behead_drop_succ {α : Type} (l : List α) (i : ℤ) (h : 0 ≤ i) :
                                                                                                                          EC.behead (EC.drop i l) = EC.drop (i + 1) l

                                                                                                                          behead (drop i l) = drop (i + 1) l.

                                                                                                                          theorem GaudisCrypt.SHA3.Gconcl_list.INV_Real_mono [SLCommon.Params] {c1 c2 c2' : ℤ} {m mi : EC.FMap state state} {p : EC.FMap (List Common.block) state} (h : INV_Real c1 c2 m mi p) (h2 : c2 ≤ c2') :
                                                                                                                          INV_Real c1 c2' m mi p

                                                                                                                          INV_Real with a larger bound.

                                                                                                                          The bound of concl and Real_Ideal.

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

                                                                                                                            Footprints and losslessness of the oracles (for A_lossless, Ideal_lossless) #

                                                                                                                            EasyCrypt reads a concrete module's globals off its code and proves the oracles' losslessness inline (proc; inline*; ...; while (true) (n - i)); here they are lemmas.

                                                                                                                            FC touches C.c only. Not an EC lemma (EC reads it off the code).

                                                                                                                            The section Real_Ideal #

                                                                                                                            A(D) touches D's globals and C.c. Not an EC lemma.

                                                                                                                            dstate's mass at a point (EC: dprod1E, dunifin1E, block_card, capacity_card).

                                                                                                                            The section Real_Ideal_Abs (its local declarations in a namespace of that name, as #

                                                                                                                            invmC is also a local lemma of Real)

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

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

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

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

                                                                                                                              @[simp]

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

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

                                                                                                                              Equations
                                                                                                                              Instances For
                                                                                                                                @[simp]

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

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

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

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

                                                                                                                                  The simulator #

                                                                                                                                  EC's Simulator.m.

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

                                                                                                                                    EC's Simulator.mi.

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

                                                                                                                                      EC's Simulator.paths.

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

                                                                                                                                        EC's Simulator.unvalid_map.

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

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

                                                                                                                                          Equations
                                                                                                                                          Instances For
                                                                                                                                            @[simp]

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

                                                                                                                                            theorem GaudisCrypt.SHA3.Gconcl_list.Simulator.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] [Params] (holeArgs✝ : (HoleSigs.cons (procsig (List Common.block × ℤ) → List Common.block) HoleSigs.empty).Instantiation) :
                                                                                                                                            procedure.instantiate holeArgs✝ = proc (x : state) : state { var p : List Common.block, v : Common.block, q : List Common.block, k : ℤ, cs : List Common.block, y1 : Common.block, r : Common.block, y2 : Common.capacity, y : state; if (!decide ((§m).dom §x)) { if (decide ((§paths).dom (§x).2)) { p, v <- EC.oget ((§paths).get (§x).2); q, k <- BlockSponge.parse (EC.rcons (§p) (§v +^ (§x).1)); if (valid §q) { cs <- call (holeArgs✝.lookup HoleIndex.zero) (§q, §k); y1 <- EC.last Common.b0 §cs; } else { if (decide (0 < §k)) { if (!decide ((§unvalid_map).dom (§q, §k - 1))) { r <$ Common.bdistr; unvalid_map <- (§unvalid_map).set (§q, §k - 1) §r; } y1 <- EC.oget ((§unvalid_map).get (§q, §k - 1)); } else { y1 <- Common.b0; } } } else { y1 <$ Common.bdistr; } y2 <$ Common.cdistr; y <- (§y1, §y2); m <- (§m).set §x §y; mi <- (§mi).set §y §x; if (decide ((§paths).dom (§x).2)) { p, v <- EC.oget ((§paths).get (§x).2); paths <- (§paths).set §y2 (EC.rcons (§p) (§v +^ (§x).1), (§y).1); } } else { y <- EC.oget ((§m).get §x); } return §y }

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

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

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

                                                                                                                                                proc f of module Simulator 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 Simulator.f.apply_simp, which fills the holes of Simulator.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 Simulator, 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 Simulator.f.procedure.apply_simp) rather than run. Use Simulator.f for this procedure as a module.

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

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

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

                                                                                                                                                    @[simp]

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

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

                                                                                                                                                    @[simp]

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

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

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

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

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

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

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

                                                                                                                                                        The section Simplify_Simulator (its local declarations in a namespace of that name, as #

                                                                                                                                                        L is also a local module of Ideal)

                                                                                                                                                        The body of proc init of module Simu, as a procedure of its own: the 2 calls it makes to module parameters (FRO, F) 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 Simu.init.procedure.apply_simp) rather than run. Use Simu.init 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 Simu as a module, abstracted over the module parameters it uses (FRO, F, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                                                                                                                                          Apply it with the @[simp] lemma Simu.init.apply_simp, which fills the holes of Simu.init.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 Simu.fi.procedure with a tuple holeArgs of procedures: the body of proc fi as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

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

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

                                                                                                                                                            @[simp]

                                                                                                                                                            @[simp]: applying Simu to a tuple of its 2 parameters FRO, F — the record of its procedures Simu.init, Simu.f, Simu.fi, each applied to the parameters it uses.

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

                                                                                                                                                            @[simp]

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

                                                                                                                                                            theorem GaudisCrypt.SHA3.Gconcl_list.Simplify_Simulator.Simu.f.procedure.apply_simp [SLCommon.Params] [BlockSponge.Params] [Params] (holeArgs✝ : (HoleSigs.cons (procsig (List Common.block × ℤ) → List Common.block) (HoleSigs.cons (procsig (List Common.block × ℤ) → Unit) (HoleSigs.cons (procsig (List Common.block × ℤ) → Common.block) HoleSigs.empty))).Instantiation) :
                                                                                                                                                            procedure.instantiate holeArgs✝ = proc (x : state) : state { var p : List Common.block, v : Common.block, q : List Common.block, k : ℤ, cs : List Common.block, y1 : Common.block, i : ℤ, y2 : Common.capacity, y : state; if (!decide ((§Simulator.m).dom §x)) { if (decide ((§Simulator.paths).dom (§x).2)) { p, v <- EC.oget ((§Simulator.paths).get (§x).2); q, k <- BlockSponge.parse (EC.rcons (§p) (§v +^ (§x).1)); if (valid §q) { cs <- call (holeArgs✝.lookup HoleIndex.zero) (§q, §k); y1 <- EC.last Common.b0 §cs; } else { if (decide (0 < §k)) { i <- 0; while (decide (§i < §k)) { call (holeArgs✝.lookup HoleIndex.zero.succ) (§q, §i); i <- §i + 1; } y1 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§q, §k - 1); } else { y1 <- Common.b0; } } } else { y1 <$ Common.bdistr; } y2 <$ Common.cdistr; y <- (§y1, §y2); Simulator.m <- (§Simulator.m).set §x §y; Simulator.mi <- (§Simulator.mi).set §y §x; if (decide ((§Simulator.paths).dom (§x).2)) { p, v <- EC.oget ((§Simulator.paths).get (§x).2); Simulator.paths <- (§Simulator.paths).set §y2 (EC.rcons (§p) (§v +^ (§x).1), (§y).1); } } else { y <- EC.oget ((§Simulator.m).get §x); } return §y }

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

                                                                                                                                                            @[simp]

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

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

                                                                                                                                                            Equations
                                                                                                                                                            Instances For
                                                                                                                                                              @[simp]

                                                                                                                                                              @[simp]: applying Simu.f to the parameters proc f uses (FRO, F) is Module.proc (Simu.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 Simu as a module, abstracted over the module parameters it uses (FRO, F, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                                                                                                                                              Apply it with the @[simp] lemma Simu.f.apply_simp, which fills the holes of Simu.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 Simu, as a procedure of its own: the 3 calls it makes to module parameters (FRO, F) 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 Simu.f.procedure.apply_simp) rather than run. Use Simu.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 fi of module Simu, 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 Simu.fi.procedure.apply_simp) rather than run. Use Simu.fi 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 Simu, abstracted over its 2 parameters FRO, 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 Simu.init, Simu.f, Simu.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Simu.apply_simp says.

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

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

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

                                                                                                                                                                      Equations
                                                                                                                                                                      Instances For

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

                                                                                                                                                                        @[simp]

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

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

                                                                                                                                                                        Apply it with the @[simp] lemma L.distinguish.apply_simp, which fills the holes of L.distinguish.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 L, abstracted over its single parameter FRO, 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 L.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma L.apply_simp says.

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

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

                                                                                                                                                                            From Ideal_equiv_valid on, the proofs are written on the strict tactics (ec_auto, ec_close, ec_progress, ec_prep: Logic/ECAutoStrict.lean, Logic/ECProgress.lean); ideal_equiv is on the older ones.

                                                                                                                                                                            Section Ideal #

                                                                                                                                                                            EC's local equiv ideal_equiv (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S}) : SLCommon.IdealIndif(IF, S, SLCommon.DRestr(A(D))).main ~ SLCommon.IdealIndif(IF, S, A(D)).main : ={glob D} ==> ={glob D, res}.

                                                                                                                                                                            proc f of module IF' 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 IF'.f.apply_simp, which fills the holes of IF'.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 IF', 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 IF'.init, IF'.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma IF'.apply_simp says.

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

                                                                                                                                                                                The body of proc f of module IF', as a procedure of its own: the 2 calls it makes to module parameters (F) 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 IF'.f.procedure.apply_simp) rather than run. Use IF'.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 IF': an alias, EasyCrypt's proc init = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no IF'.init.procedure: applied with the @[simp] lemma IF'.init.apply_simp, it is the callee.

                                                                                                                                                                                  Equations
                                                                                                                                                                                  Instances For

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

                                                                                                                                                                                    @[simp]

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

                                                                                                                                                                                    @[simp]

                                                                                                                                                                                    @[simp]: the alias IF'.init, applied to the parameters its callee uses (F), is its callee, as written in the declaration.

                                                                                                                                                                                    @[simp]

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

                                                                                                                                                                                    @[reducible, inline]

                                                                                                                                                                                    EC's local module (L (D : DISTINGUISHER) : F.RO_Distinguisher) (F : F.RO): proc distinguish = SLCommon.IdealIndif(IF'(F), S, A(D)).main (an alias, so that proc opens it; the old port's L is a def).

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

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

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

                                                                                                                                                                                        @[simp]

                                                                                                                                                                                        @[simp]: the alias Valid2.init, applied to the parameters its callee uses (F), is its callee, as written in the declaration.

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

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

                                                                                                                                                                                            @[simp]: applying Valid2.f to the parameters proc f uses (F) is Module.proc (Valid2.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 init = …; of module Valid2: an alias, EasyCrypt's proc init = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no Valid2.init.procedure: applied with the @[simp] lemma Valid2.init.apply_simp, it is the callee.

                                                                                                                                                                                            Equations
                                                                                                                                                                                            Instances For
                                                                                                                                                                                              @[reducible, inline]

                                                                                                                                                                                              EC's local module (L2 (D : DISTINGUISHER) : F.RO_Distinguisher) (F : F.RO): proc distinguish = SLCommon.IdealIndif(Valid2(F), S, A(D)).main.

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

                                                                                                                                                                                                EC's local equiv Ideal_equiv_valid (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S}) : L(D,F.LRO).distinguish ~ L2(D,F.LRO).distinguish : ={glob D} ==> ={glob D, res}.

                                                                                                                                                                                                Deviations: after EC's call (: I) on two different concrete procedures, equiv_proc (EC's form opens the callees itself); GAP 3 of the file header.

                                                                                                                                                                                                EC's local equiv ideal_equiv2 (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S}) : L2(D,F.RO).distinguish ~ SLCommon.IdealIndif(IF,S,A(D)).main : ={glob D} ==> ={glob D, res}.

                                                                                                                                                                                                Deviations: after EC's call (: I) on two concrete procedures, equiv_proc (EC's form opens them). EC's smt(parse_valid parseK formatK) are closed without the lemmas.

                                                                                                                                                                                                @[reducible, inline]

                                                                                                                                                                                                EC's local module (L3 (D : DISTINGUISHER) : F.RO_Distinguisher) (F : F.RO): proc distinguish = SLCommon.IdealIndif(IF2(F,F2.RO), S, A(D)).main (an alias; the old port's L3 is a def).

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

                                                                                                                                                                                                  EC's local equiv Ideal_equiv3 (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S, -F2.RO}) : L(D,F.RO).distinguish ~ L3(D,F.RO).distinguish : ={glob D} ==> ={glob D, res}.

                                                                                                                                                                                                  Deviations: GAPs 5 and 6 of the file header. EC's smt(lemma1 lemma2 incl_dom parse_valid …) calls are closed by hand with those lemmas and the old port's inv_L_L3.dom_valid, get_valid, set_valid, dom_invalid, get_invalid (the invariant on a query with a valid, or an invalid, prefix); the hypotheses are taken by type.

                                                                                                                                                                                                  @[reducible, inline]

                                                                                                                                                                                                  EC's local module L4 (D : DISTINGUISHER) (F : F.RO) (F2 : F2.RO): proc distinguish = IdealIndif(DSqueeze2(F,F2),S2,DValid(DRestr(D))).main (an alias; the old port's L4 is a def).

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

                                                                                                                                                                                                    EC's local equiv equiv_L3_L4 (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S, -F2.RO, -BIRO.IRO, -BIRO2.IRO}) : L3(D,F.RO).distinguish ~ L4(D,F.RO,F2.RO).distinguish : ={glob D} ==> ={glob D, res}.

                                                                                                                                                                                                    Deviations: GAPs 5 and 7 of the file header. EC's variables of inlined callees are named differently (noted at each use). EC's smt calls with parse_gt0, parseK, formatK, parse_valid are by hand (smt_close fails on them with an unknown free variable, GAP 2); the two loop side goals EC repeats are the local macros l3l4_round and l3l4_i_lt_n.

                                                                                                                                                                                                    EC's local equiv equiv_L4_ideal (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S, -F2.RO, -BIRO.IRO, -BIRO2.IRO}) : L4(D,F.LRO,F2.LRO).distinguish ~ IdealIndif(BIRO.IRO,SimLast(S),DRestr(D)).main : ={glob D} ==> ={glob D, res}.

                                                                                                                                                                                                    Deviations: equiv_proc after EC's call (: I) on two concrete procedures (EC's form opens them). What EC's smt(parseK), smt(parse_twice) read off INV_L4_ideal is stated once at the top (hdom, hget for a valid prefix; hpt, hdom', hget' for an invalid one) and applied by hand at EC's progress goals, with EC's lemma5, lemma5bis.

                                                                                                                                                                                                    @[implicit_reducible]

                                                                                                                                                                                                    SLCommon's primitive where BlockSponge's distinguisher's is expected (PC(S(Valid2(F))) in D2): EC's subtyping.

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

                                                                                                                                                                                                    proc distinguish = …; of module D2: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no D2.distinguish.procedure: applied with the @[simp] lemma D2.distinguish.apply_simp, it is the callee.

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

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

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

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

                                                                                                                                                                                                      Equations
                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                        proc distinguish = …; of module D3: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no D3.distinguish.procedure: applied with the @[simp] lemma D3.distinguish.apply_simp, it is the callee.

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

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

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

                                                                                                                                                                                                          Equations
                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                            @[simp]

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

                                                                                                                                                                                                            The clone F's FullEager.RO_LRO_D (PROM.FullRO's, at F's dout and module variables, its dout_ll EC's dunifin_ll): a distinguisher cannot tell F.RO from F.LRO. Its side conditions, which EC checks itself, are found (ec_module, fp_disjoint).

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

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

                                                                                                                                                                                                            Equations
                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                              proc distinguish = …; of module D5: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no D5.distinguish.procedure: applied with the @[simp] lemma D5.distinguish.apply_simp, it is the callee.

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

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

                                                                                                                                                                                                                proc distinguish = …; of module D6: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F2', in declaration order). It has no D6.distinguish.procedure: applied with the @[simp] lemma D6.distinguish.apply_simp, it is the callee.

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

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

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

                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                  Instances For

                                                                                                                                                                                                                    EC's lemma equiv_ideal (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S, -F.FRO, -F2.RO, -F2.FRO, -BIRO.IRO, -BIRO2.IRO}) &m: Pr[SLCommon.IdealIndif(IF,S,SLCommon.DRestr(A(D))).main() @ &m : res] = Pr[IdealIndif(BIRO.IRO,SimLast(S),DRestr(D)).main() @ &m : res].

                                                                                                                                                                                                                    The four lazy/eager steps are EC's (byequiv; proc; sp; inline*; sp; wp; call (F.FullEager.RO_LRO_D (D2(D)) _); auto, and the same with D3, D5, D6), the clones' RO_LRO_D finding their side conditions. Deviations: D5, D6 have S2(…) for EC's S(Last(…)) (see D5); EC's sequence of rewrites is one chain of equations at the end; -F.FRO, -F2.FRO are written as their variables.

                                                                                                                                                                                                                    Section Real #

                                                                                                                                                                                                                    @[implicit_reducible]

                                                                                                                                                                                                                    Perm where SLCommon's DPRIMITIVE is expected (SqueezelessSponge(Perm)): EC's subtyping. EC's module P = Perm is not declared: the old port's alias P is a BlockSponge primitive that inline* does not open, and EC's scripts are the same with Perm for P.

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

                                                                                                                                                                                                                    The absorbing loop of equiv_sponge extends Redo.prefixes by take (i + 1) p, a prefix it does not know. EC proves the invariant's facts on the extended map inline, in both branches of the permutation's test (smt(mem_set get_setE domE take_take size_take …) and by hand); here each is stated once.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.absorb_dom [SLCommon.Params] {P pref : EC.FMap (List Common.block) SLCommon.state} {bl : List Common.block} {i : ℤ} (hdom : ∀ (l : List Common.block), P.dom l → pref.dom l ∨ ∃ (j : ℤ), 0 < j ∧ j ≤ i ∧ l = EC.take j bl) (hi : 0 ≤ i) (v : SLCommon.state) (l : List Common.block) (hl : (P.set (EC.take (i + 1) bl) v).dom l) :
                                                                                                                                                                                                                    pref.dom l ∨ ∃ (j : ℤ), 0 < j ∧ j ≤ i + 1 ∧ l = EC.take j bl

                                                                                                                                                                                                                    A key of the extended map is in pref, or a prefix of p.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.absorb_get [SLCommon.Params] {P pref : EC.FMap (List Common.block) SLCommon.state} {bl : List Common.block} {i : ℤ} (hpl : ∀ (l : List Common.block), pref.dom l → pref.get l = P.get l) (hnd : ¬P.dom (EC.take (i + 1) bl)) (v : SLCommon.state) (l : List Common.block) (hl : pref.dom l) :
                                                                                                                                                                                                                    pref.get l = (P.set (EC.take (i + 1) bl) v).get l

                                                                                                                                                                                                                    The extended map agrees with pref on pref's keys.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.absorb_fresh [SLCommon.Params] {P : EC.FMap (List Common.block) SLCommon.state} {bl : List Common.block} {i : ℤ} (hall : SLCommon.Prefix.all_prefixes P) (hnd : ¬P.dom (EC.take (i + 1) bl)) (hi : 0 ≤ i) (hlt : i + 1 < EC.size bl) (v : SLCommon.state) :
                                                                                                                                                                                                                    ¬(P.set (EC.take (i + 1) bl) v).dom (EC.take (i + 1 + 1) bl)

                                                                                                                                                                                                                    The extended map does not know the next prefix.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.absorb_step [SLCommon.Params] {P : EC.FMap (List Common.block) SLCommon.state} {bl : List Common.block} {i : ℤ} {m m' : EC.FMap SLCommon.state SLCommon.state} {sa : Common.block} {sc : Common.capacity} (hall : SLCommon.Prefix.all_prefixes P) (hnd : ¬P.dom (EC.take (i + 1) bl)) (hget : P.get (EC.take i bl) = some (sa, sc)) (hstep : ∀ (j : ℤ), 0 ≤ j ∧ j < i → ∃ (b : Common.block) (c : Common.capacity), P.get (EC.take j bl) = some (b, c) ∧ m.get (b +^ EC.nth default bl j, c) = P.get (EC.take (j + 1) bl)) (hm : ∀ (x : SLCommon.state), m.dom x → m'.get x = m.get x) (v : SLCommon.state) (hv : m'.get (sa +^ EC.nth default bl i, sc) = some v) (j : ℤ) (hj : 0 ≤ j ∧ j < i + 1) :
                                                                                                                                                                                                                    ∃ (b : Common.block) (c : Common.capacity), (P.set (EC.take (i + 1) bl) v).get (EC.take j bl) = some (b, c) ∧ m'.get (b +^ EC.nth default bl j, c) = (P.set (EC.take (i + 1) bl) v).get (EC.take (j + 1) bl)

                                                                                                                                                                                                                    The extended map records the permutation's steps along p, up to i + 1: m' is the permutation's map after the step (m with, possibly, one more entry), v its value at the state recorded for take i p xored with the next block.

                                                                                                                                                                                                                    The squeezing loop of equiv_sponge runs the squeezeless sponge on format p (i + 1) when format p i is a known prefix: all its blocks but the last are known. EC proves this at each rcond and in each loop (have->: take (i1 + 1) (format bl (i + 1)) = take (i1 + 1) (format bl i); smt(all_prefixes_of_INV_real), smt(take_format size_cat size_nseq …)); here once for the blocks of p and once for the padding.

                                                                                                                                                                                                                    EC's size_cat, size_nseq on format.

                                                                                                                                                                                                                    EC's smt(take_cat take_le0 cats0): within p, a prefix of format p j is one of p.

                                                                                                                                                                                                                    A prefix of format p (i + 1) within p is known.

                                                                                                                                                                                                                    A prefix of format p (i + 1) past p, but for the last block, is known.

                                                                                                                                                                                                                    EC's local lemma equiv_sponge (D <: DISTINGUISHER {-P, -Redo, -C, -SLCommon.C}) : equiv [ GReal(A(D)).main ~ NIndif(Squeeze(SqueezelessSponge(P)),P,DRestr(D)).main : ={glob D} ==> ={res, glob D, glob P, C.c} /\ SLCommon.C.c{1} <= C.c{2} <= max_size].

                                                                                                                                                                                                                    Deviations: EC's P (module P = Perm) is written Perm, and glob P its two maps (GAP 3); the facts EC proves inline in the two branches of the permutation's test and at each rcond are the lemmas above (absorb_*, squeeze_known_*); GAPs 8 to 10 of the file header.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.INV_Real_known_step [SLCommon.Params] {c1 c2 : ℤ} {m mi : EC.FMap SLCommon.state SLCommon.state} {P : EC.FMap (List Common.block) SLCommon.state} {l : List Common.block} {i : ℤ} {sa : Common.block} {sc : Common.capacity} (hinv : Gconcl_list.INV_Real c1 c2 m mi P) (hi : 0 ≤ i ∧ i < EC.size l) (hd : P.dom (EC.take (i + 1) l)) (hget : P.get (EC.take i l) = some (sa, sc)) :
                                                                                                                                                                                                                    m.get (sa +^ EC.nth default l i, sc) = P.get (EC.take (i + 1) l)

                                                                                                                                                                                                                    A known next prefix is the permutation's step from the current one. EC proves it inline at each use in squeeze_squeezeless's absorbing loop (have[]_[]_ hmp1 _ :=H2;have:=hmp1 _ H5 i0 _;1:smt(size_take). move=>[]b3 c3;rewrite!take_take!nth_take …, five times).

                                                                                                                                                                                                                    EC's rewrite take_oversize;1:rewrite size_cat size_nseq ler_maxr/# at i1 = size p + i - 1: the whole of format p (i + 1).

                                                                                                                                                                                                                    EC's rewrite nth_cat nth_nseq;1:smt(size_ge0). have->/=:!size p + i - 1 < size p by smt() at i1 = size p + i - 1: the last block of format p (i + 1) is b0.

                                                                                                                                                                                                                    A prefix of format p (i + 1), but for the last block, is known (0 < i).

                                                                                                                                                                                                                    EC's rewrite take_format … have->: x = format p (i_R+1): format p (j + 1) without its last block is format p j.

                                                                                                                                                                                                                    EC's local lemma squeeze_squeezeless (D <: DISTINGUISHER {-P, -Redo, -C, -SLCommon.C}) : equiv [ NIndif(Squeeze(SqueezelessSponge(P)),P,DRestr(D)).main ~ RealIndif(Sponge,P,DRestr(D)).main : ={glob D} ==> ={res, glob P, glob D, C.c} /\ C.c{1} <= max_size].

                                                                                                                                                                                                                    Deviations: Perm for EC's P, glob P its two maps (as equiv_sponge); GAP 11 of the file header (one bridge line after inline*); the facts EC proves inline at each use are the lemmas above (INV_Real_known_step, squeeze_known, take_format_full, nth_format_pad, take_format_pred); EC's one goal on the body of while{1} is our two.

                                                                                                                                                                                                                    EC's lemma pr_real (D <: DISTINGUISHER{-SLCommon.C, -C, -Perm, -Redo}) &m : Pr [ GReal(A(D)).main() @ &m : res /\ SLCommon.C.c <= max_size] = Pr [ RealIndif(Sponge,P,DRestr(D)).main() @ &m : res].

                                                                                                                                                                                                                    Section Real_Ideal #

                                                                                                                                                                                                                    concl (EC l. 1786) applies Gconcl.Real_Ideal to the composed distinguisher A(D), with A_lossless for its D_ll. EC's glob A(D) is glob D and C.c by definition; here the footprint of an application is bounded from above only, so {-A(D)} does not give {-D}. The pilots' Real_Ideal is therefore stated against a region for glob D (declare module … with glob R, Logic/DeclareModule.lean; exception E14), and concl gives the region of A(D) written out, R ⊔ C.c.footprint. This section's D has a region too: EC applies concl to Neg_D(D) (neg_D_concl).

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.A_lossless [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] (D : BlockSponge.DISTINGUISHER) [Module.Declared D (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (D_lossless : ∀ (F0 : BlockSponge.DFUNCTIONALITY) [Module.Declared F0 R] (P0 : BlockSponge.DPRIMITIVE) [Module.Declared P0 R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) F0).procedure.IsLossless → (Module.app D (Module.pair F0 P0)).procedure.IsLossless) (F : SLCommon.DFUNCTIONALITY) [Module.Declared F (R ⊔ BlockSponge.C.c.footprint)] (P0 : SLCommon.DPRIMITIVE) [Module.Declared P0 (R ⊔ BlockSponge.C.c.footprint)] :

                                                                                                                                                                                                                    EC's lemma A_lossless (F <: SLCommon.DFUNCTIONALITY{-A(D)}) (P0 <: SLCommon.DPRIMITIVE{-A(D)}) : islossless P0.f => islossless P0.fi => islossless F.f => islossless A(D, F, P0).distinguish; {-A(D)} is {-R, -C}, its globals.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.concl [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] (D : BlockSponge.DISTINGUISHER) [Module.Declared D (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (D_lossless : ∀ (F0 : BlockSponge.DFUNCTIONALITY) [Module.Declared F0 R] (P0 : BlockSponge.DPRIMITIVE) [Module.Declared P0 R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) F0).procedure.IsLossless → (Module.app D (Module.pair F0 P0)).procedure.IsLossless) (m : VariableAssignment) :

                                                                                                                                                                                                                    EC's lemma concl &m : Pr [ RealIndif(Sponge,P,DRestr(D)).main() @ &m : res ] <= Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ] + (max_size ^ 2 - max_size)%r / 2%r / (2^r)%r / (2^c)%r + max_size%r * ((2*max_size)%r / (2^c)%r) + max_size%r * ((2*max_size)%r / (2^c)%r).

                                                                                                                                                                                                                    Section Real_Ideal_Abs #

                                                                                                                                                                                                                    EC's section, complete. Three deviations, each at its lemma: Real_lossless calls D with lossless oracles where EC keeps the invariant invm Perm.m Perm.mi (GAP 12); in Ideal_lossless the sampling behind a loop is passed by phoare_auto; neg_D_concl is EC's script with AdvAbsVal's Neg_A_Pr_minus. The section's D has a region for glob D (exception E14): concl is applied to Neg_D(D) here, and Inefficient_Real_Ideal to a distinguisher built from a declared one in SHA3Indiff.

                                                                                                                                                                                                                    DRestr(D) touches what D does and the counter C.c. Not an EC lemma: Neg_A_Pr_minus takes the games on Neg_D(D) as modules with finitely many globals, which the footprint solver reads through it.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.Neg_D_lossless [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] (D : BlockSponge.DISTINGUISHER) [Module.Declared D (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (D_lossless : ∀ (F0 : BlockSponge.DFUNCTIONALITY) [Module.Declared F0 R] (P0 : BlockSponge.DPRIMITIVE) [Module.Declared P0 R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) F0).procedure.IsLossless → (Module.app D (Module.pair F0 P0)).procedure.IsLossless) (F : BlockSponge.DFUNCTIONALITY) [Module.Declared F R] (P : BlockSponge.DPRIMITIVE) [Module.Declared P R] :

                                                                                                                                                                                                                    EC's local lemma Neg_D_lossless (F <: DFUNCTIONALITY{-Neg_D(D)}) (P <: DPRIMITIVE{-Neg_D(D)}) : islossless P.f => islossless P.fi => islossless F.f => islossless Neg_D(D, F, P).distinguish; {-Neg_D(D)} is {-R}.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.Real_lossless [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] (D : BlockSponge.DISTINGUISHER) [Module.Declared D (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (D_lossless : ∀ (F0 : BlockSponge.DFUNCTIONALITY) [Module.Declared F0 R] (P0 : BlockSponge.DPRIMITIVE) [Module.Declared P0 R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) F0).procedure.IsLossless → (Module.app D (Module.pair F0 P0)).procedure.IsLossless) :

                                                                                                                                                                                                                    EC's local lemma Real_lossless : islossless RealIndif(Sponge, P, DRestr(Neg_D(D))).main.

                                                                                                                                                                                                                    Deviation (GAP 12): EC calls D under the invariant invm Perm.m Perm.mi, under which the permutation's sampling is lossless (useful). phoare_call on an abstract module has the rule for lossless oracles only, and here Perm.f, Perm.fi are lossless in every state (the first port's P_f_ll, P_fi_ll: a finite map missing a key misses a value). So the call is EC's call (: true), the oracles' proofs keep EC's steps without the invariant, and the calls of the permutation are not inlined: EC's inline* on the functionality's oracle is phoare_inline 0 (the sponge's call only), so that call P_f_ll applies to the permutation's calls.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.variant_decr {i n : ℤ} {z : ℕ} (hi : decide (i < n) = true) (hz : (n - i).toNat = z) :
                                                                                                                                                                                                                    (n - (i + 1)).toNat < z

                                                                                                                                                                                                                    EC's smt() after each while (true) (n - i): an iteration decreases the variant.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.Ideal_lossless [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] (D : BlockSponge.DISTINGUISHER) [Module.Declared D (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (D_lossless : ∀ (F0 : BlockSponge.DFUNCTIONALITY) [Module.Declared F0 R] (P0 : BlockSponge.DPRIMITIVE) [Module.Declared P0 R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) F0).procedure.IsLossless → (Module.app D (Module.pair F0 P0)).procedure.IsLossless) :

                                                                                                                                                                                                                    EC's local lemma Ideal_lossless : islossless IdealIndif(BIRO.IRO, SimLast(S), DRestr(Neg_D(D))).main.

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.neg_D_concl [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] (D : BlockSponge.DISTINGUISHER) [Module.Declared D (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (D_lossless : ∀ (F0 : BlockSponge.DFUNCTIONALITY) [Module.Declared F0 R] (P0 : BlockSponge.DPRIMITIVE) [Module.Declared P0 R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) F0).procedure.IsLossless → (Module.app D (Module.pair F0 P0)).procedure.IsLossless) (m : VariableAssignment) :

                                                                                                                                                                                                                    EC's local lemma neg_D_concl &m : Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ] <= Pr [ RealIndif(Sponge,P,DRestr(D)).main() @ &m : res ] + (max_size ^ 2 - max_size)%r / 2%r / (2^r)%r / (2^c)%r + max_size%r * ((2*max_size)%r / (2^c)%r) + max_size%r * ((2*max_size)%r / (2^c)%r).

                                                                                                                                                                                                                    EC's script, with AdvAbsVal's Neg_main and Neg_A_Pr_minus (Lib/EC/AdvAbsVal.lean); the games are modules with finitely many globals (Neg_A_Pr_minus's A <: Adv) through the bound fvP_DRestr'. concl is applied to Neg_D(D) with the region of D (glob Neg_D(D) is glob D).

                                                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.Inefficient_Real_Ideal [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] (D : BlockSponge.DISTINGUISHER) [Module.Declared D (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (D_lossless : ∀ (F0 : BlockSponge.DFUNCTIONALITY) [Module.Declared F0 R] (P0 : BlockSponge.DPRIMITIVE) [Module.Declared P0 R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) F0).procedure.IsLossless → (Module.app D (Module.pair F0 P0)).procedure.IsLossless) (m : VariableAssignment) :

                                                                                                                                                                                                                    EC's lemma Inefficient_Real_Ideal &m : |Pr [ RealIndif(Sponge,Perm,DRestr(D)).main() @ &m : res ] - Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ]| <= (max_size ^ 2 - max_size)%r / 2%r / (2^r)%r / (2^c)%r + max_size%r * ((2max_size)%r / (2^c)%r) + max_size%r * ((2max_size)%r / (2^c)%r)`.

                                                                                                                                                                                                                    Section Simplify_Simulator #

                                                                                                                                                                                                                    equal2 is done; equal1 (EC l. 2086) and Simplify_simulator (l. 2186) are not yet.

                                                                                                                                                                                                                    EC's local clone import PROM.FullRO as IRO2 with type in_t <- block list * int, type out_t <- block, op dout _ <- bdistr, type d_in_t <- unit, type d_out_t <- bool: the clone's module variables are global_vars (the first port's are lens parameters).

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

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

                                                                                                                                                                                                                      The clone's module variable IRO2.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
                                                                                                                                                                                                                            @[reducible, inline]
                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                              @[reducible, inline]

                                                                                                                                                                                                                              EC's local module L (F : IRO2.RO): proc distinguish = IdealIndif(BIRO.IRO, Simu(F), DRestr(D)).main (an alias).

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

                                                                                                                                                                                                                                EC proves this inline, three times in equal1 (have->>: q = (parse l).1, the same for k, then formatK): the query parsed from l` formats back to it.

                                                                                                                                                                                                                                EC's local lemma equal1 &m : Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ] = Pr [ L(IRO2.RO).distinguish() @ &m : res ].

                                                                                                                                                                                                                                The proof is EC's, with these differences. The fact EC derives inline three times (the query parsed on the left formats back to the list parsed on the right) is parse_format_of_eq_parse. In the invalid query, EC shows that the last query is already sampled by splitting off the loop's last iteration (splitwhile, rcondt, rcondf, seq on a Hoare triple); there is no seq on a Hoare triple here (GAP 9), and the loop is given the invariant "the query before i is sampled" directly. The invariant of the main loop carries what the loops do not write (GAP 15).

                                                                                                                                                                                                                                EC's local lemma equal2 &m : Pr [ IdealIndif(BIRO.IRO, Simulator, DRestr(D)).main() @ &m : res ] = Pr [ L(IRO2.LRO).distinguish() @ &m : res ].

                                                                                                                                                                                                                                The section's D with the local clone's variable in its restriction (fresh in EC). Deviations: GAPs 5, 14, 15, 16 of the file header.

                                                                                                                                                                                                                                @[reducible, inline]

                                                                                                                                                                                                                                The first port's L D: a module whose one procedure calls the game (exception E5), which is the RO_Distinguisher that RO_LRO_D takes.

                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                Instances For

                                                                                                                                                                                                                                  EC's lemma Simplify_simulator &m : Pr [ IdealIndif(BIRO.IRO, Simulator, DRestr(D)).main() @ &m : res ] = Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ].

                                                                                                                                                                                                                                  The section's D with the local clone's variables in its restriction (fresh in EC). Deviation: EC's L is an alias, and RO_LRO_D takes a module; the two probabilities are first moved to the first port's module L D (LF, exception E5).

                                                                                                                                                                                                                                  Section Real_Ideal (EC's last) #

                                                                                                                                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.Gconcl_list.Real_Ideal [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] (D : BlockSponge.DISTINGUISHER) [Module.Declared D (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ Simplify_Simulator.IRO2.RO.m.footprint ⊔ Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob D R] [R.Restricted (SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ BlockSponge.C.c.footprint ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ Simplify_Simulator.IRO2.RO.m.footprint ⊔ Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (D_lossless : ∀ (F0 : BlockSponge.DFUNCTIONALITY) [Module.Declared F0 R] (P0 : BlockSponge.DPRIMITIVE) [Module.Declared P0 R], (SHA3.Indifferentiability.DPRIMITIVE.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DPRIMITIVE.fi SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) P0).procedure.IsLossless → (SHA3.Indifferentiability.DFUNCTIONALITY.f SHA3.SLCommon.state (List Common.block × ℤ) (List Common.block) F0).procedure.IsLossless → (Module.app D (Module.pair F0 P0)).procedure.IsLossless) (m : VariableAssignment) :

                                                                                                                                                                                                                                  EC's lemma Real_Ideal &m : |Pr [ RealIndif(Sponge,Perm,DRestr(D)).main() @ &m : res ] - Pr [ IdealIndif(BIRO.IRO, Simulator, DRestr(D)).main() @ &m : res ]| <= (max_size ^ 2 - max_size)%r / 2%r / (2^r)%r / (2^c)%r + max_size%r * ((2max_size)%r / (2^c)%r) + max_size%r * ((2max_size)%r / (2^c)%r)`.