Binary-counter exponential iteration on fair-coin multitape machines #
Cslib.Probability.IsPPTOn.iterate_spec clocks bounded adaptive loops in polynomial time when the
iteration count is computed in unary (encUnary). Exponential-time randomized algorithms such as
Schöning's k-SAT walk instead repeat a polynomial-time step an exponential number of times while
reusing polynomial workspace across restarts.
When the iteration count count : α → ℕ is computable in polynomial time in binary (encNat),
(encNat (count a)).length is polynomial in (input a).length even when count a itself is
exponential. Pairing a binary countdown counter with a polynomially bounded state and running clean
phases inside Turing.MultiTapePTM.repeatUntilBlank produces one finite-control MultiTapePTM
whose runs:
- halt on every branch within
C * ((count a + 1) * ((input a).length + 1) ^ E)steps, - realize
(ProbComp.eval (OracleComp.iterate (count a) (step a) (initial a))).map stateEncoding, - visit at most
C * ((input a).length + 1) ^ Ework-tape cells (toNTM.RunsInSpace), independent ofcount a.
Main definitions #
Cslib.Probability.repeatAnyStep: one OR-accumulating trial step (if acc then pure true else trial).
Main results #
Cslib.Probability.eval_iterate_repeatAnyStep_false_toReal:rindependent trials fail with probability(1 - p) ^ r.Cslib.Probability.IsPPTOn.exists_multiTapePTM_iterate_binary: closed binary-counter iteration with(count a + 1) * poly(|input a|)halting time and polynomial workspace.Cslib.Probability.IsPPTOn.exists_multiTapePTM_iterateWith_binary: captured-input variant.Cslib.Probability.IsPPTOn.exists_multiTapePTM_repeatAnyBool_binary: repeating a strict PPT Boolean trial an exponential binary-computable number of times in polynomial workspace.
Exponential independent Boolean trial repetition #
r independent trials fail (false) with probability (1 - p) ^ r, where
p = (ProbComp.eval trial true).toReal.
Repeating a strict PPT Boolean trial an exponential binary-computable number of times. Given
htrial : IsPPTOn input encBool trialProg and hcount : ComputableInPolyTime trials input encNat,
one finite-control fair-coin MultiTapePTM halts on every branch within
C * ((trials a + 1) * ((input a).length + 1) ^ E) steps, runs in polynomial workspace
C * ((input a).length + 1) ^ E, never outputs [true] when trialProg a has zero probability of
true, and outputs [true] with probability 1 - (1 - p) ^ (trials a) where
p = (ProbComp.eval (trialProg a) true).toReal.