User:CircuitCraft/Emulation Theorem

Theorem
Let $M = \struct {S, \vdash}$ and $M' = \struct {S', \vdash'}$ be abstract machines.

Let there exist a left-total relation $\phi \subseteq S \to S'$.

Suppose that, for all $s, t \in S$ and $s' \in S'$ such that:
 * $\map \phi {s, s'}$
 * $s \vdash t$

there exists $t' \in S'$ such that:
 * $\map \phi {t, t'}$
 * $t'$ is reachable from $s'$ in $M'$.

Then, for any $a, b \in S$, and $a' \in S'$, such that:
 * $\map \phi {a, a'}$
 * $b$ is reachable from $a$ in $M$

there exists $b' \in S'$ such that:
 * $\map \phi {b, b'}$
 * $b'$ is reachable from $a'$ in $M'$

Proof
By definition of reachable, there is a finite sequence:
 * $a = s_0 \vdash s_1 \vdash \dotso \vdash s_n = b$

By the Principle of Recursive Definition, construct the sequence:
 * $s'_0 \in S'$ such that $\map \phi {s_0, s'_0}$
 * $s'_{i + 1} \in S'$ such that $\map \phi {s_{i + 1}, s'_{i + 1} }$ and $s'_{i + 1}$ is reachable from $s'_i$ in $M'$

$s'_0$ is well-defined, as $\phi$ is left-total.

$s'_{i + 1}$ is also well-defined, by hypothesis.

At each step, the choice among the satisfactory configurations is arbitrary.

By definition of reachable, there is a finite sequence:
 * $s'_i = t_{i,0} \vdash' t_{i,1} \vdash' \dotso \vdash' t_{i,m_i} = s'_{i + 1}$

for every $0 \le i < n$.

Thus, the following finite sequence holds:
 * $s'_0 = t_{0, 0} \vdash' t_{0, 1} \vdash' \dotso \vdash' t_{0, m_0} = s'_1 = t_{1, 0} \vdash' \dotso \vdash' t_{n - 2, m_{n - 2} } = s'_{n - 1} = t_{n - 1, 0} \vdash' \dotso \vdash' t_{n - 1, m_{n - 1} } = s'_n$

Therefore, $s'_n$ is reachable from $s'_0$.

But as the choice of $s'_0$ was arbitrary, the result holds for any such $s'_0$.

Hence the result.