Documentation

CslibFrontier.Languages.Probabilistic.RandomOracle.Through

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 #

References #

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.