abstractmath.org
help with abstract math
Produced by Charles Wells. Home. Website Contents Website Index
Posted 11 August
2008
THE SYMBOLIC LANGUAGE OF MATH:
|
|
VARIABLES AND SUBSTITUTION
Contents
Images and metaphors for variables
A variable is a symbol that denotes a mathematical object of a certain type, but which object of that type is not specified.
¨
In the expression “ ” the symbol x may denote an unspecified number.
¨ The statement “Let S be a finite set” establishes that in this part of the text, “S” is a variable denoting a set. The only thing you know about the set is that it is finite. Note: Some mathematicians would not refer to “S” as a variable in this context. The usage comes from logic.
The type of a variable determines what can be legally substituted for it. The word “type” is used for variables in a rather limited way in math writing and many mathematicians don’t use it at all.
Generally, the type of a variable determines that the object substituted must be
from some natural and
commonly used set.
¨
In a calculus book the variable x in the expression would (by convention) be of
type real.
¨ In the statement “Let S be a finite set” the variable S would probably be regarded by those who use that terminology as “a variable of type set” with the restriction that the set be finite, rather than “a variable of type finite set”.
In effect, the word “type”, for many mathematicians, is a reference to one of the natural kinds of things used in math, a concept that has psychological reality (for many of us) but not a mathematical definition. This is discussed more extensively in the Handbook.
Abstractmath.org uses the word “type” in this way.
In some limited ways, the type may be used as an adjective before the name of the variable. Thus a real variable is a variable of type real: in other words, a real variable x may have any real number as its value, subject to any constraints that have been put on it. Similarly complex variable, integer variable, set variable.
¨ i, j, k, m, n are generally integer variables.
¨ x, y, z are usually real variables, although z is also customary for complex numbers.
¨ Letters at the beginning of the alphabet usually denote constants or parameters.
¨ If an upper case letter denotes a structure, the same letter in lower case may denote an element of the structure. For example the element a of the set A.
These conventions are not observed universally.
You already know about
substituting values and other expressions for variables. This section is intended to make your implicit
knowledge more explicit.
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 generally different meaning and the meaning can be determined just knowing the old expression and what was substituted.
ExampleLet the expression t = 3 + 5x.
¨
The result of substituting 4 for x in t
is ,
which is 23.
¨ The result of substituting x + y for x in t is 3 + 5(x +y).
Instead of “substitute e for x” people may say “replace x by e” or “plug e into t for x”. There are mathematicians who find the “plug in” terminology offensive.
The act of substituting may require insertion of parentheses and other adjustments to the expression containing the variable.
Substituting
is not a mechanical act.
It requires understanding the form and meaning of the expression.
¨ Substituting
¨ Let e be x+y
and t be
¨ Substituting gives
.
Note the changes that have to be made from a straight textual substitution. Of course, this expression simplifies to
.
¨
Suppose . Then
and
.
All
uses of a particular identifier must refer to the same object.
When I substituted 2u
for x in above, I had to substitute it for both occurrences of x. “Replace the first x by 2u and the second x by W
“ (see case)
gives
,
but that
action is not an example of substitution in the mathematical sense.
This observation is an implicit rule in pattern
recognition. The statement “x + x = 2x” is true whatever real number is substituted for x. So
and
. But of course the statement does not mean
.
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:
If you replace a subexpression by its value
the value of the containing expression remains the same.
ExampleThe expression has two subexpressions, 3x and
.
a) If
you substitute 4 for x and 5 for y in the
expression ,
you get the expression
which equals 37.
b) If
you substitute 4 for x in the
expression 3x, you get 12. If you substitute 5 for y in the expression ,
you get 25. If you substitute 12 for 3x and 25 for
in
,
you get
,
which is also 37.
This is an obvious but basic property of
mathematical expressions. Teachers and students of math almost never see
an explicit statement of it. I believe I have observed students being confused because they
didn’t fully grasp this fact. Whether
that happens often is something the math ed people have not investigated,
as far as I know.
¨ Computer scientists refer to process (a) as top-down
evaluation and process (b) as bottom-up evaluation.
¨ The principle that substitution commutes with evaluation is
behind the definition of algebras for a monad (see ttt, where
monads are called triples.)
You can describe
how to calculate for x =
4 and y = 5 by saying
Substitute 4 for x and 5 for y in .
Doing this requires being familiar with the process of substitution that I described above. You can spell it out more transparently by describing the process:
a) Multiply x by 3.
b) Square y.
c) Add the results of a) and b).
This illustrates the fact that an expression may be associated
with a computational process. The math ed people say the expression encapsulates the process.
See other examples here.
A variable in an expression is either free or bound. It is approximately correct to say:
¨ A variable is free if you can substitute a value for it and the resulting expressions is meaningful.
¨ A variable is bound if the
expression is a statement about all the possible values of the variable all at
once. A bound variable is bound by an
operator such as the integral sign, a quantifier, or a summation sign.
Those
statements are a guide to what “free” and “bound” mean but are not totally
precise they are not mathematical definitions. Precise mathematical definitions of “free” and “bound”
involve technicalities (see Wikipedia).
¨
In the expression “ ”, the x
is a free variable.. You can substitute
¨ In “ ”, the variable x is bound
by the integral
sign. The value of the integral, which is
,
depends on all the
values of x between
.
¨
You
can substitute for the variables a and b in the
integral .
In this expression, a and b are free. You
can substitute a = 3 and b = 5 and get the integral we had in the previous example.
is actually a function of two variables
a and b. You
can even plot it.
¨ In the symbolic assertion “ ”, x is
free. You can substitute
”. You can substitute
”, which is a false assertion but is
nevertheless a
correctly formed assertion with a specific meaning.