6. T3, first half: from System 4 to System 3
6.1. Orientation
This is the deepest link of Smith's proof (TM23Proof.pdf p. 6-15, Lemma 0, Lemma 1
and "why the initial condition works"). System 3 (Smith.sys3, a lookahead machine
of the chapter on the machine model) emulates System 4 with
each set represented by a block of 2^w cells of 1s and 2s and each star by a 0
that stands in for a neighbouring cell. Three modules: Smith/ParityBlocks.lean
(the parity theory of a block), Smith/System3Runs.lean (the runs of System 3 over
a block), Smith/Conjecture3.lean (the relation, the per-rule lemmas, the initial
tape, T3). The result is Smith.sys4_sys3_forwardSim, and with
the chapter on Systems 3 to 0 Smith.sys4_sys0_forwardSim
and Smith.conjecture3_finite.
6.2. Parity blocks
A block of 1s and 2s as a list of bits, 2 being true.
Lean code for Definition6.2.1●1 definition
Associated Lean declarations
-
Smith.Bits[complete]
-
Smith.Bits[complete]
-
abbrevdefined in Smith/ParityBlocks.leancomplete
abbrev Smith.Bits : Type
abbrev Smith.Bits : Type
A block of 1s and 2s as bits, `2` being `true`.
The prefix-XOR transducer of a System 3 scan in state B or C over a
Definition 6.2.1: from the entering state s (state B is false, state C is
true), each bit b is replaced by s ^^ b, and that value is the state carried
to the next bit; the empty block is left empty.
Lean code for Definition6.2.2●1 definition
Associated Lean declarations
-
Smith.scanFrom[complete]
-
Smith.scanFrom[complete]
-
defdefined in Smith/ParityBlocks.leancomplete
def Smith.scanFrom : Bool → Smith.Bits → Smith.Bits
def Smith.scanFrom : Bool → Smith.Bits → Smith.Bits
The prefix-XOR of a block from an initial state `s`: the transducer of a System 3 scan (state B is `false`, state C is `true`).
Smith's operator, the scan in state B: T = scanFrom false (Definition 6.2.2).
Lean code for Definition6.2.3●1 definition
Associated Lean declarations
-
Smith.T[complete]
-
Smith.T[complete]
-
defdefined in Smith/ParityBlocks.leancomplete
def Smith.T (x : Smith.Bits) : Smith.Bits
def Smith.T (x : Smith.Bits) : Smith.Bits
The scan in state B.
The scan in state C of a nonempty block is the scan in state B (Definition 6.2.3)
of the block with its first bit toggled: scanFrom true (a :: x) = T ((!a) :: x)
(Definition 6.2.2). This is Smith's sublemmas 5 to 8 of Lemma 0 in one line.
Lean code for Lemma6.2.4●1 theorem
Associated Lean declarations
-
Smith.scanC_eq_T_toggle[complete]
-
Smith.scanC_eq_T_toggle[complete]
-
theoremdefined in Smith/ParityBlocks.leancomplete
theorem Smith.scanC_eq_T_toggle (a : Bool) (x : Smith.Bits) : Smith.scanFrom true (a :: x) = Smith.T ((!a) :: x)
theorem Smith.scanC_eq_T_toggle (a : Bool) (x : Smith.Bits) : Smith.scanFrom true (a :: x) = Smith.T ((!a) :: x)
Unfold T and scanFrom one step: the first output bit is !a on both sides and
the state carried to the tail is !a on both sides.
parAt x k is the parity of the block x after k scans in state B: the number of
2s modulo 2 of T^[k] x (Definition 6.2.3).
Lean code for Definition6.2.5●1 definition
Associated Lean declarations
-
Smith.parAt[complete]
-
Smith.parAt[complete]
-
defdefined in Smith/ParityBlocks.leancomplete
def Smith.parAt (x : Smith.Bits) (k : ℕ) : Bool
def Smith.parAt (x : Smith.Bits) (k : ℕ) : Bool
The parity of the block at its `k`-th scan (in state B).
The parity set Definition 6.2.5 is linear in the block: for blocks x and y
of the same length, parAt (xorB x y) k = (parAt x k ^^ parAt y k), where xorB
is the pointwise XOR.
Lean code for Lemma6.2.6●1 theorem
Associated Lean declarations
-
Smith.parAt_xor[complete]
-
Smith.parAt_xor[complete]
-
theoremdefined in Smith/ParityBlocks.leancomplete
theorem Smith.parAt_xor (x y : Smith.Bits) (h : List.length x = List.length y) (k : ℕ) : Smith.parAt (Smith.xorB x y) k = (Smith.parAt x k ^^ Smith.parAt y k)
theorem Smith.parAt_xor (x y : Smith.Bits) (h : List.length x = List.length y) (k : ℕ) : Smith.parAt (Smith.xorB x y) k = (Smith.parAt x k ^^ Smith.parAt y k)
The parity set is linear in the block.
T commutes with the pointwise XOR of blocks of equal length, hence so does every
iterate of T, and the parity of a pointwise XOR is the XOR of the parities.
One row of the rule-60 cellular automaton: a block XOR its shift to the right by one
cell (a 1 coming in at the left, the last cell dropped), stepR x = xorB (shiftR x) x.
Lean code for Definition6.2.7●1 definition
Associated Lean declarations
-
Smith.stepR[complete]
-
Smith.stepR[complete]
-
defdefined in Smith/ParityBlocks.leancomplete
def Smith.stepR (x : Smith.Bits) : Smith.Bits
def Smith.stepR (x : Smith.Bits) : Smith.Bits
One row of the rule-60 cellular automaton: `x` XOR `x` shifted right.
Smith's strings for the one-element sets (p. 8), the rows of the rule-60 automaton:
row n 0 is the block 2 1 1 ... 1 of length n, a single 2, and row n (i + 1)
is row n i XOR its shift (Definition 6.2.7). One scan takes row n (i + 1)
back to row n i.
Lean code for Definition6.2.8●1 definition
Associated Lean declarations
-
Smith.row[complete]
-
Smith.row[complete]
-
defdefined in Smith/ParityBlocks.leancomplete
def Smith.row (n : ℕ) : ℕ → Smith.Bits
def Smith.row (n : ℕ) : ℕ → Smith.Bits
Smith's strings for the one-element sets, p. 8: `row n i` is the string for `{i}` at width `n`.
The Frobenius identity of the rule-60 automaton over GF(2): for every w and every
block x, the 2^w-fold iterate of Definition 6.2.7 is x XOR its
2^w-fold shift, stepR^[2 ^ w] x = xorB (shiftR^[2 ^ w] x) x.
Lean code for Lemma6.2.9●1 theorem
Associated Lean declarations
-
Smith.stepR_iterate_two_pow[complete]
-
Smith.stepR_iterate_two_pow[complete]
-
theoremdefined in Smith/ParityBlocks.leancomplete
theorem Smith.stepR_iterate_two_pow (w : ℕ) (x : Smith.Bits) : Smith.stepR^[2 ^ w] x = Smith.xorB (Smith.shiftR^[2 ^ w] x) x
theorem Smith.stepR_iterate_two_pow (w : ℕ) (x : Smith.Bits) : Smith.stepR^[2 ^ w] x = Smith.xorB (Smith.shiftR^[2 ^ w] x) x
The Frobenius identity of the rule-60 automaton over GF(2).
Induction on w. For w + 1 the 2^(w+1)-fold iterate is the 2^w-fold iterate
applied twice; by the induction hypothesis, the commutation of stepR with the shift
and the linearity of both in the block, the result is x XOR two copies of the
2^w-fold shift of x XOR the 2^(w+1)-fold shift of x, and the two copies
cancel. At width 2^w the 2^w-fold shift empties the block, so the rows of width
2^w have period 2^w.
Smith's Lemma 1: for i and k below 2^w, the parity of Definition 6.2.8
row (2 ^ w) i after k scans (Definition 6.2.5) is true exactly when
k = i.
Lean code for Lemma6.2.10●1 theorem
Associated Lean declarations
-
Smith.parAt_row[complete]
-
Smith.parAt_row[complete]
-
theoremdefined in Smith/ParityBlocks.leancomplete
theorem Smith.parAt_row (w i k : ℕ) (hi : i < 2 ^ w) (hk : k < 2 ^ w) : Smith.parAt (Smith.row (2 ^ w) i) k = decide (k = i)
theorem Smith.parAt_row (w i k : ℕ) (hi : i < 2 ^ w) (hk : k < 2 ^ w) : Smith.parAt (Smith.row (2 ^ w) i) k = decide (k = i)
Smith's strings for one-element sets have odd parity exactly at the scan of their element (within the first `2^w` scans).
Within width n, the parity of row n j is odd exactly when j = 0, the single 2.
For k at most i, k scans take row n i to row n (i - k). For k above i,
the scans pass through row n 0, and one scan of row n 0 is row n (2^w - 1),
the all-2s block, by the periodicity of Lemma 6.2.9; the
remaining scans walk down from there and do not reach row n 0 again within the
window of 2^w scans.
So the block of a set is the XOR of the rows of its elements, and by the linearity
of parAt it has the parity of the set's membership on each of the next 2^w
scans. This is the whole of "Lemma 1" and of the choice of w.
6.3. The runs of System 3
The run lemmas of Smith/System3Runs.lean are stated as equations on
Smith.lnSteps sys3, the n-step run of System 3 of
the chapter on the machine model.
Lemma 0.1: in state A the head walks left over 1s and 2s unchanged (A1 -> A1<,
A2 -> A2<) onto the first other cell. From a nonzero cell a with p nonzero
cells left of it and then the cell z, the run of p + 1 steps of
Definition 2.5.12 (Definition 2.5.6) puts the head on z in state A,
with the walked cells and a now on the right in their order.
Lean code for Lemma6.3.1●1 theorem
Associated Lean declarations
-
Smith.walkLeft[complete]
-
Smith.walkLeft[complete]
-
theoremdefined in Smith/System3Runs.leancomplete
theorem Smith.walkLeft (P : List (Fin 3)) (hP : ∀ c ∈ P, c ≠ 0) (z : Fin 3) (L : List (Fin 3)) (a : Fin 3) (ha : a ≠ 0) (R : List (Fin 3)) : Smith.lnSteps Smith.sys3 { left := P ++ z :: L, head := a, right := R, state := Smith.LState.A } (P.length + 1) = some { left := L, head := z, right := P.reverse ++ a :: R, state := Smith.LState.A }
theorem Smith.walkLeft (P : List (Fin 3)) (hP : ∀ c ∈ P, c ≠ 0) (z : Fin 3) (L : List (Fin 3)) (a : Fin 3) (ha : a ≠ 0) (R : List (Fin 3)) : Smith.lnSteps Smith.sys3 { left := P ++ z :: L, head := a, right := R, state := Smith.LState.A } (P.length + 1) = some { left := L, head := z, right := P.reverse ++ a :: R, state := Smith.LState.A }
In state A the head walks left over 1s and 2s, unchanged (`A1 -> A1<`, `A2 -> A2<`), onto the cell `z` beyond them.
Induction on the walked cells, one step of sys3 each, all cases by computation.
A0 -> B2>: at a 0 in state A, one step of Definition 2.5.12
(Definition 2.5.5) turns the 0 into a 2 and moves the head right in state B.
Lean code for Lemma6.3.2●1 theorem
Associated Lean declarations
-
Smith.turnA[complete]
-
Smith.turnA[complete]
-
theoremdefined in Smith/System3Runs.leancomplete
theorem Smith.turnA (L : List (Fin 3)) (b : Fin 3) (R : List (Fin 3)) : Smith.lstep Smith.sys3 { left := L, head := 0, right := b :: R, state := Smith.LState.A } = some { left := 2 :: L, head := b, right := R, state := Smith.LState.B }
theorem Smith.turnA (L : List (Fin 3)) (b : Fin 3) (R : List (Fin 3)) : Smith.lstep Smith.sys3 { left := L, head := 0, right := b :: R, state := Smith.LState.A } = some { left := 2 :: L, head := b, right := R, state := Smith.LState.B }
At a 0 in state A: the 0 becomes a 2, the head moves right in state B.
By the table of sys3: the rule for state A on 0 is one B 2 R, and lstep applies it.
B0 -> A2<: at a 0 in state B, one step of Definition 2.5.12 turns the 0 into
a 2 and moves the head left in state A.
Lean code for Lemma6.3.3●1 theorem
Associated Lean declarations
-
Smith.starB[complete]
-
Smith.starB[complete]
-
theoremdefined in Smith/System3Runs.leancomplete
theorem Smith.starB (c : Fin 3) (L R : List (Fin 3)) : Smith.lstep Smith.sys3 { left := c :: L, head := 0, right := R, state := Smith.LState.B } = some { left := L, head := c, right := 2 :: R, state := Smith.LState.A }
theorem Smith.starB (c : Fin 3) (L R : List (Fin 3)) : Smith.lstep Smith.sys3 { left := c :: L, head := 0, right := R, state := Smith.LState.B } = some { left := L, head := c, right := 2 :: R, state := Smith.LState.A }
A 0 active in state B: the 0 becomes a 2, the head moves left in state A.
By the table of sys3: the rule for state B on 0 is one A 2 L, and lstep applies it when there is a cell to the left.
A scan over a block followed by a nonzero cell: from the cell a of the block
a :: x in the state s (B for false, C for true), the run of
x.length + 1 steps of Definition 2.5.12 leaves scanFrom s (a :: x)
(Definition 6.2.2) behind and lands on the nonzero cell in the state given
by the parity, s ^^ parity (a :: x).
Lean code for Lemma6.3.4●1 theorem
Associated Lean declarations
-
Smith.scanBlock[complete]
-
Smith.scanBlock[complete]
-
theoremdefined in Smith/System3Runs.leancomplete
theorem Smith.scanBlock (L : List (Fin 3)) (s a : Bool) (x : Smith.Bits) (c : Fin 3) (hc : c ≠ 0) (R : List (Fin 3)) : Smith.lnSteps Smith.sys3 { left := L, head := Smith.toCell a, right := Smith.ofBits x ++ c :: R, state := Smith.stB s } (List.length x + 1) = some { left := (Smith.ofBits (Smith.scanFrom s (a :: x))).reverse ++ L, head := c, right := R, state := Smith.stB (s ^^ Smith.parity (a :: x)) }
theorem Smith.scanBlock (L : List (Fin 3)) (s a : Bool) (x : Smith.Bits) (c : Fin 3) (hc : c ≠ 0) (R : List (Fin 3)) : Smith.lnSteps Smith.sys3 { left := L, head := Smith.toCell a, right := Smith.ofBits x ++ c :: R, state := Smith.stB s } (List.length x + 1) = some { left := (Smith.ofBits (Smith.scanFrom s (a :: x))).reverse ++ L, head := c, right := R, state := Smith.stB (s ^^ Smith.parity (a :: x)) }
The scan of a block that is followed by a cell `c` that is not a 0 (an adjacent block): the block becomes its prefix-XOR from the entering state, the head lands on `c` in the exit state.
Induction on x. One scanning step inside a block replaces the cell a, followed
by a cell that is not a 0, by s ^^ a and moves right in the state s ^^ a; the
last step lands on the nonzero cell.
A scan over a block followed by a 0, when the exit state is B (the entering state
XOR the parity of the block is false): the same run as Lemma 6.3.4
leaves scanFrom s (a :: x) behind and lands on the 0 in state B.
Lean code for Lemma6.3.5●1 theorem
Associated Lean declarations
-
Smith.scanBlock0B[complete]
-
Smith.scanBlock0B[complete]
-
theoremdefined in Smith/System3Runs.leancomplete
theorem Smith.scanBlock0B (L : List (Fin 3)) (s a : Bool) (x : Smith.Bits) (R : List (Fin 3)) (h : (s ^^ Smith.parity (a :: x)) = false) : Smith.lnSteps Smith.sys3 { left := L, head := Smith.toCell a, right := Smith.ofBits x ++ 0 :: R, state := Smith.stB s } (List.length x + 1) = some { left := (Smith.ofBits (Smith.scanFrom s (a :: x))).reverse ++ L, head := 0, right := R, state := Smith.LState.B }
theorem Smith.scanBlock0B (L : List (Fin 3)) (s a : Bool) (x : Smith.Bits) (R : List (Fin 3)) (h : (s ^^ Smith.parity (a :: x)) = false) : Smith.lnSteps Smith.sys3 { left := L, head := Smith.toCell a, right := Smith.ofBits x ++ 0 :: R, state := Smith.stB s } (List.length x + 1) = some { left := (Smith.ofBits (Smith.scanFrom s (a :: x))).reverse ++ L, head := 0, right := R, state := Smith.LState.B }
The scan of a block followed by a 0, exit in state B.
As for scanBlock; the last cell of the block followed by a 0, with exit parity
false, is written as in the interior and the head lands on the 0 in state B.
A scan over a block followed by a 0, when the exit state would be C (the entering
state XOR the parity of the block is true): the run of x.length + 1 steps of
Definition 2.5.12 leaves scanFrom s (a :: x) behind except for its last cell,
a 2, which becomes a 0, and lands on the 0 in state A (B20 -> A00>,
C10 -> A00>). These are the two 0s of Smith's star active in state C, p. 11 and
13.
Lean code for Lemma6.3.6●1 theorem
Associated Lean declarations
-
Smith.scanBlock0C[complete]
-
Smith.scanBlock0C[complete]
-
theoremdefined in Smith/System3Runs.leancomplete
theorem Smith.scanBlock0C (L : List (Fin 3)) (s a : Bool) (x : Smith.Bits) (R : List (Fin 3)) (h : (s ^^ Smith.parity (a :: x)) = true) : Smith.lnSteps Smith.sys3 { left := L, head := Smith.toCell a, right := Smith.ofBits x ++ 0 :: R, state := Smith.stB s } (List.length x + 1) = some { left := 0 :: (Smith.ofBits (Smith.scanFrom s (a :: x))).dropLast.reverse ++ L, head := 0, right := R, state := Smith.LState.A }
theorem Smith.scanBlock0C (L : List (Fin 3)) (s a : Bool) (x : Smith.Bits) (R : List (Fin 3)) (h : (s ^^ Smith.parity (a :: x)) = true) : Smith.lnSteps Smith.sys3 { left := L, head := Smith.toCell a, right := Smith.ofBits x ++ 0 :: R, state := Smith.stB s } (List.length x + 1) = some { left := 0 :: (Smith.ofBits (Smith.scanFrom s (a :: x))).dropLast.reverse ++ L, head := 0, right := R, state := Smith.LState.A }
The scan of a block followed by a 0, exit that would be in state C: the last cell becomes a 0 and the head lands on the 0 in state A.
As for Lemma 6.3.4; the last cell of the block followed by a 0, with
exit parity true, would become a 2 and instead becomes a 0, the head landing on
the 0 in state A.
6.4. The relation
Rather than a predicate on pairs of tapes, an abstract configuration carries the items on both sides of the head, the ends of the tape, the System 4 state and a focus; both the System 4 and the System 3 configuration are computed from it.
What the head is on: setA xl b xr S, state A on the cell b of the block
xl.reverse ++ b :: xr of the set S, held as a zipper; setB x0 x' S, state B
or C on the first cell x0 of the block x0 :: x' of S; setT x1 x' S, System 4
in state C right after rule 5, on the second cell x1 of the block
true :: x1 :: x' in System 3's state B; star, on a star; off, System 4's head
past its tape.
Lean code for Definition6.4.1●1 definition
Associated Lean declarations
-
Smith.Focus[complete]
-
Smith.Focus[complete]
-
inductivedefined in Smith/Conjecture3.leancomplete
inductive Smith.Focus : Type
inductive Smith.Focus : Type
What the head is on.
Constructors
Smith.Focus.setA (xl : Smith.Bits) (b : Bool) (xr : Smith.Bits) (S : List ℤ) : Smith.Focus
State A, on the cell `b` of the block `xl.reverse ++ b :: xr`.
Smith.Focus.setB (x0 : Bool) (x' : Smith.Bits) (S : List ℤ) : Smith.Focus
State B or C, on the first cell of the block `x0 :: x'`.
Smith.Focus.setT (x1 : Bool) (x' : Smith.Bits) (S : List ℤ) : Smith.Focus
State C right after rule 5: on the second cell of the block `true :: x1 :: x'`, in System 3's state B.
Smith.Focus.star : Smith.Focus
On a star.
Smith.Focus.off : Smith.Focus
Past the right end of the tape.
An abstract configuration: the items left of the head (nearest first), the items right of it, the left end (Definition 6.4.14), the right end (Definition 6.4.15), the System 4 state and the focus (Definition 6.4.1). An item is a set with its block (a Definition 6.2.1) or a star.
Lean code for Definition6.4.2●1 definition
Associated Lean declarations
-
Smith.AC[complete]
-
Smith.AC[complete]
-
structuredefined in Smith/Conjecture3.leancomplete
structure Smith.AC : Type
structure Smith.AC : Type
An abstract configuration.
Fields
ls : List Smith.Item
rs : List Smith.Item
le : Smith.LeftEnd
rc : Smith.Closing
st : BiTM.System4State
foc : Smith.Focus
The System 4 configuration of an Definition 6.4.2: the items left of the head,
reversed, then the set or star at the head unless the focus is off, then the
items right of it, each item as its System 4 element; the active position is the
number of items left of the head; the state is the System 4 state.
Lean code for Definition6.4.3●1 definition
Associated Lean declarations
-
Smith.AC.to4[complete]
-
Smith.AC.to4[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.AC.to4 (a : Smith.AC) : BiTM.System4Config
def Smith.AC.to4 (a : Smith.AC) : BiTM.System4Config
The System 4 configuration of an abstract configuration.
The cells of the items right of the head, left to right: a set gives its block, without its first cell when a star precedes it (the flag records whether one does); a star gives a 0.
Lean code for Definition6.4.4●1 definition
Associated Lean declarations
-
Smith.renderR[complete]
-
Smith.renderR[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.renderR : Bool → List Smith.Item → List (Fin 3)
def Smith.renderR : Bool → List Smith.Item → List (Fin 3)
The cells of the items right of the head, left to right: a set gives its block, without its first cell when a star precedes it; a star gives a 0.
The cells of the items left of the head, nearest first: a set gives its block reversed, without its last cell when a star follows it (the flag records whether one does); a star gives a 0.
Lean code for Definition6.4.5●1 definition
Associated Lean declarations
-
Smith.renderL[complete]
-
Smith.renderL[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.renderL : Bool → List Smith.Item → List (Fin 3)
def Smith.renderL : Bool → List Smith.Item → List (Fin 3)
The cells of the items left of the head, nearest first (the items are given nearest first too): a set gives its block reversed, without its last cell when a star follows it; a star gives a 0.
The System 3 configuration (Definition 2.5.4) of an Definition 6.4.2:
the cells left of the head are the block cells left of the focus, then
Definition 6.4.5 of the left items, then the left end; the cells right of
it are the block cells right of the focus, then Definition 6.4.4 of the
right items, then the right end; the head cell and the System 3 state follow the
focus: the block cell in state A for setA, the first cell in state B or C for
setB, the second cell in state B with a 2 left of it for setT, a 0 for star
(with the neighbouring set's replaced cell dropped on the side the star stands for,
and an extra 0 to the left in state A when System 4 is in state C), and the closing
cell for off.
Lean code for Definition6.4.6●1 definition
Associated Lean declarations
-
Smith.AC.toL[complete]
-
Smith.AC.toL[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.AC.toL (a : Smith.AC) : Smith.LConfig
def Smith.AC.toL (a : Smith.AC) : Smith.LConfig
The System 3 configuration of an abstract configuration.
Decodes x S k: the block x decodes to the set S on its next k scans, that
is for every j below k, Definition 6.2.5 x j is true exactly when j
is in S.
Lean code for Definition6.4.7●1 definition
Associated Lean declarations
-
Smith.Decodes[complete]
-
Smith.Decodes[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.Decodes (x : Smith.Bits) (S : List ℤ) (k : ℕ) : Prop
def Smith.Decodes (x : Smith.Bits) (S : List ℤ) (k : ℕ) : Prop
The block `x` decodes to the set `S` on its next `k` scans.
The star-side rule for the items left of the head, nearest first: a star stands in the place of the last cell of the set beyond it, which is a 2; two stars are never adjacent; the leftmost item is a set, or, when the left end is junk (the flag), a star that is never reached.
Lean code for Definition6.4.8●1 definition
Associated Lean declarations
-
Smith.LeftOK[complete]
-
Smith.LeftOK[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.LeftOK (j : Bool) : List Smith.Item → Prop
def Smith.LeftOK (j : Bool) : List Smith.Item → Prop
The items left of the head, nearest first: a star stands in the place of the last cell of the set beyond it, which is a 2; the leftmost item is a set, or, when the left end is junk (`j`), a star that is never reached.
The star-side rule for the items right of the head, left to right: a star stands in the place of the first cell of the set after it, which is a 2; two stars are never adjacent; the last item is a set.
Lean code for Definition6.4.9●1 definition
Associated Lean declarations
-
Smith.RightOK[complete]
-
Smith.RightOK[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.RightOK : List Smith.Item → Prop
def Smith.RightOK : List Smith.Item → Prop
The items right of the head, left to right: a star stands in the place of the first cell of the set after it, which is a 2; the last item is a set.
The first item of a list of items is a set whose block ends in a 2: the condition on the items left of a star at the head in state A or C, which stands in the place of that cell.
Lean code for Definition6.4.10●1 definition
Associated Lean declarations
-
Smith.HeadLastTrue[complete]
-
Smith.HeadLastTrue[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.HeadLastTrue : List Smith.Item → Prop
def Smith.HeadLastTrue : List Smith.Item → Prop
The first item is a set with last bit true.
The first item of a list of items is a set whose block begins with a 2: the condition on the items right of a star at the head in state B or C, which stands in the place of that cell.
Lean code for Definition6.4.11●1 definition
Associated Lean declarations
-
Smith.HeadFirstTrue[complete]
-
Smith.HeadFirstTrue[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.HeadFirstTrue : List Smith.Item → Prop
def Smith.HeadFirstTrue : List Smith.Item → Prop
The first item is a set with first bit true.
The side conditions on a Definition 6.4.1 for width N, k scans, the
junk flag, the System 4 state and the items on both sides: setA requires state A
and a sound item (a block of width N that Definition 6.4.7 to its set,
which has no duplicates); setB requires a state other than A and a sound item;
setT requires state C, a block true :: x1 :: x' of width N that decodes to
the set with 1 toggled (xorInsert 1 S; the skipped first cell, a 2, is what turns
"toggle 1, then decrement" into one scan); star requires, in state A,
Definition 6.4.10 on the left items and a set first on the right, in
state B a set first on the left and Definition 6.4.11 on the right,
and in state C HeadLastTrue on the left (or no left item at all with a junk left
end) and HeadFirstTrue on the right; off requires nothing.
Lean code for Definition6.4.12●1 definition
Associated Lean declarations
-
Smith.FocusOK[complete]
-
Smith.FocusOK[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.FocusOK (N k : ℕ) (j : Bool) (st : BiTM.System4State) (ls rs : List Smith.Item) : Smith.Focus → Prop
def Smith.FocusOK (N k : ℕ) (j : Bool) (st : BiTM.System4State) (ls rs : List Smith.Item) : Smith.Focus → Prop
The side conditions on the focus.
SafeC h c4: within the next h System 4 steps (Definition 5.1.1
iterated by System4.nSteps) the head is on the leftmost element only in state C.
Rule 1 at the leftmost element (the turn) and rule 4 there (stuck) are the only
steps that would look at what lies left of the tape; rules 2, 3 and 5 do not.
Lean code for Definition6.4.13●1 definition
Associated Lean declarations
-
Smith.SafeC[complete]
-
Smith.SafeC[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.SafeC (h : ℕ) (c : BiTM.System4Config) : Prop
def Smith.SafeC (h : ℕ) (c : BiTM.System4Config) : Prop
`SafeC h c`: within the next `h` System 4 steps the head is on the leftmost element only in state C. Rule 1 at the leftmost element (the turn) and rule 4 there (stuck) are the only steps that would look at what lies left of the tape; rules 2, 3 and 5 do not.
The left end of the tape beyond the items: either zeros m t, the string
0^m 2 2 1^t of Smith's Perl programs (p. 44), one 0 turned into a 2 by every
turn; or junk L, arbitrary cells. Its condition with h System 4 steps left is
h <= m and 1 <= t for zeros m t, and Definition 6.4.13 h c4 for
junk L: no turn and no rule 4 ever looks at what lies left of the tape. The junk
case exists for the infinite form
(the chapter on the infinite form).
Lean code for Definition6.4.14●1 definition
Associated Lean declarations
-
Smith.LeftEnd[complete]
-
Smith.LeftEnd[complete]
-
inductivedefined in Smith/Conjecture3.leancomplete
inductive Smith.LeftEnd : Type
inductive Smith.LeftEnd : Type
The left end of the tape beyond the items: the `0^m 2 2 1^t` of the finite construction, which turns the head round once per zero; or arbitrary cells, never reached because System 4 never turns at its left end within the budget (the concatenated construction of `Smith.Infinite`, whose blocks are guarded by stars).
Constructors
Smith.LeftEnd.zeros (m t : ℕ) : Smith.LeftEnd
Smith.LeftEnd.junk (L : List (Fin 3)) : Smith.LeftEnd
The right end of the tape beyond the items: one, the closing 1 of the finite
tape, on which the head stops when System 4 leaves its tape; or zero Rc, a 0
followed by arbitrary cells, the next block of the infinite form, on which the head
lands as on a star.
Lean code for Definition6.4.15●1 definition
Associated Lean declarations
-
Smith.Closing[complete]
-
Smith.Closing[complete]
-
inductivedefined in Smith/Conjecture3.leancomplete
inductive Smith.Closing : Type
inductive Smith.Closing : Type
The right end of the tape beyond the items: the closing `1` of the finite construction, on which the head stops when System 4 leaves its tape; or a `0` followed by arbitrary cells (the next block of the concatenated construction), on which the head lands as on a star.
Constructors
Smith.Closing.one : Smith.Closing
Smith.Closing.zero (Rc : List (Fin 3)) : Smith.Closing
The side conditions a.OK w h of an Definition 6.4.2 for width 2^w, h being
the number of System 4 steps left:
-
h + 3 <= 2^w; -
the left end (Definition 6.4.14) satisfies its condition for
hsteps froma.to4; -
every item on either side is sound: its block has width
2^wand Definition 6.4.7 to its set, which has no duplicates, on the nexth + 1scans; -
the star-side rule: Definition 6.4.8 on the left items (with the junk flag of the left end) and Definition 6.4.9 on the right items; a star left of the head, or at the head in state A or C, stands in the place of the last cell of the set before it, which is a 2; a star right of the head, or at the head in state B or C, stands in the place of the first cell of the set after it, which is a 2 (Definition 6.4.10, Definition 6.4.11; Definition 6.4.5 and Definition 6.4.4 drop the replaced cell);
-
the head shape: Definition 6.4.12 for width
2^wandh + 1scans.
Lean code for Definition6.4.16●1 definition
Associated Lean declarations
-
Smith.AC.OK[complete]
-
Smith.AC.OK[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.AC.OK (w h : ℕ) (a : Smith.AC) : Prop
def Smith.AC.OK (w h : ℕ) (a : Smith.AC) : Prop
The side conditions of an abstract configuration, for width `2^w` and `h` System 4 steps left.
The relation of the link: Rep3 rc c3 c4 w h says that the System 3 configuration
c3 and the System 4 configuration c4 come from one Definition 6.4.2 a
with right end rc (Definition 6.4.15) satisfying the side conditions
Definition 6.4.16 w h, with c3 = a.toL (Definition 6.4.6) and
c4 = a.to4 (Definition 6.4.3).
Lean code for Definition6.4.17●1 definition
Associated Lean declarations
-
Smith.Rep3[complete]
-
Smith.Rep3[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.Rep3 (rc : Smith.Closing) (c3 : Smith.LConfig) (c4 : BiTM.System4Config) (w h : ℕ) : Prop
def Smith.Rep3 (rc : Smith.Closing) (c3 : Smith.LConfig) (c4 : BiTM.System4Config) (w h : ℕ) : Prop
The relation of link D: the System 3 configuration `c3` stands for the System 4 configuration `c4` with blocks of width `2^w`, `h` System 4 steps left, and the right end `rc` beyond the items.
The star-side rule and the transient shape were found and validated by a Python
checker of the relation along system4.pl runs before anything was proved; the
checker's first version had the active set on the wrong side of the rule.
6.5. The per-rule lemmas
The conclusion of every per-rule lemma: Matches w h rc c3 c4' says that a run of
Definition 2.5.12 from c3 of at least one step (Definition 2.5.6)
reaches the toL (Definition 6.4.6) of an Definition 6.4.2 with right
end rc whose to4 (Definition 6.4.3) is c4' and which satisfies
Definition 6.4.16 w h.
Lean code for Definition6.5.1●1 definition
Associated Lean declarations
-
Smith.Matches[complete]
-
Smith.Matches[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.Matches (w h : ℕ) (rc : Smith.Closing) (c3 : Smith.LConfig) (c4' : BiTM.System4Config) : Prop
def Smith.Matches (w h : ℕ) (rc : Smith.Closing) (c3 : Smith.LConfig) (c4' : BiTM.System4Config) : Prop
The conclusion of every per-rule lemma: a run of System 3 from `c3` of at least one step reaches the System 3 side of an abstract configuration whose System 4 side is `c4'`.
The turn at the left end: from the cell b of the block xl.reverse ++ b :: xr
in state A, with the left end 0^(m' + 1) 2 2 1^t beyond the block, the run of
xl.length + 2 * t + 6 steps of Definition 2.5.12 walks left, turns the
nearest 0 into a 2, scans back over 2 2 1^t, which becomes 2 1 1^t, and lands
on the first cell of the block in state B, the left end now being
0^m' 2 2 1^(t + 1).
Lean code for Lemma6.5.2●1 theorem
Associated Lean declarations
-
Smith.turnRun[complete]
-
Smith.turnRun[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.turnRun (xl : Smith.Bits) (b : Bool) (xr : Smith.Bits) (m' t : ℕ) (R0 : List (Fin 3)) (x0 : Bool) (x' : Smith.Bits) (hx : List.reverse xl ++ b :: xr = x0 :: x') : Smith.lnSteps Smith.sys3 { left := Smith.ofBits xl ++ Smith.leftEndRev (m' + 1) t, head := Smith.toCell b, right := Smith.ofBits xr ++ R0, state := Smith.LState.A } (List.length xl + 2 * t + 6) = some { left := Smith.leftEndRev m' (t + 1), head := Smith.toCell x0, right := Smith.ofBits x' ++ R0, state := Smith.LState.B }
theorem Smith.turnRun (xl : Smith.Bits) (b : Bool) (xr : Smith.Bits) (m' t : ℕ) (R0 : List (Fin 3)) (x0 : Bool) (x' : Smith.Bits) (hx : List.reverse xl ++ b :: xr = x0 :: x') : Smith.lnSteps Smith.sys3 { left := Smith.ofBits xl ++ Smith.leftEndRev (m' + 1) t, head := Smith.toCell b, right := Smith.ofBits xr ++ R0, state := Smith.LState.A } (List.length xl + 2 * t + 6) = some { left := Smith.leftEndRev m' (t + 1), head := Smith.toCell x0, right := Smith.ofBits x' ++ R0, state := Smith.LState.B }
The turn at the left end: the walk over the block and the left end, the 0 turned into a 2, and the scan back over `2 2 1^t`, which becomes `2 1 1^t`, onto the first cell of the block.
First Lemma 6.3.1 over the block cells, the 1^t and the two 2s onto
the nearest 0; then Lemma 6.3.2; then the scan back in state B over
2 2 1^t followed by the nonzero first cell of the block
(Lemma 6.3.4), whose prefix XOR is 2 1 1^t with exit state B.
The System 3 configuration reached by a scan that left the block z behind and
exits with parity e (state C when e), with the cells L left of the block, the
items rs right of it and the right end rc (Definition 6.4.15): on the
first cell of the next set in the exit state; on the closing 1 in the exit state;
or, at a star's 0 or the 0 of Closing.zero, on the 0 in state B when e is
false, and with the last cell of z turned into a 0 and the head on the 0 in
state A when e is true.
Lean code for Definition6.5.3●1 definition
Associated Lean declarations
-
Smith.landing[complete]
-
Smith.landing[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.landing (L : List (Fin 3)) (rs : List Smith.Item) (rc : Smith.Closing) (z : Smith.Bits) (e : Bool) : Smith.LConfig
def Smith.landing (L : List (Fin 3)) (rs : List Smith.Item) (rc : Smith.Closing) (z : Smith.Bits) (e : Bool) : Smith.LConfig
The configuration after a scan that left the block `z` behind, exiting with parity `e` (state C when `e`), with `L` the cells left of the block and `rs` the items right of it.
A scan of Definition 2.5.12 from the cell a over the rest x of a block,
followed by Definition 6.4.4 of items whose blocks are nonempty and then the
right end, takes x.length + 1 steps and lands as Definition 6.5.3 says,
with the block scanFrom s (a :: x) (Definition 6.2.2) left behind and
the exit parity s ^^ parity (a :: x).
Lean code for Lemma6.5.4●1 theorem
Associated Lean declarations
-
Smith.scanRun[complete]
-
Smith.scanRun[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.scanRun (L : List (Fin 3)) (s a : Bool) (x : Smith.Bits) (rs : List Smith.Item) (rc : Smith.Closing) (hrs : ∀ (y : Smith.Bits) (U : List ℤ), Smith.Item.set y U ∈ rs → y ≠ []) : Smith.lnSteps Smith.sys3 { left := L, head := Smith.toCell a, right := Smith.ofBits x ++ Smith.renderR false rs ++ rc.render, state := Smith.stB s } (List.length x + 1) = some (Smith.landing L rs rc (Smith.scanFrom s (a :: x)) (s ^^ Smith.parity (a :: x)))
theorem Smith.scanRun (L : List (Fin 3)) (s a : Bool) (x : Smith.Bits) (rs : List Smith.Item) (rc : Smith.Closing) (hrs : ∀ (y : Smith.Bits) (U : List ℤ), Smith.Item.set y U ∈ rs → y ≠ []) : Smith.lnSteps Smith.sys3 { left := L, head := Smith.toCell a, right := Smith.ofBits x ++ Smith.renderR false rs ++ rc.render, state := Smith.stB s } (List.length x + 1) = some (Smith.landing L rs rc (Smith.scanFrom s (a :: x)) (s ^^ Smith.parity (a :: x)))
A scan from the cell `a` over the block `x` lands as `landing` says.
Case analysis on the first item right of the block and on the right end: a set or
the closing 1 is a nonzero cell, Lemma 6.3.4; a star or the 0 of
Closing.zero is a 0, Lemma 6.3.5 or Lemma 6.3.6
according to the exit parity.
The Definition 6.4.2 after a scan: the block z with its new set S' joins the
left items, the right items lose their first element, and the focus is on it: off
when there was none, setB on the first cell of the next set, or star.
Lean code for Definition6.5.5●1 definition
Associated Lean declarations
-
Smith.afterScan[complete]
-
Smith.afterScan[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.afterScan (ls rs : List Smith.Item) (le : Smith.LeftEnd) (rc : Smith.Closing) (z : Smith.Bits) (S' : List ℤ) (st' : BiTM.System4State) : Smith.AC
def Smith.afterScan (ls rs : List Smith.Item) (le : Smith.LeftEnd) (rc : Smith.Closing) (z : Smith.Bits) (S' : List ℤ) (st' : BiTM.System4State) : Smith.AC
The abstract configuration after a scan: the block `z` with its set `S'` joins the left items, and the head is on the next item.
The first scan decides 0 in S: if the block Definition 6.4.7 to S on at
least one scan, its parity is true exactly when 0 is in S. This is what makes
System 3's exit state agree with System 4's toggle.
Lean code for Lemma6.5.6●1 theorem
Associated Lean declarations
-
Smith.Decodes_parity[complete]
-
Smith.Decodes_parity[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.Decodes_parity (x : Smith.Bits) (S : List ℤ) (k : ℕ) (h : Smith.Decodes x S (k + 1)) : Smith.parity x = decide (0 ∈ S)
theorem Smith.Decodes_parity (x : Smith.Bits) (S : List ℤ) (k : ℕ) (h : Smith.Decodes x S (k + 1)) : Smith.parity x = decide (0 ∈ S)
The first scan decides membership of 0.
The instance of Decodes at scan 0 says the block's parity at position 0 is the membership of 0 in S (parAt_zero).
A scan in state B decodes the decremented set: if x Definition 6.4.7 to a
duplicate-free S on k + 1 scans, then T x (Definition 6.2.3) decodes to
decr S (the set of e - 1 for e in S other than 0) on k scans.
Lean code for Lemma6.5.7●1 theorem
Associated Lean declarations
-
Smith.Decodes_T[complete]
-
Smith.Decodes_T[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.Decodes_T (x : Smith.Bits) (S : List ℤ) (hS : S.Nodup) (k : ℕ) (h : Smith.Decodes x S (k + 1)) : Smith.Decodes (Smith.T x) (Smith.decr S) k
theorem Smith.Decodes_T (x : Smith.Bits) (S : List ℤ) (hS : S.Nodup) (k : ℕ) (h : Smith.Decodes x S (k + 1)) : Smith.Decodes (Smith.T x) (Smith.decr S) k
After a scan in state B the block decodes to the decremented set.
A scan shifts the parity set down by one, parAt (T x) j = parAt x (j + 1), and
j is in decr S exactly when j + 1 is in S.
The scan in state C decodes the decremented set too (Smith's Corollary 0): for a
block a :: x of width 2^w that Definition 6.4.7 to a duplicate-free S
on k + 1 scans with k + 1 < 2^w, scanFrom true (a :: x)
(Definition 6.2.2) decodes to decr S on k scans.
Lean code for Lemma6.5.8●1 theorem
Associated Lean declarations
-
Smith.Decodes_scanC[complete]
-
Smith.Decodes_scanC[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.Decodes_scanC (w : ℕ) (a : Bool) (x : Smith.Bits) (hx : (a :: x).length = 2 ^ w) (S : List ℤ) (hS : S.Nodup) (k : ℕ) (hk : k + 1 < 2 ^ w) (h : Smith.Decodes (a :: x) S (k + 1)) : Smith.Decodes (Smith.scanFrom true (a :: x)) (Smith.decr S) k
theorem Smith.Decodes_scanC (w : ℕ) (a : Bool) (x : Smith.Bits) (hx : (a :: x).length = 2 ^ w) (S : List ℤ) (hS : S.Nodup) (k : ℕ) (hk : k + 1 < 2 ^ w) (h : Smith.Decodes (a :: x) S (k + 1)) : Smith.Decodes (Smith.scanFrom true (a :: x)) (Smith.decr S) k
After a scan in state C the block decodes to the decremented set as well (Corollary 0): the toggle of the first bit is invisible after the first scan.
By Lemma 6.2.4 the scan in state C is T of the block with
its first bit toggled. Toggling the first bit is XOR with row n 0
(Definition 6.2.8), whose parity is at scan 0 only (Lemma 6.2.10,
Lemma 6.2.6), so after the scan the parities at scans 1 to k are
those of Lemma 6.5.7.
The skipped-cell scan after rule 5: for a block true :: x of width 2^w that
Definition 6.4.7 to xorInsert 1 S (the duplicate-free S with 1 toggled)
on k + 1 scans with k + 1 < 2^w, the block true :: scanFrom false x (the
first bit kept, the rest scanned from state B; Definition 6.2.2) decodes to
decr S on k scans. The result is 2 :: T tail, and toggling 1 before the
decrement is toggling 0 after it.
Lean code for Lemma6.5.9●1 theorem
Associated Lean declarations
-
Smith.Decodes_transient[complete]
-
Smith.Decodes_transient[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.Decodes_transient (w : ℕ) (x : Smith.Bits) (hx : (true :: x).length = 2 ^ w) (S : List ℤ) (hS : S.Nodup) (k : ℕ) (hk : k + 1 < 2 ^ w) (h : Smith.Decodes (true :: x) (BiTM.xorInsert 1 S) (k + 1)) : Smith.Decodes (true :: Smith.scanFrom false x) (Smith.decr S) k
theorem Smith.Decodes_transient (w : ℕ) (x : Smith.Bits) (hx : (true :: x).length = 2 ^ w) (S : List ℤ) (hS : S.Nodup) (k : ℕ) (hk : k + 1 < 2 ^ w) (h : Smith.Decodes (true :: x) (BiTM.xorInsert 1 S) (k + 1)) : Smith.Decodes (true :: Smith.scanFrom false x) (Smith.decr S) k
The skipped-cell scan after rule 5: the block with its first bit kept and the rest scanned from state B decodes to the decremented set when the block decoded to the set with 1 toggled.
Write the result as the toggle of the first bit of T (false :: x), and the given
block as the toggle of the first bit of false :: x; both toggles are XOR with
row n 0 and change the parity at scan 0 only (Lemma 6.2.10,
Lemma 6.2.6). The membership bookkeeping: j is in decr S exactly
when j + 1 is in S, and j + 1 is in xorInsert 1 S exactly when it is in S
unless j = 0, where the toggle at scan 0 of the result compensates.
Every System 4 step (Definition 5.1.1) from the to4 of an
Definition 6.4.2 a satisfying Definition 6.4.16 w (h + 1) is matched
(Definition 6.5.1 w h) by a run of System 3 from a.toL.
Lean code for Proposition6.5.10●1 theorem
Associated Lean declarations
-
Smith.ac_step[complete]
-
Smith.ac_step[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.ac_step (w h : ℕ) (a : Smith.AC) (hOK : Smith.AC.OK w (h + 1) a) (c4' : BiTM.System4Config) (hs : BiTM.System4.step a.to4 = some c4') : Smith.Matches w h a.rc a.toL c4'
theorem Smith.ac_step (w h : ℕ) (a : Smith.AC) (hOK : Smith.AC.OK w (h + 1) a) (c4' : BiTM.System4Config) (hs : BiTM.System4.step a.to4 = some c4') : Smith.Matches w h a.rc a.toL c4'
Every System 4 step from an abstract configuration is matched by a run of System 3 to the abstract configuration of the result.
Case analysis on the focus and the state. Each System 4 rule is matched by a
System 3 run to the toL of a new AC whose to4 is the System 4 result: rule 1
by Lemma 6.3.1 over p + 1 cells onto the previous block's last cell
or a star's 0, or, at the left end, Lemma 6.5.2 (p + 2t + 6 steps:
walk, turnA, scan back over 2 2 1^t, which becomes 2 1 1^t); rule 2 by one
Lemma 6.3.2; rule 4 by one Lemma 6.3.3; rule 5 by one turnA
onto the second cell of the next block; rule 3 by Lemma 6.5.4, a scan
of 2^w cells (or 2^w - 1 from setT), landing on the closing cell, the next
block's first cell, or a star (Definition 6.5.3, Definition 6.5.5).
The parity side is Lemma 6.5.7 for the scan in state B,
Lemma 6.5.8 for the scan in state C,
Lemma 6.5.9 for the skipped-cell scan after rule 5 and
Lemma 6.5.6 for the agreement of the exit state with System 4's
toggle. The focus off has no System 4 step. The side conditions of the new
abstract configuration for h steps follow from those for h + 1: the left end's
condition steps down with the budget, the items keep decoding on one scan fewer,
and the star-side rule is preserved by each move.
6.6. The initial tape
Smith's block of a set (s42s0-3.pl): the XOR of the rows (Definition 6.2.8)
of the elements and of the last row row N (N - 1), the all-2s block, plus the
row N - 2 when the first cell would otherwise be a 1.
Lean code for Definition6.6.1●1 definition
Associated Lean declarations
-
Smith.encSet[complete]
-
Smith.encSet[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.encSet (N : ℕ) (S : List ℤ) : Smith.Bits
def Smith.encSet (N : ℕ) (S : List ℤ) : Smith.Bits
Smith's block of a set: `baseSet`, with the row `N - 2` added when the first cell is a 1.
The first cell of Definition 6.6.1 (2 ^ w) S is a 2, so that a star may
stand in its place.
Lean code for Lemma6.6.2●1 theorem
Associated Lean declarations
-
Smith.firstTrue_encSet[complete]
-
Smith.firstTrue_encSet[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.firstTrue_encSet (w : ℕ) (S : List ℤ) : Smith.firstTrue (Smith.encSet (2 ^ w) S)
theorem Smith.firstTrue_encSet (w : ℕ) (S : List ℤ) : Smith.firstTrue (Smith.encSet (2 ^ w) S)
Either the base block already begins with a 2, or the row 2^w - 2 is added, and
that row begins with a 2.
For a duplicate-free S whose elements are nonnegative and below 2^w, and
k + 2 <= 2^w, Definition 6.6.1 (2 ^ w) S Definition 6.4.7 to S
on k scans.
Lean code for Lemma6.6.3●1 theorem
Associated Lean declarations
-
Smith.Decodes_encSet[complete]
-
Smith.Decodes_encSet[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.Decodes_encSet (w k : ℕ) (S : List ℤ) (hS : S.Nodup) (hb : ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ w) (hk : k + 2 ≤ 2 ^ w) : Smith.Decodes (Smith.encSet (2 ^ w) S) S k
theorem Smith.Decodes_encSet (w k : ℕ) (S : List ℤ) (hS : S.Nodup) (hb : ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ w) (hk : k + 2 ≤ 2 ^ w) : Smith.Decodes (Smith.encSet (2 ^ w) S) S k
By Lemma 6.2.6 and Lemma 6.2.10 the base block has
the membership parity of S on every scan below 2^w - 1, the last row having its
parity at scan 2^w - 1 only; the optional row 2^w - 2 has its parity at scan
2^w - 2 only. Both extra rows are outside the window of k scans.
initAC w h S0 rest is the Definition 6.4.2 of the well-formed initial tape for
the System 4 configuration with elements set S0 :: rest, active position 0 and
state A: no item left of the head, the elements of rest as items with their
blocks Definition 6.6.1 (2 ^ w), the left end 0^h 2 2 1
(Definition 6.4.14 zeros h 1), closing 1 (Definition 6.4.15 one),
and the head on the first cell of the block of S0 in state A
(Definition 6.4.1 setA).
Lean code for Definition6.6.4●1 definition
Associated Lean declarations
-
Smith.initAC[complete]
-
Smith.initAC[complete]
-
defdefined in Smith/Conjecture3.leancomplete
def Smith.initAC (w h : ℕ) (S0 : List ℤ) (rest : List BiTM.System4Elem) : Smith.AC
def Smith.initAC (w h : ℕ) (S0 : List ℤ) (rest : List BiTM.System4Elem) : Smith.AC
The abstract configuration of the initial tape for the System 4 configuration `<set S0 :: rest, 0, A>`: no item left of the head, the left end `0^h 2 2 1`, the head on the first cell of the block of `S0` in state A.
The initial condition of the link: under h + 3 <= 2^w, a well-formed System 4
configuration (Definition 5.5.1) with elements
set S0 :: rest, whose last element is not a star and whose set elements are all
nonnegative and below 2^w, stands in Definition 6.4.17 Closing.one with the
toL of Definition 6.6.4 w h S0 rest, for width w and h steps left.
Lean code for Lemma6.6.5●1 theorem
Associated Lean declarations
-
Smith.rep3_init[complete]
-
Smith.rep3_init[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.rep3_init (w h : ℕ) (S0 : List ℤ) (rest : List BiTM.System4Elem) (hN : h + 3 ≤ 2 ^ w) (hwf : { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A }.WellFormed) (hlast : (BiTM.System4Elem.set S0 :: rest).getLast? ≠ some BiTM.System4Elem.star) (hb : ∀ (S : List ℤ), BiTM.System4Elem.set S ∈ BiTM.System4Elem.set S0 :: rest → ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ w) : Smith.Rep3 Smith.Closing.one (Smith.initAC w h S0 rest).toL { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } w h
theorem Smith.rep3_init (w h : ℕ) (S0 : List ℤ) (rest : List BiTM.System4Elem) (hN : h + 3 ≤ 2 ^ w) (hwf : { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A }.WellFormed) (hlast : (BiTM.System4Elem.set S0 :: rest).getLast? ≠ some BiTM.System4Elem.star) (hb : ∀ (S : List ℤ), BiTM.System4Elem.set S ∈ BiTM.System4Elem.set S0 :: rest → ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ w) : Smith.Rep3 Smith.Closing.one (Smith.initAC w h S0 rest).toL { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } w h
The initial condition of link D: the System 3 tape of `initAC` stands for the System 4 configuration.
The to4 of initAC is the System 4 configuration by computation, and its side
conditions hold: the width bound is the hypothesis, the left end zeros h 1 allows
h turns, every block is encSet and decodes to its set on h + 1 scans by
Lemma 6.6.3 (with h + 3 <= 2^w), the star-side rule on the
right items follows from well-formedness (no adjacent stars) and the last element
not being a star, with Lemma 6.6.2 for the cell each star
stands for.
6.7. Formal statements
For every width w and right end rc (Definition 6.4.15), System 3
(Definition 2.5.12) tracks the fuelled System 4 (Definition 4.2.7 of the
step system of Definition 5.1.1) through Definition 6.4.17 as a
forward simulation (Definition 4.2.3): the relation between a pair
(System 4 configuration, fuel h) and a System 3 configuration c is
Rep3 rc c c4 w h, the fuel being the budget of scans the blocks are good for.
Lean code for Theorem6.7.1●1 theorem
Associated Lean declarations
-
Smith.sys4_sys3_forwardSim[complete]
-
Smith.sys4_sys3_forwardSim[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.sys4_sys3_forwardSim (w : ℕ) (rc : Smith.Closing) : Smith.ForwardSim (Smith.fueled Smith.system4Sys) (Smith.lsys Smith.sys3) fun p c => Smith.Rep3 rc c p.1 w p.2
theorem Smith.sys4_sys3_forwardSim (w : ℕ) (rc : Smith.Closing) : Smith.ForwardSim (Smith.fueled Smith.system4Sys) (Smith.lsys Smith.sys3) fun p c => Smith.Rep3 rc c p.1 w p.2
Link D as a `ForwardSim`: System 3 tracks the fuelled System 4 through `Rep3`, the fuel being the budget of scans the blocks are good for.
Unfold Rep3 to an abstract configuration a with a.OK w h. With fuel 0 the
fuelled system has no step. With fuel h + 1 a step of the fuelled system is a
System 4 step from a.to4 with the fuel dropping to h, and Proposition 6.5.10
gives the matching System 3 run of at least one step to the toL of an AC
satisfying OK w h whose to4 is the result, which is Rep3 again.
For every width w and right end rc, System 0 (Definition 2.5.9) tracks the
fuelled System 4 (Definition 4.2.7) as a forward simulation
(Definition 4.2.3) through the relation: the System 0 configuration is
phi2 (phi3 c3) (Definition 7.2.2, Definition 7.2.3) for some c3 in
Definition 6.4.17 rc with the System 4 configuration, for width w and the
fuel.
Lean code for Theorem6.7.2●1 theorem
Associated Lean declarations
-
Smith.sys4_sys0_forwardSim[complete]
-
Smith.sys4_sys0_forwardSim[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.sys4_sys0_forwardSim (w : ℕ) (rc : Smith.Closing) : Smith.ForwardSim (Smith.fueled Smith.system4Sys) (Smith.lsys Smith.sys0) fun p c0 => ∃ c3, Smith.Rep3 rc c3 p.1 w p.2 ∧ c0 = Smith.phi2 (Smith.phi3 c3)
theorem Smith.sys4_sys0_forwardSim (w : ℕ) (rc : Smith.Closing) : Smith.ForwardSim (Smith.fueled Smith.system4Sys) (Smith.lsys Smith.sys0) fun p c0 => ∃ c3, Smith.Rep3 rc c3 p.1 w p.2 ∧ c0 = Smith.phi2 (Smith.phi3 c3)
Links D and E composed: System 0 tracks the fuelled System 4 through `Rep3` and the relabelings `phi2`, `phi3`.
The composition (Lemma 4.2.4) of
Theorem 6.7.1 with the relabeling simulation
Theorem 7.2.10 of
the chapter on Systems 3 to 0, the composed relation
rewritten by ForwardSim_congr.
T3 in finite form. Let h + 3 <= 2^w, let the System 4 configuration with elements
set S0 :: rest, active position 0 and state A be well-formed
(Definition 5.5.1), with last element not a star and every
set element nonnegative and below 2^w, and let its run of n <= h System 4 steps
(System4.nSteps) be defined. Then there are times with times 0 = 0, strictly
increasing on [0, n], such that for every i <= n the i-th System 4
configuration ci exists and the run of Definition 2.5.9
(Definition 2.5.6) of times i steps from phi2 (phi3 (initAC w h S0 rest).toL)
(Definition 7.2.2, Definition 7.2.3, Definition 6.6.4) is
phi2 (phi3 c3i) for a System 3 configuration c3i with
Definition 6.4.17 Closing.one c3i ci w (h - i): the tapes stand in Rep3 with
the budget counting down.
Lean code for Theorem6.7.3●1 theorem
Associated Lean declarations
-
Smith.conjecture3_finite[complete]
-
Smith.conjecture3_finite[complete]
-
theoremdefined in Smith/Conjecture3.leancomplete
theorem Smith.conjecture3_finite (w h n : ℕ) (S0 : List ℤ) (rest : List BiTM.System4Elem) (hN : h + 3 ≤ 2 ^ w) (hwf : { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A }.WellFormed) (hlast : (BiTM.System4Elem.set S0 :: rest).getLast? ≠ some BiTM.System4Elem.star) (hb : ∀ (S : List ℤ), BiTM.System4Elem.set S ∈ BiTM.System4Elem.set S0 :: rest → ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ w) (hn : n ≤ h) (c' : BiTM.System4Config) (hrun : BiTM.System4.nSteps { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } n = some c') : ∃ times, times 0 = 0 ∧ (∀ i < n, times i < times (i + 1)) ∧ ∀ i ≤ n, ∃ ci c3i, BiTM.System4.nSteps { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } i = some ci ∧ Smith.lnSteps Smith.sys0 (Smith.phi2 (Smith.phi3 (Smith.initAC w h S0 rest).toL)) (times i) = some (Smith.phi2 (Smith.phi3 c3i)) ∧ Smith.Rep3 Smith.Closing.one c3i ci w (h - i)
theorem Smith.conjecture3_finite (w h n : ℕ) (S0 : List ℤ) (rest : List BiTM.System4Elem) (hN : h + 3 ≤ 2 ^ w) (hwf : { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A }.WellFormed) (hlast : (BiTM.System4Elem.set S0 :: rest).getLast? ≠ some BiTM.System4Elem.star) (hb : ∀ (S : List ℤ), BiTM.System4Elem.set S ∈ BiTM.System4Elem.set S0 :: rest → ∀ e ∈ S, 0 ≤ e ∧ e.toNat < 2 ^ w) (hn : n ≤ h) (c' : BiTM.System4Config) (hrun : BiTM.System4.nSteps { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } n = some c') : ∃ times, times 0 = 0 ∧ (∀ i < n, times i < times (i + 1)) ∧ ∀ i ≤ n, ∃ ci c3i, BiTM.System4.nSteps { elems := BiTM.System4Elem.set S0 :: rest, active := 0, state := BiTM.System4State.A } i = some ci ∧ Smith.lnSteps Smith.sys0 (Smith.phi2 (Smith.phi3 (Smith.initAC w h S0 rest).toL)) (times i) = some (Smith.phi2 (Smith.phi3 c3i)) ∧ Smith.Rep3 Smith.Closing.one c3i ci w (h - i)
T3 in finite form: a System 4 run of `n <= h` steps from a well-formed tape whose head is on its leftmost element in state A, with sets bounded by `2^w`, is tracked by the System 0 run from the relabeled initial tape at strictly increasing times, the tapes standing in `Rep3` with the budget counting down.
Apply Lemma 4.2.6 to Theorem 6.7.2
w Closing.one, with the initial relation from Lemma 6.6.5 and the
fuelled run of n <= h steps obtained from the System 4 run; the fuel at step i
is h - i.
6.8. Notes and caveats
-
The width condition is
h + 3 <= 2^w, weaker than Smith's2^w >= 3f, because the fuel, notf, bounds the scans; the link tofis made in the chapter on Conjecture 0, where2^wmust also exceed every set element. -
The head of the initial tape is on the first cell of the first block, not on Smith's leftmost 0. Started on its leftmost 0 in state A, the tape
0^m 2 2 1 ...walks off its left end in three steps. This is why the finite form does not chain by plain concatenation (the chapter on the infinite form). -
Rep3is stated on the System 3 tape and leaves the swap of the cells left of the head tophi3(the chapter on Systems 3 to 0), so Smith'ss42s0-3.pl 3output isphi3ofinitAC's tape. -
T3 does not use loop-freeness:
Smith/Conjecture3.leandoes not importSmith/LoopFree.lean; the generic run lemmaSmith.lnSteps_addis inSmith/Lookahead.lean. -
The D8 vectors of
Vectors/SmithVectors.leanrun a six-step System 4 program through System 3 bydecide.
6.9. Depends on
The modules Smith.ParityBlocks, Smith.System3Runs, Smith.Conjecture3 and
Smith.Lookahead; the chapter on System 5 to System 4
for System4.step, decr and xorInsert;
the chapter on Systems 3 to 0 for phi2 and phi3.
In the graph, the nodes of this chapter use these nodes of other chapters:
-
Smith.sys3,Smith.sys0,Smith.lstep,Smith.lnStepsandSmith.LConfigfrom the chapter on the machine model; -
Smith.ForwardSim,Smith.ForwardSim_comp,Smith.ForwardSim_nStepsandSmith.fueledfrom the chapter on cyclic tag to System 5; -
BiTM.System4.stepandBiTM.System4Config.WellFormedfrom the chapter on System 5 to System 4; -
Smith.phi2,Smith.phi3andSmith.sys3_sys0_forwardSimfrom the chapter on Systems 3 to 0.