Substitution Theorem for Terms

Theorem
Let $\beta, \tau$ be terms.

Let $x \in \mathrm{VAR}$ be a variable.

Let $\beta \left({x \gets \tau}\right)$ be the substitution instance of $\beta$ substituting $\tau$ for $x$.

Let $\mathcal A$ be a structure for predicate logic.

Let $\sigma$ be an assignment for $\beta$ and $\tau$.

Suppose that:


 * $\mathop{ \operatorname{val}_{\mathcal A} \left({\tau}\right) } \left[{\sigma}\right] = a$

where $\mathop{ \operatorname{val}_{\mathcal A} \left({\tau}\right) } \left[{\sigma}\right]$ is the value of $\tau$ under $\sigma$.

Then:


 * $\mathop{ \operatorname{val}_{\mathcal A} \left({\beta \left({x \gets \tau}\right) }\right) } \left[{\sigma}\right] = \mathop{ \operatorname{val}_{\mathcal A} \left({\beta}\right) } \left[{\sigma + \left({x / a}\right)}\right]$

where $\sigma + \left({x / a}\right)$ is the extension of $\sigma$ by mapping $x$ to $a$.

Proof
Proceed by the Principle of Structural Induction on the definition of term, applied to $\beta$.

If $\beta = y$ for some variable $y$, then:


 * $\beta \left({x \gets \tau}\right) = \begin{cases} \tau &: \text{if $y = x$} \\ y &: \text{otherwise} \end{cases}$

In the first case:

In the second case:

as desired.

If $\beta = f \left({\tau_1, \ldots, \tau_n}\right)$ and the induction hypothesis holds for $\tau_1, \ldots, \tau_n$, then:


 * $\beta \left({x \gets \tau}\right) = f \left({ \tau_1 \left({x \gets \tau}\right), \ldots, \tau_n \left({x \gets \tau}\right) }\right)$

Now:

as desired.

The result follows by the Principle of Structural Induction.