Copying a first-cell-marked input #
The copier distinguishes the first input bit, writes the empty-input marker
when necessary, and then uses the existing simulator's rewind phase. The total
initialization cost remains exactly 2 * input.length + 2 transitions.
theorem
Complexity.MathlibTM0.MarkedMachine.prefixCells_length
(M : MarkedMachine)
(w : List Bool)
:
theorem
Complexity.MathlibTM0.MarkedMachine.prefixCells_append
(M : MarkedMachine)
(w : List Bool)
(b : Bool)
:
noncomputable def
Complexity.MathlibTM0.MarkedMachine.contents
(M : MarkedMachine)
(cells : List M.Alphabet)
(i : Track M.binary)
(z : ℤ)
:
Symbol tracks containing the specified complete source cells.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Complexity.MathlibTM0.MarkedMachine.contents_append
(M : MarkedMachine)
(cells : List M.Alphabet)
(a : M.Alphabet)
(i : Track M.binary)
:
M.contents (cells ++ [a]) i = Function.update (M.contents cells i) (↑cells.length) (SymbolTracks.encode (Symbol.source a) ((trackEquiv M.binary) i))
noncomputable def
Complexity.MathlibTM0.MarkedMachine.copyCfg
(M : MarkedMachine)
(w : List Bool)
(t : ℕ)
(ht : t ≤ w.length)
:
Turing.Cfg (Fintype.card M.binary.Alphabet) Bool M.TargetState w
The marked copier after reading the first t input bits.
Equations
- One or more equations did not get rendered due to their size.
Instances For
noncomputable def
Complexity.MathlibTM0.MarkedMachine.rewindCfg
(M : MarkedMachine)
(w : List Bool)
(t : ℕ)
(ht : t ≤ w.length)
:
Turing.Cfg (Fintype.card M.binary.Alphabet) Bool M.TargetState w
A rewind configuration with the complete marked input already on the tracks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Complexity.MathlibTM0.MarkedMachine.copyCfg_step
(M : MarkedMachine)
(w : List Bool)
(t : ℕ)
(ht : t < w.length)
:
theorem
Complexity.MathlibTM0.MarkedMachine.rewindCfg_step
(M : MarkedMachine)
(w : List Bool)
(t : ℕ)
(ht : t + 1 ≤ w.length)
:
theorem
Complexity.MathlibTM0.MarkedMachine.run_add
(M : MarkedMachine)
{w : List Bool}
(d : Turing.Cfg (Fintype.card M.binary.Alphabet) Bool M.TargetState w)
(t u : ℕ)
:
Turing.MultiTapeTM.runFrom d (t + u) = Turing.MultiTapeTM.runFrom (Turing.MultiTapeTM.runFrom d t) u
theorem
Complexity.MathlibTM0.MarkedMachine.run_succ
(M : MarkedMachine)
{w : List Bool}
(d : Turing.Cfg (Fintype.card M.binary.Alphabet) Bool M.TargetState w)
(t : ℕ)
:
theorem
Complexity.MathlibTM0.MarkedMachine.run_copy
(M : MarkedMachine)
(w : List Bool)
(t : ℕ)
(ht : t ≤ w.length)
:
theorem
Complexity.MathlibTM0.MarkedMachine.run_rewind
(M : MarkedMachine)
(w : List Bool)
(t : ℕ)
(ht : t ≤ w.length)
:
noncomputable def
Complexity.MathlibTM0.MarkedMachine.readyCfg
(M : MarkedMachine)
(w : List Bool)
:
Turing.Cfg (Fintype.card M.binary.Alphabet) Bool (Control M.State) w
The legacy simulator configuration at the start of source execution.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Complexity.MathlibTM0.MarkedMachine.ready_sim
(M : MarkedMachine)
(w : List Bool)
:
Sim M.binary (M.sourceCfg (Turing.TM0.init (M.inputCells true w))) (M.readyCfg w)
theorem
Complexity.MathlibTM0.MarkedMachine.init_ready
(M : MarkedMachine)
(w : List Bool)
:
Turing.MultiTapeTM.runFrom (Turing.MultiTapeTM.initCfg w) (2 * w.length + 2) = M.liftCfg (M.readyCfg w)