Documentation

CslibFrontier.DataStructure.HashFamily.Randomized

Resamplable hash families as randomized specifications #

HashFamily.seedSpec seedLaw eval is the seed-level model of a resamplable hash family as a RandomizedSpec. Its state is the current seed: resample draws a fresh seed from seedLaw, and eval u answers eval θ u at the seed θ. On the oblivious client of an operation list it is evalOpsFromSeed (run_obliviousClient_seedSpec), and after an initial resample it is evalOps (run_resample_obliviousClient_seedSpec). An implementation that refines seedSpec by a RandomizedRefinement therefore meets every contract proved for evalOps, such as kWiseSpec_contract_evalOps, and its adaptive clients are described by seedSpec as well.

Main definitions #

Main results #

@[reducible, inline]
noncomputable abbrev Cslib.DataStructure.HashFamily.seedSpec {Seed : Type} {U m : ℕ} (seedLaw : PMF Seed) (eval : Seed → Fin U → Fin m) :

The seed-level model of a resamplable hash family: the state is the current seed, resample draws a fresh seed from seedLaw, and eval u answers eval θ u without changing the seed.

theorem Cslib.DataStructure.HashFamily.run_obliviousClient_seedSpec {Seed : Type} {U m : ℕ} (seedLaw : PMF Seed) (eval : Seed → Fin U → Fin m) (θ : Seed) (ops : List (Op U)) :
PMF.map Prod.fst ((seedSpec seedLaw eval).run ((seedSpec seedLaw eval).obliviousClient ops) θ) = evalOpsFromSeed seedLaw eval θ ops

Running the oblivious client of ops from the seed θ gives the transcript law evalOpsFromSeed.

theorem Cslib.DataStructure.HashFamily.run_resample_bind_seedSpec {Seed : Type} {U m : ℕ} (seedLaw : PMF Seed) (eval : Seed → Fin U → Fin m) {α : Type} (θ : Seed) (p : OracleComp (Result m) α) :
(seedSpec seedLaw eval).run (do let _ ← OracleComp.query Op.resample p) θ = seedLaw.bind fun (θ' : Seed) => (seedSpec seedLaw eval).run p θ'

After an initial resample, a client runs from a fresh seed drawn from seedLaw.

theorem Cslib.DataStructure.HashFamily.run_resample_obliviousClient_seedSpec {Seed : Type} {U m : ℕ} (seedLaw : PMF Seed) (eval : Seed → Fin U → Fin m) (θ : Seed) (ops : List (Op U)) :
PMF.map Prod.fst ((seedSpec seedLaw eval).run (do let _ ← OracleComp.query Op.resample (seedSpec seedLaw eval).obliviousClient ops) θ) = evalOps seedLaw eval ops

After an initial resample, the transcript law of the oblivious client of ops is evalOps.