Documentation

GaudisCrypt.Logic.ECProcViewsTest

Golden tests: a module read at another module type; a procedure's footprint read off its code #

instance GaudisCrypt.ECProcViewsTest.instIsGlobalVarIntCntMk :
cnt.IsGlobalVar (VariableName.mk "GaudisCrypt.ECProcViewsTest.cnt" ℤ)
Equations
Instances For
    @[reducible]

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

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

    Equations
    Instances For
      @[simp]
      theorem GaudisCrypt.ECProcViewsTest.PRIM.f.mk_simp (theRecord✝ : Structure) :
      (mk theRecord✝).f = theRecord✝.f

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

      It is what carries the right-hand side of an X.apply_simp (which is an PRIM.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 PRIM, with fields init, f: the type Module PRIM.typeRep of modules that are a right-nested tuple of the field types.

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

      Equations
      Instances For

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

        PRIM.f.mk_simp reads this field back off a module built by PRIM.mk; PRIM.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 field init of a module of type PRIM: the projection onto component 0 of the right-nested tuple PRIM.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

          PRIM.init.mk_simp reads this field back off a module built by PRIM.mk; PRIM.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.ECProcViewsTest.PRIM.mk_destruct (theRecord✝ : Structure) :
            (mk theRecord✝).structure = theRecord✝

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

            @[implicit_reducible]

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

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

            Equations
            @[simp]
            theorem GaudisCrypt.ECProcViewsTest.PRIM.init.mk_simp (theRecord✝ : Structure) :
            (mk theRecord✝).init = theRecord✝.init

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

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

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

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

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

              PRIM is by definition Module PRIM.typeRep.

              Equations
              Instances For

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

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

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

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

                  Equations
                  Instances For
                    @[simp]
                    theorem GaudisCrypt.ECProcViewsTest.PRIM.destruct_mk (theModule✝ : PRIM) :
                    mk theModule✝.structure = theModule✝

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

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

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

                    Instances For

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

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

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

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

                        Equations
                        Instances For

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

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

                          Instances For
                            @[simp]
                            theorem GaudisCrypt.ECProcViewsTest.DPRIM.destruct_mk (theModule✝ : DPRIM) :
                            mk theModule✝.structure = theModule✝

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

                            @[implicit_reducible]

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

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

                            Equations
                            @[simp]
                            theorem GaudisCrypt.ECProcViewsTest.DPRIM.mk_destruct (theRecord✝ : Structure) :
                            (mk theRecord✝).structure = theRecord✝

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

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

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

                            Equations
                            Instances For
                              @[simp]
                              theorem GaudisCrypt.ECProcViewsTest.DPRIM.f.mk_simp (theRecord✝ : Structure) :
                              (mk theRecord✝).f = theRecord✝.f

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

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

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

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

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

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

                                Equations
                                Instances For

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

                                  DPRIM is by definition Module DPRIM.typeRep.

                                  Equations
                                  Instances For

                                    The distinguisher's view of a primitive (a hand-written record, as the first SHA-3 port's PRIMITIVE.view).

                                    Equations
                                    Instances For

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

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

                                      theorem GaudisCrypt.ECProcViewsTest.Ctr.f.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                      procedure.instantiate holeArgs✝ = proc (x : ℤ) : ℤ { cnt <- §cnt + 1; return §x + 1 }

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

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

                                      @[simp]

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

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

                                      Equations
                                      Instances For

                                        The body of proc f of module Ctr, as a procedure of its own: it calls no module parameter, so it has no holes.

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

                                        Equations
                                        Instances For

                                          The body of proc init of module Ctr, as a procedure of its own: it calls no module parameter, so it has no holes.

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

                                          Equations
                                          Instances For

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

                                            Equations
                                            Instances For

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

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

                                              Equations
                                              Instances For
                                                @[simp]

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

                                                @[reducible, inline]

                                                Ctr as the distinguisher sees it.

                                                Equations
                                                Instances For

                                                  The module declared by module G: the record of its procedures G.run.

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

                                                  Equations
                                                  Instances For

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

                                                    Equations
                                                    Instances For
                                                      @[simp]

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

                                                      The body of proc run of module G, as a procedure of its own: it calls no module parameter, so it has no holes.

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

                                                      Equations
                                                      Instances For
                                                        theorem GaudisCrypt.ECProcViewsTest.G.run.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                        procedure.instantiate holeArgs✝ = proc () : ℤ { var y : ℤ; y <- call CtrView.f.procedure (1); return §y }

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

                                                        theorem GaudisCrypt.ECProcViewsTest.H.run.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                        procedure.instantiate holeArgs✝ = proc () : ℤ { var y : ℤ; y <- call Ctr.f.procedure (1); return §y }

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

                                                        The module declared by module H: the record of its procedures H.run.

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

                                                        Equations
                                                        Instances For

                                                          The body of proc run of module H, as a procedure of its own: it calls no module parameter, so it has no holes.

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

                                                          Equations
                                                          Instances For

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

                                                            Equations
                                                            Instances For
                                                              @[simp]

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

                                                              Equations
                                                              Instances For
                                                                instance GaudisCrypt.ECProcViewsTest.instIsGlobalVarIntOtherMk :
                                                                other.IsGlobalVar (VariableName.mk "GaudisCrypt.ECProcViewsTest.other" ℤ)

                                                                A module read at a clone's module type through another module type's record: the first SHA-3 port's module types (explicit type parameters) are the theory's (instance parameters) at the clone's types, so a module built with the first port's constructor is one of the clone's module type, and the clone's accessor (here of a clone inside a cloned theory, as SHA3OSecurity's SH.OIndif) meets that record. proc opens it as it is (SHA3OSecurity's GAP 3, whose hand simp only [ODPRIMITIVE_f_mk] became unnecessary with the procedures across clones' module types, 2026-11-17).

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

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

                                                                Equations
                                                                Instances For
                                                                  @[simp]
                                                                  theorem GaudisCrypt.ECProcViewsTest.FP.DPRIM2.destruct_mk (p : Type) (theModule✝ : DPRIM2 p) :
                                                                  mk p («structure» p theModule✝) = theModule✝

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

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

                                                                  DPRIM2 is by definition Module DPRIM2.typeRep.

                                                                  Equations
                                                                  Instances For

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

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

                                                                    Instances For
                                                                      @[implicit_reducible]

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

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

                                                                      Equations
                                                                      @[reducible]

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

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

                                                                      Equations
                                                                      Instances For

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

                                                                        DPRIM2.f.mk_simp reads this field back off a module built by DPRIM2.mk; DPRIM2.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.ECProcViewsTest.FP.DPRIM2.f.mk_simp (p : Type) (theRecord✝ : Structure p) :
                                                                          f p (mk p theRecord✝) = theRecord✝.f

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

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

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

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

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

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

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

                                                                            Equations
                                                                            Instances For

                                                                              The theory's type.

                                                                                Instances
                                                                                  @[simp]
                                                                                  theorem GaudisCrypt.ECProcViewsTest.TH.DPRIM2.f.mk_simp {p : Type} [_gaudiParam0 : Params p] (theRecord✝ : Structure) :
                                                                                  (mk theRecord✝).f = theRecord✝.f

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

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

                                                                                  noncomputable def GaudisCrypt.ECProcViewsTest.TH.DPRIM2.structure {p : Type} [_gaudiParam0 : Params p] :

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

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

                                                                                  Equations
                                                                                  Instances For
                                                                                    noncomputable def GaudisCrypt.ECProcViewsTest.TH.DPRIM2.f {p : Type} [_gaudiParam0 : Params p] :

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

                                                                                    DPRIM2.f.mk_simp reads this field back off a module built by DPRIM2.mk; DPRIM2.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
                                                                                      @[reducible]
                                                                                      noncomputable def GaudisCrypt.ECProcViewsTest.TH.DPRIM2.mk {p : Type} [_gaudiParam0 : Params p] :

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

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

                                                                                      Equations
                                                                                      Instances For
                                                                                        @[simp]
                                                                                        theorem GaudisCrypt.ECProcViewsTest.TH.DPRIM2.destruct_mk {p : Type} [_gaudiParam0 : Params p] (theModule✝ : DPRIM2) :
                                                                                        mk theModule✝.structure = theModule✝

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

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

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

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

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

                                                                                          Instances For
                                                                                            @[simp]
                                                                                            theorem GaudisCrypt.ECProcViewsTest.TH.DPRIM2.mk_destruct {p : Type} [_gaudiParam0 : Params p] (theRecord✝ : Structure) :
                                                                                            (mk theRecord✝).structure = theRecord✝

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

                                                                                            @[implicit_reducible]

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

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

                                                                                            Equations

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

                                                                                            DPRIM2 is by definition Module DPRIM2.typeRep.

                                                                                            Equations
                                                                                            Instances For
                                                                                              def GaudisCrypt.ECProcViewsTest.TH.DPRIM2 {p : Type} [_gaudiParam0 : Params p] :

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

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

                                                                                              Equations
                                                                                              Instances For

                                                                                                The theory's type.

                                                                                                  Instances

                                                                                                    The body of proc f of module Inc2, as a procedure of its own: it calls no module parameter, so it has no holes.

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

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      theorem GaudisCrypt.ECProcViewsTest.Inc2.f.procedure.apply_simp (holeArgs✝ : HoleSigs.empty.Instantiation) :
                                                                                                      procedure.instantiate holeArgs✝ = proc (x : ℤ) : ℤ { cnt <- §cnt + 1; return §x + 1 }

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

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

                                                                                                      The module declared by module Inc2: the record of its procedures Inc2.f.

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

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        @[simp]

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

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

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          noncomputable def GaudisCrypt.ECProcViewsTest.Inc2Rec :
                                                                                                          TC.I.DPRIM2

                                                                                                          Inc2 handed on at the clone's module type, built with the first port's constructor.

                                                                                                          Equations
                                                                                                          Instances For