Random-Oracle Simulation Helpers #
Generic lemmas for simulating OracleComp (unifSpec + hashSpec) computations via
unifFwdImpl + ro in StateT hashSpec.QueryCache ProbComp, where unifFwdImpl forwards
uniform-randomness queries and ro handles the hash oracle (typically randomOracle).
These lemmas factor out boilerplate shared by FiatShamir.perfectlyCorrect,
FiatShamirWithAbort.correct, and other random-oracle-model proofs.
The typical usage pattern is:
let ro : QueryImpl hashSpec (StateT hashSpec.QueryCache ProbComp) := randomOracle
let impl := unifFwdImpl hashSpec + ro
Then the roSim namespace lemmas apply to simulateQ impl.
Main definitions #
unifFwdImpl: the identity forwarding implementation forunifSpec, lifted toStateT
The identity forwarding implementation for unifSpec queries, lifted to
StateT hashSpec.QueryCache ProbComp. Each uniform query passes through to the underlying
ProbComp without touching the cache state.
Instances For
Simulating a plain ProbComp through unifFwdImpl and running it on cache s leaves
the cache untouched, pairing each sampled output with the unchanged s.
Simulating a liftComp-embedded ProbComp through unifFwdImpl + ro discards the hash
oracle, reducing to simulation through unifFwdImpl alone.
Running the unifFwdImpl + ro simulation of a lifted ProbComp on cache s leaves the
cache untouched, pairing each sampled output with s.
The support of the unifFwdImpl + ro simulation of a lifted ProbComp run on cache s
is the image of support oa under pairing each output with s.
Running the unifFwdImpl + ro simulation of a lifted ProbComp bound to a continuation,
projected to its value via run', samples oa and then runs each continuation on cache s.
Simulating a hashSpec query through unifFwdImpl + ro dispatches it to the hash-oracle
handler ro, since uniform forwarding leaves hash queries to ro.
Simulating a HasQuery.query hash query through unifFwdImpl + ro dispatches it to the
hash-oracle handler ro, matching simulateQ_liftM_spec_query through the monad-lift form.
The random-oracle simulation of a plain OracleComp never fails on any starting cache.
Support characterization for lazy random-oracle simulation.
A value a can appear as the output of the random-oracle simulation from cache iff some total
answer function agreeing with cache evaluates the computation to a. The final cache produced
by the simulation is existentially quantified away.
Probability-one form of the random-oracle support characterization.
A predicate on the result value holds with probability one under lazy random-oracle simulation
from preexisting_cache iff it holds for every total answer function agreeing with that cache.
Simulating the random oracle leaves a mapped uniform Fin sample unchanged: the query is
intercepted, but from the empty cache it misses and resamples uniformly, and the updated cache is
then discarded by run', so the distribution over results is identical to the original sample.