Variables are placeholders for mathematical objects. In this chapter variables will be placeholders for integers. We use the characters \(a\text{,}\)\(b\text{,}\)\(c\text{,}\) …, \(z\) and \(A\text{,}\)\(B\text{,}\)\(C\text{,}\) …, \(Z\) as variables. Note that when we use a letter as a variable, it is written in italics.
We use variables in several ways, which we describe below. Sometimes we simply want to give a value a name. If we do not assign a concrete value, for example a number, to a variable, we describe what values the variable can have, for example, a natural number. Sometimes, we use a variable that does not have a concrete value in a mathematical statement, such as an equation or an inequality. Finding a solution to such an equation or inequality means finding values for the variables that make the equation or inequality true.
The most concrete use of variables is to assign a value to a variable. To assign a value to the variable \(a\) we say or write “let \(a\) be ” or “let \(a:=\).”
The symbol \(:=\) is used for assignment, which shows that an action is taking place. The symbol \(=\text{,}\) which shows equality, is used in statements. The assignment “let \(a:=\)” changes the value of the variable \(a\text{.}\)
When an equality statement is true, such as \(a = 32\) at the end of Example 1.3.2, we can replace \(32\) with \(a\) (or \(a\) with \(32\)) in other statements and expressions. This replacement is called substitution. Substitution is a basic principle that we will often use without explicitly saying that we have substituted one expression for another expression that is equal to the first. For example, we used substitution when evaluating the expressions in Example 1.1.8. We replaced \(2+3\) with \(5\) because \(2+3 = 5\) is a true equality.
We give an example of using substitution. Let \(a := 32\text{.}\) Since \(32 + 7 = 39\) is a true equality statement, \(a + 7 = 39\) is also a true equality statement.
First, we state what kind of object we mean. We give the object a variable name so we can refer to it. Then we use that variable to state the definition of the property.
The variable \(c\) is defined to be a cup (any cup). We are defining the property full, so full is in italics. We define full to mean that you cannot put anything else in the cup. If you had a cup, you could test to see if you could put anything else in it or not.
Now we define the property non-negative for an integer. The first sentence, “Let \(a\) be an integer,” states the kind of object. The second sentence uses \(a\) and gives the condition for calling it non-negative.
Now instead of saying “\(a\) is an integer and \(a\ge 0\text{,}\)” we can say “\(a\) is a non-negative integer.” In this example, using the definition does not make the statement much shorter than the earlier version. As ideas become more complicated, the vocabulary and notation introduced by definitions become more useful. We start with familiar terms.
Variables let us define the product of a natural number and an integer by repeated addition, as in Example 1.1.6. We name the objects: a natural number and an integer. Then we use those names in the definition.
When we use a variable without assigning it a concrete value, as in Definition 1.3.9, we describe what kind of object we want the variable to be. “Let \(a\) be an integer” means that the variable \(a\) is an integer, and can be any integer.
In Example 1.3.11, Example 1.3.12, and Example 1.3.11 we present statements that are true for all integers. In each example we give two formulations of the same statement.
It is not always this easy to decide whether a “for all” statement is true or false, as the statement often is claimed to be true for infinitely many numbers. We know that a “for all” statement is false when we have found one value for which the statement is wrong. This makes it easier to prove that a statement is false. Values for which a “for all” statement is false are called a counterexample.
We use the “for all.” formulation to state the distributive property for integers. The statement is true for every choice of integers for the three variables.
Example1.3.17.Distributive property formulated with “for all”.
For all integers \(a\text{,}\)\(b\text{,}\) and \(c\) we have \(a\cdot(b+c)=(a\cdot b) + (a\cdot c)\text{.}\) This statement is called the distributive property for the addition and multiplication of integers.
Instead of using “for all \(a\) ” we sometimes choose a different approach for formulating statements. We write “given any \(a\)” or more commonly “let \(a\) be ” followed by what type of object \(a\) is and some other statement or property. The statement that follows applies to any objects of the given type.
We give another common way to state the properties of integer addition and multiplication, shown in Example 1.3.16 and Example 1.3.17, respectively. Instead of using “for all”, we use “let” to introduce the variables and state what kind of numbers they represent. Then we state the property using these variables.
Example1.3.21.Another formulation of the distributive property.
Let \(a\) be an integer, let \(b\) be an integer, and let \(c\) be an integer. Then \(a\cdot(b+c)=(a\cdot b) + (a\cdot c)\text{.}\) We call this the distributive property.
The existence of a number with certain properties can be proven by presenting a number that has these properties. Such a number is called a witness to the validity of the statement. of
So far our use of variables has been in the formulation of statements. Now we give a more hands-on use of them. When evaluating an expression we replace the variables by the values given for them and then compute.
Replacing \(a\) by \(7\) the left hand side of the inequality becomes \(7\cdot(-2)=-14\text{,}\) As \(-14>4\) is false, the statement \(a\cdot(-2)>4\) is false for \(a:=7\text{.}\)