Indifferentiability (EasyCrypt proof/Indifferentiability.eca) — EC-fidelity port #
A construction C of a functionality from a primitive is indifferentiable from an ideal
functionality F when some simulator S makes Indif(C(P), P, D) and Indif(F, S(F), D)
indistinguishable to every distinguisher D.
The theory's types are outParams of the (field-less) class Params p f_in f_out: a clone is
clone Indifferentiability as Indiff0 with type p <- … (Syntax/Clone.lean), and inside the
theory nothing is written. EC's subtyping of module types (FUNCTIONALITY <: DFUNCTIONALITY) 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.
What is derivable about the accessor PRIMITIVE.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
PRIMITIVE.f.utilities.accessorModule : PRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;PRIMITIVE.f.utilities.apply_simp—Module.app PRIMITIVE.f.utilities.accessorModule m = PRIMITIVE.f m: applying that module is the accessor;PRIMITIVE.f.utilities.expression_eq— the same at the level of expressions:(PRIMITIVE.f m).expression = (PRIMITIVE.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: PRIMITIVE.mk (PRIMITIVE.structure m) = m — rebuilding a module from its own fields gives that module back.
The IsModule PRIMITIVE instance: PRIMITIVE is a module type, with representation PRIMITIVE.typeRep.
It is what lets the name PRIMITIVE stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module PRIMITIVE.typeRep would do on its own but PRIMITIVE, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Indifferentiability.instIsModulePRIMITIVE p f_in f_out = { moduleTypeRep := GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.typeRep p f_in f_out, isModule := ⋯ }
The module type declared by moduletype PRIMITIVE, with fields init, f, fi: the type Module PRIMITIVE.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with PRIMITIVE.mk, read a single field off one with the accessors PRIMITIVE.init, PRIMITIVE.f, PRIMITIVE.fi, and get the whole record back with PRIMITIVE.structure.
Equations
- GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE p f_in f_out = GaudisCrypt.Module (GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.typeRep p f_in f_out)
Instances For
@[simp]: reading the field f back off a module built from a record — PRIMITIVE.f (PRIMITIVE.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an PRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The record of the fields of a module of type PRIMITIVE: the fields init, f, fi, one per moduletype field, each of that field's own module type.
PRIMITIVE.mk turns such a record into a PRIMITIVE, PRIMITIVE.structure turns a PRIMITIVE back into one.
Instances For
The ModuleTypeRep underlying PRIMITIVE, the module type declared by moduletype PRIMITIVE: the right-nested product of its 3 field types, in declaration order.
PRIMITIVE is by definition Module PRIMITIVE.typeRep.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of a module's fields: PRIMITIVE.structure m is PRIMITIVE.Structure.mk applied to PRIMITIVE.init, PRIMITIVE.f, PRIMITIVE.fi of m.
Inverse of PRIMITIVE.mk (PRIMITIVE.mk_destruct, PRIMITIVE.destruct_mk).
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: PRIMITIVE.structure (PRIMITIVE.mk r) = r — destructing a module built from a record gives that record back.
The field fi of a module of type PRIMITIVE: the projection onto component 2 of the right-nested tuple PRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
PRIMITIVE.fi.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.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.Indifferentiability.PRIMITIVE.fi p f_in f_out theModule✝ = (GaudisCrypt.Module.snd' theModule✝).snd'
Instances For
Builds a module of type PRIMITIVE from the record PRIMITIVE.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of PRIMITIVE.structure (PRIMITIVE.mk_destruct, PRIMITIVE.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas PRIMITIVE.init.mk_simp, PRIMITIVE.f.mk_simp, PRIMITIVE.fi.mk_simp.
Equations
- GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.mk p f_in f_out theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init (GaudisCrypt.Module.pair' theRecord✝.f theRecord✝.fi)
Instances For
The field init of a module of type PRIMITIVE: the projection onto component 0 of the right-nested tuple PRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
PRIMITIVE.init.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- GaudisCrypt.SHA3.Indifferentiability.PRIMITIVE.init p f_in f_out theModule✝ = GaudisCrypt.Module.fst' theModule✝
Instances For
The field f of a module of type PRIMITIVE: the projection onto component 1 of the right-nested tuple PRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
PRIMITIVE.f.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.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.Indifferentiability.PRIMITIVE.f p f_in f_out theModule✝ = (GaudisCrypt.Module.snd' theModule✝).fst'
Instances For
What is derivable about the accessor PRIMITIVE.fi, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
PRIMITIVE.fi.utilities.accessorModule : PRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;PRIMITIVE.fi.utilities.apply_simp—Module.app PRIMITIVE.fi.utilities.accessorModule m = PRIMITIVE.fi m: applying that module is the accessor;PRIMITIVE.fi.utilities.expression_eq— the same at the level of expressions:(PRIMITIVE.fi m).expression = (PRIMITIVE.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 — PRIMITIVE.fi (PRIMITIVE.mk r) = r.fi.
It is what carries the right-hand side of an X.apply_simp (which is an PRIMITIVE.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 PRIMITIVE.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
PRIMITIVE.init.utilities.accessorModule : PRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;PRIMITIVE.init.utilities.apply_simp—Module.app PRIMITIVE.init.utilities.accessorModule m = PRIMITIVE.init m: applying that module is the accessor;PRIMITIVE.init.utilities.expression_eq— the same at the level of expressions:(PRIMITIVE.init m).expression = (PRIMITIVE.init.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 — PRIMITIVE.init (PRIMITIVE.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an PRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
@[simp]: DPRIMITIVE.structure (DPRIMITIVE.mk r) = r — destructing a module built from a record gives that record back.
@[simp]: DPRIMITIVE.mk (DPRIMITIVE.structure m) = m — rebuilding a module from its own fields gives that module back.
The record of a module's fields: DPRIMITIVE.structure m is DPRIMITIVE.Structure.mk applied to DPRIMITIVE.f, DPRIMITIVE.fi of m.
Inverse of DPRIMITIVE.mk (DPRIMITIVE.mk_destruct, DPRIMITIVE.destruct_mk).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Builds a module of type DPRIMITIVE from the record DPRIMITIVE.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of DPRIMITIVE.structure (DPRIMITIVE.mk_destruct, DPRIMITIVE.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas DPRIMITIVE.f.mk_simp, DPRIMITIVE.fi.mk_simp.
Equations
- GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.mk p f_in f_out theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.f theRecord✝.fi
Instances For
The IsModule DPRIMITIVE instance: DPRIMITIVE is a module type, with representation DPRIMITIVE.typeRep.
It is what lets the name DPRIMITIVE stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module DPRIMITIVE.typeRep would do on its own but DPRIMITIVE, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Indifferentiability.instIsModuleDPRIMITIVE p f_in f_out = { moduleTypeRep := GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.typeRep p f_in f_out, isModule := ⋯ }
What is derivable about the accessor DPRIMITIVE.fi, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DPRIMITIVE.fi.utilities.accessorModule : DPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;DPRIMITIVE.fi.utilities.apply_simp—Module.app DPRIMITIVE.fi.utilities.accessorModule m = DPRIMITIVE.fi m: applying that module is the accessor;DPRIMITIVE.fi.utilities.expression_eq— the same at the level of expressions:(DPRIMITIVE.fi m).expression = (DPRIMITIVE.fi.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 DPRIMITIVE: the fields f, fi, one per moduletype field, each of that field's own module type.
DPRIMITIVE.mk turns such a record into a DPRIMITIVE, DPRIMITIVE.structure turns a DPRIMITIVE back into one.
Instances For
@[simp]: reading the field fi back off a module built from a record — DPRIMITIVE.fi (DPRIMITIVE.mk r) = r.fi.
It is what carries the right-hand side of an X.apply_simp (which is an DPRIMITIVE.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 DPRIMITIVE.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DPRIMITIVE.f.utilities.accessorModule : DPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;DPRIMITIVE.f.utilities.apply_simp—Module.app DPRIMITIVE.f.utilities.accessorModule m = DPRIMITIVE.f m: applying that module is the accessor;DPRIMITIVE.f.utilities.expression_eq— the same at the level of expressions:(DPRIMITIVE.f m).expression = (DPRIMITIVE.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ModuleTypeRep underlying DPRIMITIVE, the module type declared by moduletype DPRIMITIVE: the right-nested product of its 2 field types, in declaration order.
DPRIMITIVE is by definition Module DPRIMITIVE.typeRep.
Equations
Instances For
@[simp]: reading the field f back off a module built from a record — DPRIMITIVE.f (DPRIMITIVE.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an DPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The module type declared by moduletype DPRIMITIVE, with fields f, fi: the type Module DPRIMITIVE.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with DPRIMITIVE.mk, read a single field off one with the accessors DPRIMITIVE.f, DPRIMITIVE.fi, and get the whole record back with DPRIMITIVE.structure.
Equations
- GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE p f_in f_out = GaudisCrypt.Module (GaudisCrypt.SHA3.Indifferentiability.DPRIMITIVE.typeRep p f_in f_out)
Instances For
The field fi of a module of type DPRIMITIVE: the projection onto component 1 of the right-nested tuple DPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DPRIMITIVE.fi.mk_simp reads this field back off a module built by DPRIMITIVE.mk; DPRIMITIVE.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.Indifferentiability.DPRIMITIVE.fi p f_in f_out theModule✝ = GaudisCrypt.Module.snd' theModule✝
Instances For
The field f of a module of type DPRIMITIVE: the projection onto component 0 of the right-nested tuple DPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DPRIMITIVE.f.mk_simp reads this field back off a module built by DPRIMITIVE.mk; DPRIMITIVE.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.Indifferentiability.DPRIMITIVE.f p f_in f_out theModule✝ = GaudisCrypt.Module.fst' theModule✝
Instances For
The field init of a module of type FUNCTIONALITY: the projection onto component 0 of the right-nested tuple FUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
FUNCTIONALITY.init.mk_simp reads this field back off a module built by FUNCTIONALITY.mk; FUNCTIONALITY.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.init p f_in f_out theModule✝ = GaudisCrypt.Module.fst' theModule✝
Instances For
The field f of a module of type FUNCTIONALITY: the projection onto component 1 of the right-nested tuple FUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
FUNCTIONALITY.f.mk_simp reads this field back off a module built by FUNCTIONALITY.mk; FUNCTIONALITY.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.Indifferentiability.FUNCTIONALITY.f p f_in f_out theModule✝ = GaudisCrypt.Module.snd' theModule✝
Instances For
The module type declared by moduletype FUNCTIONALITY, with fields init, f: the type Module FUNCTIONALITY.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with FUNCTIONALITY.mk, read a single field off one with the accessors FUNCTIONALITY.init, FUNCTIONALITY.f, and get the whole record back with FUNCTIONALITY.structure.
Equations
Instances For
@[simp]: reading the field f back off a module built from a record — FUNCTIONALITY.f (FUNCTIONALITY.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an FUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
The IsModule FUNCTIONALITY instance: FUNCTIONALITY is a module type, with representation FUNCTIONALITY.typeRep.
It is what lets the name FUNCTIONALITY stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module FUNCTIONALITY.typeRep would do on its own but FUNCTIONALITY, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Indifferentiability.instIsModuleFUNCTIONALITY p f_in f_out = { moduleTypeRep := GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.typeRep p f_in f_out, isModule := ⋯ }
@[simp]: reading the field init back off a module built from a record — FUNCTIONALITY.init (FUNCTIONALITY.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an FUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
Builds a module of type FUNCTIONALITY from the record FUNCTIONALITY.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of FUNCTIONALITY.structure (FUNCTIONALITY.mk_destruct, FUNCTIONALITY.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas FUNCTIONALITY.init.mk_simp, FUNCTIONALITY.f.mk_simp.
Equations
- GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.mk p f_in f_out theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init theRecord✝.f
Instances For
What is derivable about the accessor FUNCTIONALITY.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
FUNCTIONALITY.f.utilities.accessorModule : FUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;FUNCTIONALITY.f.utilities.apply_simp—Module.app FUNCTIONALITY.f.utilities.accessorModule m = FUNCTIONALITY.f m: applying that module is the accessor;FUNCTIONALITY.f.utilities.expression_eq— the same at the level of expressions:(FUNCTIONALITY.f m).expression = (FUNCTIONALITY.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: FUNCTIONALITY.structure (FUNCTIONALITY.mk r) = r — destructing a module built from a record gives that record back.
The record of a module's fields: FUNCTIONALITY.structure m is FUNCTIONALITY.Structure.mk applied to FUNCTIONALITY.init, FUNCTIONALITY.f of m.
Inverse of FUNCTIONALITY.mk (FUNCTIONALITY.mk_destruct, FUNCTIONALITY.destruct_mk).
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: FUNCTIONALITY.mk (FUNCTIONALITY.structure m) = m — rebuilding a module from its own fields gives that module back.
What is derivable about the accessor FUNCTIONALITY.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
FUNCTIONALITY.init.utilities.accessorModule : FUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;FUNCTIONALITY.init.utilities.apply_simp—Module.app FUNCTIONALITY.init.utilities.accessorModule m = FUNCTIONALITY.init m: applying that module is the accessor;FUNCTIONALITY.init.utilities.expression_eq— the same at the level of expressions:(FUNCTIONALITY.init m).expression = (FUNCTIONALITY.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ModuleTypeRep underlying FUNCTIONALITY, the module type declared by moduletype FUNCTIONALITY: the right-nested product of its 2 field types, in declaration order.
FUNCTIONALITY is by definition Module FUNCTIONALITY.typeRep.
Equations
- GaudisCrypt.SHA3.Indifferentiability.FUNCTIONALITY.typeRep p f_in f_out = (GaudisCrypt.ModuleTypeRep.proc (procsig () → Unit)).prod (GaudisCrypt.ModuleTypeRep.proc (procsig (f_in) → f_out))
Instances For
The record of the fields of a module of type FUNCTIONALITY: the fields init, f, one per moduletype field, each of that field's own module type.
FUNCTIONALITY.mk turns such a record into a FUNCTIONALITY, FUNCTIONALITY.structure turns a FUNCTIONALITY back into one.
Instances For
The IsModule DFUNCTIONALITY instance: DFUNCTIONALITY is a module type, with representation DFUNCTIONALITY.typeRep.
It is what lets the name DFUNCTIONALITY stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module DFUNCTIONALITY.typeRep would do on its own but DFUNCTIONALITY, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Indifferentiability.instIsModuleDFUNCTIONALITY p f_in f_out = { moduleTypeRep := GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.typeRep p f_in f_out, isModule := ⋯ }
@[simp]: DFUNCTIONALITY.structure (DFUNCTIONALITY.mk r) = r — destructing a module built from a record gives that record back.
The record of the fields of a module of type DFUNCTIONALITY: the fields f, one per moduletype field, each of that field's own module type.
DFUNCTIONALITY.mk turns such a record into a DFUNCTIONALITY, DFUNCTIONALITY.structure turns a DFUNCTIONALITY back into one.
Instances For
The field f of a module of type DFUNCTIONALITY: the projection onto component 0 of the right-nested tuple DFUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DFUNCTIONALITY.f.mk_simp reads this field back off a module built by DFUNCTIONALITY.mk; DFUNCTIONALITY.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.Indifferentiability.DFUNCTIONALITY.f p f_in f_out theModule✝ = theModule✝
Instances For
@[simp]: reading the field f back off a module built from a record — DFUNCTIONALITY.f (DFUNCTIONALITY.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an DFUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
@[simp]: DFUNCTIONALITY.mk (DFUNCTIONALITY.structure m) = m — rebuilding a module from its own fields gives that module back.
The ModuleTypeRep underlying DFUNCTIONALITY, the module type declared by moduletype DFUNCTIONALITY: the right-nested product of its 1 field types, in declaration order.
DFUNCTIONALITY is by definition Module DFUNCTIONALITY.typeRep.
Equations
- GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.typeRep p f_in f_out = GaudisCrypt.ModuleTypeRep.proc (procsig (f_in) → f_out)
Instances For
The module type declared by moduletype DFUNCTIONALITY, with fields f: the type Module DFUNCTIONALITY.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with DFUNCTIONALITY.mk, read a single field off one with the accessors DFUNCTIONALITY.f, and get the whole record back with DFUNCTIONALITY.structure.
Equations
Instances For
Builds a module of type DFUNCTIONALITY from the record DFUNCTIONALITY.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of DFUNCTIONALITY.structure (DFUNCTIONALITY.mk_destruct, DFUNCTIONALITY.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas DFUNCTIONALITY.f.mk_simp.
Equations
- GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.mk p f_in f_out theRecord✝ = theRecord✝.f
Instances For
The record of a module's fields: DFUNCTIONALITY.structure m is DFUNCTIONALITY.Structure.mk applied to DFUNCTIONALITY.f of m.
Inverse of DFUNCTIONALITY.mk (DFUNCTIONALITY.mk_destruct, DFUNCTIONALITY.destruct_mk).
Equations
- GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.structure p f_in f_out theModule✝ = { f := GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.f p f_in f_out theModule✝ }
Instances For
What is derivable about the accessor DFUNCTIONALITY.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DFUNCTIONALITY.f.utilities.accessorModule : DFUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;DFUNCTIONALITY.f.utilities.apply_simp—Module.app DFUNCTIONALITY.f.utilities.accessorModule m = DFUNCTIONALITY.f m: applying that module is the accessor;DFUNCTIONALITY.f.utilities.expression_eq— the same at the level of expressions:(DFUNCTIONALITY.f m).expression = (DFUNCTIONALITY.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EasyCrypt's module type CONSTRUCTION (P : DPRIMITIVE) = { proc init() : unit {} proc f(x : f_in): f_out { 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 SIMULATOR (F : DFUNCTIONALITY) = { proc init() : unit { } proc f(x : p) : p { F.f } proc fi(x : p) : p { 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 DISTINGUISHER (F : DFUNCTIONALITY, P : DPRIMITIVE) = { 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 FUNCTIONALITY <: DFUNCTIONALITY).
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 PRIMITIVE <: DPRIMITIVE).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The view's f is the primitive's. Not an EC lemma (EC's subtyping).
The oracle procedures a DISTINGUISHER may call (EasyCrypt's OI.allowed): F.f, P.f,
P.fi. The holes of its representation (Module.Representable, exception E2).
Equations
- One or more equations did not get rendered due to their size.
Instances For
F.f, P.f, P.fi out of the oracles (F, P).
Equations
- One or more equations did not get rendered due to their size.
Instances For
F.f out of the oracle F.
Equations
- GaudisCrypt.SHA3.Indifferentiability.simExt p f_in f_out F = (GaudisCrypt.SHA3.Indifferentiability.DFUNCTIONALITY.f p f_in f_out F).procedure
Instances For
S applied to an oracle F behaves, procedure by procedure, like pinit, and like pf, pfi
filled with F.f, and these touch nothing that S does not. Module.RepresentedBy for a
simulator, whose result has three procedures (exception E2).
- init (F : DFUNCTIONALITY p f_in f_out) (a : (procsig () → Unit).ParamType) : procedureDenotation S(F).init.procedure a = procedureDenotation (pinit.instantiate PUnit.unit) a
- f (F : DFUNCTIONALITY p f_in f_out) (a : (procsig (p) → p).ParamType) : procedureDenotation S(F).f.procedure a = procedureDenotation (pf.instantiate (simExt p f_in f_out F)) a
- fi (F : DFUNCTIONALITY p f_in f_out) (a : (procsig (p) → p).ParamType) : procedureDenotation S(F).fi.procedure a = procedureDenotation (pfi.instantiate (simExt p f_in f_out F)) a
Instances For
S is an EasyCrypt-like simulator: representable (SIMULATOR.Representable) and with finitely
many global variables (Footprint.FinitelySupported), as Module.ECModule for a distinguisher.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Indif.main to the parameters proc main uses (F, P, D) is Module.proc (Indif.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 Indif to a tuple of its 3 parameters F, P, D — the record of its procedures Indif.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 Indif.main.apply_simp to fill that procedure's holes.
Instantiating the holes of Indif.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 [Indif.main.procedure.apply_simp]).
The module declared by module Indif, 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 Indif.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Indif.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 Indif, 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 Indif.main.procedure.apply_simp) rather than run. Use Indif.main for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc main of module Indif 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 Indif.main.apply_simp, which fills the holes of Indif.main.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
module GReal(C : CONSTRUCTION, P : PRIMITIVE) = Indif(C(P), P).
Equations
- One or more equations did not get rendered due to their size.
Instances For
module GIdeal(F : FUNCTIONALITY, S : SIMULATOR) = Indif(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.
What is derivable about the accessor PRIMITIVE.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
PRIMITIVE.init.utilities.accessorModule : PRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;PRIMITIVE.init.utilities.apply_simp—Module.app PRIMITIVE.init.utilities.accessorModule m = PRIMITIVE.init m: applying that module is the accessor;PRIMITIVE.init.utilities.expression_eq— the same at the level of expressions:(PRIMITIVE.init m).expression = (PRIMITIVE.init.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 PRIMITIVE.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
PRIMITIVE.f.utilities.accessorModule : PRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;PRIMITIVE.f.utilities.apply_simp—Module.app PRIMITIVE.f.utilities.accessorModule m = PRIMITIVE.f m: applying that module is the accessor;PRIMITIVE.f.utilities.expression_eq— the same at the level of expressions:(PRIMITIVE.f m).expression = (PRIMITIVE.f.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 — PRIMITIVE.init (PRIMITIVE.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an PRIMITIVE.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 PRIMITIVE: the fields init, f, fi, one per moduletype field, each of that field's own module type.
PRIMITIVE.mk turns such a record into a PRIMITIVE, PRIMITIVE.structure turns a PRIMITIVE back into one.
Instances For
@[simp]: reading the field fi back off a module built from a record — PRIMITIVE.fi (PRIMITIVE.mk r) = r.fi.
It is what carries the right-hand side of an X.apply_simp (which is an PRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.fi.apply_simp.
The record of a module's fields: PRIMITIVE.structure m is PRIMITIVE.Structure.mk applied to PRIMITIVE.init, PRIMITIVE.f, PRIMITIVE.fi of m.
Inverse of PRIMITIVE.mk (PRIMITIVE.mk_destruct, PRIMITIVE.destruct_mk).
Instances For
The field init of a module of type PRIMITIVE: the projection onto component 0 of the right-nested tuple PRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
PRIMITIVE.init.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.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
@[simp]: PRIMITIVE.structure (PRIMITIVE.mk r) = r — destructing a module built from a record gives that record back.
The field f of a module of type PRIMITIVE: the projection onto component 1 of the right-nested tuple PRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
PRIMITIVE.f.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.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
The module type declared by moduletype PRIMITIVE, with fields init, f, fi: the type Module PRIMITIVE.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with PRIMITIVE.mk, read a single field off one with the accessors PRIMITIVE.init, PRIMITIVE.f, PRIMITIVE.fi, and get the whole record back with PRIMITIVE.structure.
Equations
Instances For
What is derivable about the accessor PRIMITIVE.fi, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
PRIMITIVE.fi.utilities.accessorModule : PRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;PRIMITIVE.fi.utilities.apply_simp—Module.app PRIMITIVE.fi.utilities.accessorModule m = PRIMITIVE.fi m: applying that module is the accessor;PRIMITIVE.fi.utilities.expression_eq— the same at the level of expressions:(PRIMITIVE.fi m).expression = (PRIMITIVE.fi.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: PRIMITIVE.mk (PRIMITIVE.structure m) = m — rebuilding a module from its own fields gives that module back.
The ModuleTypeRep underlying PRIMITIVE, the module type declared by moduletype PRIMITIVE: the right-nested product of its 3 field types, in declaration order.
PRIMITIVE is by definition Module PRIMITIVE.typeRep.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The IsModule PRIMITIVE instance: PRIMITIVE is a module type, with representation PRIMITIVE.typeRep.
It is what lets the name PRIMITIVE stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module PRIMITIVE.typeRep would do on its own but PRIMITIVE, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.instIsModulePRIMITIVE = { moduleTypeRep := GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.typeRep, isModule := ⋯ }
Builds a module of type PRIMITIVE from the record PRIMITIVE.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of PRIMITIVE.structure (PRIMITIVE.mk_destruct, PRIMITIVE.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas PRIMITIVE.init.mk_simp, PRIMITIVE.f.mk_simp, PRIMITIVE.fi.mk_simp.
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.PRIMITIVE.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init (GaudisCrypt.Module.pair' theRecord✝.f theRecord✝.fi)
Instances For
The field fi of a module of type PRIMITIVE: the projection onto component 2 of the right-nested tuple PRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
PRIMITIVE.fi.mk_simp reads this field back off a module built by PRIMITIVE.mk; PRIMITIVE.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
@[simp]: reading the field f back off a module built from a record — PRIMITIVE.f (PRIMITIVE.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an PRIMITIVE.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 f back off a module built from a record — DPRIMITIVE.f (DPRIMITIVE.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an DPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
@[simp]: DPRIMITIVE.structure (DPRIMITIVE.mk r) = r — destructing a module built from a record gives that record back.
@[simp]: DPRIMITIVE.mk (DPRIMITIVE.structure m) = m — rebuilding a module from its own fields gives that module back.
The ModuleTypeRep underlying DPRIMITIVE, the module type declared by moduletype DPRIMITIVE: the right-nested product of its 2 field types, in declaration order.
DPRIMITIVE is by definition Module DPRIMITIVE.typeRep.
Equations
Instances For
What is derivable about the accessor DPRIMITIVE.fi, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DPRIMITIVE.fi.utilities.accessorModule : DPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;DPRIMITIVE.fi.utilities.apply_simp—Module.app DPRIMITIVE.fi.utilities.accessorModule m = DPRIMITIVE.fi m: applying that module is the accessor;DPRIMITIVE.fi.utilities.expression_eq— the same at the level of expressions:(DPRIMITIVE.fi m).expression = (DPRIMITIVE.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 DPRIMITIVE: the projection onto component 0 of the right-nested tuple DPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DPRIMITIVE.f.mk_simp reads this field back off a module built by DPRIMITIVE.mk; DPRIMITIVE.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
The record of the fields of a module of type DPRIMITIVE: the fields f, fi, one per moduletype field, each of that field's own module type.
DPRIMITIVE.mk turns such a record into a DPRIMITIVE, DPRIMITIVE.structure turns a DPRIMITIVE back into one.
Instances For
@[simp]: reading the field fi back off a module built from a record — DPRIMITIVE.fi (DPRIMITIVE.mk r) = r.fi.
It is what carries the right-hand side of an X.apply_simp (which is an DPRIMITIVE.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.fi.apply_simp.
The record of a module's fields: DPRIMITIVE.structure m is DPRIMITIVE.Structure.mk applied to DPRIMITIVE.f, DPRIMITIVE.fi of m.
Inverse of DPRIMITIVE.mk (DPRIMITIVE.mk_destruct, DPRIMITIVE.destruct_mk).
Instances For
The module type declared by moduletype DPRIMITIVE, with fields f, fi: the type Module DPRIMITIVE.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with DPRIMITIVE.mk, read a single field off one with the accessors DPRIMITIVE.f, DPRIMITIVE.fi, and get the whole record back with DPRIMITIVE.structure.
Equations
Instances For
What is derivable about the accessor DPRIMITIVE.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DPRIMITIVE.f.utilities.accessorModule : DPRIMITIVE →ₘ …— the accessor as a module, a projection being a module morphism;DPRIMITIVE.f.utilities.apply_simp—Module.app DPRIMITIVE.f.utilities.accessorModule m = DPRIMITIVE.f m: applying that module is the accessor;DPRIMITIVE.f.utilities.expression_eq— the same at the level of expressions:(DPRIMITIVE.f m).expression = (DPRIMITIVE.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The field fi of a module of type DPRIMITIVE: the projection onto component 1 of the right-nested tuple DPRIMITIVE.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DPRIMITIVE.fi.mk_simp reads this field back off a module built by DPRIMITIVE.mk; DPRIMITIVE.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
The IsModule DPRIMITIVE instance: DPRIMITIVE is a module type, with representation DPRIMITIVE.typeRep.
It is what lets the name DPRIMITIVE stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module DPRIMITIVE.typeRep would do on its own but DPRIMITIVE, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.instIsModuleDPRIMITIVE = { moduleTypeRep := GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.typeRep, isModule := ⋯ }
Builds a module of type DPRIMITIVE from the record DPRIMITIVE.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of DPRIMITIVE.structure (DPRIMITIVE.mk_destruct, DPRIMITIVE.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas DPRIMITIVE.f.mk_simp, DPRIMITIVE.fi.mk_simp.
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.DPRIMITIVE.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.f theRecord✝.fi
Instances For
A functionality: the target construction.
@[simp]: reading the field init back off a module built from a record — FUNCTIONALITY.init (FUNCTIONALITY.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an FUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
The module type declared by moduletype FUNCTIONALITY, with fields init, f: the type Module FUNCTIONALITY.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with FUNCTIONALITY.mk, read a single field off one with the accessors FUNCTIONALITY.init, FUNCTIONALITY.f, and get the whole record back with FUNCTIONALITY.structure.
Equations
Instances For
@[simp]: reading the field f back off a module built from a record — FUNCTIONALITY.f (FUNCTIONALITY.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an FUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
@[simp]: FUNCTIONALITY.structure (FUNCTIONALITY.mk r) = r — destructing a module built from a record gives that record back.
Builds a module of type FUNCTIONALITY from the record FUNCTIONALITY.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of FUNCTIONALITY.structure (FUNCTIONALITY.mk_destruct, FUNCTIONALITY.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas FUNCTIONALITY.init.mk_simp, FUNCTIONALITY.f.mk_simp.
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init theRecord✝.f
Instances For
What is derivable about the accessor FUNCTIONALITY.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
FUNCTIONALITY.init.utilities.accessorModule : FUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;FUNCTIONALITY.init.utilities.apply_simp—Module.app FUNCTIONALITY.init.utilities.accessorModule m = FUNCTIONALITY.init m: applying that module is the accessor;FUNCTIONALITY.init.utilities.expression_eq— the same at the level of expressions:(FUNCTIONALITY.init m).expression = (FUNCTIONALITY.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of a module's fields: FUNCTIONALITY.structure m is FUNCTIONALITY.Structure.mk applied to FUNCTIONALITY.init, FUNCTIONALITY.f of m.
Inverse of FUNCTIONALITY.mk (FUNCTIONALITY.mk_destruct, FUNCTIONALITY.destruct_mk).
Instances For
The IsModule FUNCTIONALITY instance: FUNCTIONALITY is a module type, with representation FUNCTIONALITY.typeRep.
It is what lets the name FUNCTIONALITY stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module FUNCTIONALITY.typeRep would do on its own but FUNCTIONALITY, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.instIsModuleFUNCTIONALITY = { moduleTypeRep := GaudisCrypt.SHA3.Pilot.Indifferentiability.FUNCTIONALITY.typeRep, isModule := ⋯ }
The ModuleTypeRep underlying FUNCTIONALITY, the module type declared by moduletype FUNCTIONALITY: the right-nested product of its 2 field types, in declaration order.
FUNCTIONALITY is by definition Module FUNCTIONALITY.typeRep.
Equations
Instances For
The record of the fields of a module of type FUNCTIONALITY: the fields init, f, one per moduletype field, each of that field's own module type.
FUNCTIONALITY.mk turns such a record into a FUNCTIONALITY, FUNCTIONALITY.structure turns a FUNCTIONALITY back into one.
Instances For
The field init of a module of type FUNCTIONALITY: the projection onto component 0 of the right-nested tuple FUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
FUNCTIONALITY.init.mk_simp reads this field back off a module built by FUNCTIONALITY.mk; FUNCTIONALITY.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
@[simp]: FUNCTIONALITY.mk (FUNCTIONALITY.structure m) = m — rebuilding a module from its own fields gives that module back.
The field f of a module of type FUNCTIONALITY: the projection onto component 1 of the right-nested tuple FUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
FUNCTIONALITY.f.mk_simp reads this field back off a module built by FUNCTIONALITY.mk; FUNCTIONALITY.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
What is derivable about the accessor FUNCTIONALITY.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
FUNCTIONALITY.f.utilities.accessorModule : FUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;FUNCTIONALITY.f.utilities.apply_simp—Module.app FUNCTIONALITY.f.utilities.accessorModule m = FUNCTIONALITY.f m: applying that module is the accessor;FUNCTIONALITY.f.utilities.expression_eq— the same at the level of expressions:(FUNCTIONALITY.f m).expression = (FUNCTIONALITY.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 DFUNCTIONALITY: the fields f, one per moduletype field, each of that field's own module type.
DFUNCTIONALITY.mk turns such a record into a DFUNCTIONALITY, DFUNCTIONALITY.structure turns a DFUNCTIONALITY back into one.
Instances For
@[simp]: DFUNCTIONALITY.mk (DFUNCTIONALITY.structure m) = m — rebuilding a module from its own fields gives that module back.
Builds a module of type DFUNCTIONALITY from the record DFUNCTIONALITY.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of DFUNCTIONALITY.structure (DFUNCTIONALITY.mk_destruct, DFUNCTIONALITY.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas DFUNCTIONALITY.f.mk_simp.
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.mk theRecord✝ = theRecord✝.f
Instances For
The field f of a module of type DFUNCTIONALITY: the projection onto component 0 of the right-nested tuple DFUNCTIONALITY.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
DFUNCTIONALITY.f.mk_simp reads this field back off a module built by DFUNCTIONALITY.mk; DFUNCTIONALITY.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
The module type declared by moduletype DFUNCTIONALITY, with fields f: the type Module DFUNCTIONALITY.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with DFUNCTIONALITY.mk, read a single field off one with the accessors DFUNCTIONALITY.f, and get the whole record back with DFUNCTIONALITY.structure.
Equations
Instances For
The ModuleTypeRep underlying DFUNCTIONALITY, the module type declared by moduletype DFUNCTIONALITY: the right-nested product of its 1 field types, in declaration order.
DFUNCTIONALITY is by definition Module DFUNCTIONALITY.typeRep.
Equations
Instances For
The record of a module's fields: DFUNCTIONALITY.structure m is DFUNCTIONALITY.Structure.mk applied to DFUNCTIONALITY.f of m.
Inverse of DFUNCTIONALITY.mk (DFUNCTIONALITY.mk_destruct, DFUNCTIONALITY.destruct_mk).
Instances For
@[simp]: DFUNCTIONALITY.structure (DFUNCTIONALITY.mk r) = r — destructing a module built from a record gives that record back.
What is derivable about the accessor DFUNCTIONALITY.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
DFUNCTIONALITY.f.utilities.accessorModule : DFUNCTIONALITY →ₘ …— the accessor as a module, a projection being a module morphism;DFUNCTIONALITY.f.utilities.apply_simp—Module.app DFUNCTIONALITY.f.utilities.accessorModule m = DFUNCTIONALITY.f m: applying that module is the accessor;DFUNCTIONALITY.f.utilities.expression_eq— the same at the level of expressions:(DFUNCTIONALITY.f m).expression = (DFUNCTIONALITY.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The IsModule DFUNCTIONALITY instance: DFUNCTIONALITY is a module type, with representation DFUNCTIONALITY.typeRep.
It is what lets the name DFUNCTIONALITY stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module DFUNCTIONALITY.typeRep would do on its own but DFUNCTIONALITY, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.instIsModuleDFUNCTIONALITY = { moduleTypeRep := GaudisCrypt.SHA3.Pilot.Indifferentiability.DFUNCTIONALITY.typeRep, isModule := ⋯ }
@[simp]: reading the field f back off a module built from a record — DFUNCTIONALITY.f (DFUNCTIONALITY.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an DFUNCTIONALITY.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
A PRIMITIVE is a DPRIMITIVE (its f, fi).
Equations
- One or more equations did not get rendered due to their size.
A FUNCTIONALITY is a DFUNCTIONALITY (its f).
Equations
- One or more equations did not get rendered due to their size.
EC's module type CONSTRUCTION (P : DPRIMITIVE) = { proc init() : unit {} proc f(x : f_in): f_out { P.f } }.
Equations
Instances For
EC's module type DISTINGUISHER (F : DFUNCTIONALITY, P : DPRIMITIVE) = { proc distinguish(): bool }.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Indif.main to the parameters proc main uses (F, P, D) is Module.proc (Indif.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.
The module declared by module Indif, 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 Indif.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Indif.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Indif to a tuple of its 3 parameters F, P, D — the record of its procedures Indif.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 Indif.main.apply_simp to fill that procedure's holes.
proc main of module Indif 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 Indif.main.apply_simp, which fills the holes of Indif.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 Indif.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 [Indif.main.procedure.apply_simp]).
The body of proc main of module Indif, 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 Indif.main.procedure.apply_simp) rather than run. Use Indif.main for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
module GReal(C : CONSTRUCTION, P : PRIMITIVE) = Indif(C(P), P).
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.GReal C P D = GaudisCrypt.SHA3.Pilot.Indifferentiability.Indif(C(P), P, D).main
Instances For
module GIdeal(F : FUNCTIONALITY, S : SIMULATOR) = Indif(F, S(F)).
Equations
- GaudisCrypt.SHA3.Pilot.Indifferentiability.GIdeal F S D = GaudisCrypt.SHA3.Pilot.Indifferentiability.Indif(F, S(F), D).main