Generic commitment schemes #
A transliteration of EasyCrypt's theories/crypto/Commitment.ec (theory
CommitmentProtocol) into the Gaudí module/procedure syntax.
- EC's abstract theory types
value,message,commitment,openingkeybecome the fields of the structureCommitmentTypes, declared here as a sectionvariable (types : CommitmentTypes)and hence a Lean parameter of everymoduletypeandmodulebelow that mentions one of them. - EC
module types becomemoduletypes. - EC's parameterized modules (
Correctness(S),HidingExperiment(S,U),BindingExperiment(S,B)) becomemodule X … using (P : T) { … }declarations: the calls are written against the parameters' own fields and the holes are inferred from them.
- Value : Type
- Message : Type
- Commitment : Type
- OpeningKey : Type
- commitment_inhabited : Inhabited self.Commitment
- openingKey_inhabited : Inhabited self.OpeningKey
Instances For
Equations
Equations
Equations
Equations
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]: 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.
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
- GaudisCrypt.Examples.Pedersen.instIsModuleCommitmentScheme types = { moduleTypeRep := GaudisCrypt.Examples.Pedersen.CommitmentScheme.typeRep types, isModule := ⋯ }
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]: CommitmentScheme.structure (CommitmentScheme.mk r) = r — destructing a module built from a record gives that record back.
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
- GaudisCrypt.Examples.Pedersen.CommitmentScheme.mk types theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.gen (GaudisCrypt.Module.pair' theRecord✝.commit theRecord✝.verify)
Instances For
@[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]: 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
- GaudisCrypt.Examples.Pedersen.CommitmentScheme.verify types theModule✝ = (GaudisCrypt.Module.snd' theModule✝).snd'
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]: 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
- GaudisCrypt.Examples.Pedersen.CommitmentScheme.commit types theModule✝ = (GaudisCrypt.Module.snd' theModule✝).fst'
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
- GaudisCrypt.Examples.Pedersen.CommitmentScheme.gen types theModule✝ = GaudisCrypt.Module.fst' theModule✝
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
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
- GaudisCrypt.Examples.Pedersen.Unhider.mk types theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.choose theRecord✝.guess
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]: Unhider.structure (Unhider.mk r) = r — destructing a module built from a record gives that record back.
@[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]: 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
- GaudisCrypt.Examples.Pedersen.Unhider.guess types theModule✝ = GaudisCrypt.Module.snd' theModule✝
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]: 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.
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
- GaudisCrypt.Examples.Pedersen.instIsModuleUnhider types = { moduleTypeRep := GaudisCrypt.Examples.Pedersen.Unhider.typeRep types, isModule := ⋯ }
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
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
- GaudisCrypt.Examples.Pedersen.Unhider.choose types theModule✝ = GaudisCrypt.Module.fst' theModule✝
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
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
- GaudisCrypt.Examples.Pedersen.Binder.bind types theModule✝ = theModule✝
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.
- bind : procmod (types.Value) → (types.Commitment × types.Message × types.OpeningKey × types.Message × types.OpeningKey)
Instances For
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
- GaudisCrypt.Examples.Pedersen.Binder.mk types theRecord✝ = theRecord✝.bind
Instances For
@[simp]: Binder.mk (Binder.structure m) = m — rebuilding a module from its own fields gives that module back.
@[simp]: Binder.structure (Binder.mk r) = r — destructing a module built from a record gives that record back.
@[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.
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
- GaudisCrypt.Examples.Pedersen.instIsModuleBinder types = { moduleTypeRep := GaudisCrypt.Examples.Pedersen.Binder.typeRep types, isModule := ⋯ }
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
- GaudisCrypt.Examples.Pedersen.Binder.structure types theModule✝ = { bind := GaudisCrypt.Examples.Pedersen.Binder.bind types theModule✝ }
Instances For
The record of a module's fields: CorrectnessT.structure m is CorrectnessT.Structure.mk applied to CorrectnessT.main of m.
Inverse of CorrectnessT.mk (CorrectnessT.mk_destruct, CorrectnessT.destruct_mk).
Equations
- GaudisCrypt.Examples.Pedersen.CorrectnessT.structure types theModule✝ = { main := GaudisCrypt.Examples.Pedersen.CorrectnessT.main types theModule✝ }
Instances For
@[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]: 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
- GaudisCrypt.Examples.Pedersen.CorrectnessT.main types theModule✝ = theModule✝
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
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
- GaudisCrypt.Examples.Pedersen.instIsModuleCorrectnessT types = { moduleTypeRep := GaudisCrypt.Examples.Pedersen.CorrectnessT.typeRep types, isModule := ⋯ }
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]: 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.
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
- GaudisCrypt.Examples.Pedersen.CorrectnessT.mk types theRecord✝ = theRecord✝.main
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]: 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]: 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
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]: 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]: 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
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
- GaudisCrypt.Examples.Pedersen.HidingExperimentT.mk theRecord✝ = theRecord✝.main
Instances For
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
- GaudisCrypt.Examples.Pedersen.instIsModuleHidingExperimentT = { moduleTypeRep := GaudisCrypt.Examples.Pedersen.HidingExperimentT.typeRep, isModule := ⋯ }
The record of a module's fields: HidingExperimentT.structure m is HidingExperimentT.Structure.mk applied to HidingExperimentT.main of m.
Inverse of HidingExperimentT.mk (HidingExperimentT.mk_destruct, HidingExperimentT.destruct_mk).
Instances For
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]).
Instances For
@[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.
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]: 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]: 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
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
- GaudisCrypt.Examples.Pedersen.instIsModuleBindingExperimentT = { moduleTypeRep := GaudisCrypt.Examples.Pedersen.BindingExperimentT.typeRep, isModule := ⋯ }
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]: 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]: 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.
The record of a module's fields: BindingExperimentT.structure m is BindingExperimentT.Structure.mk applied to BindingExperimentT.main of m.
Inverse of BindingExperimentT.mk (BindingExperimentT.mk_destruct, BindingExperimentT.destruct_mk).
Instances For
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
- GaudisCrypt.Examples.Pedersen.BindingExperimentT.mk theRecord✝ = theRecord✝.main
Instances For
@[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]).
Instances For
@[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
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]: 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.