Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Internal.OnWords

Running tidy machines on selected work tapes #

The embedded onWords specification stores the output on the selected tape while preserving all other tape words. The encoded-function specializations give time and space bounds for running their machine witnesses on selected tape layouts.

theorem Turing.MultiTapeTM.transformsTapes_onWords_embed {k K : ℕ} {Symbol : Type u_1} {S : Type u_2} {tm : MultiTapeTM k Symbol S} {x y : List Symbol} {t s : ℕ} (h : tm.TransformsTapes (fun (inp : List Symbol) (ws : Fin k → List Symbol) => inp = x ∧ ws = fun (x : Fin k) => []) (fun (x : List Symbol) (x_1 ws' : Fin k → List Symbol) (e : List Symbol) => (ws' = fun (x : Fin k) => []) ∧ e = y) t s) (mark : Symbol) (e : Fin (k + 1 + 2) ↪ Fin K) :
((tm.onWords mark).extendTapes e).TransformsTapes (fun (x_1 : List Symbol) (ws : Fin K → List Symbol) => ws (e (Fin.natAdd (k + 1) 0)) = x ∧ ∀ (j : Fin (k + 1 + 2)), j ≠ Fin.natAdd (k + 1) 0 → ws (e j) = []) (fun (x : List Symbol) (ws ws' : Fin K → List Symbol) (em : List Symbol) => ws' = Function.update ws (e (Fin.castAdd 2 (Fin.last k))) y ∧ em = []) (t + y.length + 6) (s + 2 * x.length + 2 * y.length + 3 * k + 18 + (K - (k + 1 + 2)))

onWords on embedded tapes, with every other tape arbitrary: the input on the tape selected for the input of onWords, its other tapes blank.

theorem Turing.MultiTapeTM.transformsTapes_outputToWord {β : Type u_1} {δ : Type u_2} {k K : ℕ} {S : Type u_3} {tm : MultiTapeTM k Bool S} {encB : β ↪ List Bool} {encD : δ ↪ List Bool} {f : β → δ} {t s : β → ℕ} (h : tm.ComputesFunTidilyInTimeAndSpace encB encD f t s) {e : Fin (k + 1) ↪ Fin K} {V : Fin K} (he : e (Fin.last k) = V) (b : β) :
(tm.outputToWord.extendTapes e).TransformsTapes (fun (inp : List Bool) (ws : Fin K → List Bool) => inp = encB b ∧ ws = fun (x : Fin K) => []) (fun (x : List Bool) (x_1 ws' : Fin K → List Bool) (em : List Bool) => ws' = Function.update (fun (x : Fin K) => []) V (encD (f b)) ∧ em = []) (t b + (encD (f b)).length + 2) (s b + 2 * (encD (f b)).length + 2 * K + 3)

A tidy machine writing its output to tape V.

theorem Turing.MultiTapeTM.transformsTapes_inputFromWord_fun {β : Type u_1} {δ : Type u_2} {k K : ℕ} {S : Type u_3} {tm : MultiTapeTM k Bool S} {encB : β ↪ List Bool} {encD : δ ↪ List Bool} {f : β → δ} {t s : β → ℕ} (h : tm.ComputesFunTidilyInTimeAndSpace encB encD f t s) {e : Fin (k + 2) ↪ Fin K} {V : Fin K} (he : e (Fin.natAdd k 0) = V) (b : β) :
((tm.inputFromWord true).extendTapes e).TransformsTapes (fun (x : List Bool) (ws : Fin K → List Bool) => ws = Function.update (fun (x : Fin K) => []) V (encB b)) (fun (x : List Bool) (ws ws' : Fin K → List Bool) (em : List Bool) => ws' = ws ∧ em = encD (f b)) (t b + 4) (s b + 2 * (encB b).length + 3 * K + 10)

A tidy machine run on the word on tape V, emitting its output.

theorem Turing.MultiTapeTM.transformsTapes_onWords {β : Type u_1} {δ : Type u_2} {k K : ℕ} {S : Type u_3} {tm : MultiTapeTM k Bool S} {encB : β ↪ List Bool} {encD : δ ↪ List Bool} {f : β → δ} {t s : β → ℕ} (h : tm.ComputesFunTidilyInTimeAndSpace encB encD f t s) {e : Fin (k + 1 + 2) ↪ Fin K} {V O : Fin K} (hi : e (Fin.natAdd (k + 1) 0) = V) (ho : e (Fin.castAdd 2 (Fin.last k)) = O) (b : β) :
((tm.onWords true).extendTapes e).TransformsTapes (fun (x : List Bool) (ws : Fin K → List Bool) => ws = Function.update (fun (x : Fin K) => []) V (encB b)) (fun (x : List Bool) (ws ws' : Fin K → List Bool) (em : List Bool) => ws' = Function.update ws O (encD (f b)) ∧ em = []) (t b + (encD (f b)).length + 6) (s b + 2 * (encB b).length + 2 * (encD (f b)).length + 4 * K + 15)

A tidy machine run on the word on tape V, writing its output to tape O.