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 specify 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 indicates that an action is taking place. The symbol \(=\text{,}\) which indicates equality, is used in statements. The assignment “let \(a:=\)” changes the value of the variable \(a\text{.}\)
When we have a true equality statement, such as \(a = 32\) at the end of Example 1.23, we can replace \(32\) with \(a\) (or \(a\) with \(32\)) in other statements and expressions. This replacement is called substitution, and it is a fundamental principle in mathematics that we will use, often without explicitly mentioning that we have substituted one expression by another expression that is equal to the first. For example, we have already used substitution when evaluating the expressions in Example 1.9. 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 are talking about. To be able to refer to the object in the definition, we give it a variable name. Then we state the definition of the property using the variable name.
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.
We now define the property non-negative for an integer. With the first sentence, “Let \(a\) be an integer,” we indicate for what kind of object we want to define a property. In the second sentence we refer to the integer \(a\) and give the condition under which it is called 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 the statement that uses the definition is not much shorter than the explicit version that we were able to give before. As concepts become more complicated, it will become more convenient to use new vocabulary and notation that we introduce with definitions. We start with well-known terminology.
With variables we can define the product of a natural number and an integer using repeated addition as in Example 1.7. We introduce the objects under consideration, namely a natural number and an integer, and assign variable names. Then we use the variable names in the statement of the definition.
When we use a variable without assigning it a concrete value, as in Definition 1.31, we specify 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.33, Example 1.34, and Example 1.33 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.
Example1.39.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 specified type.
We give another common formulation for the property of integer addition and multiplication, compare Example 1.38 and Example 1.39 respectively. Instead of using the formulation “for all” we introduce the variables and what kind of numbers they represent with “let” and then state the property in terms of these variables.
Example1.43.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.
In Checkpoint 1.44 decide whether the statements are true or false. If a statement is false, proof that it is false by giving a counterexample. That is, give a value of the variable for which the statement is false.
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. We now 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{.}\)