Documentation

GaudisCrypt.Examples.Pedersen.Commitment

Generic commitment schemes #

A transliteration of EasyCrypt's theories/crypto/Commitment.ec (theory CommitmentProtocol) into the Gaudí module/procedure syntax.

Instances For

    Module types #

    module type CommitmentScheme = {
      proc gen() : value
      proc commit(x: value, m: message) : commitment * openingkey
      proc verify(x: value, m: message, c: commitment, d: openingkey) : bool
    }.
    

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

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

    Equations
    Instances For
      @[simp]
      theorem GaudisCrypt.Examples.Pedersen.CommitmentScheme.commit.mk_simp (types : CommitmentTypes) (theRecord✝ : Structure types) :
      commit types (mk types theRecord✝) = theRecord✝.commit

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

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

      @[implicit_reducible]

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

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

      Equations

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

      CommitmentScheme is by definition Module CommitmentScheme.typeRep.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem GaudisCrypt.Examples.Pedersen.CommitmentScheme.mk_destruct (types : CommitmentTypes) (theRecord✝ : Structure types) :
        «structure» types (mk types theRecord✝) = theRecord✝

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

        @[reducible]

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

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

        Equations
        Instances For
          @[simp]
          theorem GaudisCrypt.Examples.Pedersen.CommitmentScheme.destruct_mk (types : CommitmentTypes) (theModule✝ : CommitmentScheme types) :
          mk types («structure» types theModule✝) = theModule✝

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

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

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

          Instances For
            @[simp]
            theorem GaudisCrypt.Examples.Pedersen.CommitmentScheme.verify.mk_simp (types : CommitmentTypes) (theRecord✝ : Structure types) :
            verify types (mk types theRecord✝) = theRecord✝.verify

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

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

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

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

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

            Equations
            Instances For

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Equations
                      Instances For

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

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

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[reducible]
                          noncomputable def GaudisCrypt.Examples.Pedersen.Unhider.mk (types : CommitmentTypes) :
                          Structure types → Unhider types

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

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

                          Equations
                          Instances For

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

                            Unhider is by definition Module Unhider.typeRep.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[simp]
                              theorem GaudisCrypt.Examples.Pedersen.Unhider.mk_destruct (types : CommitmentTypes) (theRecord✝ : Structure types) :
                              «structure» types (mk types theRecord✝) = theRecord✝

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

                              @[simp]
                              theorem GaudisCrypt.Examples.Pedersen.Unhider.guess.mk_simp (types : CommitmentTypes) (theRecord✝ : Structure types) :
                              guess types (mk types theRecord✝) = theRecord✝.guess

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

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

                              @[simp]
                              theorem GaudisCrypt.Examples.Pedersen.Unhider.destruct_mk (types : CommitmentTypes) (theModule✝ : Unhider types) :
                              mk types («structure» types theModule✝) = theModule✝

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

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

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

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

                              Equations
                              Instances For

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

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

                                  The record of a module's fields: Unhider.structure m is Unhider.Structure.mk applied to Unhider.choose, Unhider.guess of m.

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

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[simp]
                                    theorem GaudisCrypt.Examples.Pedersen.Unhider.choose.mk_simp (types : CommitmentTypes) (theRecord✝ : Structure types) :
                                    choose types (mk types theRecord✝) = theRecord✝.choose

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

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

                                    @[implicit_reducible]

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

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

                                    Equations

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

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

                                    Instances For
                                      noncomputable def GaudisCrypt.Examples.Pedersen.Unhider.choose (types : CommitmentTypes) :
                                      Unhider types → procmod (types.Value) → (types.Message × types.Message)

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

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

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

                                      Equations
                                      Instances For

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

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

                                        Equations
                                        Instances For

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

                                          • Unhider.guess.utilities.accessorModule : Unhider →ₘ … — the accessor as a module, a projection being a module morphism;
                                          • Unhider.guess.utilities.apply_simp — Module.app Unhider.guess.utilities.accessorModule m = Unhider.guess m: applying that module is the accessor;
                                          • Unhider.guess.utilities.expression_eq — the same at the level of expressions: (Unhider.guess m).expression = (Unhider.guess.utilities.proj m.expression).reduce.
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            noncomputable def GaudisCrypt.Examples.Pedersen.Binder.bind (types : CommitmentTypes) :
                                            Binder types → procmod (types.Value) → (types.Commitment × types.Message × types.OpeningKey × types.Message × types.OpeningKey)

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

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

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

                                            Equations
                                            Instances For

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

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

                                              Instances For
                                                @[reducible]
                                                noncomputable def GaudisCrypt.Examples.Pedersen.Binder.mk (types : CommitmentTypes) :
                                                Structure types → Binder types

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

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

                                                Equations
                                                Instances For
                                                  @[simp]
                                                  theorem GaudisCrypt.Examples.Pedersen.Binder.destruct_mk (types : CommitmentTypes) (theModule✝ : Binder types) :
                                                  mk types («structure» types theModule✝) = theModule✝

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

                                                  @[simp]
                                                  theorem GaudisCrypt.Examples.Pedersen.Binder.mk_destruct (types : CommitmentTypes) (theRecord✝ : Structure types) :
                                                  «structure» types (mk types theRecord✝) = theRecord✝

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

                                                  @[simp]
                                                  theorem GaudisCrypt.Examples.Pedersen.Binder.bind.mk_simp (types : CommitmentTypes) (theRecord✝ : Structure types) :
                                                  bind types (mk types theRecord✝) = theRecord✝.bind

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

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

                                                  @[implicit_reducible]

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

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

                                                  Equations

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

                                                  Binder is by definition Module Binder.typeRep.

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

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

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

                                                    Equations
                                                    Instances For

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

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

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

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

                                                        Equations
                                                        Instances For
                                                          @[simp]
                                                          theorem GaudisCrypt.Examples.Pedersen.CorrectnessT.destruct_mk (types : CommitmentTypes) (theModule✝ : CorrectnessT types) :
                                                          mk types («structure» types theModule✝) = theModule✝

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

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

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

                                                          Equations
                                                          Instances For
                                                            @[simp]
                                                            theorem GaudisCrypt.Examples.Pedersen.CorrectnessT.mk_destruct (types : CommitmentTypes) (theRecord✝ : Structure types) :
                                                            «structure» types (mk types theRecord✝) = theRecord✝

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

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

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

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

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

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

                                                              Equations
                                                              Instances For

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

                                                                CorrectnessT is by definition Module CorrectnessT.typeRep.

                                                                Equations
                                                                Instances For
                                                                  @[implicit_reducible]

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

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

                                                                  Equations

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

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

                                                                  Instances For
                                                                    @[simp]
                                                                    theorem GaudisCrypt.Examples.Pedersen.CorrectnessT.main.mk_simp (types : CommitmentTypes) (theRecord✝ : Structure types) :
                                                                    main types (mk types theRecord✝) = theRecord✝.main

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

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

                                                                    @[reducible]

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

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

                                                                    Equations
                                                                    Instances For

                                                                      The body of proc main of module Correctness, as a procedure of its own: the 3 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 Correctness.main.procedure.apply_simp) rather than run. Use Correctness.main for this procedure as a module.

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

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

                                                                        @[simp]

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

                                                                        The module declared by module Correctness, abstracted over its single parameter S, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.

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

                                                                        Equations
                                                                        Instances For
                                                                          theorem GaudisCrypt.Examples.Pedersen.Correctness.main.procedure.apply_simp (types : CommitmentTypes) (holeArgs✝ : (HoleSigs.cons (procsig () → types.Value) (HoleSigs.cons (procsig (types.Value, types.Message) → types.Commitment × types.OpeningKey) (HoleSigs.cons (procsig (types.Value, types.Message, types.Commitment, types.OpeningKey) → Bool) HoleSigs.empty))).Instantiation) :
                                                                          (procedure types).instantiate holeArgs✝ = proc (m : types.Message) : Bool { var x : types.Value, c : types.Commitment, d : types.OpeningKey, b : Bool; x <- call (holeArgs✝.lookup HoleIndex.zero) (); c, d <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x, §m); b <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§x, §m, §c, §d); return §b }

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

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

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

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

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

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

                                                                            Equations
                                                                            Instances For
                                                                              @[simp]
                                                                              theorem GaudisCrypt.Examples.Pedersen.HidingExperimentT.mk_destruct (theRecord✝ : Structure) :
                                                                              (mk theRecord✝).structure = theRecord✝

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

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

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

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

                                                                                HidingExperimentT is by definition Module HidingExperimentT.typeRep.

                                                                                Equations
                                                                                Instances For
                                                                                  @[reducible]

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

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

                                                                                  Equations
                                                                                  Instances For
                                                                                    @[implicit_reducible]

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

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

                                                                                    Equations

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

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

                                                                                    Instances For

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

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

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

                                                                                      Equations
                                                                                      • theModule✝.main = theModule✝
                                                                                      Instances For
                                                                                        @[simp]
                                                                                        theorem GaudisCrypt.Examples.Pedersen.HidingExperimentT.main.mk_simp (theRecord✝ : Structure) :
                                                                                        (mk theRecord✝).main = theRecord✝.main

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

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

                                                                                        theorem GaudisCrypt.Examples.Pedersen.HidingExperiment.main.procedure.apply_simp (types : CommitmentTypes) (holeArgs✝ : (HoleSigs.cons (procsig () → types.Value) (HoleSigs.cons (procsig (types.Value) → types.Message × types.Message) (HoleSigs.cons (procsig (types.Value, types.Message) → types.Commitment × types.OpeningKey) (HoleSigs.cons (procsig (types.Commitment) → Bool) HoleSigs.empty)))).Instantiation) :
                                                                                        (procedure types).instantiate holeArgs✝ = proc () : Bool { var x : types.Value, m0 : types.Message, m1 : types.Message, b : Bool, c : types.Commitment, d : types.OpeningKey, b' : Bool; x <- call (holeArgs✝.lookup HoleIndex.zero) (); m0, m1 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§x); b <$ SubProbability.uniform; c, d <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§x, if §b = true then §m1 else §m0); b' <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§c); return §b == §b' }

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

                                                                                        @[simp]

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

                                                                                        The module declared by module HidingExperiment, abstracted over its 2 parameters S, U, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.

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

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

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

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

                                                                                            @[simp]: applying HidingExperiment.main to the parameters proc main uses (S, U) is Module.proc (HidingExperiment.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.

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

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

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

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

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

                                                                                              Equations

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

                                                                                              BindingExperimentT is by definition Module BindingExperimentT.typeRep.

                                                                                              Equations
                                                                                              Instances For

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

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

                                                                                                Equations
                                                                                                Instances For

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

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

                                                                                                  Instances For
                                                                                                    @[simp]
                                                                                                    theorem GaudisCrypt.Examples.Pedersen.BindingExperimentT.mk_destruct (theRecord✝ : Structure) :
                                                                                                    (mk theRecord✝).structure = theRecord✝

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

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

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

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

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

                                                                                                      @[reducible]

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

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

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        @[simp]

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

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

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

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

                                                                                                        Equations
                                                                                                        • theModule✝.main = theModule✝
                                                                                                        Instances For
                                                                                                          @[simp]

                                                                                                          @[simp]: applying BindingExperiment.main to the parameters proc main uses (S, B) is Module.proc (BindingExperiment.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.

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

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

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

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

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

                                                                                                              The module declared by module BindingExperiment, abstracted over its 2 parameters S, B, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.

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

                                                                                                              Equations
                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                              Instances For
                                                                                                                theorem GaudisCrypt.Examples.Pedersen.BindingExperiment.main.procedure.apply_simp (types : CommitmentTypes) (holeArgs✝ : (HoleSigs.cons (procsig () → types.Value) (HoleSigs.cons (procsig (types.Value) → types.Commitment × types.Message × types.OpeningKey × types.Message × types.OpeningKey) (HoleSigs.cons (procsig (types.Value, types.Message, types.Commitment, types.OpeningKey) → Bool) HoleSigs.empty))).Instantiation) :
                                                                                                                (procedure types).instantiate holeArgs✝ = proc () : Bool { var c : types.Commitment, m : types.Message, d : types.OpeningKey, m' : types.Message, d' : types.OpeningKey, v : Bool, v' : Bool; have _ : DecidableEq types.Message := Classical.decEq types.Message; (localVarLens "x" types.Value) <- call (holeArgs✝.lookup HoleIndex.zero) (); c, m, d, m', d' <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§(localVarLens "x" types.Value)); v <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§(localVarLens "x" types.Value), §m, §c, §d); v' <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§(localVarLens "x" types.Value), §m', §c, §d'); return §v && §v' && !§m == §m' }

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

                                                                                                                @[simp]

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