Documentation

GaudisCrypt.Examples.SHA3.Indifferentiability

Indifferentiability (EasyCrypt proof/Indifferentiability.eca) — EC-fidelity port #

A construction C of a functionality from a primitive is indifferentiable from an ideal functionality F when some simulator S makes Indif(C(P), P, D) and Indif(F, S(F), D) indistinguishable to every distinguisher D.

The theory's types are outParams of the (field-less) class Params p f_in f_out: a clone is clone Indifferentiability as Indiff0 with type p <- … (Syntax/Clone.lean), and inside the theory nothing is written. EC's subtyping of module types (FUNCTIONALITY <: DFUNCTIONALITY) is module_subtype. EC's call restrictions ({ P.f }) are not part of a module type (exception E2 of the port): they are the ext of declare module's representability.

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.

noncomputable def GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.f.utilities (p f_in f_out : Type) :
ModuleTypeUtilities (PRIMITIVE p f_in f_out) (procmod (p) → p) (f p f_in f_out)

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

  • PRIMITIVE.f.utilities.accessorModule : PRIMITIVE →ₘ … — the accessor as a module, a projection being a module morphism;
  • PRIMITIVE.f.utilities.apply_simp — Module.app PRIMITIVE.f.utilities.accessorModule m = PRIMITIVE.f m: applying that module is the accessor;
  • PRIMITIVE.f.utilities.expression_eq — the same at the level of expressions: (PRIMITIVE.f m).expression = (PRIMITIVE.f.utilities.proj m.expression).reduce.
Equations
  • One or more equations did not get rendered due to their size.
Instances For
    @[simp]
    theorem GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.destruct_mk (p f_in f_out : Type) (theModule✝ : PRIMITIVE p f_in f_out) :
    mk p f_in f_out («structure» p f_in f_out theModule✝) = theModule✝

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

    @[implicit_reducible]

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

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

    Equations

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

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

    Equations
    Instances For
      @[simp]
      theorem GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.f.mk_simp (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
      f p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝.f

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

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

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

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

      Instances For

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

        PRIMITIVE is by definition Module PRIMITIVE.typeRep.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.structure (p f_in f_out : Type) :
          PRIMITIVE p f_in f_out → Structure p f_in f_out

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

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

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[simp]
            theorem GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.mk_destruct (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
            «structure» p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝

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

            noncomputable def GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.fi (p f_in f_out : Type) :
            PRIMITIVE p f_in f_out → procmod (p) → p

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

            PRIMITIVE.fi.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.fi.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
              @[reducible]
              noncomputable def GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.mk (p f_in f_out : Type) :
              Structure p f_in f_out → PRIMITIVE p f_in f_out

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

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

              Equations
              Instances For
                noncomputable def GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.init (p f_in f_out : Type) :
                PRIMITIVE p f_in f_out → procmod () → Unit

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

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

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

                Equations
                Instances For
                  noncomputable def GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.f (p f_in f_out : Type) :
                  PRIMITIVE p f_in f_out → procmod (p) → p

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

                  PRIMITIVE.f.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.f.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.Indifferentiability.PRIMITIVE.fi.utilities (p f_in f_out : Type) :
                    ModuleTypeUtilities (PRIMITIVE p f_in f_out) (procmod (p) → p) (fi p f_in f_out)

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

                    • PRIMITIVE.fi.utilities.accessorModule : PRIMITIVE →ₘ … — the accessor as a module, a projection being a module morphism;
                    • PRIMITIVE.fi.utilities.apply_simp — Module.app PRIMITIVE.fi.utilities.accessorModule m = PRIMITIVE.fi m: applying that module is the accessor;
                    • PRIMITIVE.fi.utilities.expression_eq — the same at the level of expressions: (PRIMITIVE.fi m).expression = (PRIMITIVE.fi.utilities.proj m.expression).reduce.
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[simp]
                      theorem GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.fi.mk_simp (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                      fi p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝.fi

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

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

                      noncomputable def GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.init.utilities (p f_in f_out : Type) :
                      ModuleTypeUtilities (PRIMITIVE p f_in f_out) (procmod () → Unit) (init p f_in f_out)

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

                      • PRIMITIVE.init.utilities.accessorModule : PRIMITIVE →ₘ … — the accessor as a module, a projection being a module morphism;
                      • PRIMITIVE.init.utilities.apply_simp — Module.app PRIMITIVE.init.utilities.accessorModule m = PRIMITIVE.init m: applying that module is the accessor;
                      • PRIMITIVE.init.utilities.expression_eq — the same at the level of expressions: (PRIMITIVE.init m).expression = (PRIMITIVE.init.utilities.proj m.expression).reduce.
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        @[simp]
                        theorem GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.init.mk_simp (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                        init p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝.init

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

                        It is what carries the right-hand side of an X.apply_simp (which is an PRIMITIVE.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.Indifferentiability.DPRIMITIVE.mk_destruct (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                        «structure» p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝

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

                        @[simp]
                        theorem GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.destruct_mk (p f_in f_out : Type) (theModule✝ : DPRIMITIVE p f_in f_out) :
                        mk p f_in f_out («structure» p f_in f_out theModule✝) = theModule✝

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

                        noncomputable def GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.structure (p f_in f_out : Type) :
                        DPRIMITIVE p f_in f_out → Structure p f_in f_out

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

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

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[reducible]
                          noncomputable def GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.mk (p f_in f_out : Type) :
                          Structure p f_in f_out → DPRIMITIVE p f_in f_out

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

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

                          Equations
                          Instances For
                            @[implicit_reducible]

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

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

                            Equations
                            noncomputable def GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.fi.utilities (p f_in f_out : Type) :
                            ModuleTypeUtilities (DPRIMITIVE p f_in f_out) (procmod (p) → p) (fi p f_in f_out)

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

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

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

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

                              Instances For
                                @[simp]
                                theorem GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.fi.mk_simp (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                                fi p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝.fi

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

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

                                noncomputable def GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.f.utilities (p f_in f_out : Type) :
                                ModuleTypeUtilities (DPRIMITIVE p f_in f_out) (procmod (p) → p) (f p f_in f_out)

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

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

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

                                  DPRIMITIVE is by definition Module DPRIMITIVE.typeRep.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.f.mk_simp (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                                    f p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝.f

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

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

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

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

                                    Equations
                                    Instances For
                                      noncomputable def GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.fi (p f_in f_out : Type) :
                                      DPRIMITIVE p f_in f_out → procmod (p) → p

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

                                      DPRIMITIVE.fi.mk_simp reads this field back off a module built by DPRIMITIVE.mk; DPRIMITIVE.fi.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.Indifferentiability.DPRIMITIVE.f (p f_in f_out : Type) :
                                        DPRIMITIVE p f_in f_out → procmod (p) → p

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

                                        DPRIMITIVE.f.mk_simp reads this field back off a module built by DPRIMITIVE.mk; DPRIMITIVE.f.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.Indifferentiability.FUNCTIONALITY.init (p f_in f_out : Type) :
                                          FUNCTIONALITY p f_in f_out → procmod () → Unit

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

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

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

                                          Equations
                                          Instances For
                                            noncomputable def GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.f (p f_in f_out : Type) :
                                            FUNCTIONALITY p f_in f_out → procmod (f_in) → f_out

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

                                            FUNCTIONALITY.f.mk_simp reads this field back off a module built by FUNCTIONALITY.mk; FUNCTIONALITY.f.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

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

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

                                              Equations
                                              Instances For
                                                @[simp]
                                                theorem GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.f.mk_simp (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                                                f p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝.f

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

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

                                                @[implicit_reducible]

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

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

                                                Equations
                                                @[simp]
                                                theorem GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.init.mk_simp (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                                                init p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝.init

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

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

                                                @[reducible]
                                                noncomputable def GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.mk (p f_in f_out : Type) :
                                                Structure p f_in f_out → FUNCTIONALITY p f_in f_out

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

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

                                                Equations
                                                Instances For
                                                  noncomputable def GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.f.utilities (p f_in f_out : Type) :
                                                  ModuleTypeUtilities (FUNCTIONALITY p f_in f_out) (procmod (f_in) → f_out) (f p f_in f_out)

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

                                                  • FUNCTIONALITY.f.utilities.accessorModule : FUNCTIONALITY →ₘ … — the accessor as a module, a projection being a module morphism;
                                                  • FUNCTIONALITY.f.utilities.apply_simp — Module.app FUNCTIONALITY.f.utilities.accessorModule m = FUNCTIONALITY.f m: applying that module is the accessor;
                                                  • FUNCTIONALITY.f.utilities.expression_eq — the same at the level of expressions: (FUNCTIONALITY.f m).expression = (FUNCTIONALITY.f.utilities.proj m.expression).reduce.
                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    @[simp]
                                                    theorem GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.mk_destruct (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                                                    «structure» p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝

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

                                                    noncomputable def GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.structure (p f_in f_out : Type) :
                                                    FUNCTIONALITY p f_in f_out → Structure p f_in f_out

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

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

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      @[simp]
                                                      theorem GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.destruct_mk (p f_in f_out : Type) (theModule✝ : FUNCTIONALITY p f_in f_out) :
                                                      mk p f_in f_out («structure» p f_in f_out theModule✝) = theModule✝

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

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

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

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

                                                        FUNCTIONALITY is by definition Module FUNCTIONALITY.typeRep.

                                                        Equations
                                                        Instances For

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

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

                                                          Instances For
                                                            @[implicit_reducible]

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

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

                                                            Equations
                                                            @[simp]
                                                            theorem GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.mk_destruct (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                                                            «structure» p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝

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

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

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

                                                            Instances For
                                                              noncomputable def GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.f (p f_in f_out : Type) :
                                                              DFUNCTIONALITY p f_in f_out → procmod (f_in) → f_out

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

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

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

                                                              Equations
                                                              Instances For
                                                                @[simp]
                                                                theorem GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.f.mk_simp (p f_in f_out : Type) (theRecord✝ : Structure p f_in f_out) :
                                                                f p f_in f_out (mk p f_in f_out theRecord✝) = theRecord✝.f

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

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

                                                                @[simp]
                                                                theorem GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.destruct_mk (p f_in f_out : Type) (theModule✝ : DFUNCTIONALITY p f_in f_out) :
                                                                mk p f_in f_out («structure» p f_in f_out theModule✝) = theModule✝

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

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

                                                                DFUNCTIONALITY is by definition Module DFUNCTIONALITY.typeRep.

                                                                Equations
                                                                Instances For

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

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

                                                                  Equations
                                                                  Instances For
                                                                    @[reducible]
                                                                    noncomputable def GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.mk (p f_in f_out : Type) :
                                                                    Structure p f_in f_out → DFUNCTIONALITY p f_in f_out

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

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

                                                                    Equations
                                                                    Instances For
                                                                      noncomputable def GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.f.utilities (p f_in f_out : Type) :
                                                                      ModuleTypeUtilities (DFUNCTIONALITY p f_in f_out) (procmod (f_in) → f_out) (f p f_in f_out)

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

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

                                                                        EasyCrypt's module type CONSTRUCTION (P : DPRIMITIVE) = { proc init() : unit {} proc f(x : f_in): f_out { P.f } }: a construction takes a primitive and builds a functionality.

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

                                                                          EasyCrypt's module type SIMULATOR (F : DFUNCTIONALITY) = { proc init() : unit { } proc f(x : p) : p { F.f } proc fi(x : p) : p { F.f } }: a simulator takes a functionality and simulates the primitive.

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

                                                                            EasyCrypt's module type DISTINGUISHER (F : DFUNCTIONALITY, P : DPRIMITIVE) = { proc distinguish(): bool }: a distinguisher gets oracle access to a primitive and a functionality and returns its guess.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              noncomputable def GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.view (p f_in f_out : Type) (F : FUNCTIONALITY p f_in f_out) :
                                                                              DFUNCTIONALITY p f_in f_out

                                                                              The distinguisher's view of a functionality (EasyCrypt's subtyping FUNCTIONALITY <: DFUNCTIONALITY).

                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For
                                                                                noncomputable def GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.view (p f_in f_out : Type) (P : PRIMITIVE p f_in f_out) :
                                                                                DPRIMITIVE p f_in f_out

                                                                                The distinguisher's view of a primitive (EasyCrypt's subtyping PRIMITIVE <: DPRIMITIVE).

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For
                                                                                  theorem GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.view_f (p f_in f_out : Type) (P : PRIMITIVE p f_in f_out) :
                                                                                  DPRIMITIVE.f p f_in f_out (view p f_in f_out P) = f p f_in f_out P

                                                                                  The view's f is the primitive's. Not an EC lemma (EC's subtyping).

                                                                                  @[reducible, inline]

                                                                                  The oracle procedures a DISTINGUISHER may call (EasyCrypt's OI.allowed): F.f, P.f, P.fi. The holes of its representation (Module.Representable, exception E2).

                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    noncomputable def GaudisCrypt.SHA3.Indifferentiability.distExt (p f_in f_out : Type) (FP : Module.Prod (DFUNCTIONALITY p f_in f_out) (DPRIMITIVE p f_in f_out)) :
                                                                                    (distHoles p f_in f_out).Instantiation

                                                                                    F.f, P.f, P.fi out of the oracles (F, P).

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

                                                                                      The oracle procedure a SIMULATOR's f and fi may call (EasyCrypt's { F.f }): F.f. Its init may call none ({ }).

                                                                                      Equations
                                                                                      Instances For
                                                                                        noncomputable def GaudisCrypt.SHA3.Indifferentiability.simExt (p f_in f_out : Type) (F : DFUNCTIONALITY p f_in f_out) :
                                                                                        (simHoles f_in f_out).Instantiation

                                                                                        F.f out of the oracle F.

                                                                                        Equations
                                                                                        Instances For
                                                                                          structure GaudisCrypt.SHA3.Indifferentiability.SIMULATOR.RepresentedBy (p f_in f_out : Type) (S : SIMULATOR p f_in f_out) (pinit : proctype () -> Unit) (pf pfi : proctype (p) -> p) :

                                                                                          S applied to an oracle F behaves, procedure by procedure, like pinit, and like pf, pfi filled with F.f, and these touch nothing that S does not. Module.RepresentedBy for a simulator, whose result has three procedures (exception E2).

                                                                                          Instances For

                                                                                            EasyCrypt's call restrictions of SIMULATOR for an abstract simulator S (exception E2).

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

                                                                                              S is an EasyCrypt-like simulator: representable (SIMULATOR.Representable) and with finitely many global variables (Footprint.FinitelySupported), as Module.ECModule for a distinguisher.

                                                                                              Equations
                                                                                              • One or more equations did not get rendered due to their size.
                                                                                              Instances For
                                                                                                @[simp]
                                                                                                theorem GaudisCrypt.SHA3.Indifferentiability.Indif.main.apply_simp (p f_in f_out : Type) (F : FUNCTIONALITY p f_in f_out) (P : PRIMITIVE p f_in f_out) (D : DISTINGUISHER p f_in f_out) :
                                                                                                Module.app (Module.app (Module.app (main p f_in f_out) F) P) D = Module.proc ((procedure p f_in f_out).instantiate ((PRIMITIVE.init p f_in f_out P).procedure, (FUNCTIONALITY.init p f_in f_out F).procedure, (Module.app D (Module.pair (DFUNCTIONALITY.mk p f_in f_out { f := FUNCTIONALITY.f p f_in f_out F }) (DPRIMITIVE.mk p f_in f_out { f := PRIMITIVE.f p f_in f_out P, fi := PRIMITIVE.fi p f_in f_out P }))).procedure))

                                                                                                @[simp]: applying Indif.main to the parameters proc main uses (F, P, D) is Module.proc (Indif.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.Indifferentiability.Indif.apply_simp (p f_in f_out : Type) (F : FUNCTIONALITY p f_in f_out) (P : PRIMITIVE p f_in f_out) (D : DISTINGUISHER p f_in f_out) :
                                                                                                Indif(p, f_in, f_out, F, P, D).main = Module.app (Module.app (Module.app (main p f_in f_out) F) P) D

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

                                                                                                theorem GaudisCrypt.SHA3.Indifferentiability.Indif.main.procedure.apply_simp (p f_in f_out : Type) (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → Bool) HoleSigs.empty))).Instantiation) :
                                                                                                (procedure p f_in f_out).instantiate holeArgs✝ = proc () : Bool { var b : Bool; call (holeArgs✝.lookup HoleIndex.zero) (); call (holeArgs✝.lookup HoleIndex.zero.succ) (); b <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (); return §b }

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

                                                                                                noncomputable def GaudisCrypt.SHA3.Indifferentiability.Indif (p f_in f_out : Type) :
                                                                                                Module.Arr (Module.Prod (FUNCTIONALITY p f_in f_out) (Module.Prod (PRIMITIVE p f_in f_out) (DISTINGUISHER p f_in f_out))) (procmod () → Bool)

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

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

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

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

                                                                                                  A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Indif.main.procedure.apply_simp) rather than run. Use Indif.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.Indifferentiability.Indif.main (p f_in f_out : Type) :
                                                                                                    Module.Arr (FUNCTIONALITY p f_in f_out) (Module.Arr (PRIMITIVE p f_in f_out) (Module.Arr (DISTINGUISHER p f_in f_out) (procmod () → Bool)))

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

                                                                                                    Apply it with the @[simp] lemma Indif.main.apply_simp, which fills the holes of Indif.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.Indifferentiability.GReal (p f_in f_out : Type) (C : CONSTRUCTION p f_in f_out) (P : PRIMITIVE p f_in f_out) (D : DISTINGUISHER p f_in f_out) :

                                                                                                      module GReal(C : CONSTRUCTION, P : PRIMITIVE) = Indif(C(P), P).

                                                                                                      Equations
                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                      Instances For
                                                                                                        noncomputable def GaudisCrypt.SHA3.Indifferentiability.GIdeal (p f_in f_out : Type) (F : FUNCTIONALITY p f_in f_out) (S : SIMULATOR p f_in f_out) (D : DISTINGUISHER p f_in f_out) :

                                                                                                        module GIdeal(F : FUNCTIONALITY, S : SIMULATOR) = Indif(F, S(F)).

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

                                                                                                          EC's type p., type f_in, f_out.: the theory's types (a clone fixes them).

                                                                                                            Instances

                                                                                                              A primitive: the building block we assume ideal.

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

                                                                                                              • PRIMITIVE.init.utilities.accessorModule : PRIMITIVE →ₘ … — the accessor as a module, a projection being a module morphism;
                                                                                                              • PRIMITIVE.init.utilities.apply_simp — Module.app PRIMITIVE.init.utilities.accessorModule m = PRIMITIVE.init m: applying that module is the accessor;
                                                                                                              • PRIMITIVE.init.utilities.expression_eq — the same at the level of expressions: (PRIMITIVE.init m).expression = (PRIMITIVE.init.utilities.proj m.expression).reduce.
                                                                                                              Equations
                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                              Instances For
                                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.f.utilities {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

                                                                                                                • PRIMITIVE.f.utilities.accessorModule : PRIMITIVE →ₘ … — the accessor as a module, a projection being a module morphism;
                                                                                                                • PRIMITIVE.f.utilities.apply_simp — Module.app PRIMITIVE.f.utilities.accessorModule m = PRIMITIVE.f m: applying that module is the accessor;
                                                                                                                • PRIMITIVE.f.utilities.expression_eq — the same at the level of expressions: (PRIMITIVE.f m).expression = (PRIMITIVE.f.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.Indifferentiability.PRIMITIVE.init.mk_simp {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                  (mk theRecord✝).init = theRecord✝.init

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

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

                                                                                                                  structure GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.Structure {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                  Instances For
                                                                                                                    @[simp]
                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.fi.mk_simp {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                    (mk theRecord✝).fi = theRecord✝.fi

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

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

                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.structure {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                    Equations
                                                                                                                    • theModule✝.structure = { init := theModule✝.init, f := theModule✝.f, fi := theModule✝.fi }
                                                                                                                    Instances For
                                                                                                                      noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.init {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

                                                                                                                      PRIMITIVE.init.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.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.Indifferentiability.PRIMITIVE.mk_destruct {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                        (mk theRecord✝).structure = theRecord✝

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

                                                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.f {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

                                                                                                                        PRIMITIVE.f.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.f.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.Indifferentiability.PRIMITIVE {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                          Equations
                                                                                                                          Instances For

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

                                                                                                                            • PRIMITIVE.fi.utilities.accessorModule : PRIMITIVE →ₘ … — the accessor as a module, a projection being a module morphism;
                                                                                                                            • PRIMITIVE.fi.utilities.apply_simp — Module.app PRIMITIVE.fi.utilities.accessorModule m = PRIMITIVE.fi m: applying that module is the accessor;
                                                                                                                            • PRIMITIVE.fi.utilities.expression_eq — the same at the level of expressions: (PRIMITIVE.fi m).expression = (PRIMITIVE.fi.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.Indifferentiability.PRIMITIVE.destruct_mk {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theModule✝ : PRIMITIVE) :
                                                                                                                              mk theModule✝.structure = theModule✝

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

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

                                                                                                                              PRIMITIVE is by definition Module PRIMITIVE.typeRep.

                                                                                                                              Equations
                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                              Instances For
                                                                                                                                @[implicit_reducible]
                                                                                                                                instance GaudisCrypt.SHA3.Pilot.Indifferentiability.instIsModulePRIMITIVE {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                Equations
                                                                                                                                @[reducible]
                                                                                                                                noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.mk {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                Equations
                                                                                                                                Instances For
                                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.fi {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

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

                                                                                                                                  Equations
                                                                                                                                  Instances For
                                                                                                                                    @[simp]
                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.f.mk_simp {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                    (mk theRecord✝).f = theRecord✝.f

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

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

                                                                                                                                    @[simp]
                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.f.mk_simp {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                    (mk theRecord✝).f = theRecord✝.f

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

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

                                                                                                                                    @[simp]
                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.mk_destruct {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                    (mk theRecord✝).structure = theRecord✝

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

                                                                                                                                    @[simp]
                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.destruct_mk {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theModule✝ : DPRIMITIVE) :
                                                                                                                                    mk theModule✝.structure = theModule✝

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

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

                                                                                                                                    DPRIMITIVE is by definition Module DPRIMITIVE.typeRep.

                                                                                                                                    Equations
                                                                                                                                    Instances For

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

                                                                                                                                      • DPRIMITIVE.fi.utilities.accessorModule : DPRIMITIVE →ₘ … — the accessor as a module, a projection being a module morphism;
                                                                                                                                      • DPRIMITIVE.fi.utilities.apply_simp — Module.app DPRIMITIVE.fi.utilities.accessorModule m = DPRIMITIVE.fi m: applying that module is the accessor;
                                                                                                                                      • DPRIMITIVE.fi.utilities.expression_eq — the same at the level of expressions: (DPRIMITIVE.fi m).expression = (DPRIMITIVE.fi.utilities.proj m.expression).reduce.
                                                                                                                                      Equations
                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                      Instances For
                                                                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.f {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

                                                                                                                                        DPRIMITIVE.f.mk_simp reads this field back off a module built by DPRIMITIVE.mk; DPRIMITIVE.f.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
                                                                                                                                          structure GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.Structure {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                          Instances For
                                                                                                                                            @[simp]
                                                                                                                                            theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.fi.mk_simp {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                            (mk theRecord✝).fi = theRecord✝.fi

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

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

                                                                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.structure {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                            Equations
                                                                                                                                            Instances For
                                                                                                                                              def GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                              Equations
                                                                                                                                              Instances For

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

                                                                                                                                                • DPRIMITIVE.f.utilities.accessorModule : DPRIMITIVE →ₘ … — the accessor as a module, a projection being a module morphism;
                                                                                                                                                • DPRIMITIVE.f.utilities.apply_simp — Module.app DPRIMITIVE.f.utilities.accessorModule m = DPRIMITIVE.f m: applying that module is the accessor;
                                                                                                                                                • DPRIMITIVE.f.utilities.expression_eq — the same at the level of expressions: (DPRIMITIVE.f m).expression = (DPRIMITIVE.f.utilities.proj m.expression).reduce.
                                                                                                                                                Equations
                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                Instances For
                                                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.fi {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

                                                                                                                                                  DPRIMITIVE.fi.mk_simp reads this field back off a module built by DPRIMITIVE.mk; DPRIMITIVE.fi.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
                                                                                                                                                    @[implicit_reducible]

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

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

                                                                                                                                                    Equations
                                                                                                                                                    @[reducible]
                                                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.mk {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                    Equations
                                                                                                                                                    Instances For

                                                                                                                                                      A functionality: the target construction.

                                                                                                                                                      @[simp]
                                                                                                                                                      theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.init.mk_simp {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                                      (mk theRecord✝).init = theRecord✝.init

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

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

                                                                                                                                                      def GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                      Equations
                                                                                                                                                      Instances For
                                                                                                                                                        @[simp]
                                                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.f.mk_simp {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                                        (mk theRecord✝).f = theRecord✝.f

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

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

                                                                                                                                                        @[simp]
                                                                                                                                                        theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.mk_destruct {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                                        (mk theRecord✝).structure = theRecord✝

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

                                                                                                                                                        @[reducible]
                                                                                                                                                        noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.mk {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                        Equations
                                                                                                                                                        Instances For

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

                                                                                                                                                          • FUNCTIONALITY.init.utilities.accessorModule : FUNCTIONALITY →ₘ … — the accessor as a module, a projection being a module morphism;
                                                                                                                                                          • FUNCTIONALITY.init.utilities.apply_simp — Module.app FUNCTIONALITY.init.utilities.accessorModule m = FUNCTIONALITY.init m: applying that module is the accessor;
                                                                                                                                                          • FUNCTIONALITY.init.utilities.expression_eq — the same at the level of expressions: (FUNCTIONALITY.init m).expression = (FUNCTIONALITY.init.utilities.proj m.expression).reduce.
                                                                                                                                                          Equations
                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                          Instances For
                                                                                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.structure {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                            Equations
                                                                                                                                                            Instances For
                                                                                                                                                              @[implicit_reducible]

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

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

                                                                                                                                                              Equations

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

                                                                                                                                                              FUNCTIONALITY is by definition Module FUNCTIONALITY.typeRep.

                                                                                                                                                              Equations
                                                                                                                                                              Instances For
                                                                                                                                                                structure GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.Structure {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                                Instances For
                                                                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.init {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

                                                                                                                                                                  FUNCTIONALITY.init.mk_simp reads this field back off a module built by FUNCTIONALITY.mk; FUNCTIONALITY.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.Indifferentiability.FUNCTIONALITY.destruct_mk {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theModule✝ : FUNCTIONALITY) :
                                                                                                                                                                    mk theModule✝.structure = theModule✝

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

                                                                                                                                                                    noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.f {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

                                                                                                                                                                    FUNCTIONALITY.f.mk_simp reads this field back off a module built by FUNCTIONALITY.mk; FUNCTIONALITY.f.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

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

                                                                                                                                                                      • FUNCTIONALITY.f.utilities.accessorModule : FUNCTIONALITY →ₘ … — the accessor as a module, a projection being a module morphism;
                                                                                                                                                                      • FUNCTIONALITY.f.utilities.apply_simp — Module.app FUNCTIONALITY.f.utilities.accessorModule m = FUNCTIONALITY.f m: applying that module is the accessor;
                                                                                                                                                                      • FUNCTIONALITY.f.utilities.expression_eq — the same at the level of expressions: (FUNCTIONALITY.f m).expression = (FUNCTIONALITY.f.utilities.proj m.expression).reduce.
                                                                                                                                                                      Equations
                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                      Instances For
                                                                                                                                                                        structure GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.Structure {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                                        Instances For
                                                                                                                                                                          @[simp]
                                                                                                                                                                          theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.destruct_mk {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theModule✝ : DFUNCTIONALITY) :
                                                                                                                                                                          mk theModule✝.structure = theModule✝

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

                                                                                                                                                                          @[reducible]
                                                                                                                                                                          noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.mk {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                                          Equations
                                                                                                                                                                          Instances For
                                                                                                                                                                            noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.f {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

                                                                                                                                                                            DFUNCTIONALITY.f.mk_simp reads this field back off a module built by DFUNCTIONALITY.mk; DFUNCTIONALITY.f.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✝.f = theModule✝
                                                                                                                                                                            Instances For
                                                                                                                                                                              def GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                                              Equations
                                                                                                                                                                              Instances For

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

                                                                                                                                                                                DFUNCTIONALITY is by definition Module DFUNCTIONALITY.typeRep.

                                                                                                                                                                                Equations
                                                                                                                                                                                Instances For
                                                                                                                                                                                  noncomputable def GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.structure {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] :

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

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

                                                                                                                                                                                  Equations
                                                                                                                                                                                  Instances For
                                                                                                                                                                                    @[simp]
                                                                                                                                                                                    theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.mk_destruct {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                                                                    (mk theRecord✝).structure = theRecord✝

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

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

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

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

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

                                                                                                                                                                                      Equations
                                                                                                                                                                                      @[simp]
                                                                                                                                                                                      theorem GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.f.mk_simp {p f_in f_out : Type} [_gaudiParam0 : Params p f_in f_out] (theRecord✝ : Structure) :
                                                                                                                                                                                      (mk theRecord✝).f = theRecord✝.f

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

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

                                                                                                                                                                                      @[implicit_reducible]

                                                                                                                                                                                      A PRIMITIVE is a DPRIMITIVE (its f, fi).

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

                                                                                                                                                                                      A FUNCTIONALITY is a DFUNCTIONALITY (its f).

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

                                                                                                                                                                                      EC's module type CONSTRUCTION (P : DPRIMITIVE) = { proc init() : unit {} proc f(x : f_in): f_out { P.f } }.

                                                                                                                                                                                      Equations
                                                                                                                                                                                      Instances For
                                                                                                                                                                                        @[reducible, inline]
                                                                                                                                                                                        abbrev GaudisCrypt.SHA3.Pilot.Indifferentiability.SIMULATOR {p f_in f_out : Type} [Params p f_in f_out] :

                                                                                                                                                                                        EC's module type SIMULATOR (F : DFUNCTIONALITY) = { proc init() : unit { } proc f(x : p) : p { F.f } proc fi(x : p) : p { F.f } }.

                                                                                                                                                                                        Equations
                                                                                                                                                                                        Instances For
                                                                                                                                                                                          @[reducible, inline]

                                                                                                                                                                                          EC's module type DISTINGUISHER (F : DFUNCTIONALITY, P : DPRIMITIVE) = { proc distinguish(): bool }.

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

                                                                                                                                                                                            @[simp]: applying Indif.main to the parameters proc main uses (F, P, D) is Module.proc (Indif.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 module declared by module Indif, abstracted over its 3 parameters F, P, D, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.

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

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

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

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

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

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

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

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

                                                                                                                                                                                                A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Indif.main.procedure.apply_simp) rather than run. Use Indif.main for this procedure as a module.

                                                                                                                                                                                                Equations
                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                Instances For
                                                                                                                                                                                                  @[reducible, inline]
                                                                                                                                                                                                  noncomputable abbrev GaudisCrypt.SHA3.Pilot.Indifferentiability.GReal {p f_in f_out : Type} [Params p f_in f_out] (C : CONSTRUCTION) (P : PRIMITIVE) (D : DISTINGUISHER) :

                                                                                                                                                                                                  module GReal(C : CONSTRUCTION, P : PRIMITIVE) = Indif(C(P), P).

                                                                                                                                                                                                  Equations
                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                    @[reducible, inline]
                                                                                                                                                                                                    noncomputable abbrev GaudisCrypt.SHA3.Pilot.Indifferentiability.GIdeal {p f_in f_out : Type} [Params p f_in f_out] (F : FUNCTIONALITY) (S : SIMULATOR) (D : DISTINGUISHER) :

                                                                                                                                                                                                    module GIdeal(F : FUNCTIONALITY, S : SIMULATOR) = Indif(F, S(F)).

                                                                                                                                                                                                    Equations
                                                                                                                                                                                                    Instances For