Logic
- Circle X has radius equal to 3.
- If any circle has radius r, then its area is πr2 square units.
You have no trouble putting these two facts together to get:
- Circle X has area 9π square units.
In doing this you are using logic to combine existing information to produce new information. Since a major objective in mathematics is to deduce new information, logic must play a fundamental role. This chapter is intended to give you a sufficient mastery of logic.
It is important to realize that logic is a process of deducing information correctly, not just deducing correct information. For example, suppose we were mistaken and Circle X actually had a radius of 4, not 3. Let’s look at our exact same argument again.
- Circle X has radius equal to 3.
- If any circle has radius r, then its area is πr2 square units.
- Circle X has area 9π square units.
The sentence “Circle X has radius equal to 3.” is now untrue, and so is our conclusion “Circle X has area 9π square units.” But the logic is perfectly correct; the information was combined correctly, even if some of it was false. This distinction between correct logic and correct information is significant because it is often important to follow the consequences of an incorrect assumption. Ideally, we want both our logic and our information to be correct, but the point is that they are different things.
In proving theorems, we apply logic to information that is considered obviously true (such as “Any two points determine exactly one line.”) or is already known to be true (e.g., the Pythagorean theorem). If our logic is correct, then anything we deduce from such information will also be true (or at least as true as the “obviously true” information we began with).
Statements
The study of logic begins with statements. A statement is a sentence or a mathematical expression that is either definitely true or definitely false. You can think of statements as pieces of information that are either correct or incorrect. Thus statements are pieces of information that we might apply logic to in order to produce other pieces of information (which are also statements).Example 1
Here are some examples of statements. They are all true.If a circle has radius r, then its area is πr2 square units.
Every even number is divisible by 2.
The set {0,1,2} has three elements.
Some right triangles are isosceles.
Example 2
Here are some additional statements. They are all false.All right triangles are isosceles.
5 = 2
Example 3
Here we pair sentences or expressions that are not statements with similar expressions that are statements.NOT Statements | Statements |
---|---|
Add 5 to both sides. | Adding 5 to both sides of x − 5 = 37 gives x = 42. |
(The set of integers) |
(42 is an element of the set of integers.) |
42 | 42 is not a number. |
What is the solution of 2x = 84? | The solution of 2x = 84 is 42. |
Example 4
We will often use the letters P, Q, R, and S to stand for specific statements. When more letters are needed we can use subscripts. Here are more statements, designated with letters. You decide which of them are true and which are false.P : For every integer n > 1, the number 2n − 1 is prime.
Q : Every polynomial of degree n has at most n roots.
R : The function f(x) = x2 is continuous.
S1 :
S2 :
Statements can contain variables. Here is an example.
P : If an integer x is a multiple of 6, then x is even.
This is a sentence that is true. (All multiples of 6 are even, so no matter which multiple of 6 the integer x happens to be, it is even.) Since the sentence P is definitely true, it is a statement. When a sentence or statement P contains a variable such as x, we sometimes denote it as P(x) to indicate that it is saying something about x. Thus the above statement can be denoted asP(x) : If an integer x is a multiple of 6, then x is even.
A statement or sentence involving two variables might be denoted P(x, y), and so on.It is quite possible for a sentence containing variables to not be a statement. Consider the following example.
Q(x) : The integer x is even.
Is this a statement? Whether it is true or false depends on just which integer x is. It is true if x = 4 and false if x = 7, etc. But without any stipulations on the value of x it is impossible to say whether Q(x) is true or false. Since it is neither definitely true nor definitely false, Q(x) cannot be a statement. A sentence such as this, whose truth depends on the value of one or more variables, is called an open sentence. The variables in an open sentence (or statement) can represent any type of entity, not just numbers. Here is an open sentence where the variables are functions:R(f, g) : The function f is the derivative of the function g.
This open sentence is true if f(x) = 2x and g(x) = x2. It is false if f(x) = x3 and g(x) = x2, etc. We point out that a sentence such as R(f, g) (that involves variables) can be denoted either as R(f, g) or just R. We use the expression R(f, g) when we want to emphasize that the sentence involves variables.We will have more to say about open sentences later, but for now let’s return to statements.
Statements are everywhere in mathematics. Any result or theorem that has been proved true is a statement. The quadratic formula and the Pythagorean theorem are both statements:
P : The solutions of the equation
Q : If a right triangle has legs of lengths a and b and hypotenuse of length
R : For all numbers a, b, c, n ∈
Here is another statement famous enough to be named. It was first posed in the eighteenth century by the German mathematician Christian Goldbach, and thus is called the Goldbach conjecture:
S : Every even integer greater than 2 is a sum of two prime numbers.
You must agree that S is either true or false. It appears to be true, because when you examine even numbers that are bigger than 2, they seem to be sums of two primes: 4 = 2+2, 6 = 3+3, 8 = 3+5, 10 = 5+5, 12 = 5+7, 100 = 17+83 and so on. But that’s not to say there isn’t some large even number that’s not the sum of two primes. If such a number exists, then S is false. The thing is, in the over 260 years since Goldbach first posed this problem, no one has been able to determine whether it’s true or false. But since it is clearly either true or false, S is a statement.This book is about the methods that can be used to prove that S (or any other statement) is true or false. To prove that a statement is true, we start with obvious statements (or other statements that have been proven true) and use logic to deduce more and more complex statements until finally we obtain a statement such as S. Of course some statements are more difficult to prove than others, and S appears to be notoriously difficult; we will concentrate on statements that are easier to prove.
But the point is this: In proving that statements are true, we use logic to help us understand statements and to combine pieces of information to produce new pieces of information. In the next several sections we explore some standard ways that statements can be combined to form new statements, or broken down into simpler statements.
And, Or, Not
The word “and” can be used to combine two statements to form a new statement. Consider for example the following sentence.R1 : The number 2 is even and the number 3 is odd.
We recognize this as a true statement, based on our common-sense understanding of the meaning of the word “and.” Notice that R1 is made up of two simpler statements:P : The number 2 is even.
Q : The number 3 is odd.
Had one or both of P and Q been false, then R1 would be false. For instance, each of the following statements is false.
R2 : The number 1 is even and the number 3 is odd.
R3 : The number 2 is even and the number 4 is odd.
R4 : The number 3 is even and the number 2 is odd.
P | Q | P ∧ Q |
---|---|---|
T | T | T |
T | F | F |
F | T | F |
F | F | F |
Statements can also be combined using the word “or.” Consider the following four statements.
S1 : The number 2 is even or the number 3 is odd.
S2 : The number 1 is even or the number 3 is odd.
S3 : The number 2 is even or the number 4 is odd.
S4 : The number 3 is even or the number 2 is odd.
P | Q | P ∨ Q |
---|---|---|
T | T | T |
T | F | T |
F | T | T |
F | F | F |
You pay your tuition or you will be withdrawn from school.
You understand that this means that either you pay your tuition or you will be withdrawn from school, but not both. In mathematics we never use the word “or” in such a sense. For us “or” means exactly what is stated in the table for ∨. Thus P ∨ Q being true means one or both of P and Q is true. If we ever need to express the fact that exactly one of P and Q is true, we use one of the following constructions:
P or Q, but not both.
Either P or Q.
If the university official were a mathematician, he might have qualified his statement in one of the following ways.Pay your tuition or you will be withdrawn from school, but not both.
Either you pay your tuition or you will be withdrawn from school.
The number 2 is even.
This statement is true. Now change it by inserting the words “It is not true that” at the beginning:It is not true that the number 2 is even.
This new statement is false.For another example, starting with the false statement “
P | ∼ P |
---|---|
T | F |
F | T |
P : The number 2 is even.
Here are several ways of expressing its negation.∼ P : It’s not true that the number 2 is even.
∼ P : It is false that the number 2 is even.
∼ P : The number 2 is not even.
Conditional Statements
There is yet another way to combine two statements. Suppose we have in mind a specific integer a. Consider the following statement about a.R : If the integer a is a multiple of 6, then a is divisible by 2.
We immediately spot this as a true statement based on our knowledge of integers and the meanings of the words “if” and “then.” If integer a is a multiple of 6, then a is even, so therefore a is divisible by 2. Notice that R is built up from two simpler statements:P : The integer a is a multiple of 6.
Q : The integer a is divisible by 2.
R : If P, then Q.
You can think of P ⇒ Q as being a promise that whenever P is true, Q will be true also. There is only one way this promise can be broken (i.e. be false) and that is if P is true but Q is false. Thus the truth table for the promise P ⇒ Q is as follows:
P | Q | P ⇒ Q |
---|---|---|
T | T | T |
T | F | F |
F | T | T |
F | F | T |
If you pass the final exam, then you will pass the course.
Your professor is making the promise(You pass the exam) ⇒ (You pass the course).
Under what circumstances did she lie? There are four possible scenarios, depending on whether or not you passed the exam and whether or not you passed the course. These scenarios are tallied in the following table.You pass exam | You pass course | (You pass exam) ⇒ (You pass course) |
---|---|---|
T | T | T |
T | F | F |
F | T | T |
F | F | T |
Now consider the third row. In this scenario you failed the exam but still passed the course. How could that happen? Maybe your professor felt sorry for you. But that doesn’t make her a liar. Her only promise was that if you passed the exam then you would pass the course. She did not say passing the exam was the only way to pass the course. Since she didn’t lie, then she told the truth, so there is a T in the third column.
Finally look at the fourth row. In that scenario you failed the exam and you failed the course. Your professor did not lie; she did exactly what she said she would do. Hence the T in the third column.
In mathematics, whenever we encounter the construction “If P, then Q” it means exactly what the truth table for ⇒ expresses. But of course there are other grammatical constructions that also mean P ⇒ Q. Here is a summary of the main ones.
These can all be used in the place of (and mean exactly the same thing as) “If P, then Q.” You should analyze the meaning of each one and convince yourself that it captures the meaning of P ⇒ Q. For example, P ⇒ Q means the condition of P being true is enough (i.e., sufficient) to make Q true; hence “P is a sufficient condition for Q.”
The wording can be tricky. Often an everyday situation involving a conditional statement can help clarify it. For example, consider your professor’s promise:
(You pass the exam) ⇒ (You pass the course)
This means that your passing the exam is a sufficient (though perhaps not necessary) condition for your passing the course. Thus your professor might just as well have phrased her promise in one of the following ways.Passing the exam is a sufficient condition for passing the course.
For you to pass the course, it is sufficient that you pass the exam.
Biconditional Statements
It is important to understand that P ⇒ Q is not the same as Q ⇒ P. To see why, suppose that a is some integer and consider the statements(a is a multiple of 6) ⇒ (a is divisible by 2),
(a is divisible by 2) ⇒ (a is a multiple of 6).
(a is even) ⇒ (a is divisible by 2),
(a is divisible by 2) ⇒ (a is even).
We now introduce a new symbol ⇔ to express the meaning of the statement (P ⇒ Q)∧(Q ⇒ P). The expression P ⇔ Q is understood to have exactly the same meaning as (P ⇒ Q)∧(Q ⇒ P). According to the previous section, Q ⇒ P is read as “P if Q,” and P ⇒ Q can be read as “P only if Q.” Therefore we pronounce P ⇔ Q as “P if and only if Q.” For example, given an integer a, we have the true statement
(a is even) ⇔ (a is divisible by 2),
which we can read as “Integer a is even if and only if a is divisible by 2.”The truth table for ⇔ is shown below. Notice that in the first and last rows, both P ⇒ Q and Q ⇒ P are true (according to the truth table for ⇒), so (P ⇒ Q) ∧ (Q ⇒ P) is true, and hence P ⇔ Q is true. However, in the middle two rows one of P ⇒ Q or Q ⇒ P is false, so (P ⇒ Q)∧(Q ⇒ P) is false, making P ⇔ Q false.
P | Q | P ⇔ Q |
---|---|---|
T | T | T |
T | F | F |
F | T | F |
F | F | T |
Not surprisingly, there are many ways of saying P ⇔ Q in English. The following constructions all mean P ⇔ Q:
The first three of these just combine constructions from the previous section to express that P ⇒ Q and Q ⇒ P. In the last one, the words “and conversely” mean that in addition to “If P, then Q” being true, the converse statement “If Q, then P” is also true.
Truth Tables for Statements
You should now know the truth tables for ∧, ∨, ∼, ⇒ and ⇔. They should be internalized as well as memorized. You must understand the symbols thoroughly, for we now combine them to form more complex statements.For example, suppose we want to convey that one or the other of P and Q is true but they are not both true. No single symbol expresses this, but we could combine them as
(P ∨ Q)∧ ∼ (P ∧ Q),
which literally means:P or Q is true, and it is not the case that both P and Q are true.
This statement will be true or false depending on the truth values of P and Q. In fact we can make a truth table for the entire statement. Begin as usual by listing the possible true/false combinations of P and Q on four lines. The statement (P ∨ Q)∧ ∼ (P ∧ Q) contains the individual statements (P ∨ Q) and (P ∧ Q), so we next tally their truth values in the third and fourth columns. The fifth column lists values for ∼ (P ∧ Q), and these are just the opposites of the corresponding entries in the fourth column. Finally, combining the third and fifth columns with ∧, we get the values for (P ∨ Q)∧ ∼(P ∧ Q) in the sixth column.P | Q | (P ∨ Q) | (P ∧ Q) | ∼(P ∧ Q) | (P ∨ Q)∧ ∼(P ∧ Q) |
---|---|---|---|---|---|
T | T | T | T | F | F |
T | F | T | F | T | T |
F | T | T | F | T | T |
F | F | F | F | T | F |
For another example, consider the following familiar statement concerning two real numbers x and y:
The product xy equals zero if and only if x = 0 or y = 0.
This can be modeled as (xy = 0) ⇔ (x = 0 ∨ y = 0). If we introduce letters P, Q, and R for the statements xy = 0, x = 0 and y = 0, it becomes P ⇔ (Q ∨ R). Notice that the parentheses are necessary here, for without them we wouldn’t know whether to read the statement as P ⇔ (Q ∨ R) or (P ⇔ Q) ∨ R.Making a truth table for P ⇔ (Q ∨ R) entails a line for each T/F combination for the three statements P, Q, and R. The eight possible combinations are tallied in the first three columns of the following table.
P | Q | R | Q ∨ R | P ⇔ (Q ∨ R) |
---|---|---|---|---|
T | T | T | T | T |
T | T | F | T | T |
T | F | T | T | T |
T | F | F | F | F |
F | T | T | T | F |
F | T | F | T | F |
F | F | T | T | F |
F | F | F | F | T |
Notice that when we plug in various values for x and y, the statements P : xy = 0, Q : x = 0 and R : y = 0 have various truth values, but the statement P ⇔ (Q ∨ R) is always true. For example, if x = 2 and y = 3, then P, Q, and R are all false. This scenario is described in the last row of the table, and there we see that P ⇔ (Q ∨ R) is true. Likewise if x = 0 and y = 7, then P and Q are true and R is false, a scenario described in the second line of the table, where again P ⇔ (Q ∨ R) is true. There is a simple reason why P ⇔ (Q ∨ R) is true for any values of x and y: It is that P ⇔ (Q ∨ R) represents (xy = 0) ⇔ (x = 0 ∨ y = 0), which is a true mathematical statement. It is absolutely impossible for it to be false.
This may make you wonder about the lines in the table where P ⇔ (Q ∨ R) is false. Why are they there? The reason is that P ⇔ (Q ∨ R) can also represent a false statement. To see how, imagine that at the end of the semester your professor makes the following promise.
You pass the class if and only if you get an “A” on the final or you get a “B” on the final.
This promise has the form P ⇔ (Q ∨ R), so its truth values are tabulated in the above table. Imagine it turned out that you got an “A” on the exam but failed the course. Then surely your professor lied to you. In fact, P is false, Q is true and R is false. This scenario is reflected in the sixth line of the table, and indeed P ⇔ (Q ∨ R) is false (i.e., it is a lie).The moral of this example is that people can lie, but true mathematical statements never lie.
We close this section with a word about the use of parentheses. The symbol ∼ is analogous to the minus sign in algebra. It negates the expression it precedes. Thus ∼P ∨ Q means (∼P) ∨ Q, not ∼(P ∨ Q). In ∼(P ∨ Q), the value of the entire expression P ∨ Q is negated.
Logical Equivalence
In contemplating the truth table for P ⇔ Q, you probably noticed that P ⇔ Q is true exactly when P and Q are both true or both false. In other words, P ⇔ Q is true precisely when at least one of the statements P ∧ Q or ∼P ∧ ∼Q is true. This may tempt us to say that P ⇔ Q means the same thing as (P ∧ Q)∨(∼P ∧ ∼Q).To see if this is really so, we can write truth tables for P ⇔ Q and (P ∧ Q) ∨ (∼P ∧ ∼Q). In doing this, it is more efficient to put these two statements into the same table, as follows. (This table has helper columns for the intermediate expressions ∼P, ∼Q, (P ∧ Q), and (~P ∧ ∼Q).)
P | Q | ∼P | ∼Q | (P ∧ Q) | (∼P ∧ ∼Q) | (P ∧ Q)∨(∼P ∧ ∼Q) | P ⇔ Q |
---|---|---|---|---|---|---|---|
T | T | F | F | T | F | T | T |
T | F | F | T | F | F | F | F |
F | T | T | F | F | F | F | F |
F | F | T | T | F | T | T | T |
P ⇔ Q = (P ∧ Q)∨(∼P ∧ ∼Q)
and saying that P ⇔ Q and (P ∧ Q)∨(∼P ∧ ∼Q) are logically equivalent.In general, two statements are logically equivalent if their truth values match up line-for-line in a truth table.
Logical equivalence is important because it can give us different (and potentially useful) ways of looking at the same thing. As an example, the following table shows that P ⇒ Q is logically equivalent to (∼Q) ⇒ (∼P).
P | Q | ∼P | ∼Q | (∼Q) ⇒ (∼P) | P ⇒ Q |
---|---|---|---|---|---|
T | T | F | F | T | T |
T | F | F | T | F | F |
F | T | T | F | T | T |
F | F | T | T | T | T |
There are two pairs of logically equivalent statements that come up again and again throughout this book and beyond. They are prevalent enough to be dignified by a special name: DeMorgan’s laws.
Fact: DeMorgan’s Laws
- ∼(P ∧ Q) = (∼P)∨(∼Q)
- ∼(P ∨ Q) = (∼P)∧(∼Q)
P | Q | ~P | ~Q | P ∧ Q | ∼(P ∧ Q) | (∼P)∨(∼Q) |
---|---|---|---|---|---|---|
T | T | F | F | T | F | F |
T | F | F | T | F | T | T |
F | T | T | F | F | T | T |
F | F | T | T | F | T | T |
DeMorgan’s laws can be very useful. Suppose we happen to know that some statement having form ∼(P ∨ Q) is true. The second of DeMorgan’s laws tells us that (∼Q)∧(∼P) is also true, hence ∼P and ∼Q are both true as well. Being able to quickly obtain such additional pieces of information can be extremely useful.
Here is a summary of some significant logical equivalences. Those that are not immediately obvious can be verified with a truth table.
Notice how the distributive law P ∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R) has the same structure as the distributive law p(q + r) = p · q + p · r from algebra. Concerning the associative laws, the fact that P ∧ (Q ∧ R) = (P ∧ Q) ∧ R means that the position of the parentheses is irrelevant, and we can write this as P ∧ Q ∧ R without ambiguity. Similarly, we may drop the parentheses in an expression such as P ∨ (Q ∨ R).
But parentheses are essential when there is a mix of ∧ and ∨, as in P ∨(Q ∧ R). Indeed, P ∨(Q ∧ R) and (P ∨ Q) ∧ R are not logically equivalent.
Negating Statements
Given a statement R, the statement ∼R is called the negation of R. If R is a complex statement, then it is often the case that its negation ∼R can be written in a simpler or more useful form. The process of finding this form is called negating R. In proving theorems it is often necessary to negate certain statements. We now investigate how to do this.We have already examined part of this topic. DeMorgan’s laws
∼ (P ∧Q) = (∼ P)∨(∼ Q)
∼ (P ∨Q) = (∼ P)∧(∼ Q)
Example 5
Consider negating the following statement.R : You can solve it by factoring or with the quadratic formula.
Now, R means (You can solve it by factoring) ∨ (You can solve it with Q.F.), which we will denote as P ∨ Q. The negation of this is∼(P ∨ Q) = (∼P)∧(∼Q).
Therefore, in words, the negation of R is∼R : You can’t solve it by factoring and you can’t solve it with the quadratic formula.
Maybe you can find ∼R without invoking DeMorgan’s laws. That is good; you have internalized DeMorgan’s laws and are using them unconsciously.Example 6
We will negate the following sentence.R : The numbers x and y are both odd.
This statement means (x is odd) ∧ (y is odd), so its negation is~[(x is odd) ∧ (y is odd)] = ∼(x is odd) ∨ ∼(y is odd)
(x is odd) ∧ (y is odd) = (x is even) ∨ (y is even).
∼ R : The number x is even or the number y is even.
∼ R : At least one of x and y is even.
It is not the case that P(x) is true for all natural numbers x.
This means P(x) is false for at least one x. In symbols, this is ∃ x ∈∼ (∀x ∈ S, P(x)) = ∃ x ∈ S, ∼P(x)
∼ (∃ x ∈ S, P(x)) = ∀x ∈ S, ∼P(x)
Logical Inference
Suppose we know that a statement of form P ⇒ Q is true. This tells us that whenever P is true, Q will also be true. By itself, P ⇒ Q being true does not tell us that either P or Q is true (they could both be false, or P could be false and Q true). However if in addition we happen to know that P is true then it must be that Q is true. This is called a logical inference: Given two true statements we can infer that a third statement is true. In this instance true statements P ⇒ Q and P are “added together” to get Q. This is described below with P ⇒ Q and P stacked one atop the other with a line separating them from Q. The intended meaning is that P ⇒ Q combined with P produces Q.
Following are some additional useful logical inferences. The first expresses the obvious fact that if P and Q are both true then the statement P ∧ Q will be true. On the other hand, P ∧ Q being true forces P (also Q) to be true. Finally, if P is true, then P ∨ Q must be true, no matter what statement Q is.

An Important Note
It is important to be aware of the reasons that we study logic. There are three very significant reasons. First, the truth tables we studied tell us the exact meanings of the words such as “and,” “or,” “not,” and so on. For instance, whenever we use or read the “If..., then” construction in a mathematical context, logic tells us exactly what is meant. Second, the rules of inference provide a system in which we can produce new information (statements) from known information. Finally, logical rules such as DeMorgan’s laws help us correctly change certain statements into (potentially more useful) statements with the same meaning. Thus logic helps us understand the meanings of statements and it also produces new meaningful statements.Logic is the glue that holds strings of statements together and pins down the exact meaning of certain key phrases such as the “If..., then” or “For all” constructions. Logic is the common language that all mathematicians use, so we must have a firm grip on it in order to write and understand mathematics.
But despite its fundamental role, logic’s place is in the background of what we do, not the forefront. From here on, the beautiful symbols ∧, ∨, ⇒, ⇔, ∼, ∀ and ∃ are rarely written. But we are aware of their meanings constantly. When reading or writing a sentence involving mathematics we parse it with these symbols, either mentally or on scratch paper, so as to understand the true and unambiguous meaning.