Multi-Epoch Hash-Family Oblivious-Sequence Specifications #
This file defines oblivious-sequence specifications (Cslib.DataStructure.ObliviousSequenceSpec)
for resamplable hash families over a key universe Fin U and codomain Fin m with operations
Op.resample (starting a new resampling epoch with an independently sampled seed) and Op.eval u
(evaluating the active hash function at u : Fin U):
kWiseSpec k U m: on any oblivious operation sequence querying at mostkdistinct keys within each resampling epoch (BoundedEpochKeys k ops), the transcript distribution equals the exact independent-epochk-wise uniform distributionidealTranscriptPMF m ops.whpKWiseSpec k U m δ: relaxes this contract to anE * δcoupling bound (Cslib.Probability.PMF.CoupledWithin) againstidealTranscriptPMF m ops, whereE = epochCount opsis the number of resampling epochs.kWiseSpec_contract_evalOpsandwhpKWiseSpec_contract_evalOps_prod: prove that any finite-seedk-wise independent hash family satisfieskWiseSpec, and any two-level finite-seed hash family whose top seed falls in ak-wise independent setGoodTopwith failure probabilityδsatisfieswhpKWiseSpec k U m δ.
Main definitions #
Cslib.DataStructure.HashFamily.Op,Cslib.DataStructure.HashFamily.Result,Cslib.DataStructure.HashFamily.Label: hash-family operations (.resampleand.eval u), observation types (PUnitandFin m), and input-output labels.Cslib.DataStructure.HashFamily.BoundedEpochKeys,Cslib.DataStructure.HashFamily.epochCount,Cslib.DataStructure.HashFamily.idealTranscriptPMF,Cslib.DataStructure.HashFamily.evalOpsFromSeed,Cslib.DataStructure.HashFamily.evalOps: epoch key-count bounds, ideal multi-epoch uniform hash transcripts, and concrete multi-epoch seed evaluation.Cslib.DataStructure.HashFamily.kWiseSpec,Cslib.DataStructure.HashFamily.whpKWiseSpec: exact and high-probabilityk-wise independent hash-family specifications.
Main results #
Cslib.DataStructure.HashFamily.evalOpsFromSeed_eq_of_afterCurrentEpoch_eq_none,Cslib.DataStructure.HashFamily.evalOpsFromSeed_eq_of_afterCurrentEpoch_eq_some,Cslib.DataStructure.HashFamily.evalOps_eq_of_afterCurrentEpoch_eq_none,Cslib.DataStructure.HashFamily.evalOps_eq_of_afterCurrentEpoch_eq_some,Cslib.DataStructure.HashFamily.evalOpsFromSeed_map_equiv: epoch decomposition and seed-equivalence transport equations forevalOpsFromSeedandevalOps.Cslib.DataStructure.HashFamily.kWiseSpec_contract_evalOps: any finite-seedk-wise independent hash family satisfieskWiseSpecunder uniform resampling.Cslib.DataStructure.HashFamily.whpKWiseSpec_contract_evalOps_prod,Cslib.DataStructure.HashFamily.whpKWiseSpec_contract_evalOps_equiv: any two-level hash family with a(1 - δ)-good top-seed event satisfieswhpKWiseSpec k U m δunder uniform resampling.
References #
When afterCurrentEpoch ops = some rest, rest is strictly shorter than ops.
Deterministic transcript of the current epoch of ops (before the first .resample),
determined by the restriction g : currentEpochKeys ops → Fin m of the hash function to the keys
queried in that epoch.
Ideal multi-epoch transcript distribution of a k-wise independent hash family with codomain
Fin m: in each epoch, the values on currentEpochKeys ops are drawn uniformly from
currentEpochKeys ops → Fin m, independently of all subsequent epochs.
Step-by-step evaluation of ops : List (Op U) starting from an active seed θ : Seed:
.eval u deterministically returns eval θ u without changing θ, while .resample draws a
fresh seed θ' ← seedLaw and continues with θ'.
Multi-epoch transcript distribution induced by drawing an initial seed θ₀ ← seedLaw and
executing ops : List (Op U) via evalOpsFromSeed.
Exact k-wise independent hash-family specification over universe Fin U and codomain
Fin m: on any oblivious operation sequence ops querying at most k distinct keys per
resampling epoch (BoundedEpochKeys k ops), the output transcript distribution equals
idealTranscriptPMF m ops.
High-probability k-wise independent hash-family specification with per-epoch failure bound
δ : ℝ≥0∞: on any oblivious operation sequence ops querying at most k distinct keys per
resampling epoch (BoundedEpochKeys k ops), every supported transcript matches ops and the
transcript distribution μ is coupled within (epochCount ops : ℝ≥0∞) * δ of
idealTranscriptPMF m ops.
On a single-epoch sequence (afterCurrentEpoch ops = none), evalOpsFromSeed reduces to a
point mass on currentEpochPrefixTranscript applied to the restricted hash function
(currentEpochKeys ops).restrict (eval θ).
When afterCurrentEpoch ops = some rest, evalOpsFromSeed decomposes into the
deterministic current-epoch prefix currentEpochPrefixTranscript followed by .resample and an
independent draw from evalOps seedLaw eval rest.
On a single-epoch sequence (afterCurrentEpoch ops = none), evalOps is the pushforward of
the restricted seed distribution seedLaw.map (fun θ => (currentEpochKeys ops).restrict (eval θ))
under currentEpochPrefixTranscript m ops.
When afterCurrentEpoch ops = some rest, evalOps decomposes into the current-epoch prefix
distribution bound to an independent tail draw evalOps seedLaw eval rest.
Fundamental bridge theorem for exact k-wise independent hash families:
if eval : Seed → Fin U → Fin m satisfies IsKWiseIndependentHash k eval, then on any oblivious
operation sequence ops querying at most k distinct keys per epoch (BoundedEpochKeys k ops),
evalOps (PMF.uniformOfFintype Seed) eval ops equals idealTranscriptPMF m ops and
therefore satisfies (kWiseSpec k U m).Contract ops.
Every distribution whose supported transcripts match ops (TranscriptMatches ops) and
which satisfies (kWiseSpec k U m).Contract ops also satisfies
(whpKWiseSpec k U m δ).Contract ops for any δ : ℝ≥0∞.
Fundamental bridge theorem for two-level high-probability k-wise hash families:
if eval : TopSeed → BotSeed → Fin U → Fin m is k-wise independent on every good top seed
α ∈ GoodTop, then under uniform resampling on TopSeed × BotSeed, any oblivious sequence ops
querying at most k distinct keys per epoch (BoundedEpochKeys k ops) satisfies
(whpKWiseSpec k U m δ).Contract ops with bad-seed measure
δ = (#(Finset.univ \ GoodTop) : ℝ≥0∞) / Fintype.card TopSeed.
Relabelling the seed type along an equivalence e : Seed₁ ≃ Seed₂ transports
evalOpsFromSeed by pushing forward seedLaw along e and pulling back eval along e.symm.
Transport whpKWiseSpec_contract_evalOps_prod along a seed equivalence
e : Seed ≃ (TopSeed × BotSeed).