Documentation

Complexity.Computability.Complexity.Classes.Space.TQBF.PolyTime

The reduction to TQBF in polynomial time #

A formula is encoded by the list of its tokens in prefix order (Cslib.Complexity.encQBF), so a formula is computed in polynomial time as soon as its tokens are (Cslib.Complexity.TQBF.computableTidilyInPolyTime_of_tokens). The connectives of Cslib.Logic.PL.QBF and the derived connectives of the midpoint formulas (blocks of quantifiers, conjunctions of lists, implication, equivalence, literals, formulas in conjunctive normal form) get composition rules for fun_prop, with their tokens written out explicitly (Cslib.Logic.PL.QBF.tokens_exs, Cslib.Logic.PL.QBF.tokens_conj, …).

The variables of the blocks are numbered by 2 * Nat.pair (3 * i + kind) j for a level i and an index j below the width w, so they are computed in unary, where their size is polynomial in w, and converted to binary. The midpoint formula of level d is computed from its tokens (Cslib.Complexity.TQBF.tokens_midpoint): the levels from d down to 1, each with O(w) tokens, then the formula of level 0. So Savitch's formula is polynomial-time in the width and depth in unary, the two words, and the formula of level 0 (Cslib.Complexity.TQBF.computableTidilyInPolyTime_savitchFormula).

The formula of level 0 numbers the variables of a Cook–Levin tableau by odd numbers (Cslib.Complexity.TQBF.computableTidilyInPolyTime_tabVar), and is polynomial-time in the tableau. Composed with the polynomial-time width and codes of the views (Turing.MultiTapeNTM.computableTidilyInPolyTime_codeWidth) and the polynomial-time Cook–Levin tableau (Cslib.Complexity.CookLevin.computableTidilyInPolyTime_tableau), the reduction Cslib.Complexity.TQBF.reduce is polynomial-time, for every machine standing for the test of one step or none and every polynomial time bound (Cslib.Complexity.TQBF.computableTidilyInPolyTime_reduce). That test is itself polynomial-time (Cslib.Complexity.TQBF.computableTidilyInPolyTime_edgeTest), which provides the machine.

Main results #

References #

Formulas from their tokens #

A formula is polynomial-time when its tokens are.

A block of existential quantifiers, over a list of variables in binary.

A block of universal quantifiers, over a list of variables in binary.

The midpoint formulas #

The midpoint formula of level d, from the width and level in unary and the formula of level 0.

Savitch's formula is polynomial-time in the width and depth in unary, the formula of level 0, and the two words.

The formula of level 0 #

The block variable holding a certificate bit, from the width and the index in unary.

A tableau as the formula of level 0 is polynomial-time in the tableau and the width in unary.

The reduction #

The width of the words of the reduction, in unary.

The test of one step or none between codes is polynomial-time, on the instance and the concatenation of the two codes.

theorem Cslib.Complexity.TQBF.computableTidilyInPolyTime_reduce {α : Type} {enc : α ↪ List Bool} {k : ℕ} {State : Type} [Finite State] {ntm : Turing.MultiTapeNTM k Bool State} {c d kV : ℕ} {StateV : Type} [Fintype StateV] [DecidableEq StateV] (tmV : Turing.MultiTapeTM kV Bool StateV) (cV dV : ℕ) :

The reduction to TQBF is polynomial-time, for every machine tmV standing for the test of one step or none and every time bound cV * (n + 1) ^ dV allowed to it.