Documentation

GaudisCrypt.Examples.SHA3.SecureRO

Random oracles are preimage, second-preimage and collision resistant — EC-fidelity port #

(EasyCrypt proof/SecureRO.eca)

The refactor pilot of notes/SHA3/Refactor.md: EC's file transcribed one to one, its declarations and its proofs EC's (the first port of the file is gone). The facts EC's smt() finds on maps and bounds are Lib/EC/FMap.lean's and Lib/EC/Mu.lean's.

Translation:

type from, to., the operators and their axioms.

EC's op sampleto, op bound, op increase_counter, op bound_counter and their axioms. The types are outParams: a clone of the theory is an instance.

Instances

    clone import PROM.FullRO as RO with type in_t <- from, type out_t <- to, op dout _ <- sampleto, …: its module variable RO.m, and its module RO.

    instance GaudisCrypt.SHA3.Pilot.SecureRO.instIsGlobalVarFMapMMk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
    RO.m.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureRO.RO.m" (EC.FMap «from» «to»))
    noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.RO.m {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
    Lens (EC.FMap «from» «to») VariableAssignment

    The clone's module variables RO.m, FRO.m (module_var: they take the theory's instance, whose outParams fix their types).

    Equations
    Instances For
      noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.FRO.m {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        instance GaudisCrypt.SHA3.Pilot.SecureRO.instIsGlobalVarFMapProdFlagMMk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
        FRO.m.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureRO.FRO.m" (EC.FMap «from» («to» × EC.PROM.flag)))

        The module types. Their types are the theory's (implicit, fixed by Params's outParams), so they are written as in EC: RF, Oracle, AdvPreimage.

        def GaudisCrypt.SHA3.Pilot.SecureRO.RF {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

        Equations
        Instances For
          @[simp]
          theorem GaudisCrypt.SHA3.Pilot.SecureRO.RF.mk_destruct {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (theRecord✝ : Structure) :
          (mk theRecord✝).structure = theRecord✝

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

          noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.RF.init.utilities {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

          • RF.init.utilities.accessorModule : RF →ₘ … — the accessor as a module, a projection being a module morphism;
          • RF.init.utilities.apply_simp — Module.app RF.init.utilities.accessorModule m = RF.init m: applying that module is the accessor;
          • RF.init.utilities.expression_eq — the same at the level of expressions: (RF.init m).expression = (RF.init.utilities.proj m.expression).reduce.
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[simp]
            theorem GaudisCrypt.SHA3.Pilot.SecureRO.RF.get.mk_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (theRecord✝ : Structure) :
            (mk theRecord✝).get = theRecord✝.get

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

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

            @[implicit_reducible]
            instance GaudisCrypt.SHA3.Pilot.SecureRO.instIsModuleRF {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

            Equations
            noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.RF.get.utilities {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

            • RF.get.utilities.accessorModule : RF →ₘ … — the accessor as a module, a projection being a module morphism;
            • RF.get.utilities.apply_simp — Module.app RF.get.utilities.accessorModule m = RF.get m: applying that module is the accessor;
            • RF.get.utilities.expression_eq — the same at the level of expressions: (RF.get m).expression = (RF.get.utilities.proj m.expression).reduce.
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[reducible]
              noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.RF.mk {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

              Equations
              Instances For
                @[simp]
                theorem GaudisCrypt.SHA3.Pilot.SecureRO.RF.init.mk_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (theRecord✝ : Structure) :
                (mk theRecord✝).init = theRecord✝.init

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

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

                noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.RF.structure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                Equations
                Instances For
                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.RF.init {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

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

                  Equations
                  Instances For
                    structure GaudisCrypt.SHA3.Pilot.SecureRO.RF.Structure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                    Instances For
                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.RF.get {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

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

                      Equations
                      Instances For
                        @[simp]
                        theorem GaudisCrypt.SHA3.Pilot.SecureRO.RF.destruct_mk {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (theModule✝ : RF) :
                        mk theModule✝.structure = theModule✝

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

                        def GaudisCrypt.SHA3.Pilot.SecureRO.RF.typeRep {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                        RF is by definition Module RF.typeRep.

                        Equations
                        Instances For
                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.get.utilities {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                          • Oracle.get.utilities.accessorModule : Oracle →ₘ … — the accessor as a module, a projection being a module morphism;
                          • Oracle.get.utilities.apply_simp — Module.app Oracle.get.utilities.accessorModule m = Oracle.get m: applying that module is the accessor;
                          • Oracle.get.utilities.expression_eq — the same at the level of expressions: (Oracle.get m).expression = (Oracle.get.utilities.proj m.expression).reduce.
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            @[implicit_reducible]
                            instance GaudisCrypt.SHA3.Pilot.SecureRO.instIsModuleOracle {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                            Equations
                            @[simp]
                            theorem GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.get.mk_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (theRecord✝ : Structure) :
                            (mk theRecord✝).get = theRecord✝.get

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

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

                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.get {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

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

                            Equations
                            • theModule✝.get = theModule✝
                            Instances For
                              @[reducible]
                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.mk {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                              Equations
                              Instances For
                                def GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.typeRep {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                Oracle is by definition Module Oracle.typeRep.

                                Equations
                                Instances For
                                  @[simp]
                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.destruct_mk {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (theModule✝ : Oracle) :
                                  mk theModule✝.structure = theModule✝

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

                                  structure GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.Structure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                  Instances For
                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.structure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                    Equations
                                    Instances For
                                      def GaudisCrypt.SHA3.Pilot.SecureRO.Oracle {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                      Equations
                                      Instances For
                                        @[simp]
                                        theorem GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.mk_destruct {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (theRecord✝ : Structure) :
                                        (mk theRecord✝).structure = theRecord✝

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

                                        @[reducible, inline]

                                        The oracle procedure an adversary with an Oracle may call: F.get. The hole of its representation (Module.Representable, exception E2).

                                        Equations
                                        Instances For
                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Oracle.ext {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] (F : Oracle) :

                                          F.get out of the oracle F.

                                          Equations
                                          Instances For
                                            @[reducible, inline]
                                            abbrev GaudisCrypt.SHA3.Pilot.SecureRO.AdvPreimage {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :

                                            EC's module type AdvPreimage (F : Oracle) = { proc guess(h : to) : from }.

                                            Equations
                                            Instances For
                                              @[reducible, inline]
                                              abbrev GaudisCrypt.SHA3.Pilot.SecureRO.AdvSecondPreimage {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :

                                              EC's module type AdvSecondPreimage (F : Oracle) = { proc guess(m : from) : from }.

                                              Equations
                                              Instances For
                                                @[reducible, inline]
                                                abbrev GaudisCrypt.SHA3.Pilot.SecureRO.AdvCollision {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :

                                                EC's module type AdvCollision (F : Oracle) = { proc guess() : from * from }.

                                                Equations
                                                Instances For

                                                  EC's subtyping of module types, as coercions. Each is a fun building the smaller module in place: the coercion then unfolds to that record, which is what the module command reads a callee like A(Bounder(F)) back from (a named coercion function it would not see through).

                                                  @[implicit_reducible]
                                                  noncomputable instance GaudisCrypt.SHA3.Pilot.SecureRO.instCoeRFOracle {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :

                                                  An RF is an Oracle (its get).

                                                  Equations
                                                  @[implicit_reducible]
                                                  noncomputable instance GaudisCrypt.SHA3.Pilot.SecureRO.instCoeRO_TRF {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                  Coe (EC.PROM.FullRO.RO_T «from» «to») RF

                                                  The random oracle (PROM's RO) is an RF (its init and get).

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  @[reducible, inline]
                                                  abbrev GaudisCrypt.SHA3.Pilot.SecureRO.RO_T {«from» «to» : Type} [Params «from» «to»] :

                                                  EC's module type RO of the clone (F : RO): PROM's RO_T at the theory's types, which the instance fixes (EC names the module type and the module alike; here the module is RO).

                                                  Equations
                                                  Instances For
                                                    @[reducible, inline]
                                                    noncomputable abbrev GaudisCrypt.SHA3.Pilot.SecureRO.RO {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                    EC.PROM.FullRO.RO_T «from» «to»

                                                    The clone's RO.

                                                    Equations
                                                    Instances For
                                                      @[reducible, inline]
                                                      noncomputable abbrev GaudisCrypt.SHA3.Pilot.SecureRO.RO.LRO {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                      EC.PROM.FullRO.RO_T «from» «to»

                                                      The clone's lazy LRO.

                                                      Equations
                                                      Instances For
                                                        @[reducible, inline]
                                                        noncomputable abbrev GaudisCrypt.SHA3.Pilot.SecureRO.FRO {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                        EC.PROM.FullRO.FRO_T «from» «to»

                                                        The clone's FRO.

                                                        Equations
                                                        Instances For
                                                          theorem GaudisCrypt.SHA3.Pilot.SecureRO.RO_LRO_D {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] [Countable «from»] [Countable «to»] {sig : ProcedureSignature} (D : Module.Arr (EC.PROM.FullRO.RO_T «from» «to») (Module.Proc sig)) (hD : Module.ECModule D (EC.PROM.FullRO.RO_ext «from» «to») := by ec_module) (hdisj : FVP.fvP D ≤ (RO.m.footprint ⊔ FRO.m.footprint)ᶜ := by fp_disjoint) :
                                                          prhlProc (fun (a₁ : sig.ParamType) (g₁ : VariableAssignment) (a₂ : sig.ParamType) (g₂ : VariableAssignment) => a₁ = a₂ ∧ (FVP.fvP D).touched_getter.get g₁ = (FVP.fvP D).touched_getter.get g₂ ∧ RO.m.get g₁ = RO.m.get g₂) (Module.app D (EC.PROM.FullRO.RO.asRO «from» «to» (fun (x : «from») => sampleto) RO.m)).procedure (Module.app D (EC.PROM.FullRO.LRO «from» «to» (fun (x : «from») => sampleto) RO.m)).procedure fun (r₁ : sig.ret) (g₁ : VariableAssignment) (r₂ : sig.ret) (g₂ : VariableAssignment) => r₁ = r₂ ∧ (FVP.fvP D).touched_getter.get g₁ = (FVP.fvP D).touched_getter.get g₂

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

                                                          @[reducible, inline]
                                                          noncomputable abbrev GaudisCrypt.SHA3.Pilot.SecureRO.RO.asRF {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :

                                                          RO at the module type RF (the coercion, written out where a name is wanted).

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            instance GaudisCrypt.SHA3.Pilot.SecureRO.instIsGlobalVarIntCMk :
                                                            Counter.c.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureRO.Counter.c" ℤ)
                                                            Equations
                                                            Instances For

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

                                                              Equations
                                                              Instances For
                                                                @[simp]

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

                                                                The module declared by module Counter: the record of its procedures Counter.init.

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

                                                                Equations
                                                                Instances For

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

                                                                  Equations
                                                                  Instances For

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

                                                                    Equations
                                                                    Instances For
                                                                      instance GaudisCrypt.SHA3.Pilot.SecureRO.instIsGlobalVarIntBounderMk :
                                                                      Bounder.bounder.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.bounder" ℤ)
                                                                      @[simp]
                                                                      theorem GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.init.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (F : RF) :

                                                                      @[simp]: applying Bounder.init to the parameters proc init uses (F) is Module.proc (Bounder.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.Pilot.SecureRO.Bounder.init.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) HoleSigs.empty).Instantiation) :
                                                                      procedure.instantiate holeArgs✝ = proc () : Unit { bounder <- 0; call Counter.init.procedure (); call (holeArgs✝.lookup HoleIndex.zero) (); return () }

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

                                                                      @[simp]
                                                                      theorem GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (F : RF) :

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

                                                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.init {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For
                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.get {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          @[simp]
                                                                          theorem GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.get.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (F : RF) :

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

                                                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.init.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            theorem GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.get.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig («from») → «to») HoleSigs.empty).Instantiation) :
                                                                            procedure.instantiate holeArgs✝ = proc (x : «from») : «to» { var y : «to»; y <- default; if (decide (§bounder < bound)) { bounder <- §bounder + 1; if (decide (increase_counter §Counter.c §x < bound_counter)) { Counter.c <- increase_counter §Counter.c §x; y <- call (holeArgs✝.lookup HoleIndex.zero) (§x); } } return §y }

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

                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Bounder {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Bounder.get.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                              proctype («from») → «to» uses ((«from») → «to»)

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

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                proctype («to») → Bool uses (() → Unit, («to») → «from», («from») → «to»)

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

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For
                                                                                  @[simp]
                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF) :

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

                                                                                  @[simp]
                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF) :

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

                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig («to») → «from») (HoleSigs.cons (procsig («from») → «to») HoleSigs.empty))).Instantiation) :
                                                                                  procedure.instantiate holeArgs✝ = proc (hash : «to») : Bool { var m : «from», hash' : «to», b : Bool; call Counter.init.procedure (); call (holeArgs✝.lookup HoleIndex.zero) (); m <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§hash); if (decide (increase_counter §Counter.c §m < bound_counter)) { hash' <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m); b <- decide (§hash = §hash'); } else { b <- false; } return §b }

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

                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

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

                                                                                      The section Preimage #

                                                                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.FEL.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For
                                                                                        @[simp]
                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.FEL.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF) :

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

                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.FEL.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                        proctype («to») → «from» uses (() → Unit, («to») → «from»)

                                                                                        The body of proc main of module FEL, as a procedure of its own: the 2 calls it makes to module parameters (A, 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 FEL.main.procedure.apply_simp) rather than run. Use FEL.main for this procedure as a module.

                                                                                        Equations
                                                                                        • One or more equations did not get rendered due to their size.
                                                                                        Instances For
                                                                                          theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.FEL.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig («to») → «from») HoleSigs.empty)).Instantiation) :
                                                                                          procedure.instantiate holeArgs✝ = proc (hash : «to») : «from» { var m : «from»; call (holeArgs✝.lookup HoleIndex.zero) (); m <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§hash); return §m }

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

                                                                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.FEL {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                          Equations
                                                                                          • One or more equations did not get rendered due to their size.
                                                                                          Instances For
                                                                                            @[simp]
                                                                                            theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.FEL.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF) :
                                                                                            FEL(A, F).main = Module.app (Module.app main A) F

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

                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.Preimage2.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                            proctype («to») → Bool uses ((«to») → «from», («from») → «to»)

                                                                                            The body of proc main of module Preimage2, as a procedure of its own: the 2 calls it makes to module parameters (A, 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 Preimage2.main.procedure.apply_simp) rather than run. Use Preimage2.main for this procedure as a module.

                                                                                            Equations
                                                                                            • One or more equations did not get rendered due to their size.
                                                                                            Instances For
                                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.Preimage2 {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                              Equations
                                                                                              • One or more equations did not get rendered due to their size.
                                                                                              Instances For
                                                                                                @[simp]
                                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.Preimage2.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF) :

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

                                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.Preimage2.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig («to») → «from») (HoleSigs.cons (procsig («from») → «to») HoleSigs.empty)).Instantiation) :
                                                                                                procedure.instantiate holeArgs✝ = proc (hash : «to») : Bool { var m : «from», hash' : «to», b : Bool; m <- call (holeArgs✝.lookup HoleIndex.zero) (§hash); if (decide (increase_counter §Counter.c §m < bound_counter)) { hash' <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m); b <- decide (§hash = §hash'); } else { b <- false; } return §b }

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

                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.Preimage2.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                                                                                Equations
                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                Instances For
                                                                                                  @[simp]
                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.Preimage.Preimage2.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF) :

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

                                                                                                  The proof of RO_is_preimage_resistant #

                                                                                                  One proof, as EC's: EC's fel is the tactic fel (Logic/FelTactic.lean), EC's inline specifications call (: P ==> Q) and byphoare (: P ==> _) are Logic/CallSpec.lean's.

                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.RO_is_preimage_resistant {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] (A : AdvPreimage) [Module.Declared A (RO.m.footprint ⊔ Counter.c.footprint ⊔ Bounder.bounder.footprint)] [Countable «from»] (m : VariableAssignment) (h : «to») :
                                                                                                  Pr[ Preimage(A, RO).main (h) @ &m : §res = true ] ≤ ↑(bound + 1) * EC.mu1 sampleto h

                                                                                                  EC's RO_is_preimage_resistant &m (h : to), its proof EC's: the have->: by byequiv (here a calc step), then byphoare(: arg = h ==> _), proc, seq 1, its first E goal EC's call(: true ==> rng RO.m h) with EC's fel, and the arithmetic of EC's last smt() in the bound goal. The oracle's bullets are EC's proc; inline*; auto, then the logic EC leaves to smt(), its FMap facts Lib/EC/FMap.lean's.

                                                                                                  The section SecondPreimage #

                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                                  Equations
                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                  Instances For
                                                                                                    @[simp]
                                                                                                    theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RF) :

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

                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                                    proctype («from») → Bool uses (() → Unit, («from») → «from», («from») → «to»)

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

                                                                                                    Equations
                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                    Instances For
                                                                                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                                                                                      Equations
                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                      Instances For
                                                                                                        @[simp]
                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RF) :

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

                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig («from») → «from») (HoleSigs.cons (procsig («from») → «to») HoleSigs.empty))).Instantiation) :
                                                                                                        procedure.instantiate holeArgs✝ = proc (m1 : «from») : Bool { var m2 : «from», hash1 : «to», hash2 : «to», b : Bool; call (holeArgs✝.lookup HoleIndex.zero) (); m2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m1); if (decide (increase_counter §Counter.c §m1 < bound_counter)) { Counter.c <- increase_counter §Counter.c §m1; hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m1); if (decide (increase_counter §Counter.c §m2 < bound_counter)) { Counter.c <- increase_counter §Counter.c §m2; hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m2); b <- decide (§hash1 = §hash2 ∧ §m1 ≠ §m2); } else { b <- false; } } else { b <- false; } return §b }

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

                                                                                                        The section SecondPreimage, with `declare module A <: AdvSecondPreimage {-Bounder, -RO, #

                                                                                                        -FRO}(its local modules in the namespaceSecondPreimage`)

                                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.FEL.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                                                                                        Equations
                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                        Instances For
                                                                                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.FEL.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                                          proctype («from») → «from» uses (() → Unit, («from») → Unit, («from») → «from»)

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

                                                                                                          Equations
                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                          Instances For
                                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.FEL {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                                            Equations
                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                            Instances For
                                                                                                              @[simp]
                                                                                                              theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.FEL.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RO_T) :

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

                                                                                                              theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.FEL.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig («from») → Unit) (HoleSigs.cons (procsig («from») → «from») HoleSigs.empty))).Instantiation) :
                                                                                                              procedure.instantiate holeArgs✝ = proc (m1 : «from») : «from» { var m2 : «from»; call (holeArgs✝.lookup HoleIndex.zero) (); call (holeArgs✝.lookup HoleIndex.zero.succ) (§m1); m2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m1); return §m2 }

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

                                                                                                              @[simp]
                                                                                                              theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.FEL.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RO_T) :
                                                                                                              FEL(A, F).main = Module.app (Module.app main A) F

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

                                                                                                              EC's module variables SecondPreimage2.m2, D1.m1 of the local modules. The declared adversary is restricted against the local modules, as EC's local modules are fresh.

                                                                                                              instance GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.instIsGlobalVarM2Mk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                              SecondPreimage2.m2.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage2.m2" «from»)
                                                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage2.m2 {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                              Equations
                                                                                                              Instances For
                                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.D1.m1 {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  instance GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.instIsGlobalVarM1Mk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                                  D1.m1.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.D1.m1" «from»)
                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage2.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig («from») → «from») (HoleSigs.cons (procsig («from») → «to») HoleSigs.empty)).Instantiation) :
                                                                                                                  procedure.instantiate holeArgs✝ = proc (m1 : «from») : Bool { var hash1 : «to», hash2 : «to», b : Bool; m2 <- call (holeArgs✝.lookup HoleIndex.zero) (§m1); if (decide (increase_counter §Counter.c §m1 < bound_counter)) { Counter.c <- increase_counter §Counter.c §m1; hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m1); if (decide (increase_counter §Counter.c §m2 < bound_counter)) { Counter.c <- increase_counter §Counter.c §m2; hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m2); b <- decide (§hash1 = §hash2 ∧ §m1 ≠ §m2); } else { b <- false; } } else { b <- false; } return §b }

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

                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage2.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                                                  proctype («from») → Bool uses ((«from») → «from», («from») → «to»)

                                                                                                                  The body of proc main of module SecondPreimage2, as a procedure of its own: the 2 calls it makes to module parameters (A, 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 SecondPreimage2.main.procedure.apply_simp) rather than run. Use SecondPreimage2.main for this procedure as a module.

                                                                                                                  Equations
                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                  Instances For
                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage2.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                                                                                                    Equations
                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                    Instances For
                                                                                                                      @[simp]
                                                                                                                      theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage2.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RO_T) :

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

                                                                                                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage2 {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                                                      Equations
                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                      Instances For
                                                                                                                        @[simp]
                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage2.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RO_T) :

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

                                                                                                                        @[simp]

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

                                                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.D1.distinguish.procedure {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] (A : AdvSecondPreimage) :

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

                                                                                                                        Equations
                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                        Instances For
                                                                                                                          theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.D1.distinguish.procedure.apply_simp {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] (A : AdvSecondPreimage) (holeArgs✝ : (HoleSigs.cons (procsig («from») → Bool) HoleSigs.empty).Instantiation) :
                                                                                                                          (procedure A).instantiate holeArgs✝ = proc (_x : Unit) : Bool { var b : Bool; b <- call (holeArgs✝.lookup HoleIndex.zero) (§m1); return §b }

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

                                                                                                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.D1 {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] (A : AdvSecondPreimage) :

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

                                                                                                                          Equations
                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                          Instances For
                                                                                                                            @[simp]
                                                                                                                            theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.D1.apply_simp {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] (A : AdvSecondPreimage) (F : RO_T) :
                                                                                                                            D1(A, F).distinguish = Module.app (distinguish A) F

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

                                                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.D1.distinguish {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] (A : AdvSecondPreimage) :

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

                                                                                                                            Equations
                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                            Instances For
                                                                                                                              @[simp]
                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage3.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RO_T) :
                                                                                                                              SecondPreimage3(A, F).main = Module.app (main A) F

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

                                                                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage3.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) :

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

                                                                                                                              Equations
                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                              Instances For
                                                                                                                                @[simp]
                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage3.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RO_T) :

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

                                                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage3 {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) :

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

                                                                                                                                Equations
                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                Instances For
                                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage3.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig (Unit) → Bool) HoleSigs.empty)).Instantiation) :
                                                                                                                                  (procedure A).instantiate holeArgs✝ = proc (m1 : «from») : Bool { var b : Bool; SecondPreimage2.m2 <- default; D1.m1 <- §m1; call (holeArgs✝.lookup HoleIndex.zero) (); b <- call (holeArgs✝.lookup HoleIndex.zero.succ) (); return §b }

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

                                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.SecondPreimage.SecondPreimage3.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) :

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

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

                                                                                                                                    EC's RO_is_second_preimage_resistant &m (mess1 : from), its proof EC's: the chain of have->: (calc steps) from RO to LRO, to SecondPreimage2, SecondPreimage3 and back to RO (the third and fifth EC's sims, with the local modules' variables as the frame), then byphoare(: arg = mess1 ==> _), proc, seq 1, its invariant EC's call(: … /\ mess1 \in RO.m) and its first E goal EC's call(: arg = mess1 ==> rng (rem RO.m mess1) (oget RO.m.[mess1])) with EC's fel 2, and the arithmetic of EC's last smt() in the bound goal.

                                                                                                                                    The section Collision #

                                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                                                                    proctype () → Bool uses (() → Unit, () → «from» × «from», («from») → «to»)

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

                                                                                                                                    Equations
                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                    Instances For
                                                                                                                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                                                                      Equations
                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                      Instances For
                                                                                                                                        @[simp]
                                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RO_T) :

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

                                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → «from» × «from») (HoleSigs.cons (procsig («from») → «to») HoleSigs.empty))).Instantiation) :
                                                                                                                                        procedure.instantiate holeArgs✝ = proc () : Bool { var m1 : «from», m2 : «from», hash1 : «to», hash2 : «to», b : Bool; call (holeArgs✝.lookup HoleIndex.zero) (); m1, m2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (); if (decide (increase_counter §Counter.c §m1 < bound_counter)) { Counter.c <- increase_counter §Counter.c §m1; hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m1); if (decide (increase_counter §Counter.c §m2 < bound_counter)) { Counter.c <- increase_counter §Counter.c §m2; hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m2); b <- decide (§hash1 = §hash2 ∧ §m1 ≠ §m2); } else { b <- false; } } else { b <- false; } return §b }

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

                                                                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                                                                                                                        Equations
                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                        Instances For
                                                                                                                                          @[simp]
                                                                                                                                          theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RO_T) :

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

                                                                                                                                          The section Collision, with declare module A <: AdvCollision {-RO, -FRO, -Bounder} (its #

                                                                                                                                          local modules in the namespace Collision)

                                                                                                                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision.FEL {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                                                                          Equations
                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                          Instances For
                                                                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision.FEL.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                                                                                                                            Equations
                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                            Instances For
                                                                                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision.FEL.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                                                                              proctype () → «from» × «from» uses (() → Unit, () → «from» × «from»)

                                                                                                                                              The body of proc main of module FEL, as a procedure of its own: the 2 calls it makes to module parameters (A, 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 FEL.main.procedure.apply_simp) rather than run. Use FEL.main for this procedure as a module.

                                                                                                                                              Equations
                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                              Instances For
                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.FEL.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → «from» × «from») HoleSigs.empty)).Instantiation) :
                                                                                                                                                procedure.instantiate holeArgs✝ = proc () : («from» × «from») { var m1 : «from», m2 : «from»; call (holeArgs✝.lookup HoleIndex.zero) (); m1, m2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (); return (§m1, §m2) }

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

                                                                                                                                                @[simp]
                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.FEL.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RO_T) :

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

                                                                                                                                                @[simp]
                                                                                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.FEL.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RO_T) :
                                                                                                                                                FEL(A, F).main = Module.app (Module.app main A) F

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

                                                                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision.Collision2.main {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                                                                                                                                Equations
                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                Instances For
                                                                                                                                                  @[simp]
                                                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.Collision2.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RO_T) :

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

                                                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.Collision2.main.procedure.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (holeArgs✝ : (HoleSigs.cons (procsig () → «from» × «from») (HoleSigs.cons (procsig («from») → «to») HoleSigs.empty)).Instantiation) :
                                                                                                                                                  procedure.instantiate holeArgs✝ = proc () : Bool { var m1 : «from», m2 : «from», hash1 : «to», hash2 : «to», b : Bool; m1, m2 <- call (holeArgs✝.lookup HoleIndex.zero) (); if (decide (increase_counter §Counter.c §m1 < bound_counter)) { Counter.c <- increase_counter §Counter.c §m1; hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m1); if (decide (increase_counter §Counter.c §m2 < bound_counter)) { Counter.c <- increase_counter §Counter.c §m2; hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m2); b <- decide (§hash1 = §hash2 ∧ §m1 ≠ §m2); } else { b <- false; } } else { b <- false; } return §b }

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

                                                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision.Collision2.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                                                                                  proctype () → Bool uses (() → «from» × «from», («from») → «to»)

                                                                                                                                                  The body of proc main of module Collision2, as a procedure of its own: the 2 calls it makes to module parameters (A, 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 Collision2.main.procedure.apply_simp) rather than run. Use Collision2.main for this procedure as a module.

                                                                                                                                                  Equations
                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                  Instances For
                                                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureRO.Collision.Collision2 {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                                                                                                    Equations
                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                    Instances For
                                                                                                                                                      @[simp]
                                                                                                                                                      theorem GaudisCrypt.SHA3.Pilot.SecureRO.Collision.Collision2.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RO_T) :

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

                                                                                                                                                      theorem GaudisCrypt.SHA3.Pilot.SecureRO.RO_is_collision_resistant {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] (A : AdvCollision) [Module.Declared A (RO.m.footprint ⊔ FRO.m.footprint ⊔ Bounder.bounder.footprint ⊔ Counter.c.footprint)] [Countable «from»] (m : VariableAssignment) :
                                                                                                                                                      Pr[ Collision(A, RO).main () @ &m : §res = true ] ≤ ↑(bound * (bound - 1) + 2) / 2 * EC.mu1 sampleto default

                                                                                                                                                      EC's RO_is_collision_resistant &m, its proof EC's: the have->: by byequiv (a calc step), then byphoare, proc, seq 1, its first E goal EC's call(: true ==> collision RO.m) with EC's fel, and the arithmetic of EC's last smt() in the bound goal.