Quantitative certificates for polynomial PRG stretch #
Keep a seed of the original length at the front of a word. Each iteration expands that seed by one
bit and retains the previously emitted suffix. Efficiency (polyTime_iterate, polyTime_stretch)
only needs a bounded seed prefix; the one-bit length promise is used separately to prove output
lengths.
Under the genuine one-bit length invariant ((generator s).length = s.length + 1), iterate and
stretch also admit cumulative quantitative certificates (ComputableTidilyInTimeAndSpace) that
stream the emitted bits in forward generation order followed by the reversed final seed
(forwardIterate), charging O(n + k + ∑_{i < k} (tGen(seed_i) + n + 1)) time and O(Q + n + 1)
workspace during the streaming loop, and then apply one linear-time zero-workspace reversal
(Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.reverse_bits) whose composition charges the
(n + k)-bit reversal buffer to restore the exact original output order.
Main definitions #
Cslib.Crypto.PRGStretch.step,Cslib.Crypto.PRGStretch.iterate,Cslib.Crypto.PRGStretch.stretch: repeatedly expand a fixed-width seed prefix and retain emitted bits.Cslib.Crypto.PRGStretch.seedStep,Cslib.Crypto.PRGStretch.emitBit,Cslib.Crypto.PRGStretch.seedAt,Cslib.Crypto.PRGStretch.forwardIterate: seed trajectory and forward-streamed intermediate representation before final reversal.
Main results #
Cslib.Crypto.PRGStretch.polyTime_iterate,Cslib.Crypto.PRGStretch.polyTime_stretch: captured functional iteration and stretch have uniform polynomial-time TM certificates without a length promise on the generator.Cslib.Crypto.PRGStretch.forwardIterate_eq: the forward representation emits each round's bit in generation order, then the reversed final seed.Cslib.Crypto.PRGStretch.computableTidilyInTimeAndSpace_forwardIterate,Cslib.Crypto.PRGStretch.computableTidilyInTimeAndSpace_forwardIterate_captured: streamingkexpansions in forward order with cumulative time andk-independent workspaceO(Q + n + 1), both clients ofTuring.MultiTapeTM.ComputableTidilyInTimeAndSpace.iterate_unary_stream_sum.Cslib.Crypto.PRGStretch.computableTidilyInTimeAndSpace_iterate_pair,Cslib.Crypto.PRGStretch.computableTidilyInTimeAndSpace_iterate_captured,Cslib.Crypto.PRGStretch.computableTidilyInTimeAndSpace_stretch,Cslib.Crypto.PRGStretch.computableTidilyInDegree_stretch,Cslib.Crypto.PRGStretch.polyTime_stretch_of_length_eq: quantitative cumulative-time, workspace and degree certificates foriterate(unparameterized and with captured parameters) andstretch, preserving the exact reverse-generation output order and recoveringComputableTidilyInPolyTime.
References #
- B. Barak, Pseudorandomness, CS 127, length extension for PRGs. We retain the final seed and reverse the order of the emitted bits.
A generator need only expand seeds at the specified length. Longer input words carry a saved suffix, and every subsequent iteration again uses a correctly sized seed prefix.
Iteration may capture an arbitrary encoded input. Every call reads only a bounded seed prefix, so polynomial time follows without a length promise on the generator.
Any efficiently computed iteration count gives an efficient generator.
Quantitative cumulative-time and workspace certificates #
Forward streaming representation of count PRG expansions from seed: emits each round's bit
in forward generation order, followed by the reversed final seed
(seedAt generator seed count).reverse. Reversing this word once yields
iterate generator seed.length count seed.
Instances For
Under the one-bit length promise at seed.length, every round seed seedAt generator seed i
has length seed.length.
The streaming fold state after j ≤ count unary tokens equals seedAt generator seed j.
Expanding seed ++ suffix for count rounds produces seedAt generator seed count, followed
by the emitted bits in reverse generation order, followed by suffix.
Reversing forwardIterate generator count seed recovers the exact output of
iterate generator seed.length count seed (final seed followed by emitted bits in reverse
generation order).
forwardIterate emits the bits of the rounds in generation order, then the reversed final
seed.
Quantitative streaming certificate for forwardIterate. On input (seed, count) encoded
with encPair encBits encUnary, forwardIterate streams count rounds directly from the unary
suffix on the input tape, emitting each round's bit in generation order and finishing with the
reversed final seed. Each round runs the generator twice, once for the next seed and once for the
emitted bit, and both runs are charged; workspace is O(Q + seed.length + 1), independent of the
round count count.
Quantitative cumulative-time and workspace certificate for PRGStretch.iterate.
Composing forwardIterate with the linear-time zero-workspace reversal primitive
ComputableTidilyInTimeAndSpace.reverse_bits produces the exact output of
iterate generator p.1.length p.2 p.1. The time bound remains
O(n + k + ∑_{i < k} (tGen(seed_i) + n + 1)), while the workspace bound O(Q + n + k + 1)
explicitly includes the (n + k)-bit intermediate reversal buffer.
Quantitative cumulative-time and workspace certificate for PRGStretch.stretch.
On input seed : List Bool of length n with k = count n, stretch generator count runs in
time O(tCount n + n + k + ∑_{i < k} (tGen(seed_i) + n + 1)) and workspace
O(sCount n + Q seed + n + k + 1), charging count, pair assembly, every round's generator
callbacks and seed copying, and the (n + k)-bit reversal buffer.
Degree-level quantitative certificate for PRGStretch.stretch.
If generator is computable in degree (dGen, eGen) and count is computable in degree
(dCount, eCount), then under the one-bit length promise (generator s).length = s.length + 1,
stretch generator count is computable in time/space degree max dCount (eCount + max dGen 1) and
output-size degree max 1 eCount.
Recover ComputableTidilyInPolyTime (stretch generator count) directly as a corollary of the
quantitative streaming theorem computableTidilyInTimeAndSpace_stretch (via
computableTidilyInDegree_stretch).
Quantitative streaming certificate for forwardIterate with a captured parameter. On input
((a, seed), count) encoded with encPair (encPair encParam encBits) encUnary, the streaming state
holds (a, seed_i) on encPair encParam encBits, so the captured parameter length
(encParam a).length is charged alongside seed.length in each round's copying cost and in the
workspace bound, which stays independent of count.
Quantitative cumulative-time and workspace certificate for PRGStretch.iterate with a
captured parameter. On input ((a, seed), count) encoded with
encPair (encPair encParam encBits) encUnary, the streaming state holds (a, seed_i) on
encPair encParam encBits, so the captured parameter length (encParam a).length is charged
alongside seed.length in each round's copying cost and in the workspace bound.