Uniform strict probabilistic polynomial time #
IsPPTOn input output program identifies the encoded result distribution with one finite-control
fair-coin machine, clocked by a polynomial in the encoded input length. The machine and polynomial
are fixed before quantifying over inputs. Only fair bits are supplied to the machine, and it has
no oracle channels. Thus arbitrary Lean computation, nonuniform advice, and arbitrary distribution
samplers are not free operations.
The clock bounds every execution, rather than its expectation. The witness is forcibly stopped
at its clock; this definition does not require that its control state has already halted.
PPT.Clock compiles every such witness to an intrinsically halting finite machine, charging
preparation and consumption of a unary budget to its polynomial bound.
In particular, this definition does not certify exact uniform sampling from every finite type.
The public input and output encodings reuse the tidy calculus. A deterministic certificate lifts
directly to IsPPTOn without another deterministic computability predicate. PPT.Composition
certifies monadic bind, deterministic preprocessing and postprocessing. PPT.Capture permits
captured inputs and efficient conditionals. Adaptive certifies bounded probabilistic loops from
supported state-size invariants. Tactic.PPT automates the closed program rules and constant-growth
loops; oracle PPT requires further certified constructions.
Adapted from the cslib crypto branch's Computability/Probabilistic/PPT.lean at
5ff69ca93402e7c947208dc56396d6d86203ccd8. The witness uses the common machine and any finite
control type, as the upstream tidy calculus does, instead of imposing a separate Fin presentation.
Main definitions #
Cslib.Probability.IsPPTOn: uniform strict PPT on encoded types.
Main results #
Turing.MultiTapeTM.ComputableTidilyInPolyTime.isPPTOn: deterministic certificates lift to PPT.Cslib.Probability.IsPPTOn.length_le: every supported encoded output is polynomially bounded.
One finite fair-coin machine realizes the program, with a uniform polynomial clock. The clock is strict on every execution and includes the cost of writing the encoded output.
Instances For
Distributional equality reuses the same finite machine and clock.
A program returning its declared encoding has the same machine-level contract.
Reuse a tidy deterministic machine as a fair-coin machine that ignores its sampled bits.