Documentation

CslibFrontier.Computability.Probabilistic.BoundedUniform

Strict fair-bit implementations of bounded sampling #

Except in the early-stopping sampler, every attempt is sampled and stored before searching, and all coordinates and output framing are charged. The unary certificates charge the numerical bound, radius, dimension and attempt count. They do not imply polynomial dependence on the logarithm of a cryptographic modulus. Failure remains in the certified program's output.

Main results #

Unary bounds and attempt counts give a uniform strict PPT sampler, including its failure result and every stored attempt.

Binary bounds need only a unary attempt count. The sampler draws log₂ bound + 1 bits, a width computed in polynomial time from the binary bound, not a unary copy of bound; exponential cryptographic bounds are therefore permitted when the bound and attempt count are efficient.

Early stopping is strict PPT for binary bounds and a unary attempt budget. Each attempt draws bound.size bits, a width computed in polynomial time from the binary bound.

A runtime-varying integer box is sampled in uniform strict PPT when the numerical radius, dimension and per-coordinate attempt budget are efficiently supplied in unary. The full optional, framed list output and all attempted coordinates are charged.

theorem Cslib.Probability.length_enc_sampleIntegerBox {radius dimension attempts : ℕ} {result : Option (List ℤ)} (h : result ∈ (ProbComp.sampleIntegerBox radius dimension attempts).eval.support) :

The complete framed optional output has a direct linear bound in dimension and unary radius; failure encodes as the empty word.