Understanding the Problem
The problem deals with substitutions in logical formulas.
(a) We are given a substitution σ that maps variables x to a, y to b, and z to g(x, y). We are also given a formula F = Q(f(x), z), where Q and f are some functions. The task is to compute F σ, which means applying the substitution σ to the formula F. This involves replacing all occurrences of x, y, and z in F with their corresponding values according to σ.
(b) This part explains the order of applying multiple substitutions. F σθ means apply σ first, then θ. It also introduces two notations for multiple substitutions: sequential substitution F{x1/s1}{x2/ s2} . . . {xn/sn} and simultaneous substitution F{x1/s1, x2/s2, . . . , xn/sn}. The task is to provide an example where these two notations yield different results. The key is to find a scenario where the order of substitutions matters due to dependencies between the variables being substituted. We need to demonstrate this difference with a concrete example.
Solution
\subsection*{(a)}
Given $\sigma = \{x/a, y/b, z/g(x, y)\}$ and $F = Q(f(x), z)$, we compute $F \sigma$ by replacing $x$ with $a$, $y$ with $b$, and $z$ with $g(x, y)$ in $F$.
$F \sigma = Q(f(a), g(x, y))$.
However, since the substitution $\sigma$ maps $x$ to $a$, we should substitute $x$ with $a$ in $g(x, y)$ as well. Therefore, the correct result is:
$F \sigma = Q(f(a), g(a, b))$.
\subsection*{(b)}
Consider the formula $F = x + yz$ and the substitutions $\sigma = \{x/y, y/z\}$ and $\theta = \{z/w\}$.
Let's compute $F \sigma \theta$ and $F \sigma \theta$ using both notations.
First, $F \sigma = (y) + (z)(z) = y + z^2$.
Then, $F \sigma \theta = (y) + (w)^2 = y + w^2$.
Now, let's compute $F \theta = x + y(w)$.
Then, $F \theta \sigma = (y) + (z)(w) = y + zw$.
Clearly, $y + w^2 \neq y + zw$. Therefore, $F \sigma \theta \neq F \theta \sigma$.
To illustrate the difference between sequential and simultaneous substitution, let's consider $F = x + yz$ and the substitutions $\{x/y, y/z, z/w\}$.
Using sequential substitution:
$F\{x/y\} = y + yz$
$F\{x/y, y/z\} = z + z^2$
$F\{x/y, y/z, z/w\} = w + w^2$
Using simultaneous substitution:
$F\{x/y, y/z, z/w\} = y + zw$ where $x=y$, $y=z$, and $z=w$. Substituting these into the original formula, we get $y + zw$. Since $y=z$ and $z=w$, we have $z + zw = w + w^2$.
However, if we consider $F = (x+y)z$ and the substitutions $\{x/y, y/z\}$, we can see the difference more clearly.
Sequential substitution:
$F\{x/y\} = (y+y)z = 2yz$
$F\{x/y, y/z\} = 2z^2$
Simultaneous substitution:
$F\{x/y, y/z\} = (y+z)z = yz + z^2$. Since $x=y$ and $y=z$, we have $x=z$. Thus, $F\{x/y, y/z\} = xz + z^2 = z^2 + z^2 = 2z^2$.
The difference arises because in sequential substitution, the substitutions are applied one after another, potentially changing the values of variables that are used in subsequent substitutions. In simultaneous substitution, all substitutions are applied at once, using the original values of the variables. The order of substitution matters when there are dependencies between the variables being substituted.