Saved samples in adaptive oracle interactions #
An external handler can consume one saved sample per call while the client continues drawing
independent private randomness. For a program making at most n external queries, n
independent samples drawn in advance give exactly the online joint law of the result and the
handler's state (ProbOracleComp.IsQueryBounded.run_interpret_presample). Unused samples are
discarded in this equality; they need not be independent of the final state or the client's
stopping time. The handler's fallback value is never used, so a run on a sufficient list of
samples is a function of those samples.
This is the library's presampling theorem. A program without private coins is the special case
OracleComp.IsQueryBounded.run_interpret_presample, and closed ProbComp handlers the special
case ProbOracleComp.IsQueryBounded.eval_presample.
Main definitions #
Cslib.OracleComp.withSampleList: supply a list's head to a handler and retain its tail.
Main results #
Cslib.ProbOracleComp.IsQueryBounded.run_interpret_presample: presampling preserves the joint law of result and state.Cslib.ProbOracleComp.IsQueryBounded.eval_presample: the same for closed probabilistic handlers.Cslib.OracleComp.IsQueryBounded.run_interpret_presample: the same without private coins.
References #
Adapted from Languages/Probabilistic/Presample.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8, using the typed sum of private and external calls.
Supply the next saved sample to a stateful handler. The fallback makes short lists total; the ordinary state and unused suffix are retained.
Instances For
Presampling. A program makes at most n external queries, and a handler draws one sample
from source per external query. Answering from n independent samples drawn in advance instead
gives the same joint law of the result and the handler's state. Private samples are drawn online
in both runs. The statement is exact and independent of the efficiency of the program, the
handler and the source.
Presampling with closed probabilistic handlers. The ProbComp form of
IsQueryBounded.run_interpret_presample: n saved samples from source give the online joint law
of the result and the handler's state.
Presampling without private coins. A program makes at most n calls, and a handler draws
one sample from source per call. Answering from n independent samples drawn in advance gives
the same joint law of the result and the handler's state.