Wolfram (2,3) universality in Lean

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, hst are 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 -> Nat is the tape right of the head, a stream of cells, all 0, 1 or 2. istart t is the configuration (state B, left [], head 2, right t): the head on a 2 in state B at the left end. IConfig is a wolfram23 configuration whose right tape is a stream; istep and inSteps are BiTM.step and BiTM.nSteps with the stream in place of the list (the left tape is a list with an implicit blank beyond, as in BiTM.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 width 2^w and band b of block k (w = blkW tm c k, b = icBand (blkProg tm c k)), a window W and times times i, the last of them later than k (the emulation advances along the tape). The times are strictly increasing on i < k, whether or not tm halts: block k emulates k raw steps (the halting row read as an ordinary one), which are the steps of tm while it runs. For every i <= k at which the run of tm is defined, wolfram23 is in state B at times i and the infinite configuration, truncated to the W cells right of the head (truncI) or to any larger window, decodes by decodeTM to the i-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.

Definition10.2.1
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.2
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 2.3.1
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 0✓L∃∀N

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
  • structure(4 fields)defined in Smith/Infinite.lean
    complete
    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. 
    state : ℕ
    left : List ℕ
    head : ℕ
    right : ℕ → ℕ
  • defdefined in Smith/Infinite.lean
    complete
    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.lean
    complete
    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. 
Definition10.2.2
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • defdefined in Smith/Infinite.lean
    complete
    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.lean
    complete
    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. 
Theorem10.2.3
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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τ
Proof for Theorem 10.2.3
uses 0

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.

Definition10.2.4
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • defdefined in Smith/Infinite.lean
    complete
    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.lean
    complete
    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. 
Theorem10.2.5
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 10.2.5
uses 0

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.

Theorem10.2.6
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 10.2.6

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 1 to its left. Started on the leftmost 0 in state A, wolfram23 does A0 -> 1RB, B0 -> 2LA, A1 -> 2LA and 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 1 form "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 repetitions 0 2^(2^w - 1), which the entering head converts to 2 2 1 2 1 ... 2 1 0 and 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🔗

Definition10.4.1.1
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.2
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

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
  • defdefined in Smith/Infinite.lean
    complete
    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.lean
    complete
    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.lean
    complete
    def Smith.preM (n : ℕ) : List ℤ
    def Smith.preM (n : ℕ) : List ℤ
    The innermost guard before the entry. 
Definition10.4.1.2
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • defdefined in Smith/Guards.lean
    complete
    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.lean
    complete
    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.lean
    complete
    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}`. 
Theorem10.4.1.3
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

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
  • theoremdefined in Smith/Guards.lean
    complete
    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.lean
    complete
    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 }
Proof for Theorem 10.4.1.3
uses 0

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.

Theorem10.4.1.4
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • theoremdefined in Smith/Guards.lean
    complete
    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.lean
    complete
    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
Proof for Theorem 10.4.1.4
uses 0

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).

Theorem10.4.1.5
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • theoremdefined in Smith/Guards.lean
    complete
    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.lean
    complete
    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. 
Proof for Theorem 10.4.1.5
Proof uses 2
Proof dependency previews
Preview
Definition 6.4.13
Loading preview
Proof dependency preview content is loaded from the rendered-fragment cache.

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.

Theorem10.4.1.6
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 10.4.1.6
Proof uses 2
Proof dependency previews
Preview
Theorem 10.4.1.3
Loading preview
Proof dependency preview content is loaded from the rendered-fragment cache.

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.

Definition10.4.1.7
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 2
Reverse dependency previews
Preview
Theorem 10.4.1.9
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
✓L∃∀N

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
  • structure(8 fields)defined in Smith/Infinite.lean
    complete
    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. 
    n : ℕ
    r : ℕ
    w : ℕ
    b : ℕ
    S0 : List ℤ
    rest : List BiTM.System4Elem
    H : ℕ
    dt : ℕ → ℕ
  • structure(10 fields)defined in Smith/Infinite.lean
    complete
    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. 
    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)
Definition10.4.1.8
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 4
Statement dependency previews
Preview
Lemma 8.5.1
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
Used by 2
Reverse dependency previews
Preview
Theorem 10.4.1.9
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
✓L∃∀N

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
  • defdefined in Smith/Infinite.lean
    complete
    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.lean
    complete
    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.lean
    complete
    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.lean
    complete
    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.lean
    complete
    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.lean
    complete
    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.lean
    complete
    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. 
Theorem10.4.1.9
Group: The guarded System 4 tapes of <missing> : the block, its entry through the guards, the padded tracking of the program's run, one guard consumed per turn. (8)
Group member previews
Preview
Definition 10.4.1.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 10.4.1.7
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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`. 
Proof for Theorem 10.4.1.9
Proof uses 7
Proof dependency previews
Preview
Theorem 1.2.1
Loading preview
Proof dependency preview content is loaded from the rendered-fragment cache.

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).

Definition10.4.2.1
Group: The System 3 tracking of one block through the relation Rep3 with a junk left end, and the exit shape that is the next block's entry. (3)
Group member previews
Preview
Theorem 10.4.2.2
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 0✓L∃∀N

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
  • defdefined in Smith/Infinite.lean
    complete
    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.lean
    complete
    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. 
Theorem10.4.2.2
Group: The System 3 tracking of one block through the relation Rep3 with a junk left end, and the exit shape that is the next block's entry. (3)
Group member previews
Preview
Definition 10.4.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 6.4.17
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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.lean
    complete
    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. 
Proof for Theorem 10.4.2.2
uses 0

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).

Theorem10.4.2.3
Group: The System 3 tracking of one block through the relation Rep3 with a junk left end, and the exit shape that is the next block's entry. (3)
Group member previews
Preview
Definition 10.4.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 10.4.2.3
uses 0

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.

Theorem10.4.2.4
Group: The System 3 tracking of one block through the relation Rep3 with a junk left end, and the exit shape that is the next block's entry. (3)
Group member previews
Preview
Definition 10.4.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1
Used by 2
Reverse dependency previews
Preview
Theorem 10.4.3.2
Loading preview
Reverse dependency preview content is loaded from the rendered-fragment cache.
✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 10.4.2.4
Proof uses 4
Proof dependency previews
Preview
Theorem 6.7.1
Loading preview
Proof dependency preview content is loaded from the rendered-fragment cache.

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🔗

Definition10.4.3.1
Group: The blocks chained, the finite start of k + 1 blocks, and the wolfram23 run on it. (3)
Group member previews
Preview
Theorem 10.4.3.2
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • defdefined in Smith/Infinite.lean
    complete
    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.lean
    complete
    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.lean
    complete
    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. 
Theorem10.4.3.2
Group: The blocks chained, the finite start of k + 1 blocks, and the wolfram23 run on it. (3)
Group member previews
Preview
Definition 10.4.3.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 10.4.3.2

Induction on n with Theorem 10.4.2.4.

Theorem10.4.3.3
Group: The blocks chained, the finite start of k + 1 blocks, and the wolfram23 run on it. (3)
Group member previews
Preview
Definition 10.4.3.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 10.4.3.3
Proof uses 4
Proof dependency previews
Preview
Theorem 2.6.6
Loading preview
Proof dependency preview content is loaded from the rendered-fragment cache.

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🔗

Definition10.4.4.1
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

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
  • defdefined in Smith/Infinite.lean
    complete
    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. 
Theorem10.4.4.2
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 1used by 1✓L∃∀N

startFin bd k agrees (Definition 10.2.4) with istart (tape bd).

Lean code for Theorem10.4.4.2●1 theorem
  • theoremdefined in Smith/Infinite.lean
    complete
    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))
Proof for Theorem 10.4.4.2
uses 0

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.

Theorem10.4.4.3
Group: The blocks chained, the finite start of k + 1 blocks, and the wolfram23 run on it. (3)
Group member previews
Preview
Definition 10.4.3.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
uses 0used by 1✓L∃∀N

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
  • theoremdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 10.4.4.3
Proof uses 6
Proof dependency previews
Preview
Theorem 3.5.9
Loading preview
Proof dependency preview content is loaded from the rendered-fragment cache.

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.

Definition10.4.4.4
Group: The infinite tape and its semantics: configurations with a stream to the right, their agreement with finite configurations, the decoder on a window. (8)
Group member previews
Preview
Definition 10.2.1
Loading preview
Group member preview content is loaded from the rendered-fragment cache.
Statement uses 2
Statement dependency previews
Preview
Definition 10.4.1.8
Loading preview
Statement dependency preview content is loaded from the rendered-fragment cache.
used by 1✓L∃∀N

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
  • defdefined in Smith/Infinite.lean
    complete
    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. 
Proof for Theorem 1.2.3
Proof uses 4
Proof dependency previews
Preview
Theorem 10.2.3
Loading preview
Proof dependency preview content is loaded from the rendered-fragment cache.

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 c is a definition, and block k is a closed form of tm, c and k. Only the run data H and dt of 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 t form 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 block k or the cost of writing it down; both are exponential in k and in the size of c.

  • 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, A puts 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).