Polynomial-space ordered folds over bitstrings #
SpaceIter.mem_PSPACE_of_bitstring_fold folds over exponentially many
fixed-width candidates using a polynomial-time update and a polynomial-size
accumulator. Every prefix accumulator, including the seed and final value,
must satisfy the stated bound. A polynomial-time test of the result defines
a language in PSPACE.
Candidates have exactly w.eval x.length bits and are visited in increasing
little-endian numeric order. There is one candidate even at width zero. Empty
accumulators are allowed, and no algebraic laws on the update are required.
The proof uses initializedStep and SpaceIter.mem_PSPACE_of_iterate. Its
packed states have length at most 4*W + 2*V + |x| + 22, and completion is
signalled at iteration 2^W + 1. This is a depth-one exponential fold; a
polynomial-depth game-tree evaluator still requires a stack construction.
An ordered fold over all polynomial-width bitstrings is computable for
decision purposes in polynomial space. The update receives pair x (pair c a);
the final test receives pair x a. All accumulator prefixes must be short.
Fixed-width witness search is the Boolean-OR instance of the ordered fold.
The polynomial-time predicate receives pair x candidate; width zero tests [].
Small kernel-checked examples fix the order and boundary conventions.