10. T6: the infinite form
10.1. Orientation
Smith's theorem, as he states it (p. 3 and p. 21-22), is the infinite form: a single right-infinite initial condition from which System 0 emulates a two-colour cyclic tag system for an infinite number of steps. The finite form of the chapter on Conjecture 0 is his Conjecture 0; the infinite form is what he calls the solution of the problem posed in the introduction, and it is the form that answers the objection of the chapter on the composition that a budget-indexed family of tapes is not one encoding.
This chapter states what is proved (Smith/Infinite.lean, Smith/Guards.lean),
describes the construction, and says what remains existential.
10.2. The statement
The statement is Theorem 1.2.3 in the
overview, with the tape t = ITape tm c in closed form; its corollary
Theorem 1.2.4 leaves t, w and b existential. Read clause by
clause:
-
tm,hwf,c,hv,hstare as in the overview: a well-formed binary machine and a valid configuration with state in range. There is no budget and no hypothesis on halting. -
t : Nat -> Natis the tape right of the head, a stream of cells, all 0, 1 or 2.istart tis the configuration(state B, left [], head 2, right t): the head on a 2 in state B at the left end.IConfigis a wolfram23 configuration whose right tape is a stream;istepandinStepsareBiTM.stepandBiTM.nStepswith the stream in place of the list (the left tape is a list with an implicit blank beyond, as inBiTM.Config). -
At every time the run is defined (
inSteps_valid: wolfram23 never halts on a configuration whose cells are below 3,IValid) and does not move left from an empty left tape: the head never leaves the tape to the left, so the implicit blank on the left is never read and the tape is genuinely one-sided. -
For every
k: the width2^wand bandbof blockk(w = blkW tm c k,b = icBand (blkProg tm c k)), a windowWand timestimes i, the last of them later thank(the emulation advances along the tape). The times are strictly increasing oni < k, whether or nottmhalts: blockkemulateskraw steps (the halting row read as an ordinary one), which are the steps oftmwhile it runs. For everyi <= kat which the run oftmis defined, wolfram23 is in state B attimes iand the infinite configuration, truncated to theWcells right of the head (truncI) or to any larger window, decodes bydecodeTMto thei-th configuration without trailing blanks (canon). The "any larger window" clause says that the decoder, which reads up to the first 0 right of the head, has read the whole leading conglomerate: the window does not cut it.
One tape per machine and input, with no budget in the statement, and the tape a
definition. The parameters w, b, W and the schedule vary with k, as in Smith's construction (his w_n grows
along the tape, p. 25): block k re-emulates the run from the start with its own
width and band, so the decode of step i recurs in every block k >= i. What the
statement does not say is discussed under "What remains existential" below.
-
Smith.IConfig[complete] -
Smith.istep[complete] -
Smith.inSteps[complete]
A wolfram23 configuration whose tape is infinite to the right: the state, the cells
left of the head nearest first (blank beyond, as in Definition 2.3.1), the head
cell, and the cells right of the head as a stream Nat -> Nat. istep is one step
with the semantics of Definition 2.3.3 (halt on state 0, a left move reads the
list, a right move consumes the first cell of the stream and shifts it), and
inSteps iterates it.
Lean code for Definition10.2.1●3 definitions
Associated Lean declarations
-
Smith.IConfig[complete]
-
Smith.istep[complete]
-
Smith.inSteps[complete]
-
Smith.IConfig[complete] -
Smith.istep[complete] -
Smith.inSteps[complete]
-
structuredefined in Smith/Infinite.leancomplete
structure Smith.IConfig : Type
structure Smith.IConfig : Type
A wolfram23 configuration whose tape is infinite to the right: the cells left of the head nearest first (blank beyond, as in `BiTM.Config`), the head cell, and the cells right of the head as a stream.
Fields
state : ℕ
left : List ℕ
head : ℕ
right : ℕ → ℕ
-
defdefined in Smith/Infinite.leancomplete
def Smith.istep (tm : TM.Machine) (c : Smith.IConfig) : Option Smith.IConfig
def Smith.istep (tm : TM.Machine) (c : Smith.IConfig) : Option Smith.IConfig
One step, as `BiTM.step`.
-
defdefined in Smith/Infinite.leancomplete
def Smith.inSteps (tm : TM.Machine) (c : Smith.IConfig) : ℕ → Option Smith.IConfig
def Smith.inSteps (tm : TM.Machine) (c : Smith.IConfig) : ℕ → Option Smith.IConfig
`n` steps.
istart t is wolfram23 at the left end of the infinite tape t: state B on a 2 with
nothing to the left. A configuration is IValid when its state is A or B and every
cell, on the left, under the head and in the stream, is 0, 1 or 2.
Lean code for Definition10.2.2●2 definitions
Associated Lean declarations
-
Smith.istart[complete]
-
Smith.IValid[complete]
-
Smith.istart[complete] -
Smith.IValid[complete]
-
defdefined in Smith/Infinite.leancomplete
def Smith.istart (t : ℕ → ℕ) : Smith.IConfig
def Smith.istart (t : ℕ → ℕ) : Smith.IConfig
wolfram23 at the left end of an infinite tape: state B on a 2.
-
defdefined in Smith/Infinite.leancomplete
def Smith.IValid (d : Smith.IConfig) : Prop
def Smith.IValid (d : Smith.IConfig) : Prop
A valid infinite configuration of wolfram23: state A or B, every cell 0, 1 or 2.
From an IValid configuration the run of wolfram23 is defined at every time and stays
IValid: Definition 2.4.1 never halts on cells below 3.
Lean code for Theorem10.2.3●1 theorem
Associated Lean declarations
-
Smith.inSteps_valid[complete]
-
Smith.inSteps_valid[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.inSteps_valid (d : Smith.IConfig) (h : Smith.IValid d) (τ : ℕ) : ∃ dτ, Smith.inSteps BiTM.wolfram23 d τ = some dτ ∧ Smith.IValid dτ
theorem Smith.inSteps_valid (d : Smith.IConfig) (h : Smith.IValid d) (τ : ℕ) : ∃ dτ, Smith.inSteps BiTM.wolfram23 d τ = some dτ ∧ Smith.IValid dτ
Induction on the time; one step (istep_valid) is a case analysis on the six entries
of Wolfram's table, each of which writes a cell below 3 and moves to state A or B.
The finite configuration c agrees with the infinite one d when they have the same
state, left tape and head, and the explicit cells right of the head of c are the
first cells of the stream of d. truncI W d is the finite configuration made of
d's state, left tape, head and the first W cells of its stream; it agrees with
d.
Lean code for Definition10.2.4●2 definitions
Associated Lean declarations
-
Smith.Agree[complete]
-
Smith.truncI[complete]
-
Smith.Agree[complete] -
Smith.truncI[complete]
-
defdefined in Smith/Infinite.leancomplete
def Smith.Agree (c : BiTM.Config) (d : Smith.IConfig) : Prop
def Smith.Agree (c : BiTM.Config) (d : Smith.IConfig) : Prop
The finite configuration `c` agrees with the infinite one `d` on the state, the left tape, the head and the explicit cells right of the head.
-
defdefined in Smith/Infinite.leancomplete
def Smith.truncI (W : ℕ) (d : Smith.IConfig) : BiTM.Config
def Smith.truncI (W : ℕ) (d : Smith.IConfig) : BiTM.Config
The first `W` cells right of the head, as a finite configuration.
A finite run that keeps its size (Definition 2.3.5 constant, that is, never reads an implicit blank) is matched step for step by the infinite run from an agreeing configuration, the agreement holding at every step.
Lean code for Theorem10.2.5●1 theorem
Associated Lean declarations
-
Smith.agree_run[complete]
-
Smith.agree_run[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.agree_run (tm : TM.Machine) (n : ℕ) (c : BiTM.Config) (d : Smith.IConfig) : Smith.Agree c d → (∀ τ ≤ n, ∀ (cτ : BiTM.Config), BiTM.nSteps tm c τ = some cτ → Smith.biSize cτ = Smith.biSize c) → ∀ (cn : BiTM.Config), BiTM.nSteps tm c n = some cn → ∃ dn, Smith.inSteps tm d n = some dn ∧ Smith.Agree cn dn
theorem Smith.agree_run (tm : TM.Machine) (n : ℕ) (c : BiTM.Config) (d : Smith.IConfig) : Smith.Agree c d → (∀ τ ≤ n, ∀ (cτ : BiTM.Config), BiTM.nSteps tm c τ = some cτ → Smith.biSize cτ = Smith.biSize c) → ∀ (cn : BiTM.Config), BiTM.nSteps tm c n = some cn → ∃ dn, Smith.inSteps tm d n = some dn ∧ Smith.Agree cn dn
A run that stays on the finite tape is matched by the infinite tape.
One step (agree_step): the only way a finite step differs from the infinite step is
by reading the blank right of the finite tape, which grows the size by one; the
hypothesis excludes it. Then induction.
On an infinite configuration that agrees with a finite one whose right tape contains
a 0 and fits in the window W, Definition 9.2.3 of the window is
decodeTM of the finite configuration.
Lean code for Theorem10.2.6●1 theorem
Associated Lean declarations
-
Smith.decodeTM_trunc[complete]
-
Smith.decodeTM_trunc[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.decodeTM_trunc (S N b W : ℕ) (c : BiTM.Config) (d : Smith.IConfig) (h : Smith.Agree c d) (hW : c.right.length ≤ W) (hz : 0 ∈ c.right) : Smith.decodeTM S N b (Smith.truncI W d) = Smith.decodeTM S N b c
theorem Smith.decodeTM_trunc (S N b W : ℕ) (c : BiTM.Config) (d : Smith.IConfig) (h : Smith.Agree c d) (hW : c.right.length ≤ W) (hz : 0 ∈ c.right) : Smith.decodeTM S N b (Smith.truncI W d) = Smith.decodeTM S N b c
On the infinite tape, a window that reaches the first 0 right of the head decodes as the finite configuration does.
The decoder reads only the head and the cells right of it up to the first 0
(decodeW23_append, from Definition 8.4.1), and the window's cells are the
finite right tape followed by more of the stream.
10.3. Smith's argument and why the finite T4 does not chain
Smith (p. 22): concatenate the initial condition that emulates the cyclic tag system for 1 step with the one for 2 steps, for 3 steps, and so on, and start with the leftmost 0 of the first initial condition active in state A. Each finite emulation runs, exits to the right onto the next initial condition's leftmost cell, a 0, in state A, and that is the start condition of the next emulation. Any increasing sequence of budgets works, and "what is in the initial tape to the left of that doesn't matter, as it never becomes active." He needs loop-freeness (T5, the chapter on Systems 3 to 0) only to know that each finite emulation does exit; with the explicit schedules of the previous chapters the exit time is known and T5 is not used.
The formal T4 does not chain by plain concatenation:
-
Its head starts on the first cell of the first block, with the left end
0^m 2 2 1to its left. Started on the leftmost 0 in state A, wolfram23 doesA0 -> 1RB,B0 -> 2LA,A1 -> 2LAand is left of its starting cell after three steps. -
Smith's own Perl encoder has the same left end and he says so (p. 25-26): the
0^m 2 2 1form "works, but doesn't allow the program to be chained after another program by concatenation." His concatenable left end (p. 12-13) is a sequence of repetitions0 2^(2^w - 1), which the entering head converts to2 2 1 2 1 ... 2 1 0and which then supplies one turn per repetition.
So the blocks of the infinite tape are not T4's tapes.
10.4. The construction
The key observation is that Smith's concatenable left end is, in System 4 terms, a row of guard sets separated by stars in front of the encoder tape, and that the hand-off between blocks is nothing but System 4's rule 5: the exit of a block leaves the head on the next block's leading star in state C, and rule 5 carries it onto the first guard set. So the infinite construction lives at the System 4 level and the System 3 relation of the chapter on System 4 to System 3 only has to tolerate arbitrary cells beyond the guards.
10.4.1. The block on the System 4 side
-
Smith.blockTape[complete] -
Smith.preGuardPairs[complete] -
Smith.preM[complete]
A block with guard parameter n and r guards around the program orig is the
System 4 tape
star, ({1, n}, star)^(r - 1), {0, 1, n - 1}, orig
where orig = set S0 :: rest is the encoder tape of
the chapter on System 5 to System 4 for the program of the
block (preGuardPairs n (r - 1) are the r - 1 guards {1, n} with their stars,
preM n the innermost guard {0, 1, n - 1}); Definition 5.1.1 is the
step.
Lean code for Definition10.4.1.1●3 definitions
Associated Lean declarations
-
Smith.blockTape[complete]
-
Smith.preGuardPairs[complete]
-
Smith.preM[complete]
-
Smith.blockTape[complete] -
Smith.preGuardPairs[complete] -
Smith.preM[complete]
-
defdefined in Smith/Infinite.leancomplete
def Smith.blockTape (n r : ℕ) (orig : List BiTM.System4Elem) : List BiTM.System4Elem
def Smith.blockTape (n r : ℕ) (orig : List BiTM.System4Elem) : List BiTM.System4Elem
The System 4 tape of a block: the leading star, `r - 1` guards `{1, n}` with their stars, the guard `{0, 1, n - 1}`, and the program `orig`. -
defdefined in Smith/Guards.leancomplete
def Smith.preGuardPairs (n : ℕ) : ℕ → List BiTM.System4Elem
def Smith.preGuardPairs (n : ℕ) : ℕ → List BiTM.System4Elem
`k` guards before the entry, each the set `{1, n}` followed by a star. -
defdefined in Smith/Guards.leancomplete
def Smith.preM (n : ℕ) : List ℤ
def Smith.preM (n : ℕ) : List ℤ
The innermost guard before the entry.
-
Smith.padCfg[complete] -
Smith.guardPairs[complete] -
Smith.merged[complete]
The padded form of a program configuration c after t turns, with Lc to the left
and Rc to the right: Lc, then guardPairs n (r - 1 - t) (the remaining guards,
each {n - 1} followed by a star), then the sets merged n t (the guards whose stars
were deleted, each decremented once per turn since, and the innermost {n - 2 - t}),
then c's elements and Rc, the head shifted by the length of what precedes c.
Lean code for Definition10.4.1.2●3 definitions
Associated Lean declarations
-
Smith.padCfg[complete]
-
Smith.guardPairs[complete]
-
Smith.merged[complete]
-
Smith.padCfg[complete] -
Smith.guardPairs[complete] -
Smith.merged[complete]
-
defdefined in Smith/Guards.leancomplete
def Smith.padCfg (n r t : ℕ) (Lc Rc : List BiTM.System4Elem) (c : BiTM.System4Config) : BiTM.System4Config
def Smith.padCfg (n r t : ℕ) (Lc Rc : List BiTM.System4Elem) (c : BiTM.System4Config) : BiTM.System4Config
The padded configuration after `t` turns: the left context, the remaining guard pairs, the merged sets, the original tape, the right context.
-
defdefined in Smith/Guards.leancomplete
def Smith.guardPairs (n : ℕ) : ℕ → List BiTM.System4Elem
def Smith.guardPairs (n : ℕ) : ℕ → List BiTM.System4Elem
`k` guards after the entry, each the set `{n - 1}` followed by a star. -
defdefined in Smith/Guards.leancomplete
def Smith.merged (n t : ℕ) : List (List ℤ)
def Smith.merged (n t : ℕ) : List (List ℤ)
The sets right of the last remaining star after `t` turns: the guards `{n-1}, ..., {n-t}` whose stars were deleted, each scanned once per turn since, and the innermost `{n-2-t}`.
-
Smith.entryRun[complete] -
Smith.padCfg_entry[complete]
The entry: the head arrives on the leading star in state C. Rule 5 toggles 1 in the
first guard (giving {n}), the scan in state C decrements it (giving {n - 1}, the
state staying C because 0 is absent), rule 5 again on the next star, and so on; the
innermost {0, 1, n - 1} becomes {0, n - 1} and its scan in state C toggles the
state to B and decrements it. After 2r steps the head is on the program's first set
in state B: the tape is star, ({n - 1}, star)^(r - 1), {n - 2}, orig, which is
Definition 10.4.1.2 of orig after its first step, with no turn yet. On the way the
head is on the leading star only at time 0.
Lean code for Theorem10.4.1.3●2 theorems
Associated Lean declarations
-
Smith.entryRun[complete]
-
Smith.padCfg_entry[complete]
-
Smith.entryRun[complete] -
Smith.padCfg_entry[complete]
-
theoremdefined in Smith/Guards.leancomplete
theorem Smith.entryRun (n : ℕ) (hn : 3 ≤ n) (k : ℕ) (Lc T : List BiTM.System4Elem) : BiTM.System4.nSteps { elems := Lc ++ BiTM.System4Elem.star :: (Smith.preGuardPairs n k ++ BiTM.System4Elem.set (Smith.preM n) :: T), active := Lc.length, state := BiTM.System4State.C } (2 * k + 2) = some { elems := Lc ++ BiTM.System4Elem.star :: (Smith.guardPairs n k ++ BiTM.System4Elem.set (Smith.gset n 2) :: T), active := Lc.length + 2 * k + 2, state := BiTM.System4State.B } ∧ ∀ (j : ℕ), 1 ≤ j → j ≤ 2 * k + 2 → ∀ (c' : BiTM.System4Config), BiTM.System4.nSteps { elems := Lc ++ BiTM.System4Elem.star :: (Smith.preGuardPairs n k ++ BiTM.System4Elem.set (Smith.preM n) :: T), active := Lc.length, state := BiTM.System4State.C } j = some c' → Lc.length + 1 ≤ c'.active
theorem Smith.entryRun (n : ℕ) (hn : 3 ≤ n) (k : ℕ) (Lc T : List BiTM.System4Elem) : BiTM.System4.nSteps { elems := Lc ++ BiTM.System4Elem.star :: (Smith.preGuardPairs n k ++ BiTM.System4Elem.set (Smith.preM n) :: T), active := Lc.length, state := BiTM.System4State.C } (2 * k + 2) = some { elems := Lc ++ BiTM.System4Elem.star :: (Smith.guardPairs n k ++ BiTM.System4Elem.set (Smith.gset n 2) :: T), active := Lc.length + 2 * k + 2, state := BiTM.System4State.B } ∧ ∀ (j : ℕ), 1 ≤ j → j ≤ 2 * k + 2 → ∀ (c' : BiTM.System4Config), BiTM.System4.nSteps { elems := Lc ++ BiTM.System4Elem.star :: (Smith.preGuardPairs n k ++ BiTM.System4Elem.set (Smith.preM n) :: T), active := Lc.length, state := BiTM.System4State.C } j = some c' → Lc.length + 1 ≤ c'.active
The entry through `k` guard pairs and the innermost guard: `2k + 2` steps, the head ending on the first original element in state B, all intermediate heads right of the leading star.
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.padCfg_entry (n r : ℕ) (hr : 1 ≤ r) (orig : List BiTM.System4Elem) : Smith.padCfg n r 0 [BiTM.System4Elem.star] [] { elems := orig, active := 0, state := BiTM.System4State.B } = { elems := BiTM.System4Elem.star :: (Smith.guardPairs n (r - 1) ++ BiTM.System4Elem.set (Smith.gset n 2) :: orig), active := 2 * r, state := BiTM.System4State.B }
theorem Smith.padCfg_entry (n r : ℕ) (hr : 1 ≤ r) (orig : List BiTM.System4Elem) : Smith.padCfg n r 0 [BiTM.System4Elem.star] [] { elems := orig, active := 0, state := BiTM.System4State.B } = { elems := BiTM.System4Elem.star :: (Smith.guardPairs n (r - 1) ++ BiTM.System4Elem.set (Smith.gset n 2) :: orig), active := 2 * r, state := BiTM.System4State.B }
Induction on the number of guards; each guard pair takes two steps (entryPair), the
innermost one two more (entryLast), all by the step lemmas of System 4.
-
Smith.pad_turn[complete] -
Smith.parMem_zero_merged[complete]
A turn of the program (rule 1 at its leftmost element, state A) becomes, on the
guarded tape after t turns, a walk left over the merged sets, the deletion of the
next star (rule 2, state B) and a scan of the merged sets, none of which contains 0
while t + 3 <= n, so the head arrives back on the program's first element in state
B, exactly as the turn would have left it: 2t + 4 steps, the padded form now with
t + 1 turns. The head never reaches the leading star.
Lean code for Theorem10.4.1.4●2 theorems
Associated Lean declarations
-
Smith.pad_turn[complete]
-
Smith.parMem_zero_merged[complete]
-
Smith.pad_turn[complete] -
Smith.parMem_zero_merged[complete]
-
theoremdefined in Smith/Guards.leancomplete
theorem Smith.pad_turn (n r t : ℕ) (Lc Rc : List BiTM.System4Elem) (s : List ℤ) (R : List BiTM.System4Elem) (hr : t + 2 ≤ r) (hn : t + 3 ≤ n) : BiTM.System4.nSteps (Smith.padCfg n r t Lc Rc { elems := BiTM.System4Elem.set s :: R, active := 0, state := BiTM.System4State.A }) (2 * t + 4) = some (Smith.padCfg n r (t + 1) Lc Rc { elems := BiTM.System4Elem.set s :: R, active := 0, state := BiTM.System4State.B }) ∧ Smith.PosRun (fun c => Lc.length + 1 ≤ c.active) (Smith.padCfg n r t Lc Rc { elems := BiTM.System4Elem.set s :: R, active := 0, state := BiTM.System4State.A }) (2 * t + 4)
theorem Smith.pad_turn (n r t : ℕ) (Lc Rc : List BiTM.System4Elem) (s : List ℤ) (R : List BiTM.System4Elem) (hr : t + 2 ≤ r) (hn : t + 3 ≤ n) : BiTM.System4.nSteps (Smith.padCfg n r t Lc Rc { elems := BiTM.System4Elem.set s :: R, active := 0, state := BiTM.System4State.A }) (2 * t + 4) = some (Smith.padCfg n r (t + 1) Lc Rc { elems := BiTM.System4Elem.set s :: R, active := 0, state := BiTM.System4State.B }) ∧ Smith.PosRun (fun c => Lc.length + 1 ≤ c.active) (Smith.padCfg n r t Lc Rc { elems := BiTM.System4Elem.set s :: R, active := 0, state := BiTM.System4State.A }) (2 * t + 4)
The turn on the padded tape: `2t + 4` steps, all with the head right of the left context.
-
theoremdefined in Smith/Guards.leancomplete
theorem Smith.parMem_zero_merged (n t : ℕ) (ht : t + 3 ≤ n) : Smith.parMem 0 (Smith.merged n t) = false
theorem Smith.parMem_zero_merged (n t : ℕ) (ht : t + 3 ≤ n) : Smith.parMem 0 (Smith.merged n t) = false
The merged sets are {n - 1}, ..., {n - t} and {n - 2 - t}, all without 0 while
t + 3 <= n (parMem_zero_merged), so the sweep in state B decrements each and keeps
the state; the walk left and the sweep are the run lemmas moveLeft and sweep of
System 4, and one guard pair must remain (t + 2 <= r).
-
Smith.pad_step[complete] -
Smith.pad_schedule[complete]
Every rule of the program other than a turn is one step on both tapes (pad_step), so
a program run of N steps with N + 1 <= r and N + 2 <= n is tracked on the guarded
tape at strictly increasing times, the padded form carrying the number of turns so
far, and the head never on the leading star.
Lean code for Theorem10.4.1.5●2 theorems
Associated Lean declarations
-
Smith.pad_step[complete]
-
Smith.pad_schedule[complete]
-
Smith.pad_step[complete] -
Smith.pad_schedule[complete]
-
theoremdefined in Smith/Guards.leancomplete
theorem Smith.pad_step (n r t : ℕ) (Lc Rc : List BiTM.System4Elem) (c c1 : BiTM.System4Config) (hs : BiTM.System4.step c = some c1) (hr : t + 2 ≤ r) (hn : t + 3 ≤ n) : ∃ k t', 1 ≤ k ∧ t' ≤ t + 1 ∧ BiTM.System4.nSteps (Smith.padCfg n r t Lc Rc c) k = some (Smith.padCfg n r t' Lc Rc c1) ∧ Smith.PosRun (fun c => Lc.length + 1 ≤ c.active) (Smith.padCfg n r t Lc Rc c) k
theorem Smith.pad_step (n r t : ℕ) (Lc Rc : List BiTM.System4Elem) (c c1 : BiTM.System4Config) (hs : BiTM.System4.step c = some c1) (hr : t + 2 ≤ r) (hn : t + 3 ≤ n) : ∃ k t', 1 ≤ k ∧ t' ≤ t + 1 ∧ BiTM.System4.nSteps (Smith.padCfg n r t Lc Rc c) k = some (Smith.padCfg n r t' Lc Rc c1) ∧ Smith.PosRun (fun c => Lc.length + 1 ≤ c.active) (Smith.padCfg n r t Lc Rc c) k
One step of the original tape is matched on the padded tape: one step, or the turn; the head stays right of the left context throughout.
-
theoremdefined in Smith/Guards.leancomplete
theorem Smith.pad_schedule (n r : ℕ) (Lc Rc : List BiTM.System4Elem) (N : ℕ) (c0 : BiTM.System4Config) (hr : N + 1 ≤ r) (hn : N + 2 ≤ n) (cN : BiTM.System4Config) (hrun : BiTM.System4.nSteps c0 N = some cN) : ∃ times turns, times 0 = 0 ∧ turns 0 = 0 ∧ (∀ i < N, times i < times (i + 1)) ∧ (∀ i ≤ N, turns i ≤ i ∧ ∃ ci, BiTM.System4.nSteps c0 i = some ci ∧ BiTM.System4.nSteps (Smith.padCfg n r 0 Lc Rc c0) (times i) = some (Smith.padCfg n r (turns i) Lc Rc ci)) ∧ Smith.PosRun (fun c => Lc.length + 1 ≤ c.active) (Smith.padCfg n r 0 Lc Rc c0) (times N)
theorem Smith.pad_schedule (n r : ℕ) (Lc Rc : List BiTM.System4Elem) (N : ℕ) (c0 : BiTM.System4Config) (hr : N + 1 ≤ r) (hn : N + 2 ≤ n) (cN : BiTM.System4Config) (hrun : BiTM.System4.nSteps c0 N = some cN) : ∃ times turns, times 0 = 0 ∧ turns 0 = 0 ∧ (∀ i < N, times i < times (i + 1)) ∧ (∀ i ≤ N, turns i ≤ i ∧ ∃ ci, BiTM.System4.nSteps c0 i = some ci ∧ BiTM.System4.nSteps (Smith.padCfg n r 0 Lc Rc c0) (times i) = some (Smith.padCfg n r (turns i) Lc Rc ci)) ∧ Smith.PosRun (fun c => Lc.length + 1 ≤ c.active) (Smith.padCfg n r 0 Lc Rc c0) (times N)
The padded tape tracks a run of `N` steps of the original tape: at the `i`-th step the padded tape is the padded configuration with some number of turns `turns i <= i`, the times are strictly increasing, and the head is right of the left context throughout.
Induction on N with Theorem 10.4.1.4 for the turns and pad_step for the
other rules; before each turn at least one guard pair remains (pad_turn needs
t + 2 <= r, and t <= N - 1 <= r - 2), the leading star is never deleted, and the
head is never on it after time 0 (PosRun, the SafeC condition of
Definition 6.4.13); with r = T4 + 1 and N = T4 - 1 one pair is still left after
the last possible turn.
The block's System 4 run from its entry: for a program run of T4 >= 1 steps that
exits in state C past its last element, with T4 <= r and T4 + 1 <= n, the block
reaches the padded exit configuration at some time H, the head is on the leading
star only at time 0 in state C (SafeC for every budget), and the program's
configurations after each step appear, padded, at strictly increasing times
2r + padT i.
Lean code for Theorem10.4.1.6●1 theorem
Associated Lean declarations
-
Smith.block_run[complete]
-
Smith.block_run[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.block_run (n r : ℕ) (hn : 3 ≤ n) (S0 : List ℤ) (rest : List BiTM.System4Elem) (T4 : ℕ) (cE : BiTM.System4Config) (hT4 : 1 ≤ T4) (hr : T4 ≤ r) (hnT : T4 + 1 ≤ n) (hrun : BiTM.System4.nSteps { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } T4 = some cE) (hact : cE.active = cE.elems.length) : ∃ H padT turns, BiTM.System4.nSteps { elems := Smith.blockTape n r (BiTM.System4Elem.set S0 :: rest), active := 0, state := BiTM.System4State.C } H = some (Smith.padCfg n r (turns (T4 - 1)) [BiTM.System4Elem.star] [] cE) ∧ (∀ (h' : ℕ), Smith.SafeC h' { elems := Smith.blockTape n r (BiTM.System4Elem.set S0 :: rest), active := 0, state := BiTM.System4State.C }) ∧ (∀ i < T4 - 1, padT i < padT (i + 1)) ∧ ∀ (i : ℕ), i + 1 ≤ T4 → 2 * r + padT i ≤ H ∧ ∃ ci, BiTM.System4.nSteps { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } (i + 1) = some ci ∧ BiTM.System4.nSteps { elems := Smith.blockTape n r (BiTM.System4Elem.set S0 :: rest), active := 0, state := BiTM.System4State.C } (2 * r + padT i) = some (Smith.padCfg n r (turns i) [BiTM.System4Elem.star] [] ci)
theorem Smith.block_run (n r : ℕ) (hn : 3 ≤ n) (S0 : List ℤ) (rest : List BiTM.System4Elem) (T4 : ℕ) (cE : BiTM.System4Config) (hT4 : 1 ≤ T4) (hr : T4 ≤ r) (hnT : T4 + 1 ≤ n) (hrun : BiTM.System4.nSteps { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } T4 = some cE) (hact : cE.active = cE.elems.length) : ∃ H padT turns, BiTM.System4.nSteps { elems := Smith.blockTape n r (BiTM.System4Elem.set S0 :: rest), active := 0, state := BiTM.System4State.C } H = some (Smith.padCfg n r (turns (T4 - 1)) [BiTM.System4Elem.star] [] cE) ∧ (∀ (h' : ℕ), Smith.SafeC h' { elems := Smith.blockTape n r (BiTM.System4Elem.set S0 :: rest), active := 0, state := BiTM.System4State.C }) ∧ (∀ i < T4 - 1, padT i < padT (i + 1)) ∧ ∀ (i : ℕ), i + 1 ≤ T4 → 2 * r + padT i ≤ H ∧ ∃ ci, BiTM.System4.nSteps { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } (i + 1) = some ci ∧ BiTM.System4.nSteps { elems := Smith.blockTape n r (BiTM.System4Elem.set S0 :: rest), active := 0, state := BiTM.System4State.C } (2 * r + padT i) = some (Smith.padCfg n r (turns i) [BiTM.System4Elem.star] [] ci)
The truncated run of a block: the entry through the guards, then the padded tracking of the program's run after its first turn; the head is on the leading star only at time 0, in state C.
Theorem 10.4.1.3 for the first 2r steps, then Theorem 10.4.1.5
on the program's run after its first step.
BlockData packages a block: n, r, w, b, the program S0, rest, the run
length H and the decoding times dt. BlockSpec tm c k bd is the specification a
block must meet to emulate the first k raw steps of tm from c
(Definition 9.3.1): 3 <= n,
H + b + 3 <= 2^w, n < 2^w, the program well formed and ending with a set, its
integers below 2^w, SafeC (H + b) on the block tape, the exit in state C at H,
and strictly increasing decoding times dt i <= H at which the block tape is the
shape rep3_decode reads and the decode is the doubled cyclic tag word of the i-th
raw configuration rawRun tm c i.
Lean code for Definition10.4.1.7●2 definitions
Associated Lean declarations
-
Smith.BlockData[complete]
-
Smith.BlockSpec[complete]
-
Smith.BlockData[complete] -
Smith.BlockSpec[complete]
-
structuredefined in Smith/Infinite.leancomplete
structure Smith.BlockData : Type
structure Smith.BlockData : Type
The data of a block: the guard parameter `n`, the number of guards `r`, the width exponent `w`, the band `b`, the program tape `set S0 :: rest`, the length `H` of the truncated System 4 run, and the decoding times `dt` on that run.
Fields
n : ℕ
r : ℕ
w : ℕ
b : ℕ
S0 : List ℤ
rest : List BiTM.System4Elem
H : ℕ
dt : ℕ → ℕ
-
structuredefined in Smith/Infinite.leancomplete
structure Smith.BlockSpec (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) (bd : Smith.BlockData) : Prop
structure Smith.BlockSpec (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) (bd : Smith.BlockData) : Prop
The block `bd` emulates the first `k` raw steps of `tm` from `c` (`TagSystem.rawRun`: the steps of the machine, the halting state treated as an ordinary one), which are its first `k` steps as long as it runs.
Fields
hn : 3 ≤ bd.n
hN : bd.fuel + 3 ≤ 2 ^ bd.w
hnw : bd.n < 2 ^ bd.w
hwf : { elems := bd.orig, active := 0, state := BiTM.System4State.A }.WellFormed
hlast : bd.orig.getLast? ≠ some BiTM.System4Elem.star
hb : ∀ (S : List ℤ), BiTM.System4Elem.set S ∈ bd.orig → ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ bd.w
hsafe : Smith.SafeC bd.fuel { elems := bd.tape, active := 0, state := BiTM.System4State.C }
hexit : ∃ cE, BiTM.System4.nSteps { elems := bd.tape, active := 0, state := BiTM.System4State.C } bd.H = some cE ∧ cE.state = BiTM.System4State.C ∧ cE.active = cE.elems.length
hmono : ∀ i < k, bd.dt i < bd.dt (i + 1)
hdec : ∀ i ≤ k, bd.dt i ≤ bd.H ∧ ∃ Lp K R, K ≠ [] ∧ BiTM.System4.nSteps { elems := bd.tape, active := 0, state := BiTM.System4State.C } (bd.dt i) = some { elems := Lp ++ Smith.sets K ++ BiTM.System4Elem.star :: R, active := Lp.length, state := BiTM.System4State.B } ∧ (Smith.decodeS4 { elems := Smith.sets K ++ BiTM.System4Elem.star :: R, active := 0, state := BiTM.System4State.B } bd.b).bind Smith.decodeBag = some (Smith.dbl (TagSystem.ctsOfCfg tm.numStates (TagSystem.rawRun tm c i)).data)
-
Smith.closedBlock[complete] -
Smith.blkProg[complete] -
Smith.blkN[complete] -
Smith.blkR[complete] -
Smith.blkOrig[complete] -
Smith.blkH[complete] -
Smith.blkW[complete]
Block k in closed form. Its program is blkProg tm c k = icProg tm c k
(Definition 9.4.1), the System 5 program of T8 for k steps; its program tape
blkOrig is the System 4 tape of that program with the parameter icF
(Definition 8.6.1); its guard parameter and number of guards are
blkN = icT4 + 3 and blkR = icT4 + 1, from the bound icT4 on the program's
System 4 run; blkH is the bound (2 L + 2) (L + 1) of
Lemma 8.5.1 for the length L of the whole block tape
Definition 10.4.1.1; the width exponent is
blkW = Nat.size (blkH + icBand + blkN + 3 icF + 6), the bit length, and the band
icBand. The run data H and
dt of closedBlock tm c k are set to 0: the cells of a block
(BlockData.cells) do not read them.
Lean code for Definition10.4.1.8●7 definitions
Associated Lean declarations
-
Smith.closedBlock[complete]
-
Smith.blkProg[complete]
-
Smith.blkN[complete]
-
Smith.blkR[complete]
-
Smith.blkOrig[complete]
-
Smith.blkH[complete]
-
Smith.blkW[complete]
-
Smith.closedBlock[complete] -
Smith.blkProg[complete] -
Smith.blkN[complete] -
Smith.blkR[complete] -
Smith.blkOrig[complete] -
Smith.blkH[complete] -
Smith.blkW[complete]
-
defdefined in Smith/Infinite.leancomplete
def Smith.closedBlock (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : Smith.BlockData
def Smith.closedBlock (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : Smith.BlockData
Block `k` in closed form (the run data `H`, `dt` set to 0; see `block_exists` for the actual ones).
-
defdefined in Smith/Infinite.leancomplete
def Smith.blkProg (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : BiTM.System5Config
def Smith.blkProg (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : BiTM.System5Config
The System 5 program of block `k`.
-
defdefined in Smith/Infinite.leancomplete
def Smith.blkN (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : ℕ
def Smith.blkN (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : ℕ
The guard parameter `n` of block `k`.
-
defdefined in Smith/Infinite.leancomplete
def Smith.blkR (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : ℕ
def Smith.blkR (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : ℕ
The number of guards `r` of block `k`.
-
defdefined in Smith/Infinite.leancomplete
def Smith.blkOrig (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : List BiTM.System4Elem
def Smith.blkOrig (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : List BiTM.System4Elem
The program tape of block `k`.
-
defdefined in Smith/Infinite.leancomplete
def Smith.blkH (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : ℕ
def Smith.blkH (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : ℕ
A bound on the System 4 run of block `k`.
-
defdefined in Smith/Infinite.leancomplete
def Smith.blkW (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : ℕ
def Smith.blkW (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) : ℕ
The width exponent of block `k`: the bit length of the fuel, the guard parameter and the bound on the set elements, so that the block width `2 ^ blkW` is linear in them.
For every k the closed-form block, with its actual run length H and decoding
times dt filled in, meets Definition 10.4.1.7 for k:
BlockSpec tm c k {closedBlock tm c k with H, dt} (Definition 10.4.1.8).
Lean code for Theorem10.4.1.9●1 theorem
Associated Lean declarations
-
Smith.block_exists[complete]
-
Smith.block_exists[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.block_exists (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (k : ℕ) : ∃ H dt, Smith.BlockSpec tm c k (have __src := Smith.closedBlock tm c k; { n := __src.n, r := __src.r, w := __src.w, b := __src.b, S0 := __src.S0, rest := __src.rest, H := H, dt := dt })
theorem Smith.block_exists (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (k : ℕ) : ∃ H dt, Smith.BlockSpec tm c k (have __src := Smith.closedBlock tm c k; { n := __src.n, r := __src.r, w := __src.w, b := __src.b, S0 := __src.S0, rest := __src.rest, H := H, dt := dt })
Block `k` emulates the first `k` raw steps of the machine: the closed-form block with its actual run length and decoding times meets `BlockSpec`.
With N = icN c k and K = 1 + 84 S, the cyclic tag run of 2 K N steps is defined
and ends on a nonempty word (cts_run_tag, as in the proof of
Theorem 1.2.1). Proposition 8.7.1 (the System 4
half of T4) supplies the program's run: its exit in state C after T4 <= icT4 steps,
and the decoding events with their decodes. Since T4 <= icT4, the block has enough
guards (T4 <= r, T4 + 1 <= n) for Theorem 10.4.1.6 to pad the run; the
padded run length H is at most blkH by Lemma 8.5.1, so the
width covers the fuel, the guard parameter and the program's integers. The decoding
time of raw step i is dt i = 2 r + padT (t4 (2 K tagTime tm c i)), strictly
increasing because tagTime is (Lemma 9.3.4 keeps
tagTime tm c i <= N); at cyclic tag time 2 K tagTime tm c i the configuration is
ctsOfCfg S (rawRun tm c i) (Lemma 9.3.3,
Lemma 3.4.11).
10.4.2. The block on the System 3 side
Definition 6.4.17 of the chapter on System 4 to
System 3 takes a left end that is either the finite 0^m 2 2 1^t or arbitrary junk
guarded by SafeC, and a right closing that is either the closing 1 or a 0 followed by
arbitrary cells (Definition 6.4.15).
-
Smith.entry3[complete] -
Smith.BlockData.cells[complete]
The System 3 configuration at the entry of a block: the head on a 0 in state A with a
0 to its left (whatever L lies beyond is never read), the block's cells
BlockData.cells (the rendering of Definition 6.4.17 followed by the closing 0)
and the rest Rc of the tape to its right.
Lean code for Definition10.4.2.1●2 definitions
Associated Lean declarations
-
Smith.entry3[complete]
-
Smith.BlockData.cells[complete]
-
Smith.entry3[complete] -
Smith.BlockData.cells[complete]
-
defdefined in Smith/Infinite.leancomplete
def Smith.entry3 (L : List (Fin 3)) (bd : Smith.BlockData) (Rc : List (Fin 3)) : Smith.LConfig
def Smith.entry3 (L : List (Fin 3)) (bd : Smith.BlockData) (Rc : List (Fin 3)) : Smith.LConfig
The System 3 configuration at the entry of a block: the head on the 0 left of the block in state A, a 0 to its left, the block and the rest `Rc` of the tape to its right.
-
defdefined in Smith/Infinite.leancomplete
def Smith.BlockData.cells (bd : Smith.BlockData) : List (Fin 3)
def Smith.BlockData.cells (bd : Smith.BlockData) : List (Fin 3)
The System 3 cells of a block: its items rendered, then its closing 0.
For a block meeting Definition 10.4.1.7, the entry configuration stands in
Definition 6.4.17 (junk left end, closing 0 followed by Rc) with the System 4
block tape, with fuel H + b.
Lean code for Theorem10.4.2.2●2 theorems
Associated Lean declarations
-
Smith.rep3_entry[complete]
-
Smith.blockAC_OK[complete]
-
Smith.rep3_entry[complete] -
Smith.blockAC_OK[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.rep3_entry (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) (bd : Smith.BlockData) (hspec : Smith.BlockSpec tm c k bd) (L Rc : List (Fin 3)) : Smith.Rep3 (Smith.Closing.zero Rc) (Smith.entry3 L bd Rc) { elems := bd.tape, active := 0, state := BiTM.System4State.C } bd.w bd.fuel
theorem Smith.rep3_entry (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) (bd : Smith.BlockData) (hspec : Smith.BlockSpec tm c k bd) (L Rc : List (Fin 3)) : Smith.Rep3 (Smith.Closing.zero Rc) (Smith.entry3 L bd Rc) { elems := bd.tape, active := 0, state := BiTM.System4State.C } bd.w bd.fuel
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.blockAC_OK (w n r h : ℕ) (orig : List BiTM.System4Elem) (L Rc : List (Fin 3)) (hn : 3 ≤ n) (hN : h + 3 ≤ 2 ^ w) (hnw : n < 2 ^ w) (hwf : { elems := orig, active := 0, state := BiTM.System4State.A }.WellFormed) (horig_ne : orig ≠ []) (hlast : orig.getLast? ≠ some BiTM.System4Elem.star) (hb : ∀ (S : List ℤ), BiTM.System4Elem.set S ∈ orig → ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ w) (hsafe : Smith.SafeC h { elems := Smith.blockTape n r orig, active := 0, state := BiTM.System4State.C }) : Smith.AC.OK w h (Smith.blockAC w n r orig L Rc)
theorem Smith.blockAC_OK (w n r h : ℕ) (orig : List BiTM.System4Elem) (L Rc : List (Fin 3)) (hn : 3 ≤ n) (hN : h + 3 ≤ 2 ^ w) (hnw : n < 2 ^ w) (hwf : { elems := orig, active := 0, state := BiTM.System4State.A }.WellFormed) (horig_ne : orig ≠ []) (hlast : orig.getLast? ≠ some BiTM.System4Elem.star) (hb : ∀ (S : List ℤ), BiTM.System4Elem.set S ∈ orig → ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ w) (hsafe : Smith.SafeC h { elems := Smith.blockTape n r orig, active := 0, state := BiTM.System4State.C }) : Smith.AC.OK w h (Smith.blockAC w n r orig L Rc)
The side conditions of a block at its entry: the width covers the fuel `h`, the guard parameter and the program's integers, the program tape is well-formed and ends with a set, and System 4 never turns at the left end of the block tape within the fuel.
blockAC_OK discharges the side conditions of the abstract configuration at the
entry: the width covers the fuel, the guard parameter and the program's integers, the
items are well formed, the head is on the leading star in state C, and SafeC holds
for the fuel (from the specification).
At System 4's exit in state C with the head past the last element, a configuration in
Definition 6.4.17 with a closing 0 :: Rc has the System 3 head on that 0 in state
A with a 0 to its left: the entry shape of the next block.
Lean code for Theorem10.4.2.3●1 theorem
Associated Lean declarations
-
Smith.rep3_exit_zero[complete]
-
Smith.rep3_exit_zero[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.rep3_exit_zero (Rc : List (Fin 3)) (c3 : Smith.LConfig) (c4 : BiTM.System4Config) (w h : ℕ) (hrep : Smith.Rep3 (Smith.Closing.zero Rc) c3 c4 w h) (hact : c4.active = c4.elems.length) (hst : c4.state = BiTM.System4State.C) : ∃ L, c3 = { left := 0 :: L, head := 0, right := Rc, state := Smith.LState.A }
theorem Smith.rep3_exit_zero (Rc : List (Fin 3)) (c3 : Smith.LConfig) (c4 : BiTM.System4Config) (w h : ℕ) (hrep : Smith.Rep3 (Smith.Closing.zero Rc) c3 c4 w h) (hact : c4.active = c4.elems.length) (hst : c4.state = BiTM.System4State.C) : ∃ L, c3 = { left := 0 :: L, head := 0, right := Rc, state := Smith.LState.A }
At System 4's exit in state C with a closing `0`, the System 3 head is on that 0 in state A, with a 0 to its left: the next block's entry shape.
Case analysis on the focus of the abstract configuration: only the off focus has the
head past the last element, and its rendering with the zero closing is the shape.
The System 3 run of a block from its entry, for any junk L and rest Rc: it reaches
the entry of the next block (the head on the closing 0 in state A) after at least one
step, and on the way, at strictly increasing times, its tapes decode by
Definition 8.4.1 (through the relabelings and toBi) to the doubled cyclic
tag words of the first k configurations of the machine, with a 0 right of the head
and wolfram23 in state B.
Lean code for Theorem10.4.2.4●1 theorem
Associated Lean declarations
-
Smith.block_sys3[complete]
-
Smith.block_sys3[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.block_sys3 (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) (bd : Smith.BlockData) (hspec : Smith.BlockSpec tm c k bd) (L Rc : List (Fin 3)) : ∃ T3 L' t3, 1 ≤ T3 ∧ Smith.lnSteps Smith.sys3 (Smith.entry3 L bd Rc) T3 = some { left := 0 :: L', head := 0, right := Rc, state := Smith.LState.A } ∧ (∀ i < k, t3 i < t3 (i + 1)) ∧ ∀ i ≤ k, t3 i ≤ T3 ∧ ∃ c3, Smith.lnSteps Smith.sys3 (Smith.entry3 L bd Rc) (t3 i) = some c3 ∧ Smith.decodeW23 (2 ^ bd.w) bd.b (Smith.toBi (Smith.phi2 (Smith.phi3 c3))) = some (Smith.dbl (TagSystem.ctsOfCfg tm.numStates (TagSystem.rawRun tm c i)).data) ∧ 0 ∈ (Smith.toBi (Smith.phi2 (Smith.phi3 c3))).right ∧ (Smith.toBi (Smith.phi2 (Smith.phi3 c3))).state = 2
theorem Smith.block_sys3 (tm : TM.Machine) (c : BiTM.Config) (k : ℕ) (bd : Smith.BlockData) (hspec : Smith.BlockSpec tm c k bd) (L Rc : List (Fin 3)) : ∃ T3 L' t3, 1 ≤ T3 ∧ Smith.lnSteps Smith.sys3 (Smith.entry3 L bd Rc) T3 = some { left := 0 :: L', head := 0, right := Rc, state := Smith.LState.A } ∧ (∀ i < k, t3 i < t3 (i + 1)) ∧ ∀ i ≤ k, t3 i ≤ T3 ∧ ∃ c3, Smith.lnSteps Smith.sys3 (Smith.entry3 L bd Rc) (t3 i) = some c3 ∧ Smith.decodeW23 (2 ^ bd.w) bd.b (Smith.toBi (Smith.phi2 (Smith.phi3 c3))) = some (Smith.dbl (TagSystem.ctsOfCfg tm.numStates (TagSystem.rawRun tm c i)).data) ∧ 0 ∈ (Smith.toBi (Smith.phi2 (Smith.phi3 c3))).right ∧ (Smith.toBi (Smith.phi2 (Smith.phi3 c3))).state = 2
The System 3 run of a block from its entry: it reaches the entry of the next block (the head on the closing 0 in state A) and on the way, at strictly increasing times, tapes that decode to the first `k` configurations of the machine.
Theorem 6.7.1 over the block with fuel H + b, from
Theorem 10.4.2.2; at the decoding times Lemma 8.4.5 reads
the word (the band b is below the remaining fuel), and at time H
Theorem 10.4.2.3 gives the exit shape. That shape is entry3 of the next
block: the hand-off is an identity of configurations.
10.4.3. The chain and the finite prefixes
-
Smith.segCells[complete] -
Smith.start3[complete] -
Smith.startFin[complete]
segCells bd j n is the cells of the blocks j, ..., j + n - 1. start3 bd k is the
System 3 start ([], 2, 0 :: cells of blocks 0..k, B): its first step B20 -> A00>
is the entry of block 0 with L = []. startFin bd k is the wolfram23 configuration
(B, [], 2, 0 :: cells), the relabeling of start3 bd k.
Lean code for Definition10.4.3.1●3 definitions
Associated Lean declarations
-
Smith.segCells[complete]
-
Smith.start3[complete]
-
Smith.startFin[complete]
-
Smith.segCells[complete] -
Smith.start3[complete] -
Smith.startFin[complete]
-
defdefined in Smith/Infinite.leancomplete
def Smith.segCells (bd : ℕ → Smith.BlockData) (j n : ℕ) : List (Fin 3)
def Smith.segCells (bd : ℕ → Smith.BlockData) (j n : ℕ) : List (Fin 3)
The cells of the blocks `j, ..., j + n - 1`.
-
defdefined in Smith/Infinite.leancomplete
def Smith.start3 (bd : ℕ → Smith.BlockData) (k : ℕ) : Smith.LConfig
def Smith.start3 (bd : ℕ → Smith.BlockData) (k : ℕ) : Smith.LConfig
The System 3 start of the emulation of `k` steps: the head on a 2 in state B, the 0 that will be the left end of block 0 to its right, then the blocks `0, ..., k`.
-
defdefined in Smith/Infinite.leancomplete
def Smith.startFin (bd : ℕ → Smith.BlockData) (k : ℕ) : BiTM.Config
def Smith.startFin (bd : ℕ → Smith.BlockData) (k : ℕ) : BiTM.Config
The wolfram23 start of the emulation of `k` steps: `start3` relabeled.
The System 3 run through the blocks j, ..., j + n - 1, entry to entry, in at least
n steps, each block j emulating kk j steps.
Lean code for Theorem10.4.3.2●1 theorem
Associated Lean declarations
-
Smith.chain_sys3[complete]
-
Smith.chain_sys3[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.chain_sys3 (tm : TM.Machine) (c : BiTM.Config) (bd : ℕ → Smith.BlockData) (kk : ℕ → ℕ) (hbd : ∀ (j : ℕ), Smith.BlockSpec tm c (kk j) (bd j)) (n j : ℕ) (L Rc : List (Fin 3)) : ∃ T L', n ≤ T ∧ Smith.lnSteps Smith.sys3 { left := 0 :: L, head := 0, right := Smith.segCells bd j n ++ Rc, state := Smith.LState.A } T = some { left := 0 :: L', head := 0, right := Rc, state := Smith.LState.A }
theorem Smith.chain_sys3 (tm : TM.Machine) (c : BiTM.Config) (bd : ℕ → Smith.BlockData) (kk : ℕ → ℕ) (hbd : ∀ (j : ℕ), Smith.BlockSpec tm c (kk j) (bd j)) (n j : ℕ) (L Rc : List (Fin 3)) : ∃ T L', n ≤ T ∧ Smith.lnSteps Smith.sys3 { left := 0 :: L, head := 0, right := Smith.segCells bd j n ++ Rc, state := Smith.LState.A } T = some { left := 0 :: L', head := 0, right := Rc, state := Smith.LState.A }
The System 3 run through the blocks `j, ..., j + n - 1`, entry to entry; block `j` emulates `kk j` steps.
Induction on n with Theorem 10.4.2.4.
On the finite tape of blocks 0, ..., k, wolfram23 from startFin bd k decodes, at
strictly increasing times, to the first kk k configurations of the machine (a 0
right of the head, state B at each), the last time later than k, and keeps the size
of its explicit tape throughout.
Lean code for Theorem10.4.3.3●1 theorem
Associated Lean declarations
-
Smith.stage_w23[complete]
-
Smith.stage_w23[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.stage_w23 (tm : TM.Machine) (c : BiTM.Config) (bd : ℕ → Smith.BlockData) (kk : ℕ → ℕ) (hbd : ∀ (j : ℕ), Smith.BlockSpec tm c (kk j) (bd j)) (k : ℕ) : ∃ times T, k < times (kk k) ∧ (∀ i < kk k, times i < times (i + 1)) ∧ (∀ i ≤ kk k, times i ≤ T ∧ ∃ cfgi, BiTM.nSteps BiTM.wolfram23 (Smith.startFin bd k) (times i) = some cfgi ∧ Smith.decodeW23 (2 ^ (bd k).w) (bd k).b cfgi = some (Smith.dbl (TagSystem.ctsOfCfg tm.numStates (TagSystem.rawRun tm c i)).data) ∧ 0 ∈ cfgi.right ∧ cfgi.state = 2) ∧ ∀ τ ≤ T, ∃ cfgτ, BiTM.nSteps BiTM.wolfram23 (Smith.startFin bd k) τ = some cfgτ ∧ Smith.biSize cfgτ = Smith.biSize (Smith.startFin bd k)
theorem Smith.stage_w23 (tm : TM.Machine) (c : BiTM.Config) (bd : ℕ → Smith.BlockData) (kk : ℕ → ℕ) (hbd : ∀ (j : ℕ), Smith.BlockSpec tm c (kk j) (bd j)) (k : ℕ) : ∃ times T, k < times (kk k) ∧ (∀ i < kk k, times i < times (i + 1)) ∧ (∀ i ≤ kk k, times i ≤ T ∧ ∃ cfgi, BiTM.nSteps BiTM.wolfram23 (Smith.startFin bd k) (times i) = some cfgi ∧ Smith.decodeW23 (2 ^ (bd k).w) (bd k).b cfgi = some (Smith.dbl (TagSystem.ctsOfCfg tm.numStates (TagSystem.rawRun tm c i)).data) ∧ 0 ∈ cfgi.right ∧ cfgi.state = 2) ∧ ∀ τ ≤ T, ∃ cfgτ, BiTM.nSteps BiTM.wolfram23 (Smith.startFin bd k) τ = some cfgτ ∧ Smith.biSize cfgτ = Smith.biSize (Smith.startFin bd k)
The emulation of the first `kk k` steps on the finite tape of the blocks `0, ..., k`: wolfram23 from `startFin bd k` decodes, at strictly increasing times, to the first `kk k` configurations of the machine, the run staying on the explicit tape.
Theorem 10.4.3.2 through blocks 0, ..., k - 1, Theorem 10.4.2.4
on block k, then Theorem 7.2.10 and Theorem 2.6.6
relabel the System 3 run to the wolfram23 run; the size invariant is
lnSteps_length.
10.4.4. The infinite tape
The stream: a 0, then the cells of all the blocks in order; cell i + 1 is read off
the first i + 1 blocks (Definition 10.4.3.1), which have at least i + 1
cells.
Lean code for Definition10.4.4.1●1 definition
Associated Lean declarations
-
Smith.tape[complete]
-
Smith.tape[complete]
-
defdefined in Smith/Infinite.leancomplete
def Smith.tape (bd : ℕ → Smith.BlockData) : ℕ → ℕ
def Smith.tape (bd : ℕ → Smith.BlockData) : ℕ → ℕ
The infinite tape right of the head: a 0, then the cells of all the blocks in order; the `i`-th of those is read off the first `i + 1` blocks, which have at least `i + 1` cells.
startFin bd k agrees (Definition 10.2.4) with istart (tape bd).
Lean code for Theorem10.4.4.2●1 theorem
Associated Lean declarations
-
Smith.startFin_agree[complete]
-
Smith.startFin_agree[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.startFin_agree (bd : ℕ → Smith.BlockData) (k : ℕ) : Smith.Agree (Smith.startFin bd k) (Smith.istart (Smith.tape bd))
theorem Smith.startFin_agree (bd : ℕ → Smith.BlockData) (k : ℕ) : Smith.Agree (Smith.startFin bd k) (Smith.istart (Smith.tape bd))
The prefixes of the stream are stable (segCells_getElem?_of_le), so the explicit
cells of the finite start are the first cells of the stream.
On the infinite tape of a sequence of blocks, block j emulating the first j raw
steps: for every k, the window W = biSize (startFin bd k), strictly increasing
times with k < times k, no left move from an empty left tape before times k, and
the decodes, with the width and band of block k, of the defined configurations
i <= k at times i, in state B, on the window and on every larger window.
Lean code for Theorem10.4.4.3●1 theorem
Associated Lean declarations
-
Smith.stage_infinite[complete]
-
Smith.stage_infinite[complete]
-
theoremdefined in Smith/Infinite.leancomplete
theorem Smith.stage_infinite (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (bd : ℕ → Smith.BlockData) (hbd : ∀ (j : ℕ), Smith.BlockSpec tm c j (bd j)) (k : ℕ) : ∃ W times, k < times k ∧ (∀ i < k, times i < times (i + 1)) ∧ (∀ τ < times k, ∀ (d : Smith.IConfig), Smith.inSteps BiTM.wolfram23 (Smith.istart (Smith.tape bd)) τ = some d → d.left = [] → (BiTM.wolfram23.transition d.state d.head).dir = TM.Dir.R) ∧ ∀ (i : ℕ) (ci : BiTM.Config), i ≤ k → BiTM.nSteps tm c i = some ci → ∃ d, Smith.inSteps BiTM.wolfram23 (Smith.istart (Smith.tape bd)) (times i) = some d ∧ d.state = 2 ∧ ∀ (W' : ℕ), W ≤ W' → Smith.decodeTM tm.numStates (2 ^ (bd k).w) (bd k).b (Smith.truncI W' d) = some (TagSystem.canon ci)
theorem Smith.stage_infinite (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (bd : ℕ → Smith.BlockData) (hbd : ∀ (j : ℕ), Smith.BlockSpec tm c j (bd j)) (k : ℕ) : ∃ W times, k < times k ∧ (∀ i < k, times i < times (i + 1)) ∧ (∀ τ < times k, ∀ (d : Smith.IConfig), Smith.inSteps BiTM.wolfram23 (Smith.istart (Smith.tape bd)) τ = some d → d.left = [] → (BiTM.wolfram23.transition d.state d.head).dir = TM.Dir.R) ∧ ∀ (i : ℕ) (ci : BiTM.Config), i ≤ k → BiTM.nSteps tm c i = some ci → ∃ d, Smith.inSteps BiTM.wolfram23 (Smith.istart (Smith.tape bd)) (times i) = some d ∧ d.state = 2 ∧ ∀ (W' : ℕ), W ≤ W' → Smith.decodeTM tm.numStates (2 ^ (bd k).w) (bd k).b (Smith.truncI W' d) = some (TagSystem.canon ci)
The emulation of the first `k` steps on the infinite tape of a sequence of blocks, block `j` emulating the first `j` raw steps: the schedule, the head never leaving the tape to the left before the end of the schedule, the decodes of the steps at which the run of `tm` is defined.
Theorem 10.4.3.3 on the finite tape, transferred to the infinite one by
Theorem 10.2.5 from Theorem 10.4.4.2; the decoder on the
window by Theorem 10.2.6; where the run of tm is defined the raw
configuration is its configuration (Lemma 9.3.2), and undbl_dbl
and Theorem 3.5.9 turn the doubled cyclic tag word into it (its
validity along the run by nSteps_valid). "No left move from an
empty left tape" follows from the size invariant: a left move from left = [] reads
the implicit blank and grows the size by one.
The closed-form tape of T6: ITape tm c = tape (closedBlock tm c)
(Definition 10.4.4.1, Definition 10.4.1.8), a 0 followed by the cells of the
closed-form blocks 0, 1, 2, .... Cell i is a closed form of tm, c and i.
Lean code for Definition10.4.4.4●1 definition
Associated Lean declarations
-
Smith.ITape[complete]
-
Smith.ITape[complete]
-
defdefined in Smith/Infinite.leancomplete
def Smith.ITape (tm : TM.Machine) (c : BiTM.Config) : ℕ → ℕ
def Smith.ITape (tm : TM.Machine) (c : BiTM.Config) : ℕ → ℕ
The closed-form right-infinite tape of T6: the cells of the closed-form blocks `closedBlock tm c 0`, `closedBlock tm c 1`, ... after a 0. Cell `i` is a closed form of `tm`, `c` and `i`; no system is run to compute it.
Theorem 10.4.1.9 gives, for every k, the run data H k and dt k of
block k (chosen classically, choose); the blocks with their run data have the
same cells as the closed-form blocks, so their tape is ITape tm c
(Definition 10.4.4.4) by definition. Block k emulates k raw steps, and a raw
step is a step of tm while tm runs, so for a machine that halts at step m every
block reproduces the run up to m, and past m the blocks go on emulating the raw
run, which nothing decodes as a step of tm. This is why the theorem needs no
hypothesis on halting, where the finite form needs the run to last the budget.
Theorem 10.2.3 gives that the run is defined at every time,
Theorem 10.4.4.3 gives the per-k clauses, and its "no left move"
clause holds at every time because the schedule of block k ends after time k
(each block takes at least one System 3 step).
10.5. Tests
Vectors/InfiniteVectors.lean (E1-E8, all by kernel decide). E1-E5: D9's program
{0, 2} * {} in a block with n = 7, r = 5, width 2^5, band 4. E1: the System 4
entry in 10 steps to padCfg 7 5 0, the exit at 13 as the padded exit configuration,
stuck alone at 14, SafeC. E2: the System 3 run from entry3, the decode at 160
([false], as D9), the exit at 224 in the shape of rep3_exit_zero. E3: two blocks
chained through start3, decodes at 161 and 385, exits at 225 and 449. E4: wolfram23
from startFin, decodes at 335 and 793, the exit at 917 on the last cell in state A,
size 450 kept through 917 steps and 451 at 918, the head on the first cell only at
time 0. E5: tape at the block boundaries, the truncation of the infinite start to
449 cells being startFin bd 1, the infinite run decoding on a window of 64 cells and
on the theorem's window 450 at 335 and 793 (window stability: at 335 the first 0 is
cell 31, the window of 30 cells does not decode, every window from 31 on decodes
alike), entering block 2 at 918, where the finite run leaves its tape, and the
left-end clause failing on the all-zero tape at time 12. E6: the program {0} {0, 1} * {2}, which turns once at its
left end, in a block with n = 12, r = 10, width 2^6: the turn as pad_turn
states it (the program's configuration padded with no turn at block time 24, with one
turn 2 * 0 + 4 steps later, the innermost guard {10} merged as {9}), the exit at
31 as padCfg 12 10 1, the System 3 exit after 1218 steps, the head never back on the
leftmost cell. E7: two blocks of different widths (2^5 then 2^6): segCells,
tape at the boundaries, the decodes at 335 (width 32) and 1113 (width 64), the exit
at 1365 and the entry into block 2. E8: the machine-independent side conditions of
BlockSpec on the E1 block, the System 4 decode at dt 0, the raw run that the
blocks emulate on the one-step machine tmH of
Vectors/TMToCTSVectors.lean (it agrees with the run at step 1 and goes on
at step 2, where the run is none) and both theorems instantiated on tmH. The
E-blocks are hand-sized (n = T4 + 3 from the exact run length); the closed-form
blocks are far too large to evaluate (block 0 of tmH has icT4 + 1 guards), and
Vectors/ClosedFormVectors.lean checks the bounds behind them on small
instances instead.
10.6. What remains existential
-
Nothing about the tape is existential any more:
ITape tm cis a definition, and blockkis a closed form oftm,candk. Only the run dataHanddtof the blocks, which the proofs read and the tape does not, are chosen classically. -
The conclusion template alone is satisfied by machines that do nothing (an infinite tape can hold the run laid out in advance, and in the corollary's
forall tm c, exists tform one dovetailed tape could even serve all machines and inputs). The closed-form statement excludes this reading: its tape is the stated function of(tm, c), built by Smith's encoders from the machine's description and from bounds, never from the run's configurations. No theorem bounds the size of blockkor the cost of writing it down; both are exponential inkand in the size ofc. -
The times are existential, one schedule per block; there is no single schedule across blocks (each block starts the emulation over).
-
Smith starts "with the leftmost 0 active in state A"; here the start is a 2 in state B whose first step
B2 -> 0, R, Aputs the head on the leading 0 of block 0 in state A with a 0 to its left, the shape the block relation needs. This is one extra cell and one extra step.
10.7. Depends on
Smith.Guards, Smith.Conjecture3 with LeftEnd.junk and Closing.zero
(the chapter on System 4 to System 3), Smith.Conjecture0
(rep3_decode, rep3_exit), Smith.ClosedForm and Smith.RunBounds
(system4_emulation, icStart, System4.run_bound, the chapter on
Conjecture 0), Smith.Universality (decodeTM, undbl, icProg, cts_run_tag,
the chapter on the composition), TagSystem.TagBounds
(rawRun, tagTime, tag_rawRun) and TagSystem.TMToCTS (decodeCTS_word,
step_valid, the chapter on the machine reduction).