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

Variables. 1

The type of a variable. 1

Substitution. 2

Definition of “substitute” 2

Syntax of substitution. 2

Semantics of substitution. 3

Free and bound. 3

Parameters. 4

Images and metaphors for variables. 4

Role playing. 4

Slot or cell 4

Variable mathematical object 5

Appendix. 5

 

Variables

A variable is a symbol that denotes a mathematical object of a certain type, but which object of that type is not specified.

Examples 

¨  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

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 Text Box: This discussion is limited to the use of the word “type” in connection with variables.  The word has other meaning in math writing as well, for example in the reference to the type of a differential equation.commonly used set

Examples

¨  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. 

Conventions for variable types

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. 

Substitution

You already know about substituting values and other expressions for variables.  This section is intended to make your implicit knowledge more explicit.

Definition of “substitute”

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.

Text Box: There was an IBM “computer” in the 1950’s that you programmed by connect-ing different socket to other ones.  There was a socket for x and other sockets for multiplication, addition, negative sign, and so on.  By hooking the sockets up correctly you could cause a socket to output the value of  whenever a value was plugged into (literally!) the socket representing x.  

Example

Let 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). 

Terminology

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.

Syntax of substitution

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.

Examples

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

¨  Let e be x+y and t be 2u. Then substituting e for u in t yields 2(x + y).  The rules of algebra require you to put x + y in parentheses.  The answer 2x + y would be wrong. 

¨  Substituting 2u for x  in  gives . Note the changes that have to be made from a straight textual substitution.  Of course, this expression simplifies to .

¨  Suppose .   Then  and .

Uniform substitution

All uses of a particular identifier must refer to the same object.

Example

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 . 

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:

 

If you replace a subexpression by its value

 the value of the containing expression remains the same.

Text Box: The phrase “substitution commutes with evaluation” has nothing to do with commutativity of addition or multi¬plication.  It means you can evaluate first, then substitute, or substitute first, then evaluate, and get the same result, as the example illustrates.

Example

The 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.

Remarks

¨  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.)

Expression and process

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.

 

Free and bound

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).

Examples

¨  In the expression “  ”, the x is a free variable.. You can substitute 4 for x in this expression and the result is 17.

¨  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 3 and 5.  If you substitute 4 for x you get nonsense:  .

¨  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 42 for x and get the true assertion “  ”. You can substitute 5 for x and get the assertion “  ”, which is a false assertion but is nevertheless a correctly formed assertion with a specific meaning.