Sequential composition of two multi-tape Turing machines
OpenCookLevin.turingMachine_and_composeLet and be two multi-tape Turing machines with tape counts and alphabet bounds that decide binary predicates and within time bounds and respectively.
Then there exists a composed multi-tape Turing machine with tape count and alphabet size satisfying that decides their boolean conjunction:
within the sum of the two time bounds:
The machine first runs on the input tapes . Upon reaching the halting state of , it inspects cell 1 of the verdict tape: if rejected (symbol ), halts and rejects; if accepted (symbol ), executes and writes 's verdict to the final verdict tape. The total step count is bounded by .
This theorem provides the general sequential composition principle for multi-tape Turing machines deciding languages on binary tape inputs.
import Definitions.Def_CookLevin_Cost
namespace CookLevin
theorem turingMachine_and_compose
(M1 M2 : Machine) (k1 k2 G1 G2 : Nat)
(hwf1 : TuringMachine k1 G1 M1) (hwf2 : TuringMachine k2 G2 M2)
(V1 V2 : List Bool → List Bool → Bool)
(T1 T2 : Nat → Nat)
(hdec1 : ∀ x w : List Bool, DecidesIn M1 k1 (boolsToSymbols x) (boolsToSymbols w) (T1 (x.length + w.length)) (V1 x w))
(hdec2 : ∀ x w : List Bool, DecidesIn M2 k2 (boolsToSymbols x) (boolsToSymbols w) (T2 (x.length + w.length)) (V2 x w)) :
∃ (M : Machine) (k G : Nat),
TuringMachine k G M ∧
∀ x w : List Bool,
DecidesIn M k (boolsToSymbols x) (boolsToSymbols w)
(T1 (x.length + w.length) + T2 (x.length + w.length))
(V1 x w && V2 x w) := by sorry
end CookLevin