Indifferentiability with failing oracles (EasyCrypt proof/OptionIndifferentiability.eca) — #
EC-fidelity port
Indifferentiability.eca with procedures that may fail: the primitive and the functionality
return options, and every name gets an O prefix. The translation is that of
Indifferentiability.lean: the theory's types are outParams of the (field-less) class
Params p f_in f_out, so a clone is clone OptionIndifferentiability as OIndif with type p <- …
(Syntax/Clone.lean); EC's subtyping of module types is module_subtype; EC's call
restrictions ({ P.f }) are not part of a module type (exception E2 of the port), they are the
ext of declare module's representability.
Declarations of the first port #
Definitions and plain lemmas of the first port of this file (2026-10/11) that the proofs below use; its program-logic proofs are gone.
The ModuleTypeRep underlying OPRIMITIVE, the module type declared by moduletype OPRIMITIVE: the right-nested product of its 3 field types, in declaration order.
OPRIMITIVE is by definition Module OPRIMITIVE.typeRep.
Equations
- One or more equations did not get rendered due to their size.
Instances For
What is derivable about the accessor OPRIMITIVE.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OPRIMITIVE.init.utilities.accessorModule : OPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;OPRIMITIVE.init.utilities.apply_simp—Module.app OPRIMITIVE.init.utilities.accessorModule m = OPRIMITIVE.init m: applying that module is the accessor;OPRIMITIVE.init.utilities.expression_eq— the same at the level of expressions:(OPRIMITIVE.init m).expression = (OPRIMITIVE.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The field init of a module of type OPRIMITIVE: the projection onto component 0 of the right-nested tuple OPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OPRIMITIVE.init.mk_simp reads this field back off a module built by OPRIMITIVE.mk; OPRIMITIVE.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.OPRIMITIVE.init p f_in f_out theModule✝ = GaudisCrypt.Module.fst' theModule✝
Instances For
@[simp]: reading the field init back off a module built from a record — OPRIMITIVE.init (OPRIMITIVE.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an OPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
The record of a module's fields: OPRIMITIVE.structure m is OPRIMITIVE.Structure.mk applied to OPRIMITIVE.init, OPRIMITIVE.f, OPRIMITIVE.fi of m.
Inverse of OPRIMITIVE.mk (OPRIMITIVE.mk_destruct, OPRIMITIVE.destruct_mk).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module type declared by moduletype OPRIMITIVE, with fields init, f, fi: the type Module OPRIMITIVE.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with OPRIMITIVE.mk, read a single field off one with the accessors OPRIMITIVE.init, OPRIMITIVE.f, OPRIMITIVE.fi, and get the whole record back with OPRIMITIVE.structure.
Equations
Instances For
@[simp]: OPRIMITIVE.mk (OPRIMITIVE.structure m) = m — rebuilding a module from its own fields gives that module back.
Builds a module of type OPRIMITIVE from the record OPRIMITIVE.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of OPRIMITIVE.structure (OPRIMITIVE.mk_destruct, OPRIMITIVE.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas OPRIMITIVE.init.mk_simp, OPRIMITIVE.f.mk_simp, OPRIMITIVE.fi.mk_simp.
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.OPRIMITIVE.mk p f_in f_out theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init (GaudisCrypt.Module.pair' theRecord✝.f theRecord✝.fi)
Instances For
The IsModule OPRIMITIVE instance: OPRIMITIVE is a module type, with representation OPRIMITIVE.typeRep.
It is what lets the name OPRIMITIVE stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module OPRIMITIVE.typeRep would do on its own but OPRIMITIVE, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.instIsModuleOPRIMITIVE p f_in f_out = { moduleTypeRep := GaudisCrypt.SHA3.OptionIndifferentiability.OPRIMITIVE.typeRep p f_in f_out, isModule := ⋯ }
The field fi of a module of type OPRIMITIVE: the projection onto component 2 of the right-nested tuple OPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OPRIMITIVE.fi.mk_simp reads this field back off a module built by OPRIMITIVE.mk; OPRIMITIVE.fi.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.OPRIMITIVE.fi p f_in f_out theModule✝ = (GaudisCrypt.Module.snd' theModule✝).snd'
Instances For
The record of the fields of a module of type OPRIMITIVE: the fields init, f, fi, one per moduletype field, each of that field's own module type.
OPRIMITIVE.mk turns such a record into a OPRIMITIVE, OPRIMITIVE.structure turns a OPRIMITIVE back into one.
Instances For
@[simp]: reading the field f back off a module built from a record — OPRIMITIVE.f (OPRIMITIVE.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an OPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
@[simp]: reading the field fi back off a module built from a record — OPRIMITIVE.fi (OPRIMITIVE.mk r) = r.fi.
It is what carries the right-hand side of an X.apply_simp (which is an OPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.fi.apply_simp.
What is derivable about the accessor OPRIMITIVE.fi, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OPRIMITIVE.fi.utilities.accessorModule : OPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;OPRIMITIVE.fi.utilities.apply_simp—Module.app OPRIMITIVE.fi.utilities.accessorModule m = OPRIMITIVE.fi m: applying that module is the accessor;OPRIMITIVE.fi.utilities.expression_eq— the same at the level of expressions:(OPRIMITIVE.fi m).expression = (OPRIMITIVE.fi.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The field f of a module of type OPRIMITIVE: the projection onto component 1 of the right-nested tuple OPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OPRIMITIVE.f.mk_simp reads this field back off a module built by OPRIMITIVE.mk; OPRIMITIVE.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.OPRIMITIVE.f p f_in f_out theModule✝ = (GaudisCrypt.Module.snd' theModule✝).fst'
Instances For
@[simp]: OPRIMITIVE.structure (OPRIMITIVE.mk r) = r — destructing a module built from a record gives that record back.
What is derivable about the accessor OPRIMITIVE.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OPRIMITIVE.f.utilities.accessorModule : OPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;OPRIMITIVE.f.utilities.apply_simp—Module.app OPRIMITIVE.f.utilities.accessorModule m = OPRIMITIVE.f m: applying that module is the accessor;OPRIMITIVE.f.utilities.expression_eq— the same at the level of expressions:(OPRIMITIVE.f m).expression = (OPRIMITIVE.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Builds a module of type ODPRIMITIVE from the record ODPRIMITIVE.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of ODPRIMITIVE.structure (ODPRIMITIVE.mk_destruct, ODPRIMITIVE.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas ODPRIMITIVE.f.mk_simp, ODPRIMITIVE.fi.mk_simp.
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.ODPRIMITIVE.mk p f_in f_out theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.f theRecord✝.fi
Instances For
The record of the fields of a module of type ODPRIMITIVE: the fields f, fi, one per moduletype field, each of that field's own module type.
ODPRIMITIVE.mk turns such a record into a ODPRIMITIVE, ODPRIMITIVE.structure turns a ODPRIMITIVE back into one.
Instances For
The module type declared by moduletype ODPRIMITIVE, with fields f, fi: the type Module ODPRIMITIVE.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with ODPRIMITIVE.mk, read a single field off one with the accessors ODPRIMITIVE.f, ODPRIMITIVE.fi, and get the whole record back with ODPRIMITIVE.structure.
Equations
Instances For
@[simp]: ODPRIMITIVE.structure (ODPRIMITIVE.mk r) = r — destructing a module built from a record gives that record back.
What is derivable about the accessor ODPRIMITIVE.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
ODPRIMITIVE.f.utilities.accessorModule : ODPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;ODPRIMITIVE.f.utilities.apply_simp—Module.app ODPRIMITIVE.f.utilities.accessorModule m = ODPRIMITIVE.f m: applying that module is the accessor;ODPRIMITIVE.f.utilities.expression_eq— the same at the level of expressions:(ODPRIMITIVE.f m).expression = (ODPRIMITIVE.f.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: ODPRIMITIVE.structure m is ODPRIMITIVE.Structure.mk applied to ODPRIMITIVE.f, ODPRIMITIVE.fi of m.
Inverse of ODPRIMITIVE.mk (ODPRIMITIVE.mk_destruct, ODPRIMITIVE.destruct_mk).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The IsModule ODPRIMITIVE instance: ODPRIMITIVE is a module type, with representation ODPRIMITIVE.typeRep.
It is what lets the name ODPRIMITIVE stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module ODPRIMITIVE.typeRep would do on its own but ODPRIMITIVE, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.instIsModuleODPRIMITIVE p f_in f_out = { moduleTypeRep := GaudisCrypt.SHA3.OptionIndifferentiability.ODPRIMITIVE.typeRep p f_in f_out, isModule := ⋯ }
@[simp]: reading the field f back off a module built from a record — ODPRIMITIVE.f (ODPRIMITIVE.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an ODPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The ModuleTypeRep underlying ODPRIMITIVE, the module type declared by moduletype ODPRIMITIVE: the right-nested product of its 2 field types, in declaration order.
ODPRIMITIVE is by definition Module ODPRIMITIVE.typeRep.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The field fi of a module of type ODPRIMITIVE: the projection onto component 1 of the right-nested tuple ODPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
ODPRIMITIVE.fi.mk_simp reads this field back off a module built by ODPRIMITIVE.mk; ODPRIMITIVE.fi.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.ODPRIMITIVE.fi p f_in f_out theModule✝ = GaudisCrypt.Module.snd' theModule✝
Instances For
What is derivable about the accessor ODPRIMITIVE.fi, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
ODPRIMITIVE.fi.utilities.accessorModule : ODPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;ODPRIMITIVE.fi.utilities.apply_simp—Module.app ODPRIMITIVE.fi.utilities.accessorModule m = ODPRIMITIVE.fi m: applying that module is the accessor;ODPRIMITIVE.fi.utilities.expression_eq— the same at the level of expressions:(ODPRIMITIVE.fi m).expression = (ODPRIMITIVE.fi.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: reading the field fi back off a module built from a record — ODPRIMITIVE.fi (ODPRIMITIVE.mk r) = r.fi.
It is what carries the right-hand side of an X.apply_simp (which is an ODPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.fi.apply_simp.
The field f of a module of type ODPRIMITIVE: the projection onto component 0 of the right-nested tuple ODPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
ODPRIMITIVE.f.mk_simp reads this field back off a module built by ODPRIMITIVE.mk; ODPRIMITIVE.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.ODPRIMITIVE.f p f_in f_out theModule✝ = GaudisCrypt.Module.fst' theModule✝
Instances For
@[simp]: ODPRIMITIVE.mk (ODPRIMITIVE.structure m) = m — rebuilding a module from its own fields gives that module back.
What is derivable about the accessor OFUNCTIONALITY.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OFUNCTIONALITY.init.utilities.accessorModule : OFUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;OFUNCTIONALITY.init.utilities.apply_simp—Module.app OFUNCTIONALITY.init.utilities.accessorModule m = OFUNCTIONALITY.init m: applying that module is the accessor;OFUNCTIONALITY.init.utilities.expression_eq— the same at the level of expressions:(OFUNCTIONALITY.init m).expression = (OFUNCTIONALITY.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ModuleTypeRep underlying OFUNCTIONALITY, the module type declared by moduletype OFUNCTIONALITY: the right-nested product of its 2 field types, in declaration order.
OFUNCTIONALITY is by definition Module OFUNCTIONALITY.typeRep.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of a module's fields: OFUNCTIONALITY.structure m is OFUNCTIONALITY.Structure.mk applied to OFUNCTIONALITY.init, OFUNCTIONALITY.f of m.
Inverse of OFUNCTIONALITY.mk (OFUNCTIONALITY.mk_destruct, OFUNCTIONALITY.destruct_mk).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The field init of a module of type OFUNCTIONALITY: the projection onto component 0 of the right-nested tuple OFUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OFUNCTIONALITY.init.mk_simp reads this field back off a module built by OFUNCTIONALITY.mk; OFUNCTIONALITY.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.OFUNCTIONALITY.init p f_in f_out theModule✝ = GaudisCrypt.Module.fst' theModule✝
Instances For
@[simp]: OFUNCTIONALITY.mk (OFUNCTIONALITY.structure m) = m — rebuilding a module from its own fields gives that module back.
@[simp]: reading the field init back off a module built from a record — OFUNCTIONALITY.init (OFUNCTIONALITY.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an OFUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
@[simp]: OFUNCTIONALITY.structure (OFUNCTIONALITY.mk r) = r — destructing a module built from a record gives that record back.
What is derivable about the accessor OFUNCTIONALITY.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OFUNCTIONALITY.f.utilities.accessorModule : OFUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;OFUNCTIONALITY.f.utilities.apply_simp—Module.app OFUNCTIONALITY.f.utilities.accessorModule m = OFUNCTIONALITY.f m: applying that module is the accessor;OFUNCTIONALITY.f.utilities.expression_eq— the same at the level of expressions:(OFUNCTIONALITY.f m).expression = (OFUNCTIONALITY.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Builds a module of type OFUNCTIONALITY from the record OFUNCTIONALITY.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of OFUNCTIONALITY.structure (OFUNCTIONALITY.mk_destruct, OFUNCTIONALITY.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas OFUNCTIONALITY.init.mk_simp, OFUNCTIONALITY.f.mk_simp.
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.OFUNCTIONALITY.mk p f_in f_out theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init theRecord✝.f
Instances For
@[simp]: reading the field f back off a module built from a record — OFUNCTIONALITY.f (OFUNCTIONALITY.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an OFUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The field f of a module of type OFUNCTIONALITY: the projection onto component 1 of the right-nested tuple OFUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OFUNCTIONALITY.f.mk_simp reads this field back off a module built by OFUNCTIONALITY.mk; OFUNCTIONALITY.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.OFUNCTIONALITY.f p f_in f_out theModule✝ = GaudisCrypt.Module.snd' theModule✝
Instances For
The module type declared by moduletype OFUNCTIONALITY, with fields init, f: the type Module OFUNCTIONALITY.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with OFUNCTIONALITY.mk, read a single field off one with the accessors OFUNCTIONALITY.init, OFUNCTIONALITY.f, and get the whole record back with OFUNCTIONALITY.structure.
Equations
Instances For
The record of the fields of a module of type OFUNCTIONALITY: the fields init, f, one per moduletype field, each of that field's own module type.
OFUNCTIONALITY.mk turns such a record into a OFUNCTIONALITY, OFUNCTIONALITY.structure turns a OFUNCTIONALITY back into one.
Instances For
The IsModule OFUNCTIONALITY instance: OFUNCTIONALITY is a module type, with representation OFUNCTIONALITY.typeRep.
It is what lets the name OFUNCTIONALITY stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module OFUNCTIONALITY.typeRep would do on its own but OFUNCTIONALITY, a plain (non-reducible) def, would not.
Equations
- One or more equations did not get rendered due to their size.
The record of the fields of a module of type ODFUNCTIONALITY: the fields f, one per moduletype field, each of that field's own module type.
ODFUNCTIONALITY.mk turns such a record into a ODFUNCTIONALITY, ODFUNCTIONALITY.structure turns a ODFUNCTIONALITY back into one.
Instances For
@[simp]: reading the field f back off a module built from a record — ODFUNCTIONALITY.f (ODFUNCTIONALITY.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an ODFUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The ModuleTypeRep underlying ODFUNCTIONALITY, the module type declared by moduletype ODFUNCTIONALITY: the right-nested product of its 1 field types, in declaration order.
ODFUNCTIONALITY is by definition Module ODFUNCTIONALITY.typeRep.
Equations
Instances For
The field f of a module of type ODFUNCTIONALITY: the projection onto component 0 of the right-nested tuple ODFUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
ODFUNCTIONALITY.f.mk_simp reads this field back off a module built by ODFUNCTIONALITY.mk; ODFUNCTIONALITY.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.ODFUNCTIONALITY.f p f_in f_out theModule✝ = theModule✝
Instances For
Builds a module of type ODFUNCTIONALITY from the record ODFUNCTIONALITY.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of ODFUNCTIONALITY.structure (ODFUNCTIONALITY.mk_destruct, ODFUNCTIONALITY.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas ODFUNCTIONALITY.f.mk_simp.
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.ODFUNCTIONALITY.mk p f_in f_out theRecord✝ = theRecord✝.f
Instances For
@[simp]: ODFUNCTIONALITY.mk (ODFUNCTIONALITY.structure m) = m — rebuilding a module from its own fields gives that module back.
The module type declared by moduletype ODFUNCTIONALITY, with fields f: the type Module ODFUNCTIONALITY.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with ODFUNCTIONALITY.mk, read a single field off one with the accessors ODFUNCTIONALITY.f, and get the whole record back with ODFUNCTIONALITY.structure.
Equations
Instances For
What is derivable about the accessor ODFUNCTIONALITY.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
ODFUNCTIONALITY.f.utilities.accessorModule : ODFUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;ODFUNCTIONALITY.f.utilities.apply_simp—Module.app ODFUNCTIONALITY.f.utilities.accessorModule m = ODFUNCTIONALITY.f m: applying that module is the accessor;ODFUNCTIONALITY.f.utilities.expression_eq— the same at the level of expressions:(ODFUNCTIONALITY.f m).expression = (ODFUNCTIONALITY.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: ODFUNCTIONALITY.structure (ODFUNCTIONALITY.mk r) = r — destructing a module built from a record gives that record back.
The IsModule ODFUNCTIONALITY instance: ODFUNCTIONALITY is a module type, with representation ODFUNCTIONALITY.typeRep.
It is what lets the name ODFUNCTIONALITY stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module ODFUNCTIONALITY.typeRep would do on its own but ODFUNCTIONALITY, a plain (non-reducible) def, would not.
Equations
- One or more equations did not get rendered due to their size.
The record of a module's fields: ODFUNCTIONALITY.structure m is ODFUNCTIONALITY.Structure.mk applied to ODFUNCTIONALITY.f of m.
Inverse of ODFUNCTIONALITY.mk (ODFUNCTIONALITY.mk_destruct, ODFUNCTIONALITY.destruct_mk).
Equations
- GaudisCrypt.SHA3.OptionIndifferentiability.ODFUNCTIONALITY.structure p f_in f_out theModule✝ = { f := GaudisCrypt.SHA3.OptionIndifferentiability.ODFUNCTIONALITY.f p f_in f_out theModule✝ }
Instances For
EasyCrypt's module type OCONSTRUCTION (P : ODPRIMITIVE) = { proc init() : unit {} proc f(x : f_in): f_out option { P.f } }: a construction takes a primitive and builds a
functionality.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EasyCrypt's module type OSIMULATOR (F : ODFUNCTIONALITY) = { proc init() : unit { } proc f(x : p) : p option { F.f } proc fi(x : p) : p option { F.f } }: a simulator takes a
functionality and simulates the primitive.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EasyCrypt's module type ODISTINGUISHER (F : ODFUNCTIONALITY, P : ODPRIMITIVE) = { proc distinguish(): bool }: a distinguisher gets oracle access to a primitive and a
functionality and returns its guess.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The distinguisher's view of a functionality (EasyCrypt's subtyping OFUNCTIONALITY <: ODFUNCTIONALITY).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The distinguisher's view of a primitive (EasyCrypt's subtyping OPRIMITIVE <: ODPRIMITIVE).
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying OIndif.main to the parameters proc main uses (F, P, D) is Module.proc (OIndif.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 OIndif as a module, abstracted over the module parameters it uses (F, P, D, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma OIndif.main.apply_simp, which fills the holes of OIndif.main.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying OIndif to a tuple of its 3 parameters F, P, D — the record of its procedures OIndif.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 OIndif.main.apply_simp to fill that procedure's holes.
The body of proc main of module OIndif, as a procedure of its own: the 3 calls it makes to module parameters (F, P, D) are its holes, in the order the body makes them.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see OIndif.main.procedure.apply_simp) rather than run. Use OIndif.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 OIndif, abstracted over its 3 parameters F, P, D, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures OIndif.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma OIndif.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of OIndif.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 [OIndif.main.procedure.apply_simp]).
module OGReal(C : OCONSTRUCTION, P : OPRIMITIVE) = OIndif(C(P), P).
Equations
- One or more equations did not get rendered due to their size.
Instances For
module OGIdeal(F : OFUNCTIONALITY, S : OSIMULATOR) = OIndif(F, S(F)).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's type p., type f_in, f_out.: the theory's types (a clone fixes them).
Instances
A primitive: the building block we assume ideal.
The field init of a module of type OPRIMITIVE: the projection onto component 0 of the right-nested tuple OPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OPRIMITIVE.init.mk_simp reads this field back off a module built by OPRIMITIVE.mk; OPRIMITIVE.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- theModule✝.init = GaudisCrypt.Module.fst' theModule✝
Instances For
What is derivable about the accessor OPRIMITIVE.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OPRIMITIVE.f.utilities.accessorModule : OPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;OPRIMITIVE.f.utilities.apply_simp—Module.app OPRIMITIVE.f.utilities.accessorModule m = OPRIMITIVE.f m: applying that module is the accessor;OPRIMITIVE.f.utilities.expression_eq— the same at the level of expressions:(OPRIMITIVE.f m).expression = (OPRIMITIVE.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The field f of a module of type OPRIMITIVE: the projection onto component 1 of the right-nested tuple OPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OPRIMITIVE.f.mk_simp reads this field back off a module built by OPRIMITIVE.mk; OPRIMITIVE.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- theModule✝.f = (GaudisCrypt.Module.snd' theModule✝).fst'
Instances For
@[simp]: reading the field fi back off a module built from a record — OPRIMITIVE.fi (OPRIMITIVE.mk r) = r.fi.
It is what carries the right-hand side of an X.apply_simp (which is an OPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.fi.apply_simp.
@[simp]: OPRIMITIVE.mk (OPRIMITIVE.structure m) = m — rebuilding a module from its own fields gives that module back.
The IsModule OPRIMITIVE instance: OPRIMITIVE is a module type, with representation OPRIMITIVE.typeRep.
It is what lets the name OPRIMITIVE stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module OPRIMITIVE.typeRep would do on its own but OPRIMITIVE, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Pilot.OptionIndifferentiability.instIsModuleOPRIMITIVE = { moduleTypeRep := GaudisCrypt.SHA3.Pilot.OptionIndifferentiability.OPRIMITIVE.typeRep, isModule := ⋯ }
@[simp]: OPRIMITIVE.structure (OPRIMITIVE.mk r) = r — destructing a module built from a record gives that record back.
The field fi of a module of type OPRIMITIVE: the projection onto component 2 of the right-nested tuple OPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OPRIMITIVE.fi.mk_simp reads this field back off a module built by OPRIMITIVE.mk; OPRIMITIVE.fi.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- theModule✝.fi = (GaudisCrypt.Module.snd' theModule✝).snd'
Instances For
The record of a module's fields: OPRIMITIVE.structure m is OPRIMITIVE.Structure.mk applied to OPRIMITIVE.init, OPRIMITIVE.f, OPRIMITIVE.fi of m.
Inverse of OPRIMITIVE.mk (OPRIMITIVE.mk_destruct, OPRIMITIVE.destruct_mk).
Instances For
The module type declared by moduletype OPRIMITIVE, with fields init, f, fi: the type Module OPRIMITIVE.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with OPRIMITIVE.mk, read a single field off one with the accessors OPRIMITIVE.init, OPRIMITIVE.f, OPRIMITIVE.fi, and get the whole record back with OPRIMITIVE.structure.
Equations
Instances For
What is derivable about the accessor OPRIMITIVE.fi, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OPRIMITIVE.fi.utilities.accessorModule : OPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;OPRIMITIVE.fi.utilities.apply_simp—Module.app OPRIMITIVE.fi.utilities.accessorModule m = OPRIMITIVE.fi m: applying that module is the accessor;OPRIMITIVE.fi.utilities.expression_eq— the same at the level of expressions:(OPRIMITIVE.fi m).expression = (OPRIMITIVE.fi.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: reading the field init back off a module built from a record — OPRIMITIVE.init (OPRIMITIVE.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an OPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
The record of the fields of a module of type OPRIMITIVE: the fields init, f, fi, one per moduletype field, each of that field's own module type.
OPRIMITIVE.mk turns such a record into a OPRIMITIVE, OPRIMITIVE.structure turns a OPRIMITIVE back into one.
Instances For
Builds a module of type OPRIMITIVE from the record OPRIMITIVE.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of OPRIMITIVE.structure (OPRIMITIVE.mk_destruct, OPRIMITIVE.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas OPRIMITIVE.init.mk_simp, OPRIMITIVE.f.mk_simp, OPRIMITIVE.fi.mk_simp.
Equations
- GaudisCrypt.SHA3.Pilot.OptionIndifferentiability.OPRIMITIVE.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init (GaudisCrypt.Module.pair' theRecord✝.f theRecord✝.fi)
Instances For
@[simp]: reading the field f back off a module built from a record — OPRIMITIVE.f (OPRIMITIVE.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an OPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
What is derivable about the accessor OPRIMITIVE.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OPRIMITIVE.init.utilities.accessorModule : OPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;OPRIMITIVE.init.utilities.apply_simp—Module.app OPRIMITIVE.init.utilities.accessorModule m = OPRIMITIVE.init m: applying that module is the accessor;OPRIMITIVE.init.utilities.expression_eq— the same at the level of expressions:(OPRIMITIVE.init m).expression = (OPRIMITIVE.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ModuleTypeRep underlying OPRIMITIVE, the module type declared by moduletype OPRIMITIVE: the right-nested product of its 3 field types, in declaration order.
OPRIMITIVE is by definition Module OPRIMITIVE.typeRep.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module type declared by moduletype ODPRIMITIVE, with fields f, fi: the type Module ODPRIMITIVE.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with ODPRIMITIVE.mk, read a single field off one with the accessors ODPRIMITIVE.f, ODPRIMITIVE.fi, and get the whole record back with ODPRIMITIVE.structure.
Equations
Instances For
The IsModule ODPRIMITIVE instance: ODPRIMITIVE is a module type, with representation ODPRIMITIVE.typeRep.
It is what lets the name ODPRIMITIVE stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module ODPRIMITIVE.typeRep would do on its own but ODPRIMITIVE, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Pilot.OptionIndifferentiability.instIsModuleODPRIMITIVE = { moduleTypeRep := GaudisCrypt.SHA3.Pilot.OptionIndifferentiability.ODPRIMITIVE.typeRep, isModule := ⋯ }
What is derivable about the accessor ODPRIMITIVE.fi, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
ODPRIMITIVE.fi.utilities.accessorModule : ODPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;ODPRIMITIVE.fi.utilities.apply_simp—Module.app ODPRIMITIVE.fi.utilities.accessorModule m = ODPRIMITIVE.fi m: applying that module is the accessor;ODPRIMITIVE.fi.utilities.expression_eq— the same at the level of expressions:(ODPRIMITIVE.fi m).expression = (ODPRIMITIVE.fi.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ModuleTypeRep underlying ODPRIMITIVE, the module type declared by moduletype ODPRIMITIVE: the right-nested product of its 2 field types, in declaration order.
ODPRIMITIVE is by definition Module ODPRIMITIVE.typeRep.
Equations
Instances For
The record of the fields of a module of type ODPRIMITIVE: the fields f, fi, one per moduletype field, each of that field's own module type.
ODPRIMITIVE.mk turns such a record into a ODPRIMITIVE, ODPRIMITIVE.structure turns a ODPRIMITIVE back into one.
Instances For
The field fi of a module of type ODPRIMITIVE: the projection onto component 1 of the right-nested tuple ODPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
ODPRIMITIVE.fi.mk_simp reads this field back off a module built by ODPRIMITIVE.mk; ODPRIMITIVE.fi.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- theModule✝.fi = GaudisCrypt.Module.snd' theModule✝
Instances For
Builds a module of type ODPRIMITIVE from the record ODPRIMITIVE.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of ODPRIMITIVE.structure (ODPRIMITIVE.mk_destruct, ODPRIMITIVE.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas ODPRIMITIVE.f.mk_simp, ODPRIMITIVE.fi.mk_simp.
Equations
- GaudisCrypt.SHA3.Pilot.OptionIndifferentiability.ODPRIMITIVE.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.f theRecord✝.fi
Instances For
@[simp]: reading the field fi back off a module built from a record — ODPRIMITIVE.fi (ODPRIMITIVE.mk r) = r.fi.
It is what carries the right-hand side of an X.apply_simp (which is an ODPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.fi.apply_simp.
What is derivable about the accessor ODPRIMITIVE.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
ODPRIMITIVE.f.utilities.accessorModule : ODPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;ODPRIMITIVE.f.utilities.apply_simp—Module.app ODPRIMITIVE.f.utilities.accessorModule m = ODPRIMITIVE.f m: applying that module is the accessor;ODPRIMITIVE.f.utilities.expression_eq— the same at the level of expressions:(ODPRIMITIVE.f m).expression = (ODPRIMITIVE.f.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: ODPRIMITIVE.structure m is ODPRIMITIVE.Structure.mk applied to ODPRIMITIVE.f, ODPRIMITIVE.fi of m.
Inverse of ODPRIMITIVE.mk (ODPRIMITIVE.mk_destruct, ODPRIMITIVE.destruct_mk).
Instances For
@[simp]: ODPRIMITIVE.mk (ODPRIMITIVE.structure m) = m — rebuilding a module from its own fields gives that module back.
@[simp]: reading the field f back off a module built from a record — ODPRIMITIVE.f (ODPRIMITIVE.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an ODPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The field f of a module of type ODPRIMITIVE: the projection onto component 0 of the right-nested tuple ODPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
ODPRIMITIVE.f.mk_simp reads this field back off a module built by ODPRIMITIVE.mk; ODPRIMITIVE.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- theModule✝.f = GaudisCrypt.Module.fst' theModule✝
Instances For
@[simp]: ODPRIMITIVE.structure (ODPRIMITIVE.mk r) = r — destructing a module built from a record gives that record back.
A functionality: the target construction.
@[simp]: OFUNCTIONALITY.structure (OFUNCTIONALITY.mk r) = r — destructing a module built from a record gives that record back.
The field f of a module of type OFUNCTIONALITY: the projection onto component 1 of the right-nested tuple OFUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OFUNCTIONALITY.f.mk_simp reads this field back off a module built by OFUNCTIONALITY.mk; OFUNCTIONALITY.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- theModule✝.f = GaudisCrypt.Module.snd' theModule✝
Instances For
The ModuleTypeRep underlying OFUNCTIONALITY, the module type declared by moduletype OFUNCTIONALITY: the right-nested product of its 2 field types, in declaration order.
OFUNCTIONALITY is by definition Module OFUNCTIONALITY.typeRep.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: reading the field init back off a module built from a record — OFUNCTIONALITY.init (OFUNCTIONALITY.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an OFUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
@[simp]: reading the field f back off a module built from a record — OFUNCTIONALITY.f (OFUNCTIONALITY.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an OFUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
@[simp]: OFUNCTIONALITY.mk (OFUNCTIONALITY.structure m) = m — rebuilding a module from its own fields gives that module back.
The record of a module's fields: OFUNCTIONALITY.structure m is OFUNCTIONALITY.Structure.mk applied to OFUNCTIONALITY.init, OFUNCTIONALITY.f of m.
Inverse of OFUNCTIONALITY.mk (OFUNCTIONALITY.mk_destruct, OFUNCTIONALITY.destruct_mk).
Instances For
The module type declared by moduletype OFUNCTIONALITY, with fields init, f: the type Module OFUNCTIONALITY.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with OFUNCTIONALITY.mk, read a single field off one with the accessors OFUNCTIONALITY.init, OFUNCTIONALITY.f, and get the whole record back with OFUNCTIONALITY.structure.
Equations
Instances For
The IsModule OFUNCTIONALITY instance: OFUNCTIONALITY is a module type, with representation OFUNCTIONALITY.typeRep.
It is what lets the name OFUNCTIONALITY stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module OFUNCTIONALITY.typeRep would do on its own but OFUNCTIONALITY, a plain (non-reducible) def, would not.
Equations
The field init of a module of type OFUNCTIONALITY: the projection onto component 0 of the right-nested tuple OFUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
OFUNCTIONALITY.init.mk_simp reads this field back off a module built by OFUNCTIONALITY.mk; OFUNCTIONALITY.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- theModule✝.init = GaudisCrypt.Module.fst' theModule✝
Instances For
What is derivable about the accessor OFUNCTIONALITY.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OFUNCTIONALITY.f.utilities.accessorModule : OFUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;OFUNCTIONALITY.f.utilities.apply_simp—Module.app OFUNCTIONALITY.f.utilities.accessorModule m = OFUNCTIONALITY.f m: applying that module is the accessor;OFUNCTIONALITY.f.utilities.expression_eq— the same at the level of expressions:(OFUNCTIONALITY.f m).expression = (OFUNCTIONALITY.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of the fields of a module of type OFUNCTIONALITY: the fields init, f, one per moduletype field, each of that field's own module type.
OFUNCTIONALITY.mk turns such a record into a OFUNCTIONALITY, OFUNCTIONALITY.structure turns a OFUNCTIONALITY back into one.
Instances For
Builds a module of type OFUNCTIONALITY from the record OFUNCTIONALITY.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of OFUNCTIONALITY.structure (OFUNCTIONALITY.mk_destruct, OFUNCTIONALITY.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas OFUNCTIONALITY.init.mk_simp, OFUNCTIONALITY.f.mk_simp.
Equations
- GaudisCrypt.SHA3.Pilot.OptionIndifferentiability.OFUNCTIONALITY.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init theRecord✝.f
Instances For
What is derivable about the accessor OFUNCTIONALITY.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
OFUNCTIONALITY.init.utilities.accessorModule : OFUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;OFUNCTIONALITY.init.utilities.apply_simp—Module.app OFUNCTIONALITY.init.utilities.accessorModule m = OFUNCTIONALITY.init m: applying that module is the accessor;OFUNCTIONALITY.init.utilities.expression_eq— the same at the level of expressions:(OFUNCTIONALITY.init m).expression = (OFUNCTIONALITY.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: ODFUNCTIONALITY.structure (ODFUNCTIONALITY.mk r) = r — destructing a module built from a record gives that record back.
The record of a module's fields: ODFUNCTIONALITY.structure m is ODFUNCTIONALITY.Structure.mk applied to ODFUNCTIONALITY.f of m.
Inverse of ODFUNCTIONALITY.mk (ODFUNCTIONALITY.mk_destruct, ODFUNCTIONALITY.destruct_mk).
Instances For
Builds a module of type ODFUNCTIONALITY from the record ODFUNCTIONALITY.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of ODFUNCTIONALITY.structure (ODFUNCTIONALITY.mk_destruct, ODFUNCTIONALITY.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas ODFUNCTIONALITY.f.mk_simp.
Equations
- GaudisCrypt.SHA3.Pilot.OptionIndifferentiability.ODFUNCTIONALITY.mk theRecord✝ = theRecord✝.f
Instances For
The field f of a module of type ODFUNCTIONALITY: the projection onto component 0 of the right-nested tuple ODFUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
ODFUNCTIONALITY.f.mk_simp reads this field back off a module built by ODFUNCTIONALITY.mk; ODFUNCTIONALITY.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Instances For
@[simp]: reading the field f back off a module built from a record — ODFUNCTIONALITY.f (ODFUNCTIONALITY.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an ODFUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The IsModule ODFUNCTIONALITY instance: ODFUNCTIONALITY is a module type, with representation ODFUNCTIONALITY.typeRep.
It is what lets the name ODFUNCTIONALITY stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module ODFUNCTIONALITY.typeRep would do on its own but ODFUNCTIONALITY, a plain (non-reducible) def, would not.
Equations
@[simp]: ODFUNCTIONALITY.mk (ODFUNCTIONALITY.structure m) = m — rebuilding a module from its own fields gives that module back.
The module type declared by moduletype ODFUNCTIONALITY, with fields f: the type Module ODFUNCTIONALITY.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with ODFUNCTIONALITY.mk, read a single field off one with the accessors ODFUNCTIONALITY.f, and get the whole record back with ODFUNCTIONALITY.structure.
Equations
Instances For
The ModuleTypeRep underlying ODFUNCTIONALITY, the module type declared by moduletype ODFUNCTIONALITY: the right-nested product of its 1 field types, in declaration order.
ODFUNCTIONALITY is by definition Module ODFUNCTIONALITY.typeRep.
Equations
Instances For
What is derivable about the accessor ODFUNCTIONALITY.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
ODFUNCTIONALITY.f.utilities.accessorModule : ODFUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;ODFUNCTIONALITY.f.utilities.apply_simp—Module.app ODFUNCTIONALITY.f.utilities.accessorModule m = ODFUNCTIONALITY.f m: applying that module is the accessor;ODFUNCTIONALITY.f.utilities.expression_eq— the same at the level of expressions:(ODFUNCTIONALITY.f m).expression = (ODFUNCTIONALITY.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of the fields of a module of type ODFUNCTIONALITY: the fields f, one per moduletype field, each of that field's own module type.
ODFUNCTIONALITY.mk turns such a record into a ODFUNCTIONALITY, ODFUNCTIONALITY.structure turns a ODFUNCTIONALITY back into one.
Instances For
An OPRIMITIVE is an ODPRIMITIVE (its f, fi).
Equations
- One or more equations did not get rendered due to their size.
An OFUNCTIONALITY is an ODFUNCTIONALITY (its f).
Equations
- One or more equations did not get rendered due to their size.
EC's module type OCONSTRUCTION (P : ODPRIMITIVE) = { proc init() : unit {} proc f(x : f_in): f_out option { P.f } }.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's module type OSIMULATOR (F : ODFUNCTIONALITY) = { proc init() : unit { } proc f(x : p) : p option { F.f } proc fi(x : p) : p option { F.f } }.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's module type ODISTINGUISHER (F : ODFUNCTIONALITY, P : ODPRIMITIVE) = { proc distinguish(): bool }.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc main of module OIndif, as a procedure of its own: the 3 calls it makes to module parameters (F, P, D) are its holes, in the order the body makes them.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see OIndif.main.procedure.apply_simp) rather than run. Use OIndif.main for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying OIndif.main to the parameters proc main uses (F, P, D) is Module.proc (OIndif.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 OIndif as a module, abstracted over the module parameters it uses (F, P, D, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma OIndif.main.apply_simp, which fills the holes of OIndif.main.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of OIndif.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 [OIndif.main.procedure.apply_simp]).
@[simp]: applying OIndif to a tuple of its 3 parameters F, P, D — the record of its procedures OIndif.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 OIndif.main.apply_simp to fill that procedure's holes.
The module declared by module OIndif, abstracted over its 3 parameters F, P, D, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures OIndif.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma OIndif.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
module OGReal(C : OCONSTRUCTION, P : OPRIMITIVE) = OIndif(C(P), P).
Equations
Instances For
module OGIdeal(F : OFUNCTIONALITY, S : OSIMULATOR) = OIndif(F, S(F)).