Documentation

GaudisCrypt.Examples.SHA3.SecureORO

Random oracles with failing queries are preimage, second-preimage and collision resistant — #

the EC-fidelity port (EasyCrypt proof/SecureORO.eca)

SecureRO (SecureRO.lean) for oracles returning options: Bounder answers None once its bound queries are used up. Translated as the pilot SecureRO:

Declarations of the first port #

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

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

clone import PROM.FullRO as RO with type in_t <- from, type out_t <- to, op dout _ <- sampleto, type d_in_t <- unit, type d_out_t <- bool; its module variable RO.m is the lens parameter RO_m.

@[reducible, inline]
abbrev GaudisCrypt.SHA3.SecureORO.RO.RO_T («from» «to» : Type) :

EasyCrypt's module type RO of the clone.

Equations
Instances For
    @[reducible, inline]
    noncomputable abbrev GaudisCrypt.SHA3.SecureORO.RO.RO («from» «to» : Type) [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] (sampleto : SubProbability «to») (RO_m : Lens (EC.FMap «from» «to») VariableAssignment) :
    EC.PROM.FullRO.RO_T «from» «to»
    Equations
    Instances For
      @[reducible, inline]
      noncomputable abbrev GaudisCrypt.SHA3.SecureORO.RO.LRO («from» «to» : Type) [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] (sampleto : SubProbability «to») (RO_m : Lens (EC.FMap «from» «to») VariableAssignment) :
      EC.PROM.FullRO.RO_T «from» «to»
      Equations
      Instances For

        The footprints of the theory's modules (EasyCrypt reads them off the code; fp_disjoint uses them).

        theorem GaudisCrypt.SHA3.SecureORO.fvP_LRO («from» «to» : Type) [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] (sampleto : SubProbability «to») (RO_m : Lens (EC.FMap «from» «to») VariableAssignment) :
        FVP.fvP (RO.LRO «from» «to» sampleto RO_m) ≤ RO_m.footprint
        @[reducible, inline]

        The oracle procedure an adversary with an Oracle may call: F.get (E2).

        Equations
        Instances For

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

          local modules in the namespace Collision)

          The section's op collision (m : ('a, 'b) fmap): two distinct keys with the same value.

          Equations
          Instances For

            EC's op sampleto, op bound, op increase_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, type d_in_t <- unit, type d_out_t <- bool.

              instance GaudisCrypt.SHA3.Pilot.SecureORO.instIsGlobalVarFMapMMk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
              RO.m.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureORO.RO.m" (EC.FMap «from» «to»))
              noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.RO.m {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
              Lens (EC.FMap «from» «to») VariableAssignment
              Equations
              Instances For
                noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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.SecureORO.instIsGlobalVarFMapProdFlagMMk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                  FRO.m.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureORO.FRO.m" (EC.FMap «from» («to» × EC.PROM.flag)))
                  @[reducible, inline]
                  abbrev GaudisCrypt.SHA3.Pilot.SecureORO.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.

                  Equations
                  Instances For
                    @[reducible, inline]
                    noncomputable abbrev GaudisCrypt.SHA3.Pilot.SecureORO.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.SecureORO.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.SecureORO.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.SecureORO.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, its side conditions found (ec_module, fp_disjoint).

                          structure GaudisCrypt.SHA3.Pilot.SecureORO.RF_T.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_T: the fields init, get, sample, one per moduletype field, each of that field's own module type.

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

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

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

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

                            Equations
                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.RF_T.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_T: the projection onto component 0 of the right-nested tuple RF_T.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

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

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

                            Equations
                            Instances For
                              @[simp]
                              theorem GaudisCrypt.SHA3.Pilot.SecureORO.RF_T.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_T.init (RF_T.mk r) = r.init.

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

                              @[simp]
                              theorem GaudisCrypt.SHA3.Pilot.SecureORO.RF_T.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_T.get (RF_T.mk r) = r.get.

                              It is what carries the right-hand side of an X.apply_simp (which is an RF_T.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.SecureORO.RF_T.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_T.structure m is RF_T.Structure.mk applied to RF_T.init, RF_T.get, RF_T.sample of m.

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

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

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

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

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

                                Equations
                                Instances For
                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.RF_T.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_T: the projection onto component 1 of the right-nested tuple RF_T.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

                                  RF_T.get.mk_simp reads this field back off a module built by RF_T.mk; RF_T.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
                                    def GaudisCrypt.SHA3.Pilot.SecureORO.RF_T {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

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

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

                                      @[simp]
                                      theorem GaudisCrypt.SHA3.Pilot.SecureORO.RF_T.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_T.structure (RF_T.mk r) = r — destructing a module built from a record gives that record back.

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

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

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

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

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

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

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

                                        RF_T is by definition Module RF_T.typeRep.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.RF_T.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_T.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

                                          • RF_T.init.utilities.accessorModule : RF_T →ₘ … — the accessor as a module, a projection being a module morphism;
                                          • RF_T.init.utilities.apply_simp — Module.app RF_T.init.utilities.accessorModule m = RF_T.init m: applying that module is the accessor;
                                          • RF_T.init.utilities.expression_eq — the same at the level of expressions: (RF_T.init m).expression = (RF_T.init.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.SecureORO.RF_T.mk {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

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

                                            Equations
                                            Instances For
                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.RF_T.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_T.get, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

                                              • RF_T.get.utilities.accessorModule : RF_T →ₘ … — the accessor as a module, a projection being a module morphism;
                                              • RF_T.get.utilities.apply_simp — Module.app RF_T.get.utilities.accessorModule m = RF_T.get m: applying that module is the accessor;
                                              • RF_T.get.utilities.expression_eq — the same at the level of expressions: (RF_T.get m).expression = (RF_T.get.utilities.proj m.expression).reduce.
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem GaudisCrypt.SHA3.Pilot.SecureORO.RF.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») : (Option «to») { var y : «to»; y <- call (holeArgs✝.lookup HoleIndex.zero) (§x); return some §y }

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

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

                                                @[simp]: applying RF.get to the parameters proc get uses (R) is Module.proc (RF.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.SecureORO.RF.get {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                Apply it with the @[simp] lemma RF.get.apply_simp, which fills the holes of RF.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.SecureORO.RF.init.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (R : RO_T) :

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

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

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

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    @[simp]
                                                    theorem GaudisCrypt.SHA3.Pilot.SecureORO.RF.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (R : RO_T) :
                                                    Module.app RF R = RF_T.mk { init := Module.app init R, get := Module.app get R, sample := Module.app sample R }

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

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

                                                    @[simp]: the alias RF.sample, applied to the parameters its callee uses (R), is its callee, as written in the declaration.

                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.RF.get.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                    proctype («from») → Option «to» uses ((«from») → «to»)

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

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

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

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

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

                                                        Equations
                                                        Instances For
                                                          instance GaudisCrypt.SHA3.Pilot.SecureORO.instIsGlobalVarIntBounderMk :
                                                          Bounder.bounder.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureORO.Bounder.bounder" ℤ)
                                                          Equations
                                                          Instances For
                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                              @[simp]
                                                              theorem GaudisCrypt.SHA3.Pilot.SecureORO.Bounder.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (F : RF_T) :

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

                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                @[simp]
                                                                theorem GaudisCrypt.SHA3.Pilot.SecureORO.Bounder.sample.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (F : RF_T) :

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

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

                                                                @[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.SecureORO.Bounder.get.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «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
                                                                  @[simp]
                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureORO.Bounder.init.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (F : RF_T) :

                                                                  @[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.

                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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, Bounder.sample, 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.SecureORO.Bounder.sample {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :

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

                                                                      Equations
                                                                      Instances For
                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «to») HoleSigs.empty).Instantiation) :
                                                                        procedure.instantiate holeArgs✝ = proc (x : «from») : (Option «to») { var y : Option «to»; y <- none; if (decide (§bounder < bound)) { bounder <- §bounder + 1; 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]).

                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.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 (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]).

                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                          structure GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                            @[reducible]
                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                              @[simp]
                                                                              theorem GaudisCrypt.SHA3.Pilot.SecureORO.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.

                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                @[simp]
                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureORO.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.

                                                                                @[implicit_reducible]
                                                                                instance GaudisCrypt.SHA3.Pilot.SecureORO.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.SecureORO.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.

                                                                                def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                  def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                      @[reducible, inline]

                                                                                      The oracle procedure an adversary with an Oracle may call: F.get (exception E2).

                                                                                      Equations
                                                                                      Instances For
                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                          @[implicit_reducible]
                                                                                          noncomputable instance GaudisCrypt.SHA3.Pilot.SecureORO.instCoeRF_TOracle {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :

                                                                                          An RF is an Oracle (its get).

                                                                                          Equations
                                                                                          @[reducible, inline]
                                                                                          abbrev GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.Preimage.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                            proctype () → Bool uses (() → Unit, («to») → «from», («from») → Option «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.SecureORO.Preimage.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF_T) :

                                                                                              @[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.

                                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «to») HoleSigs.empty))).Instantiation) :
                                                                                                procedure.instantiate holeArgs✝ = proc () : Bool { var hash : «to», m : «from», hash' : Option «to»; hash <$ sampleto; call (holeArgs✝.lookup HoleIndex.zero) (); m <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§hash); hash' <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m); return decide (§hash' = some §hash) }

                                                                                                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.SecureORO.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
                                                                                                  @[simp]
                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureORO.Preimage.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF_T) :

                                                                                                  @[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.

                                                                                                  The section Preimage #

                                                                                                  @[simp]
                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureORO.Preimage.FEL.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvPreimage) (F : RF_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.SecureORO.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
                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                      theorem GaudisCrypt.SHA3.Pilot.SecureORO.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.SecureORO.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.SecureORO.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_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.

                                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.Preimage.Preimage2.hash {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          instance GaudisCrypt.SHA3.Pilot.SecureORO.Preimage.instIsGlobalVarHashMk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                          Preimage2.hash.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureORO.Preimage.Preimage2.hash" «to»)
                                                                                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                              theorem GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «to») HoleSigs.empty)).Instantiation) :
                                                                                                              procedure.instantiate holeArgs✝ = proc () : Bool { var m : «from», hash' : Option «to»; hash <$ sampleto; m <- call (holeArgs✝.lookup HoleIndex.zero) (§hash); hash' <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m); return decide (§hash' = some §hash) }

                                                                                                              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.SecureORO.Preimage.Preimage2.main.procedure {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] :
                                                                                                              proctype () → Bool uses ((«to») → «from», («from») → Option «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
                                                                                                                @[simp]
                                                                                                                theorem GaudisCrypt.SHA3.Pilot.SecureORO.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_T) :

                                                                                                                @[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.

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

                                                                                                                @[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 section SecondPreimage #

                                                                                                                @[reducible, inline]
                                                                                                                abbrev GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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.SecureORO.SecondPreimage.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RF_T) :

                                                                                                                    @[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.

                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «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.SecureORO.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
                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «to») HoleSigs.empty))).Instantiation) :
                                                                                                                        procedure.instantiate holeArgs✝ = proc (m1 : «from») : Bool { var m2 : «from», hash1 : Option «to», hash2 : Option «to»; call (holeArgs✝.lookup HoleIndex.zero) (); m2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m1); hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m1); hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m2); return decide (§m1 ≠ §m2 ∧ ∃ (y : «to»), some y = §hash1 ∧ some y = §hash2) }

                                                                                                                        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]).

                                                                                                                        @[simp]
                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.SecondPreimage.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RF_T) :

                                                                                                                        @[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.

                                                                                                                        The section SecondPreimage, its local modules in the namespace SecondPreimage #

                                                                                                                        @[simp]
                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.SecondPreimage.FEL.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RF_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.SecureORO.SecondPreimage.FEL.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RF_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.SecureORO.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.SecureORO.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
                                                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                              theorem GaudisCrypt.SHA3.Pilot.SecureORO.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]).

                                                                                                                              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.SecureORO.SecondPreimage.instIsGlobalVarM2Mk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                                              SecondPreimage2.m2.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureORO.SecondPreimage.SecondPreimage2.m2" «from»)
                                                                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.SecondPreimage.SecondPreimage2.m2 {«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.SecureORO.SecondPreimage.instIsGlobalVarM1Mk {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                                                D1.m1.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureORO.SecondPreimage.D1.m1" «from»)
                                                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.SecondPreimage.D1.m1 {«from» «to» : Type} [DecidableEq «from»] [Inhabited «from»] [Inhabited «to»] [Params «from» «to»] :
                                                                                                                                Equations
                                                                                                                                Instances For
                                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                      theorem GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «to») HoleSigs.empty)).Instantiation) :
                                                                                                                                      procedure.instantiate holeArgs✝ = proc (m1 : «from») : Bool { var hash1 : Option «to», hash2 : Option «to»; m2 <- call (holeArgs✝.lookup HoleIndex.zero) (§m1); hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m1); hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m2); return decide (§m1 ≠ §m2 ∧ ∃ (y : «to»), some y = §hash1 ∧ some y = §hash2) }

                                                                                                                                      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]).

                                                                                                                                      @[simp]
                                                                                                                                      theorem GaudisCrypt.SHA3.Pilot.SecureORO.SecondPreimage.SecondPreimage2.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RF_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.SecureORO.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») → Option «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
                                                                                                                                        @[simp]
                                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.SecondPreimage.SecondPreimage2.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvSecondPreimage) (F : RF_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.

                                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.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]).

                                                                                                                                        @[simp]
                                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.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.SecureORO.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
                                                                                                                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                            @[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.SecureORO.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
                                                                                                                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                                  @[simp]
                                                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureORO.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.

                                                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureORO.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.SecureORO.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.SecureORO.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.

                                                                                                                                                    EC's RO_is_second_preimage_resistant &m (mess1 : from), its proof EC's: the chain of have->: (calc steps) from RF(RO) to RF(LRO) (EC's sim, its call of A EC's call (_ : ={glob A, …})), to SecondPreimage2, SecondPreimage3 and back to RF(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 (bad without its mess1 \in RO.m, which is in the invariant: here bad is the event). The last goal's EC's rcondts, swaps and cases are the conditionals split by split_ifs.

                                                                                                                                                    The section Collision #

                                                                                                                                                    @[reducible, inline]
                                                                                                                                                    abbrev GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «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.SecureORO.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.SecureORO.Collision.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RF_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.

                                                                                                                                                            @[simp]
                                                                                                                                                            theorem GaudisCrypt.SHA3.Pilot.SecureORO.Collision.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RF_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.

                                                                                                                                                            theorem GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «to») HoleSigs.empty))).Instantiation) :
                                                                                                                                                            procedure.instantiate holeArgs✝ = proc () : Bool { var m1 : «from», m2 : «from», hash1 : Option «to», hash2 : Option «to»; call (holeArgs✝.lookup HoleIndex.zero) (); m1, m2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (); hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m1); hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m2); return decide (§m1 ≠ §m2 ∧ ∃ (y : «to»), some y = §hash1 ∧ some y = §hash2) }

                                                                                                                                                            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]).

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

                                                                                                                                                            local modules in the namespace Collision)

                                                                                                                                                            theorem GaudisCrypt.SHA3.Pilot.SecureORO.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.SecureORO.Collision.FEL.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RF_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.SecureORO.Collision.FEL.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RF_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.SecureORO.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.SecureORO.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
                                                                                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «to») HoleSigs.empty)).Instantiation) :
                                                                                                                                                                  procedure.instantiate holeArgs✝ = proc () : Bool { var m1 : «from», m2 : «from», hash1 : Option «to», hash2 : Option «to»; m1, m2 <- call (holeArgs✝.lookup HoleIndex.zero) (); hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m1); hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§m2); return decide (§m1 ≠ §m2 ∧ ∃ (y : «to»), some y = §hash1 ∧ some y = §hash2) }

                                                                                                                                                                  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]).

                                                                                                                                                                  @[simp]
                                                                                                                                                                  theorem GaudisCrypt.SHA3.Pilot.SecureORO.Collision.Collision2.main.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RF_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.

                                                                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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
                                                                                                                                                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureORO.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») → Option «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
                                                                                                                                                                        @[simp]
                                                                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.SecureORO.Collision.Collision2.apply_simp {«from» «to» : Type} [_gaudiParam0 : DecidableEq «from»] [_gaudiParam1 : Inhabited «from»] [_gaudiParam2 : Inhabited «to»] [_gaudiParam3 : Params «from» «to»] (A : AdvCollision) (F : RF_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.SecureORO.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)] [Countable «from»] (m : VariableAssignment) :
                                                                                                                                                                        Pr[ Collision(A, RF(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 invariant EC's call(: card (fdom RO.m) <= Bounder.bounder <= bound), its first E goal EC's call(: true ==> collision RO.m) with EC's fel 1, its last goal's EC's rcondts, swaps and cases the conditionals split by split_ifs and EC's cases on m1 = m2, m2 \in RO.m (by_cases), and the arithmetic of EC's last smt() in the bound goal.