Lazily sampled function called through a map #
A program queries m : M, and each query is answered by a lazily sampled function on Y at
φ m. Its result is statistically close to its result against a lazily sampled function on M
itself; the error is the probability that the queries of the second run contain two distinct
m, m' with φ m = φ m'.
Main results #
Cslib.RandomOracle.closeTo_runWith_memoize_simulate_query: the closeness statement above.
References #
- D. Boneh and V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 7.3, proof of Theorem 7.7, Games 1 and 2 (p. 264), an application of the Difference Lemma (Theorem 4.7).
theorem Cslib.RandomOracle.closeTo_runWith_memoize_simulate_query {M Y Z α : Type} [BEq M] [LawfulBEq M] [DecidableEq Y] (φ : M → Y) (dist : PMF Z) (program : ProbOracleComp (fun (x : M) => Z) α) :
Probability.CloseTo (PMF.map Prod.fst (ProbOracleComp.runWith (memoize fun (x : M) => dist) program []))
(PMF.map Prod.fst
(ProbOracleComp.runWith (answer fun (x : Y) => dist)
(ProbOracleComp.simulate (fun (m : M) => ProbOracleComp.query (φ m)) program) fun (x : Y) => none))
((ProbOracleComp.runWith (memoize fun (x : M) => dist) program []).toOuterMeasure
{x : α × List (M × Z) | HasImageCollision φ x.2})
A lazily sampled function called through φ. Replacing each query m of program by the
query φ m to a lazily sampled function on Y changes the law of the result by at most the
probability that, in the run against a lazily sampled function on the queries themselves, the
final cache holds two distinct queries with the same image.