substitution

To substitute an expression $e$ for a variable $x$ that occurs in an expression $t$ is to replace every occurrence of $x$ by $e$ (in a sophisticated way – see below). The expression resulting from the substitution has a possibly different denotation which can generally be determined from the syntax.

Example 1 Let $e$ be $x +y$ and $t$ be $2u$. Then substituting $t$ for $x$ in $e$ yields $2u +y$. Citations: (8), (286), (329)

(a) Syntax of substitution The act of substituting may require insertion of parentheses and other adjustments to the expression containing the variable. In general, substituting is not a mechanical act, but requires understanding the syntax of the expression.

Example 2 Substituting $2u$ for $x$ in $x^{2} + 2x +y$ gives $(2u )^{2} + 2(2u ) +y$; note the changes that have to be made from a straight textual substitution.

Example 3 Substituting 4 for $x$ in the expression $3x$ results in 12, not 34 (!).

Example 4 Suppose $f (x, y) = x^{2} - y^{2}$. What is $f (y, x)$? What is $f (x, x)$? Many students have trouble with this kind of question.

See also pattern recognition.

Uniform substitution Although a variate identifier denotes a variable object, or, if you wish, can be instantiated as any one of (usually) many possibilities, all uses of a particular identifier refer to the same object.

Example 5 β€œLet $f : S \to T$ be a surjective function between finite sets. Then $S$ has at least as many elements as $T$” This assertion is a theorem, which means that whenever you can find a function $f : A \to B$ with $A$ and $B$ finite sets, and you substitute $A$ for $S$ and $B$ for $T$, then the statement must be true.

Now, $S$ (as well as $T$) occurs twice in the statement. The claim that the assertion is a theorem is based on substituting the same set $A$ for both occurrences of $S$, and similarly for $T$. Otherwise you could easily make the statement false.

(b) Semantics of substitution A fundamental fact about the syntax and semantics of all mathematical expressions (as far as I know) is that substitution commutes with evaluation. This means that if you replace a subexpression by its value the value of the containing expression remains the same. For example, if you instantiate the variable $x$ in the expression $3x +y$ with 4 and replace the subexpression $3x$ by its value 12, you get the expression $12 +y$, which must have the same value as $3x +y$ as long as $x$ has the value 4. This is a basic fact about manipulating mathematical expressions.

Acknowledgments: Michael Barr.

Pages 236–237 of the book (PDF).