Documentation

CslibFrontier.Computability.Machines.ReadMachine.VirtualWord.Native

Streaming native configurations as query states #

The existing universal simulator already represents native work tapes by finite zippers and keeps the shifted input-head address in binary. This adapter reuses that representation and its native step certificate. Output history is never part of the saved query state. Position zero is the left boundary blank; a read at that position is ignored, and rightward movement from it is allowed. At the right boundary, the optional read stops further rightward movement.

Main definitions #

Main results #

This is an original infrastructure construction towards the recomputation argument on printed page 6 of expanded ECCC TR13-047 [GNR+13], not Lemma 3.3.

A numbered binary output symbol, with a total default on nonbinary descriptions.

Suppress the fetched bit at the native left boundary.

Arbitrary machine descriptions, with streaming output and no output history in SCfg.

The optional query read is exactly the native shifted-head read, including both blanks.

One query step is the existing streaming native step, even on halted configurations.

The saved query state is precisely the universal simulator's native work configuration.

Emission is the native step's output symbol, without retaining earlier output.

Streaming output agrees with the existing simulator's accumulated output at every clock.

Input-head storage is charged by the actual bounded native input convention, independently of runtime. This estimate does not assume a free bounded head or alter logspace predicates.

On a description of an existing native machine, the workspace term is its own visited-cell space, rather than a stronger resource premise built into a class definition.

On an existing binary native machine, output is preserved at every clock.

The complete native configuration is recovered from the saved state and the external output stream: finite control, input position, work tapes and work-head positions all agree.

The extracted halted flag agrees with native control, at every clock.

noncomputable def Turing.VirtualWord.Native.budget {k : ℕ} {S : Type} [Fintype S] (eS : S ↪ ℕ) (tm : MultiTapeTM k Bool S) (n s : ℕ) :

The explicit saved-configuration budget extracted from native workspace.

An ordinary native workspace certificate bounds the saved encoding by its budget, with the input head charged separately. No bound on the size of the output is needed.

theorem Turing.VirtualWord.Native.computableInSpace {k : ℕ} {S β : Type} [Fintype S] (eS : S ↪ ℕ) (tm : MultiTapeTM k Bool S) (encOut : β ↪ List Bool) (f : Simulation.Input → β) (T W : Simulation.Input → ℕ) (hhalt : ∀ (p : Simulation.Input), (MultiTapeTM.runFrom (tm.initCfg (word (↑p).original (↑p).data.cut (↑p).data.suffix)) (T p)).state = none) (hpre : ∀ (p : Simulation.Input), ∀ j < T p, (MultiTapeTM.runFrom (tm.initCfg (word (↑p).original (↑p).data.cut (↑p).data.suffix)) j).state ≠ none) (hout : ∀ (p : Simulation.Input), encOut (f p) = (MultiTapeTM.runFrom (tm.initCfg (word (↑p).original (↑p).data.cut (↑p).data.suffix)) (T p)).output) (hspace : ∀ (p : Simulation.Input), tm.RunsInSpace (word (↑p).original (↑p).data.cut (↑p).data.suffix) (W p)) :
∃ (time : Simulation.Input → ℕ) (c : ℕ), MultiTapeTM.ComputableInTimeAndSpace f Simulation.encInput encOut time fun (p : Simulation.Input) => c * (budget eS tm (word (↑p).original (↑p).data.cut (↑p).data.suffix).length (W p) + (encData (↑p).data).length + (Simulation.encInput p).length.log2 + 1)

Native virtual-input substitution from an existing machine's own first-halt, output and workspace certificates. The five component certificates and saved-state encoding bound are derived here, not assumed. Constants are uniform across supplied runtime headers and inputs.

theorem Turing.VirtualWord.Native.computableInSpace_of_computes {k : ℕ} {S β : Type} [Fintype S] (eS : S ↪ ℕ) (tm : MultiTapeTM k Bool S) (encOut : β ↪ List Bool) (f : Simulation.Input → β) (W : Simulation.Input → ℕ) (hcomp : ∀ (p : Simulation.Input), tm.Computes (word (↑p).original (↑p).data.cut (↑p).data.suffix) (encOut (f p))) (hspace : ∀ (p : Simulation.Input), tm.RunsInSpace (word (↑p).original (↑p).data.cut (↑p).data.suffix) (W p)) :
∃ (time : Simulation.Input → ℕ) (c : ℕ), MultiTapeTM.ComputableInTimeAndSpace f Simulation.encInput encOut time fun (p : Simulation.Input) => c * (budget eS tm (word (↑p).original (↑p).data.cut (↑p).data.suffix).length (W p) + (encData (↑p).data).length + (Simulation.encInput p).length.log2 + 1)

Plain native computation and workspace certificates suffice: the first-halt clock is selected internally. No time bound, output-length bound or substitution certificate is assumed.

theorem Turing.VirtualWord.Native.budget_le {k : ℕ} {S : Type} [Fintype S] (eS : S ↪ ℕ) (tm : MultiTapeTM k Bool S) :
∃ (C : ℕ), ∀ (n s : ℕ), budget eS tm n s ≤ C * (s + n.log2 + 1)

For each fixed native machine, its budget is linear in workspace plus logarithmic input length. The bounded input-head convention makes a polynomial-time premise unnecessary.

theorem Turing.VirtualWord.Native.of_logSpace {β : Type} {f : List Bool → β} {encOut : β ↪ List Bool} (hf : MultiTapeTM.ComputableInLogSpace f MultiTapeTM.encBits encOut) :
∃ (time : Simulation.Input → ℕ) (c : ℕ) (a : ℕ) (C : ℕ), MultiTapeTM.ComputableInTimeAndSpace (fun (p : Simulation.Input) => f (word (↑p).original (↑p).data.cut (↑p).data.suffix)) Simulation.encInput encOut time fun (p : Simulation.Input) => c * (C * (a * ((word (↑p).original (↑p).data.cut (↑p).data.suffix).length.log2 + 1) + (word (↑p).original (↑p).data.cut (↑p).data.suffix).length.log2 + 1) + (encData (↑p).data).length + (Simulation.encInput p).length.log2 + 1)

Every ordinary native logspace word function admits virtual-input substitution. This extracts its actual machine without strengthening ComputableInLogSpace. The saved-state budget is linear in its original logarithmic workspace plus the binary input-head cost, by budget_le. Runtime header preparation is still a separate obligation.