Length comparison is PolyTimeDecidable
ProvedCookLevin.lengthCheck_polyTimeDecidablepolynomial-timeturing-machine
The length comparison is polynomial-time decidable.
This predicate checks whether the certificate is no longer than the instance . A multi-tape Turing machine can decide this by scanning both tapes simultaneously from left to right: if the head on the -tape reaches a blank symbol before or at the same time as the head on the -tape, accept; otherwise reject. This runs in steps, which is clearly bounded by for .
Preamble
import Definitions.Def_CookLevin_Complexity
Formal statement
namespace CookLevin
theorem lengthCheck_polyTimeDecidable :
PolyTimeDecidable (fun x w => decide (w.length ≤ x.length)) := by sorry
end CookLevinSource