String equality decided in linear time by multi-tape Turing machine
ProvedCookLevin.tapeEquality_comparatorcomparatorlinear-timestring-equalityturing-machine
There exists a multi-tape Turing machine with tape count and alphabet size that decides equality between two binary strings and :
within linear time for a constant .
The machine advances its heads simultaneously across tape 0 (holding ) and tape 1 (holding ), comparing tape symbols at each position until encountering a blank. If all symbols match and blanks are reached concurrently, the machine writes (accept) to cell 1 of the verdict tape; otherwise, it writes (reject). The total step count is linear in the length of the strings.
Preamble
import Definitions.Def_CookLevin_Cost
Formal statement
namespace CookLevin
theorem tapeEquality_comparator :
∃ (M : Machine) (k G c2 : Nat),
TuringMachine k G M ∧
∀ x y : List Bool,
DecidesIn M k (boolsToSymbols x) (boolsToSymbols y)
(c2 * (x.length + 1))
(decide (y = x)) := by sorry
end CookLevinSource