From the squeezeless sponge to the block sponge (EasyCrypt proof/smart_counter/Gconcl_list.ec) #
— EC-fidelity port
EC's judgments in EC's scripts, over the old port's declarations
(section FirstPort below), as SmartCounter/Gconcl.lean. The plain lemmas (leq_add_nin, …)
are the old port's.
Translation:
- EC's
local equiv E (D <: DISTINGUISHER {-…}) : …is a theorem∀ (D <: DISTINGUISHER {-…}), equiv[ … ].
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 first port's translation notes (some mention declarations that went with its proofs):
op valid = valid_block(as a test) and the axioms onparseandformatare the parameter classParams(overBlockSponge.Params).- Both
SLCommonandBlockSpongedefineC,DRestr,DISTINGUISHER…; as in EasyCrypt (whereBlockSpongeis imported last), the unqualified names areBlockSponge's, andSLCommon's are writtenSLCommon.X. - The clones
BIRO2(ofIRO),F2(ofSLCommon'sF) declare their own module variables; the section's localIRO2(ofPROM.FullRO) has its variable as a lens parameter of the local declarations, fresh by hypothesis (exception E6). SLCommon's andBlockSponge'sPRIMITIVE/DPRIMITIVEare one module type in EasyCrypt (they depend onstateonly); in Lean their instances differ, so a module passing one as the other repackages it withmk(A'sP).- Local modules that alias a procedure of an applied functor (
L3) are Lean functions returning that procedure (the port'sIF',Valid2,D2,D3,D5,D6aremodules with procedure aliases,proc f = c;; itsL,L2,L4areabbrevs).SimLast's andDValid's aliases are EC's too (proc f = c;);S2(F) = S(Last(F)), a whole-module alias whosePRIMITIVEisSLCommon's, is a module of its own withS(Last(F))'s procedures as aliases (exception E5).
Theory parameters: validity of functionality queries #
EasyCrypt's axioms on valid, parse and format.
- parse_not_valid (x : List Common.block) : valid (BlockSponge.parse x).1 = false → ∀ (i : ℤ), valid (BlockSponge.parse (BlockSponge.format (BlockSponge.parse x).1 i)).1 = false
- parse_twice (p : List Common.block) (n : ℤ) (x : List Common.block) : (p, n) = BlockSponge.parse x → ∀ (i : ℤ), 0 < i ∧ i ≤ n → BlockSponge.parse (BlockSponge.format p i) = (p, i)
- valid_uniq (p1 p2 : List Common.block) (n1 n2 : ℤ) : valid p1 = true → valid p2 = true → BlockSponge.format p1 n1 = BlockSponge.format p2 n2 → p1 = p2 ∧ n1 = n2
Instances
The squeezing functionality and the distinguisher's adapter #
@[simp]: applying DSqueeze to a tuple of its single parameter F — the record of its procedures DSqueeze.init, DSqueeze.f, 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 DSqueeze.init.apply_simp, DSqueeze.f.apply_simp to fill that procedure's holes.
The body of proc init of module DSqueeze, as a procedure of its own: it calls no module parameter, so it has no holes.
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 DSqueeze.init.procedure.apply_simp) rather than run. Use DSqueeze.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.Gconcl_list.DSqueeze.init.procedure = proc () : Unit { skip; return () }
Instances For
The body of proc f of module DSqueeze, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 DSqueeze.f.procedure.apply_simp) rather than run. Use DSqueeze.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of DSqueeze.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [DSqueeze.init.procedure.apply_simp]).
@[simp]: DSqueeze.init = Module.proc DSqueeze.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
proc init of module DSqueeze as a module: Module.proc DSqueeze.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — DSqueeze.init.apply_simp says exactly that.
Equations
Instances For
The module declared by module DSqueeze, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures DSqueeze.init, DSqueeze.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DSqueeze.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of DSqueeze.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [DSqueeze.f.procedure.apply_simp]).
proc f of module DSqueeze as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma DSqueeze.f.apply_simp, which fills the holes of DSqueeze.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying DSqueeze.f to the parameters proc f uses (F) is Module.proc (DSqueeze.f.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 Squeeze.init_, abstracted over its single parameter F, 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 Squeeze.init_.init, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Squeeze.init_.apply_simp says.
Equations
Instances For
@[simp]: applying Squeeze.init_ to a tuple of its single parameter F — the record of its procedures Squeeze.init_.init, 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 Squeeze.init_.init.apply_simp to fill that procedure's holes.
Instantiating the holes of Squeeze.init_.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [Squeeze.init_.init.procedure.apply_simp]).
The body of proc init of module Squeeze.init_, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 Squeeze.init_.init.procedure.apply_simp) rather than run. Use Squeeze.init_.init for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc init of module Squeeze.init_ as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Squeeze.init_.init.apply_simp, which fills the holes of Squeeze.init_.init.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Squeeze.init_.init to the parameters proc init uses (F) is Module.proc (Squeeze.init_.init.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.
EC's Squeeze(F : SLCommon.FUNCTIONALITY) : FUNCTIONALITY: proc init, and
proc f = DSqueeze(F).f.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module A, abstracted over its 2 parameters F, P, 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 A.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma A.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc distinguish of module A, as a procedure of its own: the one call it makes to a module parameter (F, P) is its single hole.
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 A.distinguish.procedure.apply_simp) rather than run. Use A.distinguish for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying A.distinguish to the parameters proc distinguish uses (F, P) is Module.proc (A.distinguish.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 A to a tuple of its 2 parameters F, P — the record of its procedures A.distinguish, 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 A.distinguish.apply_simp to fill that procedure's holes.
Instantiating the holes of A.distinguish.procedure with a tuple holeArgs of procedures: the body of proc distinguish 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 [A.distinguish.procedure.apply_simp]).
proc distinguish of module A as a module, abstracted over the module parameters it uses (F, P, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma A.distinguish.apply_simp, which fills the holes of A.distinguish.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying NIndif.main to the parameters proc main uses (F, P, D) is Module.proc (NIndif.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 NIndif, 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 NIndif.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma NIndif.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc main of module NIndif 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 NIndif.main.apply_simp, which fills the holes of NIndif.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 NIndif to a tuple of its 3 parameters F, P, D — the record of its procedures NIndif.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 NIndif.main.apply_simp to fill that procedure's holes.
The body of proc main of module NIndif, 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 NIndif.main.procedure.apply_simp) rather than run. Use NIndif.main for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of NIndif.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 [NIndif.main.procedure.apply_simp]).
clone IRO as BIRO2 with type from <- block list, type to <- block, op valid <- predT, op dto <- bdistr
The clone's module variable BIRO2.IRO.mp.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Valid to a tuple of its single parameter F — the record of its procedures Valid.init, Valid.f, 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 Valid.init.apply_simp, Valid.f.apply_simp to fill that procedure's holes.
@[simp]: applying Valid.f to the parameters proc f uses (F) is Module.proc (Valid.f.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 body of proc f of module Valid, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 Valid.f.procedure.apply_simp) rather than run. Use Valid.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc init of module Valid, as a procedure of its own: it calls no module parameter, so it has no holes.
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 Valid.init.procedure.apply_simp) rather than run. Use Valid.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.Gconcl_list.Valid.init.procedure = proc () : Unit { skip; return () }
Instances For
Instantiating the holes of Valid.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [Valid.f.procedure.apply_simp]).
The module declared by module Valid, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures Valid.init, Valid.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Valid.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of Valid.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [Valid.init.procedure.apply_simp]).
proc init of module Valid as a module: Module.proc Valid.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Valid.init.apply_simp says exactly that.
Equations
Instances For
proc f of module Valid as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Valid.f.apply_simp, which fills the holes of Valid.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: Valid.init = Module.proc Valid.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
The body of proc init of module SimLast, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 SimLast.init.procedure.apply_simp) rather than run. Use SimLast.init for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying SimLast.init to the parameters proc init uses (F) is Module.proc (SimLast.init.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.
Instantiating the holes of SimLast.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [SimLast.init.procedure.apply_simp]).
proc f = …; of module SimLast: an alias, EasyCrypt's proc f = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no SimLast.f.procedure: applied with the @[simp] lemma SimLast.f.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: the alias SimLast.fi, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
The module declared by module SimLast, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures SimLast.init, SimLast.f, SimLast.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma SimLast.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: the alias SimLast.f, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
proc init of module SimLast as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma SimLast.init.apply_simp, which fills the holes of SimLast.init.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying SimLast to a tuple of its single parameter F — the record of its procedures SimLast.init, SimLast.f, SimLast.fi, 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 SimLast.init.apply_simp, SimLast.f.apply_simp, SimLast.fi.apply_simp to fill that procedure's holes.
proc fi = …; of module SimLast: an alias, EasyCrypt's proc fi = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no SimLast.fi.procedure: applied with the @[simp] lemma SimLast.fi.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
clone F as F2: a second random oracle block list -> block, with its own variables
Instances For
The clone's module variable F2.RO.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The clone's module variable F2.FRO.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
The section's op (<=) (m1 m2 : (block list, 'b) fmap).
Equations
Instances For
format p 1 = p.
bdistr is lossless, as an expectation.
- INV [SLCommon.Params] [BlockSponge.Params] {m1 m2 m3 : EC.FMap (List Common.block) Common.block} : m1 = m2.add m3 → (∀ (l : List Common.block), m2.dom l → valid (BlockSponge.parse l).1 = true) → (∀ (l : List Common.block), m3.dom l → valid (BlockSponge.parse l).1 = false) → inv_L_L3 m1 m2 m3
Instances For
@[simp]: applying IF2.init to the parameters proc init uses (F, F2) is Module.proc (IF2.init.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 IF2 to a tuple of its 2 parameters F, F2 — the record of its procedures IF2.init, IF2.f, 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 IF2.init.apply_simp, IF2.f.apply_simp to fill that procedure's holes.
The body of proc f of module IF2, as a procedure of its own: the 4 calls it makes to module parameters (F, F2) 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 IF2.f.procedure.apply_simp) rather than run. Use IF2.f 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 IF2, abstracted over its 2 parameters F, F2, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures IF2.init, IF2.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma IF2.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc f of module IF2 as a module, abstracted over the module parameters it uses (F, F2, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma IF2.f.apply_simp, which fills the holes of IF2.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying IF2.f to the parameters proc f uses (F, F2) is Module.proc (IF2.f.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 body of proc init of module IF2, as a procedure of its own: the 2 calls it makes to module parameters (F, F2) 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 IF2.init.procedure.apply_simp) rather than run. Use IF2.init for this procedure as a module.
Equations
Instances For
Instantiating the holes of IF2.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [IF2.f.procedure.apply_simp]).
Instantiating the holes of IF2.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [IF2.init.procedure.apply_simp]).
proc init of module IF2 as a module, abstracted over the module parameters it uses (F, F2, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma IF2.init.apply_simp, which fills the holes of IF2.init.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The invariant holds of the empty maps (F.RO.init, F2.RO.init).
The body of proc f of module DSqueeze2, as a procedure of its own: the 4 calls it makes to module parameters (F, F2) 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 DSqueeze2.f.procedure.apply_simp) rather than run. Use DSqueeze2.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying DSqueeze2.f to the parameters proc f uses (F, F2) is Module.proc (DSqueeze2.f.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 f of module DSqueeze2 as a module, abstracted over the module parameters it uses (F, F2, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma DSqueeze2.f.apply_simp, which fills the holes of DSqueeze2.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module DSqueeze2, abstracted over its 2 parameters F, F2, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures DSqueeze2.init, DSqueeze2.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DSqueeze2.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of DSqueeze2.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [DSqueeze2.f.procedure.apply_simp]).
proc init of module DSqueeze2 as a module, abstracted over the module parameters it uses (F, F2, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma DSqueeze2.init.apply_simp, which fills the holes of DSqueeze2.init.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc init of module DSqueeze2, as a procedure of its own: the 2 calls it makes to module parameters (F, F2) 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 DSqueeze2.init.procedure.apply_simp) rather than run. Use DSqueeze2.init for this procedure as a module.
Equations
Instances For
@[simp]: applying DSqueeze2 to a tuple of its 2 parameters F, F2 — the record of its procedures DSqueeze2.init, DSqueeze2.f, 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 DSqueeze2.init.apply_simp, DSqueeze2.f.apply_simp to fill that procedure's holes.
Instantiating the holes of DSqueeze2.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [DSqueeze2.init.procedure.apply_simp]).
@[simp]: applying DSqueeze2.init to the parameters proc init uses (F, F2) is Module.proc (DSqueeze2.init.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.
Instantiating the holes of FValid.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [FValid.f.procedure.apply_simp]).
@[simp]: applying FValid.f to the parameters proc f uses (F) is Module.proc (FValid.f.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 body of proc f of module FValid, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 FValid.f.procedure.apply_simp) rather than run. Use FValid.f 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 FValid, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures FValid.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma FValid.apply_simp says.
Equations
Instances For
@[simp]: applying FValid to a tuple of its single parameter F — the record of its procedures FValid.f, 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 FValid.f.apply_simp to fill that procedure's holes.
proc f of module FValid as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma FValid.f.apply_simp, which fills the holes of FValid.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module DValid, abstracted over its 2 parameters F, P, 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 DValid.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DValid.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc distinguish = …; of module DValid: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, P, in declaration order). It has no DValid.distinguish.procedure: applied with the @[simp] lemma DValid.distinguish.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: the alias DValid.distinguish, applied to the parameters its callee uses (F, P), is its callee, as written in the declaration.
@[simp]: applying DValid to a tuple of its 2 parameters F, P — the record of its procedures DValid.distinguish, 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 DValid.distinguish.apply_simp to fill that procedure's holes.
@[simp]: the alias S2.init, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
proc init = …; of module S2: an alias, EasyCrypt's proc init = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no S2.init.procedure: applied with the @[simp] lemma S2.init.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc f = …; of module S2: an alias, EasyCrypt's proc f = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no S2.f.procedure: applied with the @[simp] lemma S2.f.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying S2 to a tuple of its single parameter F — the record of its procedures S2.init, S2.f, S2.fi, 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 S2.init.apply_simp, S2.f.apply_simp, S2.fi.apply_simp to fill that procedure's holes.
@[simp]: the alias S2.f, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
proc fi = …; of module S2: an alias, EasyCrypt's proc fi = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no S2.fi.procedure: applied with the @[simp] lemma S2.fi.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: the alias S2.fi, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
The module declared by module S2, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures S2.init, S2.f, S2.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma S2.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- inv_maps [SLCommon.Params] [BlockSponge.Params] {m1 : EC.FMap (List Common.block) Common.block} {m2 : EC.FMap (List Common.block × ℤ) Common.block} {m3 : EC.FMap (List Common.block) Common.block} {m4 : EC.FMap (List Common.block × ℤ) Common.block} : inv_map m1 m2 → inv_map m3 m4 → (∀ (p : List Common.block) (n : ℤ), m2.dom (p, n) → valid p = true ∧ 0 ≤ n) → (∀ (p : List Common.block) (n : ℤ), m4.dom (p, n) → valid p = false ∧ 0 ≤ n) → INV_L4_ideal m1 m2 m3 m4
Instances For
The initial maps satisfy INV_L4_ideal.
- IND_M_P [SLCommon.Params] {m : EC.FMap state state} {p : EC.FMap (List Common.block) state} : p.get [] = some (Common.b0, Common.c0) → (∀ (l : List Common.block), p.dom l → ∀ (i : ℤ), 0 ≤ i ∧ i < EC.size l → ∃ (b : Common.block) (c : Common.capacity), p.get (EC.take i l) = some (b, c) ∧ m.get (b +^ EC.nth default l i, c) = p.get (EC.take (i + 1) l)) → m_p m p
Instances For
- INV_real [SLCommon.Params] {c1 c2 : ℤ} {m mi : EC.FMap state state} {p : EC.FMap (List Common.block) state} : c1 ≤ c2 → m_p m p → SLCommon.Prefix.invm m mi → INV_Real c1 c2 m mi p
Instances For
EC's local lemma lemma_3. Deviation: the prefixes of rcons bl b by cases on the
position; EC's script is a chain of smt calls (size_take, take_cat, nth_cat, get_setE).
EC's lemma2'. Deviation: from lemma_3 (EC's later lemma, here before it), as
format bl i = rcons (format bl (i - 1)) b0; EC goes through the prefixes of format bl i
directly.
EC's local lemma take_nseq (a : 'a) i j : take j (nseq i a) = if j <= i then nseq j a else nseq i a. Deviation: EC goes through eq_from_nth; here List.take_replicate.
EC's local lemma lemma4. Deviation: through format bl (i + 1) = format bl i ++ [b0];
EC goes through take_format, nth_cat, nth_nseq with an smt at each step.
format p (j + 1) is format p j and one more b0.
The first k blocks of format p (j + 1) are those of format p j, for
k <= size (format p j).
b0 is the unit of +^.
INV_Real with a larger bound.
The bound of concl and Real_Ideal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Footprints and losslessness of the oracles (for A_lossless, Ideal_lossless) #
EasyCrypt reads a concrete module's globals off its code and proves the oracles' losslessness inline
(proc; inline*; ...; while (true) (n - i)); here they are lemmas.
FC touches C.c only. Not an EC lemma (EC reads it off the code).
PC touches C.c only. Not an EC lemma.
IRO.init touches its map only. Not an EC lemma.
IRO.f touches its map only. Not an EC lemma.
SimLast(S) touches S's globals and BIRO2.IRO.mp. Not an EC lemma.
DSqueeze has no globals. Not an EC lemma.
P.f is lossless (RP's f_ll: dstate is full).
Sponge has no globals. Not an EC lemma.
The section Real_Ideal #
A(D) touches D's globals and C.c. Not an EC lemma.
The section Real_Ideal_Abs (its local declarations in a namespace of that name, as #
The module declared by module Neg_D, abstracted over its 2 parameters F, P, 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 Neg_D.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Neg_D.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of Neg_D.distinguish.procedure with a tuple holeArgs of procedures: the body of proc distinguish 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 [Neg_D.distinguish.procedure.apply_simp]).
@[simp]: applying Neg_D.distinguish to the parameters proc distinguish uses (F, P) is Module.proc (Neg_D.distinguish.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 body of proc distinguish of module Neg_D, as a procedure of its own: the one call it makes to a module parameter (F, P) is its single hole.
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 Neg_D.distinguish.procedure.apply_simp) rather than run. Use Neg_D.distinguish for this procedure as a module.
Equations
Instances For
@[simp]: applying Neg_D to a tuple of its 2 parameters F, P — the record of its procedures Neg_D.distinguish, 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 Neg_D.distinguish.apply_simp to fill that procedure's holes.
proc distinguish of module Neg_D as a module, abstracted over the module parameters it uses (F, P, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Neg_D.distinguish.apply_simp, which fills the holes of Neg_D.distinguish.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Neg_D(D) touches what D does. Not an EC lemma.
The simulator #
EC's Simulator.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's Simulator.mi.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's Simulator.paths.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's Simulator.unvalid_map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc fi of module Simulator as a module: Module.proc Simulator.fi.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Simulator.fi.apply_simp says exactly that.
Equations
Instances For
@[simp]: applying Simulator.f to the parameters proc f uses (F) is Module.proc (Simulator.f.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.
Instantiating the holes of Simulator.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [Simulator.f.procedure.apply_simp]).
The body of proc fi of module Simulator, as a procedure of its own: it calls no module parameter, so it has no holes.
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 Simulator.fi.procedure.apply_simp) rather than run. Use Simulator.fi 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 Simulator, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures Simulator.init, Simulator.f, Simulator.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Simulator.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc f of module Simulator as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Simulator.f.apply_simp, which fills the holes of Simulator.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc f of module Simulator, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 Simulator.f.procedure.apply_simp) rather than run. Use Simulator.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: Simulator.init = Module.proc Simulator.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
Instantiating the holes of Simulator.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [Simulator.init.procedure.apply_simp]).
@[simp]: applying Simulator to a tuple of its single parameter F — the record of its procedures Simulator.init, Simulator.f, Simulator.fi, 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 Simulator.init.apply_simp, Simulator.f.apply_simp, Simulator.fi.apply_simp to fill that procedure's holes.
@[simp]: Simulator.fi = Module.proc Simulator.fi.procedure — true by definition, proc fi using no module parameter and so having no holes to fill.
proc init of module Simulator as a module: Module.proc Simulator.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Simulator.init.apply_simp says exactly that.
Equations
Instances For
Instantiating the holes of Simulator.fi.procedure with a tuple holeArgs of procedures: the body of proc fi 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 [Simulator.fi.procedure.apply_simp]).
The body of proc init of module Simulator, as a procedure of its own: it calls no module parameter, so it has no holes.
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 Simulator.init.procedure.apply_simp) rather than run. Use Simulator.init for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The section Simplify_Simulator (its local declarations in a namespace of that name, as #
Equations
Instances For
Equations
Instances For
The body of proc init of module Simu, as a procedure of its own: the 2 calls it makes to module parameters (FRO, F) 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 Simu.init.procedure.apply_simp) rather than run. Use Simu.init for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc init of module Simu as a module, abstracted over the module parameters it uses (FRO, F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Simu.init.apply_simp, which fills the holes of Simu.init.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 Simu.fi.procedure with a tuple holeArgs of procedures: the body of proc fi 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 [Simu.fi.procedure.apply_simp]).
Instantiating the holes of Simu.init.procedure with a tuple holeArgs of procedures: the body of proc init 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 [Simu.init.procedure.apply_simp]).
@[simp]: applying Simu to a tuple of its 2 parameters FRO, F — the record of its procedures Simu.init, Simu.f, Simu.fi, 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 Simu.init.apply_simp, Simu.f.apply_simp, Simu.fi.apply_simp to fill that procedure's holes.
@[simp]: applying Simu.init to the parameters proc init uses (FRO, F) is Module.proc (Simu.init.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.
Instantiating the holes of Simu.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [Simu.f.procedure.apply_simp]).
@[simp]: Simu.fi = Module.proc Simu.fi.procedure — true by definition, proc fi using no module parameter and so having no holes to fill.
proc fi of module Simu as a module: Module.proc Simu.fi.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Simu.fi.apply_simp says exactly that.
Equations
Instances For
@[simp]: applying Simu.f to the parameters proc f uses (FRO, F) is Module.proc (Simu.f.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 f of module Simu as a module, abstracted over the module parameters it uses (FRO, F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Simu.f.apply_simp, which fills the holes of Simu.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc f of module Simu, as a procedure of its own: the 3 calls it makes to module parameters (FRO, F) 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 Simu.f.procedure.apply_simp) rather than run. Use Simu.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc fi of module Simu, as a procedure of its own: it calls no module parameter, so it has no holes.
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 Simu.fi.procedure.apply_simp) rather than run. Use Simu.fi 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 Simu, abstracted over its 2 parameters FRO, F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures Simu.init, Simu.f, Simu.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Simu.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying L to a tuple of its single parameter FRO — the record of its procedures L.distinguish, 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 L.distinguish.apply_simp to fill that procedure's holes.
The body of proc distinguish of module L, as a procedure of its own: the one call it makes to a module parameter (FRO) is its single hole.
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 L.distinguish.procedure.apply_simp) rather than run. Use L.distinguish for this procedure as a module.
Equations
Instances For
Instantiating the holes of L.distinguish.procedure with a tuple holeArgs of procedures: the body of proc distinguish 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 [L.distinguish.procedure.apply_simp]).
@[simp]: applying L.distinguish to the parameters proc distinguish uses (FRO) is Module.proc (L.distinguish.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 distinguish of module L as a module, abstracted over the module parameters it uses (FRO, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma L.distinguish.apply_simp, which fills the holes of L.distinguish.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module L, abstracted over its single parameter FRO, 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 L.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma L.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Gap list (batch-fix later, see TRANSFER_SKILL.md §1.6):
GAP 1 (closed 2026-11-22):
ideal_equiv's F.f guardvalid p{1} = valid p{2}afterspoverp, n <- x0andx0 <- (bl, nb); EC'sautocloses it, and so does ours now.GAP 2: EC's
autotakes a one-sided sampling of a lossless distribution (r <$ dout) as lossless; ours does since 2026-11-22 (@[ec_lossless]:bdistr_expected_one,cdistr_expected_one). Left: aconseq's postcondition closed byec_progress(EC'ssmtwithdunifin_ll) keepsbdistr's mass:simp only [bdistr_expected_one](two places).(GAP 3, fixed: after
sp,hoare_auto'sskipsimplifies the reads through writes before it generalizes the reads, so a test's reads and the precondition's are the same values.)EC's
have := prefix_le1 …side goals (move=> /> &hr …): by hand, the hypotheses byrename_ion the context's tail or by type (‹(0:ℤ) ≤ _›); a hypothesis picked by a typed pattern of a read (‹(localVarLens "p" _).get _ = _›) may be spelled differently from the context's, andomegathen sees two atoms: name it instead.EC's
smtselects its lemmas (domE,mem_set,valid_spec, the definition of<=) itself: oursmt_closelists them (deviation, not a gap).GAP 3:
glob Mof a module over an oracle (glob IF) in the={…}ofequiv_while's invariant stays a region, where EC reads the module's variables: the variable is written out. (glob Sof a concrete module is EC's since 2026-11-12,Logic/GlobWrites.lean.)GAP 4 (closed 2026-11-21):
equiv_conseq's frame took a call of a procedure that writes nothing (F.LRO.sample, EC'sproc sample(x) = {}) as writing its module's variables; the frame is now by writes, and EC's order (conseq, theninline*) is kept.GAP 5 (closed 2026-11-21): EC's
call (: I)on two different concrete procedures (S(IF').f ~ S(Valid2).f) isequiv_call (_ : ={x…} ∧ I)(their judgment a goal), thenequiv_proc(EC's form opens the callees).equiv_call (_ : ={glob IF})on the same concrete callee falls back to the frameless rule (no footprint bound forIF'sinit):={F.RO.m}.GAP 6 (closed 2026-11-21): the frame of
equiv_call (_ : P ==> Q)was the callee module's (S(F)), not the procedure's:S(F).fidoes not callF, but the call lost the oracles' maps. The frame is now by writes.GAP 7 (closed 2026-11-23): a fact about unmodified variables (
(p, n) = parse x) was carried in the new postcondition ofhoare_conseq (: _ ==> Q)and in the loop invariant;equiv_L3_L4's three loops are now EC'swhile I(hoare_while, with EC's frame) and itssmtlists.GAP 8: after
spoversa, sc <- (sa +^ b, sc); x <- (sa, sc)on both sides, the twoxare known equal by their components only (x{1}.1 = …,x{2}.1 = …), and the closer does not put them together: the guardx{1} \in Perm.m <=> x{2} \in Perm.mand the goals after it start withhave hx : x₁ = x₂ := Prod.ext ….GAP 9 (closed 2026-11-23): the closer left the guard of a split loop,
(a && b) = trueor= false(alsodecide p = !false), as it was;ec_progressnow takes it apart foromegawhere that closes the goal. (Afterauto_prepthe guard is still decoded by hand, which ConcreteF's lemmas over the guard need.) Noseqon a Hoare triple: in thercondside goals ourautotakes the code after the loop first.GAP 10:
splitwhile's condition reads the variables of the code left only:p, which is in the conditions alone, is written with its lens.GAP 11 (closed 2026-11-17):
inline*opens the calls ofPermbehind the first port'sPRIMITIVE.view(RealIndif(Sponge, Perm, D)appliesSpongeto that view).GAP 12:
phoare_callon an abstract module has the rule for lossless oracles (EC'scall (: true)), not the one with an invariant (call (: invm Perm.m Perm.mi),Real_lossless). Hand-closed:Perm.f,Perm.fiare lossless in every state here.GAP 13 (closed 2026-11-22): in a
phoare … = 1goal,phoare_autoleft a sampling's expectation of1in the postcondition; it reads it off now (@[ec_lossless]).GAP 14 (closed 2026-11-21): after
auto'sskip,glob Dread past initializations outsideDwas not rewritten (spdoes it); the strictautorewrites it now (touched_set_of_le_complbyfp_disjoint).GAP 15: EC's
conseqwithout a specification (conseq=> />: the postcondition without what the precondition gives on unwritten variables) has no automatic form: the postcondition is written out.GAP 16 (closed 2026-11-21): inlining names the two sides' locals differently (
i/i0), as EC's does;simrelates them by position (EC's equality set of pairs).GAP 17 (closed 2026-11-20): EC's theory
AdvAbsValisLib/EC/AdvAbsVal.lean;neg_D_conclis EC's script.After
sp, a goal prints as the plainprhlStmtterm until the next tactic (the conditionsx = eit adds are not in read form); display only.EC's
Listlemmas the scripts cite (take0,size_take,nth_take,size_cat,last_nseq, …) were missing or in the first port's files under other names:Lib/EC/ListLemmas.lean.
From Ideal_equiv_valid on, the proofs are written on the strict tactics (ec_auto, ec_close,
ec_progress, ec_prep: Logic/ECAutoStrict.lean, Logic/ECProgress.lean); ideal_equiv is
on the older ones.
EC's local equiv ideal_equiv (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S}) : SLCommon.IdealIndif(IF, S, SLCommon.DRestr(A(D))).main ~ SLCommon.IdealIndif(IF, S, A(D)).main : ={glob D} ==> ={glob D, res}.
proc f of module IF' as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma IF'.f.apply_simp, which fills the holes of IF'.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module IF', abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures IF'.init, IF'.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma IF'.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc f of module IF', as a procedure of its own: the 2 calls it makes to module parameters (F) 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 IF'.f.procedure.apply_simp) rather than run. Use IF'.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc init = …; of module IF': an alias, EasyCrypt's proc init = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no IF'.init.procedure: applied with the @[simp] lemma IF'.init.apply_simp, it is the callee.
Equations
Instances For
Instantiating the holes of IF'.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [IF'.f.procedure.apply_simp]).
@[simp]: applying IF' to a tuple of its single parameter F — the record of its procedures IF'.init, IF'.f, 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 IF'.init.apply_simp, IF'.f.apply_simp to fill that procedure's holes.
@[simp]: the alias IF'.init, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
@[simp]: applying IF'.f to the parameters proc f uses (F) is Module.proc (IF'.f.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.
EC's local module (L (D : DISTINGUISHER) : F.RO_Distinguisher) (F : F.RO):
proc distinguish = SLCommon.IdealIndif(IF'(F), S, A(D)).main (an alias, so that proc opens
it; the old port's L is a def).
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc f of module Valid2 as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Valid2.f.apply_simp, which fills the holes of Valid2.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Valid2 to a tuple of its single parameter F — the record of its procedures Valid2.init, Valid2.f, 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 Valid2.init.apply_simp, Valid2.f.apply_simp to fill that procedure's holes.
Instantiating the holes of Valid2.f.procedure with a tuple holeArgs of procedures: the body of proc f 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 [Valid2.f.procedure.apply_simp]).
@[simp]: the alias Valid2.init, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
The body of proc f of module Valid2, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
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 Valid2.f.procedure.apply_simp) rather than run. Use Valid2.f 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 Valid2, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures Valid2.init, Valid2.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Valid2.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying Valid2.f to the parameters proc f uses (F) is Module.proc (Valid2.f.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 init = …; of module Valid2: an alias, EasyCrypt's proc init = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no Valid2.init.procedure: applied with the @[simp] lemma Valid2.init.apply_simp, it is the callee.
Equations
Instances For
EC's local module (L2 (D : DISTINGUISHER) : F.RO_Distinguisher) (F : F.RO):
proc distinguish = SLCommon.IdealIndif(Valid2(F), S, A(D)).main.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's local equiv Ideal_equiv_valid (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S}) : L(D,F.LRO).distinguish ~ L2(D,F.LRO).distinguish : ={glob D} ==> ={glob D, res}.
Deviations: after EC's call (: I) on two different concrete procedures, equiv_proc (EC's
form opens the callees itself); GAP 3 of the file header.
EC's local equiv ideal_equiv2 (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S}) : L2(D,F.RO).distinguish ~ SLCommon.IdealIndif(IF,S,A(D)).main : ={glob D} ==> ={glob D, res}.
Deviations: after EC's call (: I) on two concrete procedures, equiv_proc (EC's form opens
them). EC's smt(parse_valid parseK formatK) are closed without the lemmas.
EC's local module (L3 (D : DISTINGUISHER) : F.RO_Distinguisher) (F : F.RO):
proc distinguish = SLCommon.IdealIndif(IF2(F,F2.RO), S, A(D)).main (an alias; the old port's
L3 is a def).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's local equiv Ideal_equiv3 (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S, -F2.RO}) : L(D,F.RO).distinguish ~ L3(D,F.RO).distinguish : ={glob D} ==> ={glob D, res}.
Deviations: GAPs 5 and 6 of the file header. EC's smt(lemma1 lemma2 incl_dom parse_valid …)
calls are closed by hand with those lemmas and the old port's inv_L_L3.dom_valid, get_valid,
set_valid, dom_invalid, get_invalid (the invariant on a query with a valid, or an invalid,
prefix); the hypotheses are taken by type.
EC's local module L4 (D : DISTINGUISHER) (F : F.RO) (F2 : F2.RO):
proc distinguish = IdealIndif(DSqueeze2(F,F2),S2,DValid(DRestr(D))).main (an alias; the old
port's L4 is a def).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's local equiv equiv_L3_L4 (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S, -F2.RO, -BIRO.IRO, -BIRO2.IRO}) : L3(D,F.RO).distinguish ~ L4(D,F.RO,F2.RO).distinguish : ={glob D} ==> ={glob D, res}.
Deviations: GAPs 5 and 7 of the file header. EC's variables of inlined callees are named
differently (noted at each use). EC's smt calls with parse_gt0, parseK, formatK,
parse_valid are by hand (smt_close fails on them with an unknown free variable, GAP 2); the two
loop side goals EC repeats are the local macros l3l4_round and l3l4_i_lt_n.
EC's local equiv equiv_L4_ideal (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S, -F2.RO, -BIRO.IRO, -BIRO2.IRO}) : L4(D,F.LRO,F2.LRO).distinguish ~ IdealIndif(BIRO.IRO,SimLast(S),DRestr(D)).main : ={glob D} ==> ={glob D, res}.
Deviations: equiv_proc after EC's call (: I) on two concrete procedures (EC's form opens
them). What EC's smt(parseK), smt(parse_twice) read off
INV_L4_ideal is stated once at the top (hdom, hget for a valid prefix; hpt, hdom',
hget' for an invalid one) and applied by hand at EC's progress goals, with EC's lemma5,
lemma5bis.
SLCommon's primitive where BlockSponge's distinguisher's is expected (PC(S(Valid2(F)))
in D2): EC's subtyping.
Equations
- One or more equations did not get rendered due to their size.
proc distinguish = …; of module D2: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no D2.distinguish.procedure: applied with the @[simp] lemma D2.distinguish.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: the alias D2.distinguish, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
@[simp]: applying D2 to a tuple of its single parameter F — the record of its procedures D2.distinguish, 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 D2.distinguish.apply_simp to fill that procedure's holes.
The module declared by module D2, abstracted over its single parameter F, 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 D2.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma D2.apply_simp says.
Equations
Instances For
proc distinguish = …; of module D3: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no D3.distinguish.procedure: applied with the @[simp] lemma D3.distinguish.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module D3, abstracted over its single parameter F, 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 D3.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma D3.apply_simp says.
Equations
Instances For
@[simp]: applying D3 to a tuple of its single parameter F — the record of its procedures D3.distinguish, 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 D3.distinguish.apply_simp to fill that procedure's holes.
@[simp]: the alias D3.distinguish, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
The clone F's FullEager.RO_LRO_D (PROM.FullRO's, at F's dout and module variables,
its dout_ll EC's dunifin_ll): a distinguisher cannot tell F.RO from F.LRO. Its side
conditions, which EC checks itself, are found (ec_module, fp_disjoint).
The module declared by module D5, abstracted over its single parameter F, 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 D5.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma D5.apply_simp says.
Equations
Instances For
proc distinguish = …; of module D5: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no D5.distinguish.procedure: applied with the @[simp] lemma D5.distinguish.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: the alias D5.distinguish, applied to the parameters its callee uses (F), is its callee, as written in the declaration.
@[simp]: applying D5 to a tuple of its single parameter F — the record of its procedures D5.distinguish, 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 D5.distinguish.apply_simp to fill that procedure's holes.
@[simp]: the alias D6.distinguish, applied to the parameters its callee uses (F2'), is its callee, as written in the declaration.
proc distinguish = …; of module D6: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F2', in declaration order). It has no D6.distinguish.procedure: applied with the @[simp] lemma D6.distinguish.apply_simp, it is the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying D6 to a tuple of its single parameter F2' — the record of its procedures D6.distinguish, 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 D6.distinguish.apply_simp to fill that procedure's holes.
The module declared by module D6, abstracted over its single parameter F2', 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 D6.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma D6.apply_simp says.
Equations
Instances For
The clone F2's FullEager.RO_LRO_D (as F.FullEager.RO_LRO_D).
EC's lemma equiv_ideal (D <: DISTINGUISHER{-SLCommon.C, -C, -IF, -S, -F.FRO, -F2.RO, -F2.FRO, -BIRO.IRO, -BIRO2.IRO}) &m: Pr[SLCommon.IdealIndif(IF,S,SLCommon.DRestr(A(D))).main() @ &m : res] = Pr[IdealIndif(BIRO.IRO,SimLast(S),DRestr(D)).main() @ &m : res].
The four lazy/eager steps are EC's (byequiv; proc; sp; inline*; sp; wp; call (F.FullEager.RO_LRO_D (D2(D)) _); auto, and the same with D3, D5, D6), the clones'
RO_LRO_D finding their side conditions. Deviations: D5, D6 have S2(…) for EC's
S(Last(…)) (see D5); EC's sequence of rewrites is one chain of equations at the end;
-F.FRO, -F2.FRO are written as their variables.
Perm where SLCommon's DPRIMITIVE is expected (SqueezelessSponge(Perm)): EC's
subtyping. EC's module P = Perm is not declared: the old port's alias P is a BlockSponge
primitive that inline* does not open, and EC's scripts are the same with Perm for P.
Equations
- One or more equations did not get rendered due to their size.
The absorbing loop of equiv_sponge extends Redo.prefixes by take (i + 1) p, a prefix
it does not know. EC proves the invariant's facts on the extended map inline, in both branches
of the permutation's test (smt(mem_set get_setE domE take_take size_take …) and by hand); here
each is stated once.
A key of the extended map is in pref, or a prefix of p.
The extended map agrees with pref on pref's keys.
The extended map does not know the next prefix.
The extended map is closed under prefixes.
The extended map records the permutation's steps along p, up to i + 1: m' is the
permutation's map after the step (m with, possibly, one more entry), v its value at the
state recorded for take i p xored with the next block.
The squeezing loop of equiv_sponge runs the squeezeless sponge on format p (i + 1) when
format p i is a known prefix: all its blocks but the last are known. EC proves this at each
rcond and in each loop (have->: take (i1 + 1) (format bl (i + 1)) = take (i1 + 1) (format bl i); smt(all_prefixes_of_INV_real), smt(take_format size_cat size_nseq …)); here once for the blocks
of p and once for the padding.
EC's size_cat, size_nseq on format.
EC's smt(take_cat take_le0 cats0): within p, a prefix of format p j is one of p.
A prefix of format p (i + 1) within p is known.
A prefix of format p (i + 1) past p, but for the last block, is known.
EC's local lemma equiv_sponge (D <: DISTINGUISHER {-P, -Redo, -C, -SLCommon.C}) : equiv [ GReal(A(D)).main ~ NIndif(Squeeze(SqueezelessSponge(P)),P,DRestr(D)).main : ={glob D} ==> ={res, glob D, glob P, C.c} /\ SLCommon.C.c{1} <= C.c{2} <= max_size].
Deviations: EC's P (module P = Perm) is written Perm, and glob P its two maps (GAP 3);
the facts EC proves inline in the two branches of the permutation's test and at each rcond are
the lemmas above (absorb_*, squeeze_known_*); GAPs 8 to 10 of the file header.
A known next prefix is the permutation's step from the current one. EC proves it inline at
each use in squeeze_squeezeless's absorbing loop (have[]_[]_ hmp1 _ :=H2;have:=hmp1 _ H5 i0 _;1:smt(size_take). move=>[]b3 c3;rewrite!take_take!nth_take …, five times).
EC's rewrite take_oversize;1:rewrite size_cat size_nseq ler_maxr/# at i1 = size p + i - 1:
the whole of format p (i + 1).
EC's rewrite nth_cat nth_nseq;1:smt(size_ge0). have->/=:!size p + i - 1 < size p by smt()
at i1 = size p + i - 1: the last block of format p (i + 1) is b0.
A prefix of format p (i + 1), but for the last block, is known (0 < i).
EC's rewrite take_format … have->: x = format p (i_R+1): format p (j + 1) without its
last block is format p j.
EC's local lemma squeeze_squeezeless (D <: DISTINGUISHER {-P, -Redo, -C, -SLCommon.C}) : equiv [ NIndif(Squeeze(SqueezelessSponge(P)),P,DRestr(D)).main ~ RealIndif(Sponge,P,DRestr(D)).main : ={glob D} ==> ={res, glob P, glob D, C.c} /\ C.c{1} <= max_size].
Deviations: Perm for EC's P, glob P its two maps (as equiv_sponge); GAP 11 of the file
header (one bridge line after inline*); the facts EC proves inline at each use are the lemmas
above (INV_Real_known_step, squeeze_known, take_format_full, nth_format_pad,
take_format_pred); EC's one goal on the body of while{1} is our two.
EC's lemma pr_real (D <: DISTINGUISHER{-SLCommon.C, -C, -Perm, -Redo}) &m : Pr [ GReal(A(D)).main() @ &m : res /\ SLCommon.C.c <= max_size] = Pr [ RealIndif(Sponge,P,DRestr(D)).main() @ &m : res].
Section Real_Ideal #
concl (EC l. 1786) applies Gconcl.Real_Ideal to the composed distinguisher A(D), with
A_lossless for its D_ll. EC's glob A(D) is glob D and C.c by definition; here the
footprint of an application is bounded from above only, so {-A(D)} does not give {-D}. The
pilots' Real_Ideal is therefore stated against a region for glob D
(declare module … with glob R, Logic/DeclareModule.lean; exception E14), and concl gives the
region of A(D) written out, R ⊔ C.c.footprint. This section's D has a region too: EC
applies concl to Neg_D(D) (neg_D_concl).
EC's glob A(D): glob D (the region given for D; a declared module's is its glob) and
C.c, the variable of A's code.
EC's lemma A_lossless (F <: SLCommon.DFUNCTIONALITY{-A(D)}) (P0 <: SLCommon.DPRIMITIVE{-A(D)}) : islossless P0.f => islossless P0.fi => islossless F.f => islossless A(D, F, P0).distinguish; {-A(D)} is {-R, -C}, its globals.
EC's lemma concl &m : Pr [ RealIndif(Sponge,P,DRestr(D)).main() @ &m : res ] <= Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ] + (max_size ^ 2 - max_size)%r / 2%r / (2^r)%r / (2^c)%r + max_size%r * ((2*max_size)%r / (2^c)%r) + max_size%r * ((2*max_size)%r / (2^c)%r).
Section Real_Ideal_Abs #
EC's section, complete. Three deviations, each at its lemma: Real_lossless calls D with
lossless oracles where EC keeps the invariant invm Perm.m Perm.mi (GAP 12); in
Ideal_lossless the sampling behind a loop is passed by phoare_auto;
neg_D_concl is EC's script with AdvAbsVal's Neg_A_Pr_minus. The section's D has
a region for glob D (exception E14): concl is applied to Neg_D(D) here, and
Inefficient_Real_Ideal to a distinguisher built from a declared one in SHA3Indiff.
DRestr(D) touches what D does and the counter C.c. Not an EC lemma: Neg_A_Pr_minus
takes the games on Neg_D(D) as modules with finitely many globals, which the footprint solver
reads through it.
EC's glob Neg_D(D): glob D (Neg_D has no variables).
EC's local lemma Neg_D_lossless (F <: DFUNCTIONALITY{-Neg_D(D)}) (P <: DPRIMITIVE{-Neg_D(D)}) : islossless P.f => islossless P.fi => islossless F.f => islossless Neg_D(D, F, P).distinguish; {-Neg_D(D)} is {-R}.
EC's local lemma Real_lossless : islossless RealIndif(Sponge, P, DRestr(Neg_D(D))).main.
Deviation (GAP 12): EC calls D under the invariant invm Perm.m Perm.mi, under which the
permutation's sampling is lossless (useful). phoare_call on an abstract module has the rule
for lossless oracles only, and here Perm.f, Perm.fi are lossless in every state (the first
port's P_f_ll, P_fi_ll: a finite map missing a key misses a value). So the call is EC's
call (: true), the oracles' proofs keep EC's steps without the invariant, and the calls of the
permutation are not inlined: EC's inline* on the functionality's oracle is phoare_inline 0
(the sponge's call only), so that call P_f_ll applies to the permutation's calls.
EC's DCapacity.dunifin_ll, as the expectation of 1.
EC's local lemma Ideal_lossless : islossless IdealIndif(BIRO.IRO, SimLast(S), DRestr(Neg_D(D))).main.
EC's local lemma neg_D_concl &m : Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ] <= Pr [ RealIndif(Sponge,P,DRestr(D)).main() @ &m : res ] + (max_size ^ 2 - max_size)%r / 2%r / (2^r)%r / (2^c)%r + max_size%r * ((2*max_size)%r / (2^c)%r) + max_size%r * ((2*max_size)%r / (2^c)%r).
EC's script, with AdvAbsVal's Neg_main and Neg_A_Pr_minus (Lib/EC/AdvAbsVal.lean); the
games are modules with finitely many globals (Neg_A_Pr_minus's A <: Adv) through the bound
fvP_DRestr'. concl is applied to Neg_D(D) with the region of D (glob Neg_D(D) is
glob D).
EC's lemma Inefficient_Real_Ideal &m : |Pr [ RealIndif(Sponge,Perm,DRestr(D)).main() @ &m : res ] -
Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ]| <=
(max_size ^ 2 - max_size)%r / 2%r / (2^r)%r / (2^c)%r + max_size%r * ((2max_size)%r / (2^c)%r) +
max_size%r * ((2max_size)%r / (2^c)%r)`.
Section Simplify_Simulator #
equal2 is done; equal1 (EC l. 2086) and Simplify_simulator (l. 2186) are not yet.
EC's local clone import PROM.FullRO as IRO2 with type in_t <- block list * int, type out_t <- block, op dout _ <- bdistr, type d_in_t <- unit, type d_out_t <- bool: the
clone's module variables are global_vars (the first port's are lens parameters).
Equations
Instances For
The clone's module variable IRO2.RO.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The clone's module variable IRO2.FRO.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
EC's local module L (F : IRO2.RO):
proc distinguish = IdealIndif(BIRO.IRO, Simu(F), DRestr(D)).main (an alias).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC proves this inline, three times in equal1 (have->>: q = (parse l).1, the same for k, then formatK): the query parsed from l` formats back to it.
EC's local lemma equal1 &m : Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ] = Pr [ L(IRO2.RO).distinguish() @ &m : res ].
The proof is EC's, with these differences. The fact EC derives inline three times (the query
parsed on the left formats back to the list parsed on the right) is parse_format_of_eq_parse.
In the invalid query, EC shows that the last query is already sampled by splitting off the
loop's last iteration (splitwhile, rcondt, rcondf, seq on a Hoare triple); there is no
seq on a Hoare triple here (GAP 9), and the loop is given the invariant "the query before i
is sampled" directly.
The invariant of the main loop carries what the loops do not write (GAP 15).
EC's local lemma equal2 &m : Pr [ IdealIndif(BIRO.IRO, Simulator, DRestr(D)).main() @ &m : res ] = Pr [ L(IRO2.LRO).distinguish() @ &m : res ].
The section's D with the local clone's variable in its restriction (fresh in EC).
Deviations: GAPs 5, 14, 15, 16 of the file header.
The first port's L D: a module whose one procedure calls the game (exception E5), which
is the RO_Distinguisher that RO_LRO_D takes.
Equations
Instances For
EC's lemma Simplify_simulator &m : Pr [ IdealIndif(BIRO.IRO, Simulator, DRestr(D)).main() @ &m : res ] = Pr [ IdealIndif(BIRO.IRO, SimLast(S), DRestr(D)).main() @ &m : res ].
The section's D with the local clone's variables in its restriction (fresh in EC). Deviation:
EC's L is an alias, and RO_LRO_D takes a module; the two probabilities are first moved to the
first port's module L D (LF, exception E5).
Section Real_Ideal (EC's last) #
EC's lemma Real_Ideal &m : |Pr [ RealIndif(Sponge,Perm,DRestr(D)).main() @ &m : res ] -
Pr [ IdealIndif(BIRO.IRO, Simulator, DRestr(D)).main() @ &m : res ]| <=
(max_size ^ 2 - max_size)%r / 2%r / (2^r)%r / (2^c)%r + max_size%r * ((2max_size)%r / (2^c)%r) +
max_size%r * ((2max_size)%r / (2^c)%r)`.