Formula well-formedness decided in quadratic time by Turing machine
ProvedCookLevin.isFormulaStringB_machine_quadisformulastringbquadratic-timeturing-machineverifier
There exists a multi-tape Turing machine with tape count and alphabet size that decides whether an input string is a valid binary encoding of a CNF formula within quadratic time:
within at most steps for a constant .
The decision procedure evaluates isFormulaStringB x, which checks whether encodeFormula (decodeFormula x) = x. Decoding into a CNF formula and re-encoding into binary both perform linear-time sweeps over the representation. Comparing the re-encoded list with takes quadratic time on a standard Turing machine due to tape head repositioning. Because the decision is independent of the witness , the step count is bounded by .
Preamble
import Definitions.Def_CookLevin_Verifier
Formal statement
namespace CookLevin
theorem isFormulaStringB_machine_quad :
∃ (M : Machine) (k G : Nat) (c0 : Nat),
TuringMachine k G M ∧
∀ x w : List Bool,
DecidesIn M k (boolsToSymbols x) (boolsToSymbols w)
(c0 * (x.length + w.length + 1) ^ 2)
(isFormulaStringB x) := by sorry
end CookLevinSource