Substitution Theorem for Terms

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

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

Let $\map \beta {x \gets \tau}$ be the substitution instance of $\beta$ substituting $\tau$ for $x$.

Let $\AA$ be a structure for predicate logic.

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

Suppose that:


 * $\map {\operatorname{val}_\AA} \tau \sqbrk \sigma = a$

where $\map {\operatorname{val}_\AA} \tau \sqbrk \sigma$ is the value of $\tau$ under $\sigma$.

Then:


 * $\map {\operatorname{val}_\AA} {\map \beta {x \gets \tau} } \sqbrk \sigma = \map {\operatorname{val}_\AA} \beta \sqbrk {\sigma + \paren {x / a} }$

where $\sigma + \paren {x / a}$ 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:


 * $\map \beta {x \gets \tau} = \begin {cases} \tau & : \text{if $y = x$} \\ y & : \text {otherwise} \end {cases}$

In the first case:

In the second case:

as desired.

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


 * $\map \beta {x \gets \tau} = \map f {\map {\tau_1} {x \gets \tau}, \ldots, \map {\tau_n} {x \gets \tau} }$

Now:

as desired.

The result follows by the Principle of Structural Induction.