9. T8: the composition
9.1. Orientation
Smith/Universality.lean composes T7
(the chapter on the machine reduction) with T4
(the chapter on Conjecture 0) into
Smith.wolfram23_universal_ic, stated in full in the overview.
This chapter records how the composition is made, what the decoder is, how the
initial condition IC tm c n is written down without running anything, and
which of the referee's objections the statement answers and which it does not.
9.2. The decoder
undbl takes a list of bits to an optional list of bits: the empty list to
some [], a one-element list to none, and a :: b :: rest to undbl rest
with a put in front when a = b, to none otherwise. It is the partial
inverse of the doubling Definition 4.3.1: it inverts dbl on doubled words
and returns none elsewhere.
Lean code for Definition9.2.1●1 definition
Associated Lean declarations
-
Smith.undbl[complete]
-
Smith.undbl[complete]
-
defdefined in Smith/Universality.leancomplete
def Smith.undbl : List Bool → Option (List Bool)
def Smith.undbl : List Bool → Option (List Bool)
The inverse of `dbl` on doubled words; `none` on any other word.
For every list of bits w, Definition 9.2.1 of Definition 4.3.1 w
is some w.
Lean code for Lemma9.2.2●1 theorem
Associated Lean declarations
-
Smith.undbl_dbl[complete]
-
Smith.undbl_dbl[complete]
-
theoremdefined in Smith/Universality.leancomplete
theorem Smith.undbl_dbl (w : List Bool) : Smith.undbl (Smith.dbl w) = some w
theorem Smith.undbl_dbl (w : List Bool) : Smith.undbl (Smith.dbl w) = some w
Induction on w: dbl (a :: w) is a :: a :: dbl w, whose first two entries
agree, so undbl strips the pair and recurses.
decodeTM S N b takes a wolfram23 configuration to an optional machine
configuration, the composite of three decoders: Definition 8.4.1 with
block width N and band b reads the doubled cyclic tag word off the wolfram23
tape (the chapter on Conjecture 0); Definition 9.2.1
undoubles it; Definition 3.5.8 with S states reads the machine
configuration off the cyclic tag word, taken as a cyclic tag configuration with
phase 0 (the chapter on the machine reduction), up to trailing
blanks. If any stage fails the result is none.
Lean code for Definition9.2.3●1 definition
Associated Lean declarations
-
Smith.decodeTM[complete]
-
Smith.decodeTM[complete]
-
defdefined in Smith/Universality.leancomplete
def Smith.decodeTM (S N b : ℕ) (cfg : BiTM.Config) : Option BiTM.Config
def Smith.decodeTM (S N b : ℕ) (cfg : BiTM.Config) : Option BiTM.Config
The decoder of the wolfram23 tape for a machine with states below `S`: the doubled cyclic tag word (`decodeW23`, blocks of width `N`, band `b`), undoubled, read as a configuration of the machine (`decodeCTS`).
decodeTM S N b is a fixed function of (S, N, b) and of the cells from the
head up to the first 0 to its right; it does not see the machine, the input or
the run.
9.3. The tag bounds
-
TagSystem.rawStep[complete] -
TagSystem.rawRun[complete] -
TagSystem.roundLen[complete] -
TagSystem.tagTime[complete]
rawStep tm c is the step of the machine with the halting state 0 treated as an
ordinary state (row 0 of the table, which Definition 3.4.12 keeps in range);
rawRun tm c n is its n-th iterate. roundLen tm c is the number of tag steps
the Cocke-Minsky tag system takes for one raw step from c (the round lengths of
Theorem 3.3.15), and tagTime tm c n their sum over the first n
raw steps.
Lean code for Definition9.3.1●4 definitions
Associated Lean declarations
-
TagSystem.rawStep[complete]
-
TagSystem.rawRun[complete]
-
TagSystem.roundLen[complete]
-
TagSystem.tagTime[complete]
-
TagSystem.rawStep[complete] -
TagSystem.rawRun[complete] -
TagSystem.roundLen[complete] -
TagSystem.tagTime[complete]
-
defdefined in TagSystem/TagBounds.leancomplete
def TagSystem.rawStep (tm : TM.Machine) (c : BiTM.Config) : BiTM.Config
def TagSystem.rawStep (tm : TM.Machine) (c : BiTM.Config) : BiTM.Config
The step of the machine with the halting state treated as an ordinary state: the one `BiTM.step` takes in every other state.
-
defdefined in TagSystem/TagBounds.leancomplete
def TagSystem.rawRun (tm : TM.Machine) (c : BiTM.Config) : ℕ → BiTM.Config
def TagSystem.rawRun (tm : TM.Machine) (c : BiTM.Config) : ℕ → BiTM.Config
The raw run.
-
defdefined in TagSystem/TagBounds.leancomplete
def TagSystem.roundLen (tm : TM.Machine) (c : BiTM.Config) : ℕ
def TagSystem.roundLen (tm : TM.Machine) (c : BiTM.Config) : ℕ
The number of tag steps of the round that carries out a raw step: three rounds for a move to the right, five for a move to the left, in the halves `m = val left` and `N = head + 2 val right` of the word.
-
defdefined in TagSystem/TagBounds.leancomplete
def TagSystem.tagTime (tm : TM.Machine) (c : BiTM.Config) : ℕ → ℕ
def TagSystem.tagTime (tm : TM.Machine) (c : BiTM.Config) : ℕ → ℕ
The tag time of `n` raw steps: the sum of their round lengths.
-
TagSystem.rawRun_eq[complete] -
TagSystem.step_eq_rawStep[complete] -
TagSystem.rawRun_valid[complete]
While the machine runs, the raw run is its run: if BiTM.nSteps tm c n = some c'
(Definition 2.3.4) then rawRun tm c n = c' (Definition 9.3.1). Raw
steps keep a configuration valid with its state in range.
Lean code for Lemma9.3.2●3 theorems
Associated Lean declarations
-
TagSystem.rawRun_eq[complete]
-
TagSystem.step_eq_rawStep[complete]
-
TagSystem.rawRun_valid[complete]
-
TagSystem.rawRun_eq[complete] -
TagSystem.step_eq_rawStep[complete] -
TagSystem.rawRun_valid[complete]
-
theoremdefined in TagSystem/TagBounds.leancomplete
theorem TagSystem.rawRun_eq (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) (c' : BiTM.Config) (h : BiTM.nSteps tm c n = some c') : TagSystem.rawRun tm c n = c'
theorem TagSystem.rawRun_eq (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) (c' : BiTM.Config) (h : BiTM.nSteps tm c n = some c') : TagSystem.rawRun tm c n = c'
The raw run agrees with the machine's run as long as the machine runs.
-
theoremdefined in TagSystem/TagBounds.leancomplete
theorem TagSystem.step_eq_rawStep (tm : TM.Machine) (c : BiTM.Config) (hq : c.state ≠ 0) : BiTM.step tm c = some (TagSystem.rawStep tm c)
theorem TagSystem.step_eq_rawStep (tm : TM.Machine) (c : BiTM.Config) (hq : c.state ≠ 0) : BiTM.step tm c = some (TagSystem.rawStep tm c)
-
theoremdefined in TagSystem/TagBounds.leancomplete
theorem TagSystem.rawRun_valid (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (n : ℕ) : TagSystem.ValidCfg (TagSystem.rawRun tm c n) ∧ (TagSystem.rawRun tm c n).state < tm.numStates
theorem TagSystem.rawRun_valid (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (n : ℕ) : TagSystem.ValidCfg (TagSystem.rawRun tm c n) ∧ (TagSystem.rawRun tm c n).state < tm.numStates
Outside state 0, Definition 2.3.3 is some (rawStep tm c) (step_eq_rawStep);
induction on n.
-
TagSystem.tag_rawRun[complete] -
TagSystem.raw_step_tag[complete] -
TagSystem.tag_run_total[complete]
From the word of a valid configuration c with state in range, the tag system
Definition 3.4.6 reaches, after tagTime tm c n steps
(Definition 9.3.1), the word (Definition 3.3.5) of rawRun tm c n. In
particular the tag run is defined for every number of steps (tag_run_total): it
does not stop when the machine halts.
Lean code for Lemma9.3.3●3 theorems
Associated Lean declarations
-
TagSystem.tag_rawRun[complete]
-
TagSystem.raw_step_tag[complete]
-
TagSystem.tag_run_total[complete]
-
TagSystem.tag_rawRun[complete] -
TagSystem.raw_step_tag[complete] -
TagSystem.tag_run_total[complete]
-
theoremdefined in TagSystem/TagBounds.leancomplete
theorem TagSystem.tag_rawRun (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (n : ℕ) : TagSystem.nStepsP (TagSystem.prod tm) (TagSystem.word c) (TagSystem.tagTime tm c n) = some (TagSystem.word (TagSystem.rawRun tm c n))
theorem TagSystem.tag_rawRun (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (n : ℕ) : TagSystem.nStepsP (TagSystem.prod tm) (TagSystem.word c) (TagSystem.tagTime tm c n) = some (TagSystem.word (TagSystem.rawRun tm c n))
At tag time `tagTime c n` the tag run is at the word of the `n`-th raw configuration.
-
theoremdefined in TagSystem/TagBounds.leancomplete
theorem TagSystem.raw_step_tag (tm : TM.Machine) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hb : (tm.transition c.state c.head).write < 2) : TagSystem.nStepsP (TagSystem.prod tm) (TagSystem.word c) (TagSystem.roundLen tm c) = some (TagSystem.word (TagSystem.rawStep tm c))
theorem TagSystem.raw_step_tag (tm : TM.Machine) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hb : (tm.transition c.state c.head).write < 2) : TagSystem.nStepsP (TagSystem.prod tm) (TagSystem.word c) (TagSystem.roundLen tm c) = some (TagSystem.word (TagSystem.rawStep tm c))
The tag system carries out a raw step in `roundLen` steps, in every state (`tm_step_tag` without `q != 0`).
-
theoremdefined in TagSystem/TagBounds.leancomplete
theorem TagSystem.tag_run_total (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (t : ℕ) : ∃ w, TagSystem.nStepsP (TagSystem.prod tm) (TagSystem.word c) t = some w
theorem TagSystem.tag_run_total (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (t : ℕ) : ∃ w, TagSystem.nStepsP (TagSystem.prod tm) (TagSystem.word c) t = some w
The tag run from the word of a valid configuration is defined for every number of steps.
The round lemmas of the machine reduction are stated for any
state; only Theorem 3.3.15 needs q != 0, to unfold
BiTM.step. raw_step_tag is the same composition of rounds for the raw step,
whatever the state, in roundLen tag steps; induction on n.
-
TagSystem.tagTime_le[complete] -
TagSystem.roundLen_le[complete] -
TagSystem.sz[complete]
For a valid configuration c with state in range, with sz c the number of
explicit tape cells, tagTime tm c n <= n * 15 * 2 ^ (sz c + n).
Lean code for Lemma9.3.4●3 declarations
Associated Lean declarations
-
TagSystem.tagTime_le[complete]
-
TagSystem.roundLen_le[complete]
-
TagSystem.sz[complete]
-
TagSystem.tagTime_le[complete] -
TagSystem.roundLen_le[complete] -
TagSystem.sz[complete]
-
theoremdefined in TagSystem/TagBounds.leancomplete
theorem TagSystem.tagTime_le (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (n : ℕ) : TagSystem.tagTime tm c n ≤ n * 15 * 2 ^ (TagSystem.sz c + n)
theorem TagSystem.tagTime_le (tm : TM.Machine) (hwf : TagSystem.WF tm) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) (hst : c.state < tm.numStates) (n : ℕ) : TagSystem.tagTime tm c n ≤ n * 15 * 2 ^ (TagSystem.sz c + n)
The tag time of `n` raw steps from a valid configuration, bounded by the size of the configuration and `n` alone.
-
theoremdefined in TagSystem/TagBounds.leancomplete
theorem TagSystem.roundLen_le (tm : TM.Machine) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) : TagSystem.roundLen tm c ≤ 15 * 2 ^ TagSystem.sz c
theorem TagSystem.roundLen_le (tm : TM.Machine) (c : BiTM.Config) (hv : TagSystem.ValidCfg c) : TagSystem.roundLen tm c ≤ 15 * 2 ^ TagSystem.sz c
-
defdefined in TagSystem/TagBounds.leancomplete
def TagSystem.sz (c : BiTM.Config) : ℕ
def TagSystem.sz (c : BiTM.Config) : ℕ
The number of explicit cells of a configuration off the head.
A round costs at most five passes over the tag word, whose halves are the numbers
val left and head + 2 val right, below 2 ^ sz c and 2 ^ (sz c + 1)
(val_lt_two_pow), so roundLen c <= 15 * 2 ^ sz c; a raw step grows the tape by
at most one cell (sz_rawStep), so the i-th raw configuration has
sz <= sz c + i; sum over i < n.
9.4. The closed-form initial condition
-
Smith.IC[complete] -
Smith.ICw[complete] -
Smith.ICb[complete] -
Smith.icN[complete] -
Smith.icProg[complete] -
Smith.ctsOf[complete]
ctsOf tm is the cyclic tag system Definition 3.4.8 of the tag system
Definition 3.4.6 tm S of T7, with S = tm.numStates. The budget is
icN c n = n * 15 * 2 ^ (sz c + n) cycles, the bound of
Lemma 9.3.4; icProg tm c n is the System 5 program
Definition 4.4.9 (ctsOf tm) (ctsOfCfg S c) (icN c n). The initial
condition is IC tm c n = icStart (icProg tm c n) (Definition 8.6.1), with the
width exponent ICw tm c n = icW (icProg tm c n) and the band
ICb tm c n = icBand (icProg tm c n). Every part is an encoder applied to tm, c
and n, or an arithmetic expression in the sizes of their outputs.
Lean code for Definition9.4.1●6 definitions
Associated Lean declarations
-
Smith.IC[complete]
-
Smith.ICw[complete]
-
Smith.ICb[complete]
-
Smith.icN[complete]
-
Smith.icProg[complete]
-
Smith.ctsOf[complete]
-
Smith.IC[complete] -
Smith.ICw[complete] -
Smith.ICb[complete] -
Smith.icN[complete] -
Smith.icProg[complete] -
Smith.ctsOf[complete]
-
defdefined in Smith/Universality.leancomplete
def Smith.IC (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) : BiTM.Config
def Smith.IC (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) : BiTM.Config
The closed-form initial condition for `n` steps of `tm` from `c`: every part of it (the tag system, the cyclic tag system, the System 5 program with `icN c n` cycles, the System 4 tape, the parity blocks of width `2 ^ ICw tm c n`) is computed from `tm`, `c` and `n` by the encoders and the closed-form parameters, without running any system.
-
defdefined in Smith/Universality.leancomplete
def Smith.ICw (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) : ℕ
def Smith.ICw (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) : ℕ
The width exponent of the parity blocks of `IC tm c n`.
-
defdefined in Smith/Universality.leancomplete
def Smith.ICb (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) : ℕ
def Smith.ICb (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) : ℕ
The band of the decoder for `IC tm c n`.
-
defdefined in Smith/Universality.leancomplete
def Smith.icN (c : BiTM.Config) (n : ℕ) : ℕ
def Smith.icN (c : BiTM.Config) (n : ℕ) : ℕ
The budget of the closed-form initial condition: a bound on the tag time of `n` machine steps from `c` (`tagTime_le`), in cycles of the cyclic tag system, one cycle per tag step.
-
defdefined in Smith/Universality.leancomplete
def Smith.icProg (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) : BiTM.System5Config
def Smith.icProg (tm : TM.Machine) (c : BiTM.Config) (n : ℕ) : BiTM.System5Config
The System 5 program of the closed-form initial condition.
-
defdefined in Smith/Universality.leancomplete
def Smith.ctsOf (tm : TM.Machine) : TagSystem.CTS
def Smith.ctsOf (tm : TM.Machine) : TagSystem.CTS
The cyclic tag system of T7 for the machine `tm`.
9.5. The composition
The statement of the headline theorem is in the overview; its proof is the composition below.
Write S for tm.numStates, K = 1 + 84 S, N = icN c n, and c_i for the
i-th configuration of the run, BiTM.nSteps tm c i = some c_i.
The tag run from word c is defined for every number of steps
(Lemma 9.3.3). The cyclic tag system ctsOf tm has 2 K
appendants (Lemma 3.4.9) and makes exactly one
cycle of them per tag step (Lemma 3.4.11): after 2 K t cyclic tag
steps from Definition 3.4.14 S c its configuration encodes the tag word at
time t (cts_run_tag). So the cyclic tag run lasts the budget of N cycles, and
its last word is nonempty because the tag run goes on one step further, which needs
a word of at least two symbols.
So T4 in closed form, Theorem 8.2.1, applies to ctsOf tm,
ctsOfCfg S c and N; its tape icStart (icProg tm c n) is IC tm c n
(Definition 9.4.1) and its width and band are ICw and ICb. It returns a
schedule times' on the cyclic tag steps and the exit time T. The schedule of T8
is times i = times' (2 K tagTime tm c i): tagTime is strictly increasing
(tagTime_strictMono) and tagTime tm c i <= tagTime tm c n <= N
(Lemma 9.3.4), so the times are strictly increasing on [0, n] and
at most T.
At cyclic tag time 2 K tagTime tm c i the tag word is word (rawRun tm c i)
(Lemma 9.3.3), and rawRun tm c i = c_i
(Lemma 9.3.2), so the cyclic tag configuration is ctsOfCfg S c_i.
The decoders compose: Definition 8.4.1 returns Definition 4.3.1 of its
data, undbl returns the data (Lemma 9.2.2), and decodeCTS returns
canon c_i (Theorem 3.5.9, for a valid configuration with state
below S, rawRun_valid). So Definition 9.2.3 S (2^w) b of the wolfram23
configuration at time times i is some (canon c_i) (Definition 3.5.7). The
validity of the start, its state A, the confinement clause and the exit clause are
those of conjecture0_closed, unchanged.
9.6. What the statement answers, and what it leaves open
Answered by the statement as it stands:
-
The decoder is fixed and position-relative, and it is a left inverse of the encoders only at the scheduled times by the theorem; it is not a table lookup into
tmorc. -
The times are strictly increasing, the machine configurations are those of the given run (
BiTM.nSteps tm c i = some ci), and confinement and exit are stated and proved. -
No axiom beyond
propext,Classical.choice,Quot.sound; nosorry; nonative_decidein the cone.
Left open by the statement (the chapter on open items):
-
One tape per machine, configuration and budget
n. The standard notion of universality asks for one encoding of(M, x)independent of the running time; the infinite form (the chapter on the infinite form,Smith.wolfram23_infinite_ic) gives it: one right-infinite tapeITape tm cper(M, x)with the whole run decodable. -
The precomputed-tape objection (the conclusion template alone is met by a machine that only moves right over a tape on which the configurations have been laid out in advance) is answered by the closed form: the tape is the definition
IC tm c n(orITape tm c), which writes down encodings of the machine's description and evaluates closed-form bounds, and never runs the machine or the emulating systems. No theorem bounds the size of the tape or the cost of computing it; it is exponential innand in the size ofc, through the budgeticN c n, and the System 5 boundicT5is exponential again in the number of rules. -
Binary machines only.
-
Decoding up to
canon, at existential times, with nothing said about other times.
9.7. Notes and caveats
-
No regression vector runs
decodeTMon encoder output and gets a configuration back: withICwthe block width is far beyonddecide, and a positive instance on a rendered tape needs the doubled encoding of a configuration word, at least2 * 4 * (1 + 84 S)bits, hence a block of width at least2^13forS = 2, whose rendering builds its parity rows by iteration.undblis covered byundbl_dbland by the vectors ofVectors/TMToCTSVectors.lean(it invertsdbl, rejects an odd word and a word that is not doubled);decodeW23by the D9 vectors ofVectors/SmithVectors.lean;decodeCTS, and the last two stages ofdecodeTMon the doubled encoding of a configuration, byVectors/TMToCTSVectors.lean. On the D9 positive tapedecodeTMreturnsnonebecause the word there has odd length (one symbol); on the D10 tape it passesundblwith the word0, whichdecodeCTS 2rejects (Vectors/SmithVectors.leanD10). A hand-picked positive instance fordecodeTMis still wanted (the chapter on open items).
9.8. Depends on
This chapter depends on the modules Smith.Universality and TagSystem.TagBounds,
and through them on the chapter on the machine reduction (T7:
TagSystem.tm_step_tag, TagSystem.cts_of_tag,
TagSystem.decodeCTS_word) and the chapter on Conjecture 0
(T4: Smith.conjecture0_closed, Smith.icStart, Smith.decodeW23).