1

I am having trouble calculating some variable assignments.

Let $s$ be a variable assignment over $M=(D,J) $

We define:

$$\begin{align} s(d/x)(y) & = d & \mbox{ if $y$ is identical to $x$} \\ s(d/x)(y) & = s(y) & \mbox{ otherwise} \end{align}$$

Now during an example question, it comes up that if, $x$ is not equal to $y$ then:

$$(s(a/x))(b/y) = (s(b/y))(a/x) \mbox{ for $a,b$ in $M$}$$

If $x=y$ then

$$(s(a/x))(b/y)=s(b/y)$$

Can somebody please show me how these two examples are true, I can not seem to use to definition of s properly to show them.

cf12418
  • 879

1 Answers1

1

In general, with $s(a/x)$ we denote the variable assignment function $s'$ wich is equal to $s$ except eventually for the value assigned to $x$, which is $a$.

Thus, if we call $s(a/x)$ as $s'$, we have that :

$s'(x)=a \ $ and $ \ s'(y)=s(y) \ $, for $y \ne x$.

Now, $(s(a/x))(b/y)=s'(b/y)=s(b/y)$, if $x \ne y$. In conclusion $(s(a/x))(b/y)$ is a function $s''$ such that :

$s''(x)=a, \ s''(y)=b \ $ and $s''(z)=s(z)$, for $z \ne x, z \ne y$.

If we perform the same reasoning with $(s(b/y))(a/x)$ we get the same result.

What about the case $x = y$ ?

$s(b/y)$ is a function $s'$ wich is equal to $s$ except for the value assigned to $y$, which is $b$.

But $x=y$, and thus $s(b/y)(y)=s'(x)=s'(y)=b$, while $(s(a/x))(b/y)=(s(a/x))(b/x)=s(b/x)$.

Thus $(s(a/x))(b/y)(y)=(s(a/x))(b/y)(x)=s(b/x)(x)=b$.