# The Coding Theorem — A Link between Complexity and Probability

*This post has been written in collaboration with* [*Iliad*](https://www.iliad.ac/) *in service of one of Iliad's longer-term goals of understanding the simplicity bias of learning machines.*

In this post, I give a self-contained treatment, including a proof, of the **coding theorem**.[^t684r77hx8r] Let $x$ be a finite binary string and $U$ a universal prefix-free Turing machine. The universal probability $P(x)$ of $x$ is defined as the probability that a program $p$ sampled uniformly at random computes $x$ when $p$ is run via $U$. The coding theorem says that $P(x) \approx 2^{-K(x)}$ up to a multiplicative constant, where $K(x)$ is the prefix-free Kolmogorov complexity of $x$.[^3t4tf4mjyo4] Thus, more complex binary strings $x$ become exponentially less likely and vice versa. This can be interpreted as a form of Occam's razor.

This statement has found some prior interest on Lesswrong. [Alexander Gietelink Oldenziel](https://www.lesswrong.com/users/alexander-gietelink-oldenziel) called the argument behind one inequality the [*padding argument*](https://www.lesswrong.com/posts/tDkYdyJSqe3DddtK4/alexander-gietelink-oldenziel-s-shortform?commentId=zH42TS7KDZo9JimTF), after it was independently rediscovered by [Matthias Dellago](https://www.lesswrong.com/users/matthias-dellago) and [Lucius Bushnaq](https://www.lesswrong.com/users/lblack).[^f712u8cwxe6] [Nate Soares](https://www.lesswrong.com/users/so8res?from=post_header) wrote a [whole post](https://www.lesswrong.com/posts/KcvJXhKqx4itFNWty/k-complexity-is-silly-use-cross-entropy-instead) about his rediscovery of some of these ideas, for the case that strings $x$ are themselves computable functions. A similar result was discussed by [Joar Skalse](https://www.lesswrong.com/users/logical_lunatic) in the context of the [complexity of functions learned by neural networks](https://www.lesswrong.com/posts/YSFJosoHYFyXjoYWa/why-neural-networks-generalise-and-why-they-are-kind-of?commentId=sQ2TN37kjWgG6EZiW). Note that my usage of the term *padding* is unrelated to [a different type of padding argument](https://en.wikipedia.org/wiki/Padding_argument).

The motivation of this post is to provide a didactical and elementary proof for readers, avoiding the typical machinery of "lower semicomputable discrete semimeasures", and to have a reference for future posts. In particular, Alexander and I are currently writing a post on the complexity of functions learned by neural networks, in which we would like to refer to this result. 

**Audience**: This post assumes basic knowledge of Turing machines, the Church-Turing thesis, and the Kolmogorov complexity for prefix-free Turing machines (often called *prefix* Turing machines; I find it clearer to append "free"). We will briefly recall some basic definitions as a reminder.

**Contributions***:* It is possible that all parts of the proofs can already be found identically in the literature, but I did not try to find them. OpenAI's o3 found the idea for the dovetailing procedure. The proof of the efficient algorithmic Kraft coding in the appendix is mine. The entire post is written by myself, except the last paragraph of the following section, which was first drafted by GPT-5. 

**Acknowledgments:** I thank Alexander Gietelink Oldenziel and Matthias Dellago for engaging discussions about the coding theorem and the padding argument. 

Formulating the Coding Theorem
==============================

Let $\{0, 1\}$ be our alphabet. Denote by $\{0, 1\}^*$ the set of binary strings of arbitrary *finite* length. A prefix-free Turing machine is a Turing machine that halts on a prefix-free set of programs $p \in \{0, 1\}^*$. Let $U$ be a *universal* prefix-free Turing machine, meaning that for any prefix-free Turing machine $T$, there exists $i \in \{0, 1\}^*$ such that for all $q \in \{0, 1\}^*$ we have $T(q) = U(i'q)$,[^517cb3ewaqr] where $i'$ is a chosen prefix-free encoding of $i$.  

We construct $P(x) = P_U(x)$, the universal a priori probability of $x$, as follows: First, by abuse of notation, consider the uniform distribution $P$ on *infinite* binary sequences $s \in \{0, 1\}^{\infty}$, which are sampled by sampling each bit in sequence with probability $1/2$. Now for a particular sampled sequence $s$, we observe whether it *starts with* a finite sequence $p$ on which $U$ halts, and if it does, then we write $U'(s) = U(p)$, where $U'$ is an adapted version of $U$ that operates on infinite sequences. There can only be one such $p$ since $U$ is prefix-free. Then, define the universal a priori probability of $x \in \{0, 1\}^*$ to be

$$
P(x) := P_U(x) := P(U'^{-1}(x)) = P\Big( \big\lbrace s \in \{0, 1\}^{\infty} \mid U'(s) = x \big\rbrace \Big),
$$

$$i.e., the probability that $U'$ maps a randomly sampled sequence $s \in \{0, 1\}^{\infty}$ to $x$, i.e., that $s$ starts with a program on which $U$ halts with output $x$. As an aside, note that this is only a semiprobability mass function since some infinite sequences $s$ do not contain *any* prefix on which $U$ halts, meaning that $U'(s)$ is undefined. Thus, we have 

$$
\sum_{x \in \{0, 1\}^*} P(x) < 1.
$$

This total probability is also called the [halting probability](https://en.wikipedia.org/wiki/Chaitin%27s_constant); it is the probability that a randomly selected program $p$ produces an output and halts. 

For a program $p \in \{0, 1\}^*$, denote by $l(p)$ its length. Then the distribution $P$ also has an alternative and more common formulation:

**Lemma 1** (Deadcode/padding argument). *We have*

$$
P(x) = \sum_{p \in \{0, 1\}^*  \colon  U(p) = x} 2^{-l(p)}.
$$

*Proof.* We first claim

$$
U'^{-1}(x) = \Big\lbrace s \in \{0, 1\}^{\infty} \mid U'(s) = x \Big\rbrace =\bigcup_{p \in \{0, 1\}^*  \colon  U(p) = x} \{p\} \times \{0, 1\}^{\infty}.
$$

The inclusion from left to right is clear: Every infinite $s$ with $U'(s) = x$ by definition starts with a finite program $p$ such that $U(p) = x$. The other direction is the **padding** or **deadcode** argument: If a program $p$ computes $x$ (i.e., $U(p) = x$), then *every* extension of $p$ to an infinite sequence $s$ will compute $x$ via $U'$: The extensions/paddings are a *dead code* that is ignored by $U'$.

Thus, we obtain

$$
P(x) = P(U'^{-1}(x)) = \sum_{p \in \{0, 1\}^*  \colon  U(p) = x} P(\{p\} \times \{0, 1\}^{\infty}) = \sum_{p \in \{0, 1\}^*  \colon  U(p) = x} 2^{-l(p)}.
$$

In the last step, we used that the likelihood of sampling an infinite sequence that starts with $p$ is exactly $2^{-l(p)}$ since each specific bit is sampled with probability $1/2$ under the uniform distribution. $\square$

Now, let $K(x)$ the Kolmogorov complexity of a binary string $x \in \{0, 1\}^{*}$ computed via the universal prefix-free Turing machine $U$, i.e., the length of the shortest program that computes $x$:

$$
K(x) := \min \big\lbrace{l(p) \mid p \in \{0, 1\}^*  \colon U(p) = x\big\rbrace}.
$$

$$We can now formulate the coding theorem:

**Theorem 2** (Coding Theorem). *There is a constant *$C > 1$ *such that for all *$x \in \{0, 1\}^*$*, we have*

$$
2^{-K(x)} \leq P(x) \leq C \cdot 2^{-K(x)}.
$$

*In other words, up to at most a multiplicative constant, *$P(x)$ *coincides with *$2^{-K(x)}$. 

$$*Proof* (first inequality). Choose a shortest program $p \in \{0, 1\}^*$ with $U(p) = x$. Then we have $l(p) = K(x)$ and we obtain $2^{-K(x)} = 2^{-l(p)} \leq P(x)$ by Lemma 1. $\square$

The rest of the post will be about proving the second inequality, which is much harder than the first. It roughly states that if $x$ is likely under the universal probability, then its Kolmogorov complexity is small, i.e., $x$ can be *compressed*. To prove this claim, we first reformulate it slightly. Up to a relabeling of $C$, and by taking the binary logarithm, the inequality is equivalent to

$$
K(x) \leq - \log P(x) + C.
$$

The rough outline is as follows: Our proof of this inequality constructs, for each string $x$, a short prefix-free program whose length is close to $−\log P(x)$, using an online version of Kraft’s inequality: We simulate all programs in parallel (dovetailing) and maintain running lower bounds $Q(x)$ of $P(x)$. Whenever $Q(x)$ first crosses a threshold $2^{-r}$, we assign $x$ a fresh codeword of length $r+1$ via an algorithmic Kraft coding procedure that guarantees prefix-freeness without knowing future codelengths. That this is accomplished by an online algorithm ensures that the decoding procedure is computable by a fixed prefix-free Turing machine, adding only a constant $C$ to the code lengths. Since $r$ is eventually within a distance of $1$ of $−\log P(x)$, the resulting shortest program length found by the procedure is at most $−\log P(x)+C+2$, establishing the desired bound with constant $C+2$. 

Algorithmic Kraft Coding
========================

We need an algorithmic version of the Kraft inequality as a tool. If you are not interested in the details, feel free to only read the statement of Theorem 4 and then move on to the next section. 

For a binary string $x \in \{0, 1\}^*$, we denote by $0.x$ the corresponding real number in base $2$, with $0 \leq 0.x < 1$. Furthermore, $D(x) := [0.x, 0.x + 2^{-l(x)})$ denotes the corresponding half-open dyadic interval. We say that $y$ is a prefix of $x$ if $x$ starts with the bits of $y$.

**Lemma 3.** *Let *$x, y \in \{0, 1\}^*$* be binary strings. Then *$D(x) \subseteq D(y)$* if and only if *$y$* is a prefix of *$x$*.*

*Proof.* Assume $y$ is a prefix of $x$. Then 

$$
0.y \leq 0.x < 0.x + 2^{-l(x)} \leq 0.y + 2^{-l(y)}.
$$

All inequalities except the last are trivial. The last inequality follows since adding $2^{-l(x)}$ to $0.x$ increments only the last bit of $0.x$, which cannot get larger than incrementing an *earlier* bit — which is what happens by forming $0.y + 2^{-l(y)}$, given that $y$ is a prefix of $x$. Overall, this shows $D(x) \subseteq D(y)$.

For the other direction, assume we have $D(x) \subseteq D(y)$, i.e., the inequalities in the first equation in the proof all hold. If $0.y = 0.x$, then the third inequality shows $2^{-l(x)} \leq 2^{-l(y)}$, which shows $l(y) \leq l(x)$, and $0.y = 0.x$ implies $x = y0^{l(x) - l(y)}$. Thus, $y$ is a prefix of $x$ and we are done. Thus, we can assume $0.y < 0.x$. For any natural numbers $k$, define $x(k)$ and $y(k)$ as the $k$'th bit in the binary expansions of $0.x$ and $0.y$, respectively. Let $k$ be the earliest index where $x(k) > y(k)$ (which exists since $0.x > 0.y$). We are done if we can show $k \geq l(y)+1$. And indeed, if this were not the case, then $0.x \geq 0.y + 2^{-l(y)}$, a contradiction to the assumed inequalities. Thus, $k \geq l(y) + 1$, i.e., $y$ is a prefix of $x$. $\square$

We are now ready to state the following theorem. I was told it is essentially equivalent to Theorem 3.6.1 in the book "Algorithmic Randomness and Complexity" by Downey and Hirschfeldt, which is therein called the KC theorem and attributed to Levin. 

**Theorem 4** (Algorithmic Kraft Coding)**.** *Let *$l_1, l_2, \dots \in \{1, 2, \dots\}$* be a sequence of natural numbers. Assume they satisfy Kraft's inequality:*

$$
\sum_{i = 1}^{\infty} 2^{-l_i} \leq 1.
$$

*Then there exist codewords *$C(k) \in \{0, 1\}^*$* with the two properties that:*

1.  $C$* forms a prefix-free code, i.e., no *$C(k)$* is the prefix of any *$C(l)$*.*
2.  *The codelengths are given by *$l(C(k)) = l_k$*.*

*Furthermore, there is an* algorithm *which successively maps the lengths*$l_k$ to a codeword $C(k)$ without looking at future codelengths and without revising earlier codewords along the way. 

*Proof.  *Here, we present a simple proof that only achieves slightly less efficient codelengths $l(C(k)) = l(k) + 1$. In the appendix we present a more complicated algorithm that achieves precisely the stated result.

The algorithm proceeds as follows: Upon receiving the sequence $(l_1, \dots, l_k)$, form the numbers $s_k = \sum_{i = 1}^{k-1} 2^{-l_i}$, and analogously $s_{k+1}$. Consider the interval $I_k = [s_k, s_{k+1})$.  
To construct the codeword $C(k)$, go through all binary codewords $x$ of length $l(k) + 1$, lexicographically, until you find the very first one for which $0.x \geq s_k$. This is $C(k)$.

Now we prove the first property (the second one holds by construction, though with lengths $l(C(k)) = l_k+1$). Due to the minimality of $C(k)$, we have $0.C(k) < s_k + 2^{-(l_k+1)}$. Consequently, we have 

$$
0.C(k) + 2^{-l(C(k))} = 0.C(k) + 2^{-(l_k+1)} < s_k + 2^{-l_k} = s_{k+1}.
$$

Consequently, the dyadic interval satisfies $D(C(k)) \subseteq I_k$. Since all $I_k$ are pairwise disjoint, all $D(C(k))$ are pairwise disjoint, too. By Lemma 3, no $C(k)$ is a prefix of any other. That proves property 1. Finally, notice that $C(k)$ was chosen algorithmically without knowledge of future codelengths and without revising any earlier codewords, finishing the proof. $\square$

**Remark:** *The statement of the theorem is stronger than many formulatios of Kraft's inequality since I require there to be an* algorithm *that selects one codeword at a time. This is what makes my proof of the efficient codewords in the appendix so complicated.*

*The reverse of this theorem is also true, i.e., the codelengths of any prefix-free code satisfy Kraft's inequality,* [*see the Wikipedia page*](https://en.wikipedia.org/wiki/Kraft%E2%80%93McMillan_inequality)*. *

A Proof of the Coding Theorem
=============================

We now prove the second inequality of Theorem 2. Recall that we want to prove

$$
K(x) \leq - \log P(x) + C.
$$

We now explain how to code binary strings $x$ algorithmically to a code of length roughly $- \log P(x)$ to achieve this. Crucially, we can't compute $- \log P(x)$ precisely and can only approximate it, leading to a moving target for the codelengths for $x$, and so we have to code $x \in \{0, 1\}^*$ in *several* ways since we can never be sure if we have found the correct codelength already.

We proceed as follows: For all $x \in \{0, 1\}^*$, initialize $Q(x) := 0$ as an approximation to $P(x)$. Initialize an empty sequence $()$ of codelengths. We approximate $P(x)$ from below. We do this by dovetailing: Run all inputs $p$ in parallel through the universal Turing machine $U$, one algorithmic step at a time. Assume our list of codelengths already contains $(l_1, \dots, l_{k-1})$ at some algorithmic step. Whenever any program halts and computes $U(p) = x$ for any binary string $x$, update the estimate $Q(x)$:

$$
Q(x) \leftarrow Q(x) + 2^{-l(p)}.
$$

When this happens, check whether $Q(x)$ just crossed a threshold $2^{-r}$ for any natural number $r$ for the first time. If it did, then for the smallest such $r$ (if it crosses several at once), append $l_k := r+1$ to a sequence $(l_1, \dots, l_{k-1})$ of codelengths to obtain $(l_1, \dots, l_k)$, and assign to $x$ a codeword of length $l_{k}$ via the algorithm from Theorem 4.

For this to be well-defined, we need to check that all the codelengths $l_1, l_2, \dots$ together satisfy Kraft's inequality. Notice that each $l_i$ is of the form $r+1$ for an $r$ with$2^{-r} \leq Q(x) \leq P(x)$ for some binary string $x$, and that no $r$ appears twice for a given $x$ since we only update the list if a threshold is crossed for the first time. For a given $x$, let $r_x$ be the *minimal* $r$ that eventually appears in the algorithm and satisfies $2^{-r} \leq Q(x)$. Thus, we have

$$
\sum_{i = 1}^{\infty} 2^{-l_i} \leq \sum_{x \in \{0, 1\}^*} \sum_{k = 1}^{\infty} 2^{-(r_x + k)}= \sum_{x \in \{0,1\}^*} 2^{-r_x} \sum_{k = 1}^{\infty} 2^{-k}
$$

$$
= \sum_{x \in \{0, 1\}^*} 2^{-r_x}   \leq \sum_{x \in \{0, 1\}^*} P(x)  \leq 1.
$$

Thus, algorithmic Kraft coding can indeed be applied.

Now, if you have a codeword $p$ that arose from this procedure, you can *decode* $p$ to $x$ algorithmically as follows: Just run the same procedure again and observe which binary string $x$ will be coded as $p$. Then, halt and output $x$. Since this procedure halts only on outputs of the above encoding, and these outputs form a prefix-free set by Theorem 4, the decoding procedure described here *halts* on a prefix-free set, and so it is given by a prefix-free Turing machine (where we make use of the [Church-Turing thesis](https://en.wikipedia.org/wiki/Church%E2%80%93Turing_thesis)). Let $T$ be this Turing machine. Thus, there exists a Turing machine index $i \in \{0, 1\}^*$ such that $U(i'q) = T(q)$ for all $q \in \{0, 1\}^*$. Consequently, we have $U(i'p) = T(p) = x$, and thus

$$
K(x) \leq l(i'p) = l(p) + l(i') = l(p) + C,
$$

where $C = l(i')$ is a constant independent of $x$ and $p$.

Now, note that for a given $x$, in the *encoding* procedure, we eventually reach the minimal $r_x$, which then satisfies $2^{-r_x} \leq P(x) \leq 2^{-(r_x-1)}$ since otherwise $Q(x)$ would eventually cross the threshold $2^{-(r_x - 1)}$, contradicting the minimality of $r_x$. Thus, there exists some minimal code $p$ such that 

$$
l(p) = r_x+1 = r_x-1 + 2 \leq - \log P(x) + 2.
$$

Combining with the previous equation, we obtain

$$
K(x) \leq - \log P(x) + C + 2,
$$

finishing the proof of Theorem 2. $\square$

Appendix: Proof of Efficient Algorithmic Kraft Coding
=====================================================

Here, we present a more complicated algorithm that achieves the efficient codelengths $l(C(k)) = l_k$ for Theorem 4. Start with the set $R_0 = \{0, 10, 110, 1110, \dots \} \subseteq \{0, 1\}^*$ of codewords.[^aw9661kl78q] Intuitively, we think of them as a "resource" from which we choose the codewords of length $l_k$. Whenever this resource does not have a codeword of the correct size available, we fractally "break up" the longest available shorter string into longer strings in a prefix-free way, assign one of them, and add the new remaining "pieces" back into the resource in a way that does not create any "waste".

We now explain the details of how to do this. Initialize the set of "found codewords" $F_0$ as the empty set $F_0 = \emptyset$. Note that $R_k$ and $F_k$ have the following properties for $k = 0$:

1.  $R_k$ is prefix-free.
2.  $F_k = \{C(1), \dots, C(k)\} \subseteq R_k$, and the codelengths are given by $l(C(i)) = l_i$ for $i = 1, \dots, k$.
3.  No codelength is represented more than once in $R_k \setminus F_k$.
4.  $\sum_{r \in R_k} 2^{-l(r)} = 1$.

In the course of this proof, we will progressively replace elements of $R_k$ with extensions and build up the desired codewords $F_k$ *algorithmically* while preserving all four properties. The fact that $R_k$ is prefix-free by property $1$ and that $F_k \subseteq R_k$ by property $2$ then shows that also $F_k$ is prefix-free, which then implies that the code $C$ is prefix-free, establishing the result. 

Let $k = 1$. As $C(1)$, choose the unique $r \in R_0$ with $l(r) = l_1$. This exists since $R_0$ contains one codeword for each codelength. Set $R_1 := R_0$ and $F_0 := \{C(1)\}$.  
Note that all four properties still hold for $k = 1$.

Now, assume by induction that $R_{k-1}$ and $F_{k-1} = \{C(1), \dots, C(k-1)\}$ are already constructed and that all four properties hold. If there is an $r \in R_{k-1} \setminus F_{k-1}$ with $l(r) = l_k$, then simply choose $C(k) = r$, $F_k = F_{k-1} \cup \{C(k)\}$ and $R_k = R_{k-1}$. The choice of $r$ is unique by property $3$. Then trivially, all four properties are preserved.

Finally, consider the case that there is *no* $r \in R_{k-1} \setminus F_{k-1}$ with $l(r) = l_k$. Define $r \in R_{k-1} \setminus F_{k-1}$ as the *longest* element with $l(r) < l_k$. It is unique by property $3$. It exists since otherwise $R_{k-1} \setminus F_{k-1}$ does not represent any of the codelengths $1, 2, \dots, l_k$, which by induction and properties $2$, $4$, and $3$ (in that order) would imply

$$
\sum_{i = 1}^{k-1} 2^{-l_i} = \sum_{r \in F_{k-1}} 2^{-l(r)} = 1 - \sum_{r \in R_{k-1} \setminus F_{k-1}} 2^{-l(r)} \geq 1 - \sum_{i = l_{k} + 1}^{\infty} 2^{-i} = 1 - 2^{-l_k}.
$$

This would result in

$$
\sum_{i = 1}^{\infty} 2^{-l_i} > \sum_{i = 1}^{k} 2^{-l_i} = \sum_{i = 1}^{k-1} 2^{-l_i} + 2^{-l_k} \geq 1 - 2^{-l_k} + 2^{-l_k} = 1,
$$

in contradiction to the assumed Kraft's inequality. Thus, $r \in R_{k-1} \setminus F_{k-1}$ with $l(r) < l_k$ (and maximally long with these properties) exists.

Now, set $n := l_k - l(r) > 0$. Define

$$
R_k := R_{k-1} \setminus \{r\} \cup \Big\lbrace r0,  r10,  \dots,  r1^{n-2}0,  r1^{n-1}0,  r1^n  \Big\rbrace.   (*)
$$

Define $C(k) := r1^n$ and $F_k :=F_{k-1} \cup \{C(k)\}$.

We now show that all four properties remain true with these constructions. The *newly added* elements in $R_k$ are clearly not prefixes of each other. Since they are all extensions of $r \in R_{k-1}$ and $R_{k-1}$ was prefix-free, the prefix-free property then follows for all of $R_k$, proving property $1$. For property $2$, note that $F_{k-1} \subseteq R_{k-1}$, and since $r \notin F_{k-1}$ by definition, we have $F_{k-1} \subseteq R_k$, too. $C(k) \in R_k$ by construction, and so $F_k \subseteq R_k$. We have $l(C(k)) = l(r) + l(1^n) = l(r) + n = l_k$, proving property $2$.

For property $3$, note that

$$
R_k \setminus F_k = \big( R_{k-1} \setminus F_{k-1}\big) \setminus \{r\} \cup \{r0,  r10,  \dots,  r1^{n-2}0,  r1^{n-1}0 \}.
$$

Thus, codelength $l(r)$ is removed from and codelengths $l(r) + 1, \dots, l(r) + n = l_k$ are added to $R_{k-1} \setminus F_{k-1}$. By construction of $r$ (i.e., its maximality), none of the newly added codelengths were present in $R_{k-1} \setminus F_{k-1}$, and so no codelength is represented more than once in $R_k \setminus F_k$, proving property $3$.

Property $4$ follows from Equation $(*)$ and the induction assumption for $k-1$:

$$
\sum_{r' \in R_k}2^{-l(r')} = \sum_{r' \in R_{k-1}} 2^{-l(r')} - 2^{-l(r)} + 2^{-l(r) - n} + \sum_{i = 1}^{n} 2^{-l(r) - i}
$$

$$
= 1 + 2^{-l(r)} \cdot \Bigg(-1 + 2^{-n} + \sum_{i = 1}^{n} 2^{-i}\Bigg) = 1.
$$

As we explained before, this concludes the proof. $\square$

[^t684r77hx8r]: See Theorem 4.3.3 in Li and Vitányi's "An Introduction to Kolmogorov Complexity and Its Applications". This was first proved by L.A. Levin in 1974. 

[^3t4tf4mjyo4]: Importantly, this result is only correct up to a logarithmic error for plain, or descriptional, Kolmogorov complexity. Thus, the assumption that we work with prefix-free Turing machines is crucial. Thanks to Daniel Filan for pointing that out.  

[^f712u8cwxe6]: The term "padding" is also used in this context in the book "An Introduction to Universal Artificial Intelligence" by Hutter, Quarel, and Catt. 

[^517cb3ewaqr]: In particular, \(T\) halts on \(q\) whenever \(U\) halts on \(i'q\). 

[^aw9661kl78q]: My guess is one could also start with the resource \(R_0 = \{\epsilon\}\) consisting of only the empty binary string, which would possibly be somewhat cleaner than the choice I made.