User blog:Rpakr/Converting TON Expressions to Sequences

In this blog post, I will explain how to convert TON expressions to sequences of numbers, and how the method Hyp cos gave in his blog post relates to this.

Step 1
In this step, every expression of the form \(C(\alpha_1,C(\alpha_2,...C(\alpha_{n-1},C(\alpha_k,\beta))...))\) for \(k\geq 1\) are converted to \(C(\alpha_k,\alpha_{k-1},...\alpha_2,\alpha_1;\beta)\). \(\alpha_m\) for \(1\leq m\leq k\) and \(\beta\) are \(C\)-expressions.

Note that the order of \(\alpha_k\) are reversed.

Step 2
In this step, every expressions of the form \(C(\alpha_1,\alpha_2,...,\alpha_k;0)\) are converted to \(D(\alpha_1,\alpha_2,...,\alpha_k)\) and every expressions of the form \(C(\alpha_1,\alpha_2,...,\alpha_k;\Omega_n)\) are converted to \(E(\alpha_1,\alpha_2,...,\alpha_k)\).

If the steps were applied to a standard \(C\)-expression, after this step, there will be no more \(C\)s in the expression.

Step 3
First, I will define the word parent.

Let \(f\) be either of \(D\) or \(E\). If an expression contains an expression of the form \(f(\alpha_1,\alpha_2,...,\alpha_k)\), the parent of \(\alpha_m\) for \(1\leq m\leq k\) are \(f\).

In this step, a sequence is derived using the converted expression using the following rules:

Scan the expression one character by character from the left. \(\Omega_n\) is considered to be one character.

If the character is a comma or parentheses, do not add any nodes.

If the character is a \(0\) or a \(D\), add \(m+1) at the end of the sequence where \(m\) is the term of the sequence which was written when the parent was scaned. \(m=0\) if there is no parent.

If the character is a \(\Omega_n\) or a \(E\), add \(m+2) at the end of the sequence where \(m\) is the term of the sequence which was written when the parent was scaned. \(m=0\) if there is no parent.

After all characters have been scanned, put the system number as the subscript of the sequence. For example, \(\varepsilon_0\) corresponds to \(C(\Omega,0)\) in 1st system and \(C(C(\Omega_2,0),0)\) in 2nd system, so its sequence can be either of \((1,3)_1\) and \((1,2,4)_2\). Any ordinal smaller than TON has countably infinitely many sequence expressions.

Using these three steps, we can convert any \(C\)-expression to sequences.

Code
I made computer programs that convert TON expressions and sequences to each other..

This program converts TON expressions to sequences.

This program converts sequences to TON expressions.

Copy-and-paste the code here to execute those.

Properties of standard TON sequences
A TON sequence is standard iff it can be derived from a standard TON expression. Note that the standardness of sequences depend on the system. For example, sequence \((1,2,4)_1\) is not standard but \((1,2,4)_2\) is.

Standard TON sequences has two interesting properties. Let \(S=(a_1,a_2,...,a_{k-1},a_k)_n\) be a standard TON sequence.

1. There does not exist a \(m\) such that \(a_m-a_{m-1}>2\).

This is true because how the sequence is derived in step 3.

2. \((a_1,a_2,...,a_{m-1},a_m)_n\) for \(1\leq m\leq k\) are standard.

3. Expressions with \(t\) C's correspond to sequences with length \(t+1\).

TON fundamental sequence by Hyp cos
A blog post by Hyp cos explains a method to find fundamental sequences of TON expressions.

I will use the method in the "Reality use" section but I will change step 2 to:

If \(\gamma=\Omega_n\), then change it into \(0\). If \(\gamma=0\land m=1\), then change the \(C(0,\beta_1)\) into \(\beta_1\), and go back to step 1. If \(\gamma=0\land m\geq 2\land \beta_1<\Omega_n\), then change the \(C(C(0,\beta_1),\beta_2)\) into \(C(0,C(\beta_1,\beta_2))\). If \(\gamma=0\land m\geq 2\land \beta_1\geq\Omega_n\), then change the \(C(C(0,\beta_1),\beta_2)\) into \(C(\Omega_n,C(\beta_1,\beta_2))\).

This modification skips checking the standardness of expressions containing \(C(\Omega_n,C(\beta_1,\beta_2))\) for \(\beta_1<\Omega_n\). Such expressions are never standard since the definition requires expressions containing \(C(\alpha,C(\gamma,\delta))\) to satisfy \(\alpha<\gamma\) to be standard. Therefore, this change does not affect the result because nonstandard expressions can never be terms of fundamental sequences.

Calculation of \(C(C(\Omega_2,C(\Omega_2,0)),0)[3]\) with modified step 1:

A pattern can be seen in the sequences. When step 2 is applied to \(S=(a_1,a_2,...,a_{k-1},a_k)_n\), if \(a_k>2\) \(S\) becomes \((a_1,a_2,...,a_{k-1},a_k)_n\), and if \(a_k=2\) \(S\) becomes \((a_1,a_2,...,a_{k-1})_n\). When step 5 is applied to \(S=(a_1,a_2,...,a_{k-1},a_k)_n\) it becomes \((a_1,a_2,...,a_{k-1},a_k,a_k+2)_n\).

Step 2 has 4 cases:

A. \(\gamma=\Omega_n\),

B. \(\gamma=0\land m=1\),

C. \(\gammma=0\land m\geq2 \land \beta<\Omeg_n\),

D. \(\gammma=0\land m\geq2 \land \beta\geq\Omeg_n\).

Case A is applied when \(a_k-a_s=2\), case B is applied when \(a_k=2\), case C is applied when \(a_k-a_s=1\land a_s-a_t=1\), and case D is applied when \(a_k-a_s=1\land a_s-a_t=2\). \(a_s\) is the parent of \(a_k\) and \(a_t\) is the parent of \(a_s\).

Weakly standard sequences
Sequence \((a_1,a_2,...,a_{k-1},a_k)_n\) is weakly standard iff \((a_1=1\lor a_1=2)\land\forall m(1a_1))\).

Properties of weakly standard sequences:

All standard sequences are weakly standard because how sequencecs are derived from TON expressions.

For every \(t\in\mathbb{N}\), there are only finitely many weakly standard sequence of which the length is \(\leq t\) because \(a_m\leq 2m\) for every weakly standard sequence \((a_1,a_2,...,a_{k-1},a_k)_n\) and every \(m\) that safisfy \(1<m<k\).

In Hyp cos's method, \(\alpha[k]\) is the largest standard TON expression smaller than \(\alpha\) with \(k\) more C's than \(\alpha\), which corresponds to the largest standard sequence smaller than \(\alpha\) that has \(k\) more entries than the sequence that \(\alpha\) corresponds to. To compute this, we can list all weakly standard sequences smaller than \(\alpha\) that has \(k\) more entries than the sequence that \(\alpha\) corresponds to, order them lexicographically, and from the largest one check their standardness until a standard one is found. This is exactly what Hyp cos's method (without modified step 3) does.

Normally we can only know standardness of sequences by seeing it can be expanded from another standard sequence, so knowing the fundamental sequence is required to check standardness. However, if we somehow happen to know a method by which we can know if a sequence is standard or not, by defining weakly standardness appropriately, we can calculate the fundamental sequence of sequences.

Modification of step 3
In Hyp cos's blog post, he also explained how a change in step 3 could largely improve computation time. In this section I will explain the change in step 3 using sequences.

Calculation of \(C(C(\Omega_2,C(\Omega_2,0)),0)[3]\) with modified step 3:

This change skips checking the standardness of sequences \((a_1,a_2,...,a_{k-1},a_k)\) if there exists an \(m\) such that \((a_1,a_2,...,a_{m-1},a_m\) is nonstandard. Every sequence that satisfy this are nonstandard because of property 2 of standard TON sequences, so this change does not affect the result.

Calculation of \(C(C(\Omega_2,C(\Omega_2,0)),0)[4]\) with modified step 3:

So, this method computes the terms of \(\alpha[k]\) one term by one term.