Documentation

GaudisCrypt.Lib.EC.SigmaProtocol

Sigma protocols (EasyCrypt theories/crypto/SigmaProtocol.ec) #

EC's theory SigmaProtocol: the module types of a scheme and of its algorithms (extractor and simulator), and the experiments for completeness, special soundness and special honest-verifier zero knowledge.

The theory's types are outParams of the class Params, its operators de and R the fields: a clone is clone import GaudisCrypt.EC.SigmaProtocol as SP with type statement <- …, op R <- …, op de <- …. EC's op slen, op wlen with their axioms slen_pos, wlen_pos are used by no declaration of the theory and are left out (EC's clones leave them abstract). R x w is a proposition; where a program stores it (r <- R x w) it is decided classically, as EC's logic is. EC's variable to is a Lean keyword, hence «to».

SimulateHonestVerifier.main calls the module's own procedures (b' <@ gameIdeal()): written with their paths, SimulateHonestVerifier(S, A, D).gameIdeal.

class GaudisCrypt.EC.SigmaProtocol.Params (statement witness message secret challenge response : outParam Type) :

EC's type statement, witness, message, secret, challenge, response, op de and op R.

Instances
    @[reducible, inline]
    abbrev GaudisCrypt.EC.SigmaProtocol.transcript {statement witness message secret challenge response : Type} [Params statement witness message secret challenge response] :

    EC's type transcript = message * challenge * response.

    Equations
    Instances For
      noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.respond.utilities {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
      ModuleTypeUtilities SigmaScheme (procmod (statement × witness, message × secret, challenge) → response) respond

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

      • SigmaScheme.respond.utilities.accessorModule : SigmaScheme →ₘ … — the accessor as a module, a projection being a module morphism;
      • SigmaScheme.respond.utilities.apply_simp — Module.app SigmaScheme.respond.utilities.accessorModule m = SigmaScheme.respond m: applying that module is the accessor;
      • SigmaScheme.respond.utilities.expression_eq — the same at the level of expressions: (SigmaScheme.respond m).expression = (SigmaScheme.respond.utilities.proj m.expression).reduce.
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem GaudisCrypt.EC.SigmaProtocol.SigmaScheme.commit.mk_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
        (mk theRecord✝).commit = theRecord✝.commit

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

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

        noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.test {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

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

        Equations
        Instances For
          @[implicit_reducible]
          instance GaudisCrypt.EC.SigmaProtocol.instIsModuleSigmaScheme {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

          Equations
          noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.gen.utilities {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

          • SigmaScheme.gen.utilities.accessorModule : SigmaScheme →ₘ … — the accessor as a module, a projection being a module morphism;
          • SigmaScheme.gen.utilities.apply_simp — Module.app SigmaScheme.gen.utilities.accessorModule m = SigmaScheme.gen m: applying that module is the accessor;
          • SigmaScheme.gen.utilities.expression_eq — the same at the level of expressions: (SigmaScheme.gen m).expression = (SigmaScheme.gen.utilities.proj m.expression).reduce.
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.verify {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

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

            Equations
            Instances For
              noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.test.utilities {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

              • SigmaScheme.test.utilities.accessorModule : SigmaScheme →ₘ … — the accessor as a module, a projection being a module morphism;
              • SigmaScheme.test.utilities.apply_simp — Module.app SigmaScheme.test.utilities.accessorModule m = SigmaScheme.test m: applying that module is the accessor;
              • SigmaScheme.test.utilities.expression_eq — the same at the level of expressions: (SigmaScheme.test m).expression = (SigmaScheme.test.utilities.proj m.expression).reduce.
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.gen {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                SigmaScheme → procmod () → (statement × witness)

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

                SigmaScheme.gen.mk_simp reads this field back off a module built by SigmaScheme.mk; SigmaScheme.gen.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.EC.SigmaProtocol.SigmaScheme.commit {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

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

                  Equations
                  Instances For
                    noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.structure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

                    The record of a module's fields: SigmaScheme.structure m is SigmaScheme.Structure.mk applied to SigmaScheme.gen, SigmaScheme.commit, SigmaScheme.test, SigmaScheme.respond, SigmaScheme.verify of m.

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

                    Equations
                    Instances For
                      noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.verify.utilities {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                      • SigmaScheme.verify.utilities.accessorModule : SigmaScheme →ₘ … — the accessor as a module, a projection being a module morphism;
                      • SigmaScheme.verify.utilities.apply_simp — Module.app SigmaScheme.verify.utilities.accessorModule m = SigmaScheme.verify m: applying that module is the accessor;
                      • SigmaScheme.verify.utilities.expression_eq — the same at the level of expressions: (SigmaScheme.verify m).expression = (SigmaScheme.verify.utilities.proj m.expression).reduce.
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        structure GaudisCrypt.EC.SigmaProtocol.SigmaScheme.Structure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

                        The record of the fields of a module of type SigmaScheme: the fields gen, commit, test, respond, verify, one per moduletype field, each of that field's own module type.

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

                        Instances For
                          @[simp]
                          theorem GaudisCrypt.EC.SigmaProtocol.SigmaScheme.mk_destruct {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                          (mk theRecord✝).structure = theRecord✝

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

                          @[simp]
                          theorem GaudisCrypt.EC.SigmaProtocol.SigmaScheme.test.mk_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                          (mk theRecord✝).test = theRecord✝.test

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

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

                          @[simp]
                          theorem GaudisCrypt.EC.SigmaProtocol.SigmaScheme.destruct_mk {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theModule✝ : SigmaScheme) :
                          mk theModule✝.structure = theModule✝

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

                          @[simp]
                          theorem GaudisCrypt.EC.SigmaProtocol.SigmaScheme.gen.mk_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                          (mk theRecord✝).gen = theRecord✝.gen

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

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

                          @[simp]
                          theorem GaudisCrypt.EC.SigmaProtocol.SigmaScheme.verify.mk_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                          (mk theRecord✝).verify = theRecord✝.verify

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

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

                          noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.commit.utilities {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                          • SigmaScheme.commit.utilities.accessorModule : SigmaScheme →ₘ … — the accessor as a module, a projection being a module morphism;
                          • SigmaScheme.commit.utilities.apply_simp — Module.app SigmaScheme.commit.utilities.accessorModule m = SigmaScheme.commit m: applying that module is the accessor;
                          • SigmaScheme.commit.utilities.expression_eq — the same at the level of expressions: (SigmaScheme.commit m).expression = (SigmaScheme.commit.utilities.proj m.expression).reduce.
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            @[reducible]
                            noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.mk {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                            Inverse of SigmaScheme.structure (SigmaScheme.mk_destruct, SigmaScheme.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas SigmaScheme.gen.mk_simp, SigmaScheme.commit.mk_simp, SigmaScheme.test.mk_simp, SigmaScheme.respond.mk_simp, SigmaScheme.verify.mk_simp.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[simp]
                              theorem GaudisCrypt.EC.SigmaProtocol.SigmaScheme.respond.mk_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                              (mk theRecord✝).respond = theRecord✝.respond

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

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

                              noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.respond {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                              SigmaScheme → procmod (statement × witness, message × secret, challenge) → response

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

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

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

                              Equations
                              Instances For
                                def GaudisCrypt.EC.SigmaProtocol.SigmaScheme {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

                                The module type declared by moduletype SigmaScheme, with fields gen, commit, test, respond, verify: the type Module SigmaScheme.typeRep of modules that are a right-nested tuple of the field types.

                                Build one from a record of its fields with SigmaScheme.mk, read a single field off one with the accessors SigmaScheme.gen, SigmaScheme.commit, SigmaScheme.test, SigmaScheme.respond, SigmaScheme.verify, and get the whole record back with SigmaScheme.structure.

                                Equations
                                Instances For
                                  def GaudisCrypt.EC.SigmaProtocol.SigmaScheme.typeRep {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                  SigmaScheme is by definition Module SigmaScheme.typeRep.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.simulate.utilities {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                    • SigmaAlgorithms.simulate.utilities.accessorModule : SigmaAlgorithms →ₘ … — the accessor as a module, a projection being a module morphism;
                                    • SigmaAlgorithms.simulate.utilities.apply_simp — Module.app SigmaAlgorithms.simulate.utilities.accessorModule m = SigmaAlgorithms.simulate m: applying that module is the accessor;
                                    • SigmaAlgorithms.simulate.utilities.expression_eq — the same at the level of expressions: (SigmaAlgorithms.simulate m).expression = (SigmaAlgorithms.simulate.utilities.proj m.expression).reduce.
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                      Equations
                                      Instances For
                                        def GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.typeRep {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                        SigmaAlgorithms is by definition Module SigmaAlgorithms.typeRep.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.soundness.utilities {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                          • SigmaAlgorithms.soundness.utilities.accessorModule : SigmaAlgorithms →ₘ … — the accessor as a module, a projection being a module morphism;
                                          • SigmaAlgorithms.soundness.utilities.apply_simp — Module.app SigmaAlgorithms.soundness.utilities.accessorModule m = SigmaAlgorithms.soundness m: applying that module is the accessor;
                                          • SigmaAlgorithms.soundness.utilities.expression_eq — the same at the level of expressions: (SigmaAlgorithms.soundness m).expression = (SigmaAlgorithms.soundness.utilities.proj m.expression).reduce.
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            @[simp]
                                            theorem GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.soundness.mk_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                                            (mk theRecord✝).soundness = theRecord✝.soundness

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

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

                                            noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.structure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

                                            The record of a module's fields: SigmaAlgorithms.structure m is SigmaAlgorithms.Structure.mk applied to SigmaAlgorithms.soundness, SigmaAlgorithms.simulate of m.

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

                                            Equations
                                            Instances For
                                              noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.simulate {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                              SigmaAlgorithms → procmod (statement, challenge) → (message × challenge × response)

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

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

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

                                              Equations
                                              Instances For
                                                noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.soundness {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

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

                                                Equations
                                                Instances For
                                                  structure GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.Structure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                  Instances For
                                                    @[simp]
                                                    theorem GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.mk_destruct {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                                                    (mk theRecord✝).structure = theRecord✝

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

                                                    @[simp]
                                                    theorem GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.destruct_mk {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theModule✝ : SigmaAlgorithms) :
                                                    mk theModule✝.structure = theModule✝

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

                                                    @[implicit_reducible]
                                                    instance GaudisCrypt.EC.SigmaProtocol.instIsModuleSigmaAlgorithms {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                    Equations
                                                    @[reducible]
                                                    noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.mk {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                    Equations
                                                    Instances For
                                                      @[simp]
                                                      theorem GaudisCrypt.EC.SigmaProtocol.SigmaAlgorithms.simulate.mk_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                                                      (mk theRecord✝).simulate = theRecord✝.simulate

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

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

                                                      noncomputable def GaudisCrypt.EC.SigmaProtocol.Completeness.main.procedure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                                      proctype (statement, witness) → Bool uses ((statement, witness) → message × secret, (statement, message) → challenge, (statement × witness, message × secret, challenge) → response, (statement, message, challenge, response) → Bool)

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

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        theorem GaudisCrypt.EC.SigmaProtocol.Completeness.main.procedure.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (holeArgs✝ : (HoleSigs.cons (procsig (statement, witness) → message × secret) (HoleSigs.cons (procsig (statement, message) → challenge) (HoleSigs.cons (procsig (statement × witness, message × secret, challenge) → response) (HoleSigs.cons (procsig (statement, message, challenge, response) → Bool) HoleSigs.empty)))).Instantiation) :
                                                        procedure.instantiate holeArgs✝ = proc (x : statement, w : witness) : Bool { var m : message, s : secret, e : challenge, z : response, b : Bool; m, s <- call (holeArgs✝.lookup HoleIndex.zero) (§x, §w); e <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x, §m); z <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) ((§x, §w), (§m, §s), §e); b <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§x, §m, §e, §z); return §b }

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

                                                        noncomputable def GaudisCrypt.EC.SigmaProtocol.Completeness {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                                        Equations
                                                        Instances For
                                                          @[simp]
                                                          theorem GaudisCrypt.EC.SigmaProtocol.Completeness.main.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) :

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

                                                          noncomputable def GaudisCrypt.EC.SigmaProtocol.Completeness.main {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            @[simp]
                                                            theorem GaudisCrypt.EC.SigmaProtocol.Completeness.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) :

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

                                                            @[simp]
                                                            theorem GaudisCrypt.EC.SigmaProtocol.Run.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) :
                                                            Run(S).main = Module.app main S

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

                                                            @[simp]
                                                            theorem GaudisCrypt.EC.SigmaProtocol.Run.main.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) :

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

                                                            noncomputable def GaudisCrypt.EC.SigmaProtocol.Run {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                                            Module.Arr SigmaScheme (procmod () → (statement × message × challenge × response))

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

                                                            Equations
                                                            Instances For
                                                              noncomputable def GaudisCrypt.EC.SigmaProtocol.Run.main.procedure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                                              proctype () → statement × message × challenge × response uses (() → statement × witness, (statement, witness) → message × secret, (statement, message) → challenge, (statement × witness, message × secret, challenge) → response)

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

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                theorem GaudisCrypt.EC.SigmaProtocol.Run.main.procedure.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (holeArgs✝ : (HoleSigs.cons (procsig () → statement × witness) (HoleSigs.cons (procsig (statement, witness) → message × secret) (HoleSigs.cons (procsig (statement, message) → challenge) (HoleSigs.cons (procsig (statement × witness, message × secret, challenge) → response) HoleSigs.empty)))).Instantiation) :
                                                                procedure.instantiate holeArgs✝ = proc () : (statement × message × challenge × response) { var x : statement, w : witness, m : message, s : secret, e : challenge, z : response; x, w <- call (holeArgs✝.lookup HoleIndex.zero) (); m, s <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x, §w); e <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§x, §m); z <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) ((§x, §w), (§m, §s), §e); return (§x, §m, §e, §z) }

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

                                                                noncomputable def GaudisCrypt.EC.SigmaProtocol.Run.main {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                                                Module.Arr SigmaScheme (procmod () → (statement × message × challenge × response))

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

                                                                Apply it with the @[simp] lemma Run.main.apply_simp, which fills the holes of Run.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.EC.SigmaProtocol.SpecialSoundnessExperiment {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    noncomputable def GaudisCrypt.EC.SigmaProtocol.SpecialSoundnessExperiment.main.procedure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                                                    proctype (statement, message, challenge, response, challenge, response) → Option witness uses ((statement, message, challenge, response, challenge, response) → Option witness, (statement, message, challenge, response) → Bool)

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

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      theorem GaudisCrypt.EC.SigmaProtocol.SpecialSoundnessExperiment.main.procedure.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (holeArgs✝ : (HoleSigs.cons (procsig (statement, message, challenge, response, challenge, response) → Option witness) (HoleSigs.cons (procsig (statement, message, challenge, response) → Bool) HoleSigs.empty)).Instantiation) :
                                                                      procedure.instantiate holeArgs✝ = proc (x : statement, m : message, e : challenge, z : response, e' : challenge, z' : response) : (Option witness) { var sto : Option witness, w : witness, r : Bool, v : Bool, v' : Bool, s : Option witness; sto <- call (holeArgs✝.lookup HoleIndex.zero) (§x, §m, §e, §z, §e', §z'); if (decide (§e ≠ §e' ∧ §sto ≠ none)) { w <- oget §sto; r <- decide (R §x §w); v <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x, §m, §e, §z); v' <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x, §m, §e', §z'); if (§r && §v && §v') { s <- some §w; } else { s <- none; } } else { s <- none; } return §s }

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

                                                                      noncomputable def GaudisCrypt.EC.SigmaProtocol.SpecialSoundnessExperiment.main {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For
                                                                        @[simp]
                                                                        theorem GaudisCrypt.EC.SigmaProtocol.SpecialSoundnessExperiment.main.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) (A : SigmaAlgorithms) :

                                                                        @[simp]: applying SpecialSoundnessExperiment.main to the parameters proc main uses (S, A) is Module.proc (SpecialSoundnessExperiment.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.EC.SigmaProtocol.SpecialSoundnessExperiment.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) (A : SigmaAlgorithms) :

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

                                                                        noncomputable def GaudisCrypt.EC.SigmaProtocol.SpecialHVZKExperiment.main {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          theorem GaudisCrypt.EC.SigmaProtocol.SpecialHVZKExperiment.main.procedure.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (holeArgs✝ : (HoleSigs.cons (procsig (statement, challenge) → message × challenge × response) (HoleSigs.cons (procsig (statement, message, challenge, response) → Bool) HoleSigs.empty)).Instantiation) :
                                                                          procedure.instantiate holeArgs✝ = proc (x : statement, e : challenge) : (Option (message × challenge × response)) { var m : message, z : response, v : Bool, «to» : Option (message × challenge × response); m, e, z <- call (holeArgs✝.lookup HoleIndex.zero) (§x, §e); v <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x, §m, §e, §z); if (§v) { «to» <- some (§m, §e, §z); } else { «to» <- none; } return §«to» }

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

                                                                          @[simp]
                                                                          theorem GaudisCrypt.EC.SigmaProtocol.SpecialHVZKExperiment.main.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) (A : SigmaAlgorithms) :

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

                                                                          noncomputable def GaudisCrypt.EC.SigmaProtocol.SpecialHVZKExperiment {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            @[simp]
                                                                            theorem GaudisCrypt.EC.SigmaProtocol.SpecialHVZKExperiment.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) (A : SigmaAlgorithms) :

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

                                                                            noncomputable def GaudisCrypt.EC.SigmaProtocol.SpecialHVZKExperiment.main.procedure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                                                            proctype (statement, challenge) → Option (message × challenge × response) uses ((statement, challenge) → message × challenge × response, (statement, message, challenge, response) → Bool)

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

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              @[implicit_reducible]
                                                                              instance GaudisCrypt.EC.SigmaProtocol.instIsModuleSigmaTraceDistinguisher {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                                              Equations
                                                                              noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.distinguish {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

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

                                                                              Equations
                                                                              Instances For
                                                                                noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.structure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                                                Equations
                                                                                Instances For
                                                                                  noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.distinguish.utilities {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                                                                  • SigmaTraceDistinguisher.distinguish.utilities.accessorModule : SigmaTraceDistinguisher →ₘ … — the accessor as a module, a projection being a module morphism;
                                                                                  • SigmaTraceDistinguisher.distinguish.utilities.apply_simp — Module.app SigmaTraceDistinguisher.distinguish.utilities.accessorModule m = SigmaTraceDistinguisher.distinguish m: applying that module is the accessor;
                                                                                  • SigmaTraceDistinguisher.distinguish.utilities.expression_eq — the same at the level of expressions: (SigmaTraceDistinguisher.distinguish m).expression = (SigmaTraceDistinguisher.distinguish.utilities.proj m.expression).reduce.
                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    @[simp]
                                                                                    theorem GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.distinguish.mk_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                                                                                    (mk theRecord✝).distinguish = theRecord✝.distinguish

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

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

                                                                                    @[reducible]
                                                                                    noncomputable def GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.mk {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                                                    Equations
                                                                                    Instances For
                                                                                      @[simp]
                                                                                      theorem GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.destruct_mk {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theModule✝ : SigmaTraceDistinguisher) :
                                                                                      mk theModule✝.structure = theModule✝

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

                                                                                      def GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.typeRep {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                                                                      SigmaTraceDistinguisher is by definition Module SigmaTraceDistinguisher.typeRep.

                                                                                      Equations
                                                                                      Instances For
                                                                                        def GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                                                        Equations
                                                                                        Instances For
                                                                                          @[simp]
                                                                                          theorem GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.mk_destruct {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (theRecord✝ : Structure) :
                                                                                          (mk theRecord✝).structure = theRecord✝

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

                                                                                          structure GaudisCrypt.EC.SigmaProtocol.SigmaTraceDistinguisher.Structure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

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

                                                                                          Instances For
                                                                                            @[simp]
                                                                                            theorem GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.main.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) (A : SigmaAlgorithms) (D : SigmaTraceDistinguisher) :

                                                                                            @[simp]: applying SimulateHonestVerifier.main to the parameters proc main uses (S, A, D) is Module.proc (SimulateHonestVerifier.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.EC.SigmaProtocol.SimulateHonestVerifier.gameReal.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) (D : SigmaTraceDistinguisher) :

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

                                                                                            noncomputable def GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.gameIdeal.procedure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                                                                            proctype () → Bool uses (() → statement × witness, (statement, witness) → message × secret, (statement, challenge) → Option (message × challenge × response), (statement, transcript) → Bool)

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

                                                                                            Equations
                                                                                            • One or more equations did not get rendered due to their size.
                                                                                            Instances For
                                                                                              theorem GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.gameReal.procedure.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (holeArgs✝ : (HoleSigs.cons (procsig () → statement × message × challenge × response) (HoleSigs.cons (procsig (statement, transcript) → Bool) HoleSigs.empty)).Instantiation) :
                                                                                              procedure.instantiate holeArgs✝ = proc () : Bool { var x : statement, m : message, e : challenge, z : response, t : transcript, b : Bool; x, m, e, z <- call (holeArgs✝.lookup HoleIndex.zero) (); t <- (§m, §e, §z); b <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x, §t); return §b }

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

                                                                                              @[simp]
                                                                                              theorem GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.gameIdeal.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) (A : SigmaAlgorithms) (D : SigmaTraceDistinguisher) :

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

                                                                                              theorem GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.main.procedure.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (holeArgs✝ : (HoleSigs.cons (procsig () → Bool) (HoleSigs.cons (procsig () → Bool) HoleSigs.empty)).Instantiation) :
                                                                                              procedure.instantiate holeArgs✝ = proc () : Bool { var b : Bool, b' : Bool; b <$ dbool; if (§b) { b' <- call (holeArgs✝.lookup HoleIndex.zero) (); } else { b' <- call (holeArgs✝.lookup HoleIndex.zero.succ) (); } return decide (§b' = §b) }

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

                                                                                              @[simp]
                                                                                              theorem GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (S : SigmaScheme) (A : SigmaAlgorithms) (D : SigmaTraceDistinguisher) :

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

                                                                                              noncomputable def GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.gameReal.procedure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :
                                                                                              proctype () → Bool uses (() → statement × message × challenge × response, (statement, transcript) → Bool)

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

                                                                                              Equations
                                                                                              • One or more equations did not get rendered due to their size.
                                                                                              Instances For
                                                                                                noncomputable def GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.gameIdeal {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

                                                                                                proc gameIdeal of module SimulateHonestVerifier as a module, abstracted over the module parameters it uses (S, A, D, in declaration order): Module.Arr … (Module.Proc (procsig …)).

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

                                                                                                Equations
                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                Instances For
                                                                                                  theorem GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.gameIdeal.procedure.apply_simp {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] (holeArgs✝ : (HoleSigs.cons (procsig () → statement × witness) (HoleSigs.cons (procsig (statement, witness) → message × secret) (HoleSigs.cons (procsig (statement, challenge) → Option (message × challenge × response)) (HoleSigs.cons (procsig (statement, transcript) → Bool) HoleSigs.empty)))).Instantiation) :
                                                                                                  procedure.instantiate holeArgs✝ = proc () : Bool { var x : statement, w : witness, m : message, s : secret, e : challenge, «to» : Option transcript, i : ℤ, t : transcript, b : Bool; x, w <- call (holeArgs✝.lookup HoleIndex.zero) (); m, s <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x, §w); e <$ de; «to» <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§x, §e); i <- 0; while (decide (§«to» = none)) { «to» <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§x, §e); i <- §i + 1; } t <- oget §«to»; b <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§x, §t); return §b }

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

                                                                                                  noncomputable def GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                                                                                  Equations
                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                  Instances For
                                                                                                    noncomputable def GaudisCrypt.EC.SigmaProtocol.SimulateHonestVerifier.main.procedure {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

                                                                                                    The body of proc main of module SimulateHonestVerifier, as a procedure of its own: the 2 calls it makes to module parameters (S, A, 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 SimulateHonestVerifier.main.procedure.apply_simp) rather than run. Use SimulateHonestVerifier.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.EC.SigmaProtocol.SimulateHonestVerifier.main {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

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

                                                                                                      Apply it with the @[simp] lemma SimulateHonestVerifier.main.apply_simp, which fills the holes of SimulateHonestVerifier.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.EC.SigmaProtocol.SimulateHonestVerifier.gameReal {statement witness message secret challenge response : Type} [_gaudiParam0 : Inhabited statement] [_gaudiParam1 : Inhabited witness] [_gaudiParam2 : Inhabited message] [_gaudiParam3 : Inhabited secret] [_gaudiParam4 : Inhabited challenge] [_gaudiParam5 : Inhabited response] [_gaudiParam6 : DecidableEq challenge] [_gaudiParam7 : Params statement witness message secret challenge response] :

                                                                                                        proc gameReal of module SimulateHonestVerifier as a module, abstracted over the module parameters it uses (S, D, in declaration order): Module.Arr … (Module.Proc (procsig …)).

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

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