Concatenation of URM Programs is Associative

Theorem
Let $P, Q, R$ be one-variable URM programs.

Then the concatenated URM programs $P * \left({Q * R}\right)$ and $\left({P * Q}\right) * R$ are the same.

Proof
For ease of analysis, let us assume that:
 * Each of $P$ and $Q$ have already had the appropriate Clear Registers Program $Z \left({2, \rho \left({P}\right)}\right)$ and $Z \left({2, \rho \left({Q}\right)}\right)$ appended to them;
 * Each of $P$ and $Q$ have already had the appropriate amendments made to their exit jumps so as to lead to the first line of the appropriate Clear Registers Program. (Note that if the latter is a null URM program, this will be the line immediately following the end of the program).

Thus we can discuss $P$ and $Q$ without reference to these technical details.

When concatenating programs, the only amendments made to the programs themselves are to the contents of the Jump.

So it is clear that the number, type and order of the basic instructions of both programs are the same.

All we have to consider are the amendments to the Jumps.

Suppose the lengths of $P$ and $Q$ are as follows:
 * $\lambda \left({P}\right) = t$;
 * $\lambda \left({Q}\right) = s$.

First we look at the Jumps of $R$.

When we form $\left({Q * R}\right)$, every Jump of $R$ of the form $J \left({m, n, q}\right)$ is replaced by $J \left({m, n, q + s}\right)$.

Then when forming $P * \left({Q * R}\right)$ the Jump $J \left({m, n, q + s}\right)$ is replaced by $J \left({m, n, q + s + t}\right)$.

On the other hand, when we form $\left({P * Q}\right) * R$, every Jump of $R$ of the form $J \left({m, n, q}\right)$ is replaced directly by $J \left({m, n, q + \left({s + t}\right)}\right)$.

Thus the Jumps of $R$ have been replaced by the same instructions in each of $\left({P * Q}\right) * R$ and $P * \left({Q * R}\right)$.

Now we look at the Jumps of $Q$.

When forming $\left({Q * R}\right)$, we have already ensured that every Jump</tt> of $Q$ of the form $J \left({m, n, q}\right)$ where $q > s$ has been replaced by $J \left({m, n, s + 1}\right)$.

So when forming $P * \left({Q * R}\right)$ the Jump</tt> $J \left({m, n, s + 1}\right)$ is replaced by $J \left({m, n, s + t + 1}\right)$.

On the other hand, when forming $\left({P * Q}\right)$, every Jump</tt> of $Q$ of the form $J \left({m, n, q}\right)$ is replaced by $J \left({m, n, q + t}\right)$.

We have that $\left({P * Q}\right)$ has $s + t$ instructions. When $q > s$, we take account of the fact that $q + t > s + t$.

So in $\left({P * Q}\right) * R$, Jump</tt>s of the form $J \left({m, n, s + 1}\right)$ are replaced by $J \left({m, n, s + t + 1}\right)$.

This agrees with the corresponding Jump</tt>s in $P * \left({Q * R}\right)$.

Similarly, we can show that all other Jump</tt>s of $Q$, and all Jump</tt>s of $P$, are amended in exactly the same way in each of $\left({P * Q}\right) * R$ and $P * \left({Q * R}\right)$.

Hence the result.