Estimating acceptance probabilities by repeated trials #
The success counter is an ordinary probabilistic program. Its independent product law gives Hoeffding bounds for the count and for its empirical acceptance probability. Division and real numbers occur only in the specification: the program returns a natural number.
Cslib.Computability.Probabilistic.Repeat supplies the separate strict PPT certificate whenever
the trial program and its unary repetition count are efficient.
Main results #
Cslib.ProbComp.countTrue_average_deviation_pow: exponentially accurate empirical rates with a polynomial trial budget in the confidence and inverse tolerance.Cslib.ProbComp.testProbabilityLT_error_pow_of_bounds: rational threshold tests satisfy overlapping postconditions except with exponentially small probability.Cslib.ProbComp.replicate_failure_pow: repeated sampling finds a good value with high probability; its proof predicate need not be computable.
References #
Adapted from Languages/Probabilistic/Concentration.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8. The concentration estimate is the finite-product
bound from Probability.Concentration, following Hoeffding.
A polynomial trial budget gives inverse-polynomial accuracy and exponentially small failure. Both parameters are natural numbers, so a client can compute the budget with unary arithmetic.
Polynomially many independent draws find a good value except with exponentially small probability whenever one draw succeeds with inverse-polynomial probability. The predicate is used only in the proof and need not be efficiently decidable.
Except with the Hoeffding error, a true test result implies the probability is at most the threshold plus tolerance; a false result implies it is at least the threshold minus tolerance.
The rational threshold test has a polynomial trial budget and exponentially small error.
A threshold test may target wider, overlapping postconditions. This form lets clients use the bounds required by an algorithm without carrying its sampling tolerance further.