Logic Notes
Logic Notes
Logic Notes
1. Logic Definitions
1.1. Propositions.
Definition 1.1.1. A proposition is a declarative sentence that is either
Notation: Variables are used to represent propositions. The most common variables
used are p, q, and r.
Discussion
Logic has been studied since the classical Greek period ( 600-300BC). The Greeks,
most notably Thales, were the first to formally analyze the reasoning process. Aristo-
tle (384-322BC), the “father of logic”, and many other Greeks searched for universal
truths that were irrefutable. A second great period for logic came with the use of sym-
bols to simplify complicated logical arguments. Gottfried Leibniz (1646-1716) began
this work at age 14, but failed to provide a workable foundation for symbolic logic.
George Boole (1815-1864) is considered the “father of symbolic logic”. He developed
logic as an abstract mathematical system consisting of defined terms (propositions),
operations (conjunction, disjunction, and negation), and rules for using the opera-
tions. It is this system that we will study in the first section.
Boole’s basic idea was that if simple propositions could be represented by pre-
cise symbols, the relation between the propositions could be read as precisely as an
algebraic equation. Boole developed an “algebra of logic” in which certain types of
reasoning were reduced to manipulations of symbols.
1.2. Examples.
Example 1.2.1. “Drilling for oil caused dinosaurs to become extinct.” is a propo-
sition.
1
sarit@gcelt.gov.in
1. LOGIC DEFINITIONS 2
Recall a proposition is a declarative sentence that is either true or false. Here are
some further examples of propositions:
Example 1.2.6. All cows are brown.
Example 1.2.7. The Earth is further from the sun than Venus.
Example 1.2.8. There is life on Mars.
Example 1.2.9. 2 × 2 = 5.
Each proposition can be assigned one of two truth values. We use T or 1 for true
and use F or 0 for false.
Discussion
A sentence like “I can jump and skip” can be thought of as a combination of the
two sentences “I can jump” and “I can skip.” When we analyze arguments or logical
expression it is very helpful to break a sentence down to some composition of simpler
statements.
Truth Table:
p ¬p
T F
F T
Discussion
Truth Table:
p q p∧q
T T T
T F F
F T F
F F F
Discussion
The conjunction operator is the binary operator which, when applied to two propo-
sitions p and q, yields the proposition “p and q”, denoted p∧q. The conjunction p∧q of
p and q is the proposition that is true when both p and q are true and false otherwise.
Truth Table:
p q p∨q
T T T
T F T
F T T
F F F
Discussion
The disjunction operator is the binary operator which, when applied to two propo-
sitions p and q, yields the proposition “p or q”, denoted p ∨ q. The disjunction p ∨ q
of p and q is the proposition that is true when either p is true, q is true, or both are
true, and is false otherwise. Thus, the “or” intended here is the inclusive or. In fact,
the symbol ∨ is the abbreviation of the Latin word vel for the inclusive “or”.
1. LOGIC DEFINITIONS 5
Truth Table:
p q p⊕q
T T F
T F T
F T T
F F F
Discussion
The exclusive or is the binary operator which, when applied to two propositions
p and q yields the proposition “p xor q”, denoted p ⊕ q, which is true if exactly one
of p or q is true, but not both. It is false if both are true or if both are false.
Many times in our every day language we use “or” in the exclusive sense. In logic,
however, we always mean the inclusive or when we simply use “or” as a connective
in a proposition. If we mean the exclusive or it must be specified. For example, in a
restaurant a menu may say there is a choice of soup or salad with a meal. In logic
this would mean that a customer may choose both a soup and salad with their meal.
The logical implication of this statement, however, is probably not what is intended.
To create a sentence that logically states the intent the menu could say that there
is a choice of either soup or salad (but not both). The phrase “either . . . or . . . ” is
normally indicates the exclusive or.
Truth Table:
p q p→q
T T T
T F F
F T T
F F T
• p implies q
• If p, q
• p only if q
• p is a sufficient condition for q
• q if p
• q whenever p
• q is a necessary condition for p
Discussion
The implication p → q is the proposition that is often read “if p then q.” “If p
then q” is false precisely when p is true but q is false. There are many ways to say
this connective in English. You should study the various forms as shown above.
For example, suppose your friend tells you that if you meet her for lunch, she
will give you a book she wants you to read. According to this statement, you would
expect her to give you a book if you do go to meet her for lunch. But what if you do
not meet her for lunch? She did not say anything about that possible situation, so
she would not be breaking any kind of promise if she dropped the book off at your
house that night or if she just decided not to give you the book at all. If either of
these last two possibilities happens, we would still say the implication stated was true
because she did not break her promise.
Exercise 1.8.1. Which of the following statements are equivalent to “If x is even,
then y is odd”? There may be more than one or none.
• ¬p → ¬q is the inverse of p → q.
• ¬q → ¬p is the contrapositive of p → q.
Discussion
We will see later that the converse and the inverse are not equivalent to the
original implication, but the contrapositive ¬q → ¬p is. In other words, p → q and
its contrapositive have the exact same truth values.
1.10. Example.
Example 1.10.1. Implication: If this book is interesting, then I am staying at
home.
Discussion
The converse of your friend’s promise given above would be “if she gives you a
book she wants you to read, then you will meet her for lunch,” and the inverse would
be “If you do not meet her for lunch, then she will not give you the book.” We can
see from the discussion about this statement that neither of these are the same as the
original promise. The contrapositive of the statement is “if she does not give you the
book, then you do not meet her for lunch.” This is, in fact, equivalent to the original
promise. Think about when would this promise be broken. It should be the exact
same situation where the original promise is broken.
1.11. Biconditional. Biconditional Operator, ”if and only if”, has symbol
↔.
Example 1.11.1. p: This book is interesting. q: I am staying at home.
Truth Table:
p q p↔q
T T T
T F F
F T F
F F T
1. LOGIC DEFINITIONS 8
Discussion
When we set out to prove a biconditional statement, we often break the proof
down into two parts. First we prove the implication p → q, and then we prove the
converse q → p.
Another type of “if...then” statement you may have already encountered is the one
used in computer languages. In this “if...then” statement, the premise is a condition
to be tested, and if it is true then the conclusion is a procedure that will be performed.
If the premise is not true, then the procedure will not be performed. Notice this is
different from “if...then” in logic. It is actually closer to the biconditional in logic.
However, it is not actually a logical statement at all since the “conclusion” is really
a list of commands, not a proposition.
Definition 1.12.1. The NAND Operator, which has symbol | (“Sheffer Stroke”),
is defined by the truth table
p q p|q
T T F
T F T
F T T
F F T
Definition 1.12.2. The NOR Operator, which has symbol ↓ (“Peirce Arrow”),
is defined by the truth table
1. LOGIC DEFINITIONS 9
p q p↓q
T T F
T F F
F T F
F F T
Discussion
These two additional operators are very useful as logical gates in a combinatorial
circuit, a topic we will discuss later.
1.13. Example.
Example 1.13.1. Write the following statement symbolically, and then make a
truth table for the statement. “If I go to the mall or go to the movies, then I will not
go to the gym.”
• p = I go to the mall
• q = I go to the movies
• r = I will go to the gym
The proposition can then be expressed as “If p or q, then not r,” or (p ∨ q) → ¬r.
p q r (p ∨ q) ¬r (p ∨ q) → ¬r
T T T T F F
T T F T T T
T F T T F F
T F F T T T
F T T T F F
F T F T T T
F F T F F T
F F F F T T
Discussion
When building a truth table for a compound proposition, you need a row for every
possible combination of T’s and F’s for the component propositions. Notice if there
is only one proposition involved, there are 2 rows. If there are two propositions, there
are 4 rows, if there are 3 propositions there are 8 rows.
1. LOGIC DEFINITIONS 10
Exercise 1.13.1. How many rows should a truth table have for a statement in-
volving n different propositions?
It is not always so clear cut how many columns one needs. If we have only three
propositions p, q, and r, you would, in theory, only need four columns: one for
each of p, q, and r, and one for the compound proposition under discussion, which is
(p ∨ q) → ¬r in this example. In practice, however, you will probably want to have
a column for each of the successive intermediate propositions used to build the final
one. In this example it is convenient to have a column for p ∨ q and a column for ¬r,
so that the truth value in each row in the column for (p ∨ q) → ¬r is easily supplied
from the truth values for p ∨ q and ¬r in that row.
Another reason why you should show the intermediate columns in your truth table
is for grading purposes. If you make an error in a truth table and do not give this
extra information, it will be difficult to evaluate your error and give you partial credit.
Set
The comma in Example 1.13.3 is not necessary to distinguish the order of the
operators, but consider the sentence “If the fish is cooked then dinner is ready and I
am hungry.” Should this sentence be interpreted as f → (r ∧ h) or (f → r) ∧ h, where
f , r, and h are the natural choices for the simple propositions? A comma needs to
1. LOGIC DEFINITIONS 11
be inserted in this sentence to make the meaning clear or rearranging the sentence
could make the meaning clear.
Exercise 1.13.3. Insert a comma into the sentence “If the fish is cooked then
dinner is ready and I am hungry.” to make the sentence mean
(a) f → (r ∧ h)
(b) (f → r) ∧ h
Example 1.13.4. Here we build a truth table for p → (q → r) and (p ∧ q) → r.
When creating a table for more than one proposition, we may simply add the necessary
columns to a single truth table.
p q r q → r p ∧ q p → (q → r) (p ∧ q) → r
T T T T T T T
T T F F T F F
T F T T F T T
T F F T F T T
F T T T F T T
F T F F F T T
F F T T F T T
F F F T F T T
Exercise 1.13.4. Build one truth table for f → (r ∧ h) and (f → r) ∧ h.
The logical operators can be turned into bit operators by thinking of 0 as false
and 1 as true. The obvious substitutions then give the table
0=1 1=0
0∨0=0 0∧0=0 0⊕0=0
0∨1=1 0∧1=0 0⊕1=1
1∨0=1 1∧0=0 1⊕0=1
1∨1=1 1∧1=1 1⊕1=0
Discussion
1. LOGIC DEFINITIONS 12
We can define the bitwise NEGATION of a string and bitwise OR, bitwise AND,
and bitwise XOR of two bit strings of the same length by applying the logical operators
to the corresponding bits in the natural way.
Example 1.14.1.
(a) 11010 = 00101
(b) 11010 ∨ 10001 = 11011
(c) 11010 ∧ 10001 = 10000
(d) 11010 ⊕ 10001 = 01011
2. PROPOSITIONAL EQUIVALENCES 13
2. Propositional Equivalences
2.1. Tautology/Contradiction/Contingency.
Definition 2.1.1. A tautology is a proposition that is always true.
Example 2.1.1. p ∨ ¬p
Discussion
Let us look at the classic example of a tautology, p ∨ ¬p. The truth table
p ¬p p ∨ ¬p
T F T
F T T
The proposition p ∨ ¬(p ∧ q) is also a tautology as the following the truth table
illustrates.
p q (p ∧ q) ¬(p ∧ q) p ∨ ¬(p ∧ q)
T T T F T
T F F T T
F T F T T
F F F T T
Exercise 2.1.1. Build a truth table to verify that the proposition (p ↔ q)∧(¬p∧q)
is a contradiction.
Discussion
A second notation often used to mean statements r and s are logically equivalent
is r ≡ s. You can determine whether compound propositions r and s are logically
equivalent by building a single truth table for both propositions and checking to see
that they have exactly the same truth values.
Notice the new symbol r ⇔ s, which is used to denote that r and s are logically
equivalent, is defined to mean the statement r ↔ s is a tautology. In a sense the
2. PROPOSITIONAL EQUIVALENCES 15
2.3. Examples.
Example 2.3.1. Show that (p → q) ∧ (q → p) is logically equivalent to p ↔ q.
Truth Table:
p q p → q q → p (p → q) ∧ (q → p) p ↔ q
T T T T T T
T F F T F F
F T T F F F
F F T T T T
We exhausted all the possibilities, so the two propositions must be logically equivalent.
2. PROPOSITIONAL EQUIVALENCES 16
Discussion
This example illustrates an alternative to using truth tables to establish the equiv-
alence of two propositions. An alternative proof is obtained by excluding all possible
ways in which the propositions may fail to be equivalent. Here is another example.
p q ¬q p → q ¬(p → q) p ∧ ¬q
T T F T F F
T F T F T T
F T F T F F
F F T T F F
Since the truth values for ¬(p → q) and p∧¬q are exactly the same for all possible
combinations of truth values of p and q, the two propositions are equivalent.
Solution 2. We consider how the two propositions could fail to be equivalent. This
can happen only if the first is true and the second is false or vice versa.
Since it is not possible for the two propositions to have different truth values, they
must be equivalent.
Exercise 2.3.1. Use a truth table to show that the propositions p ↔ q and ¬(p⊕q)
are equivalent.
Exercise 2.3.2. Use the method of Solution 2 in Example 2.3.2 to show that the
propositions p ↔ q and ¬(p ⊕ q) are equivalent.
2. PROPOSITIONAL EQUIVALENCES 17
2.4. Important Logical Equivalences. The logical equivalences below are im-
portant equivalences that should be memorized.
Commutative Laws: p ∨ q ⇔ q ∨ p
p∧q ⇔q∧p
Associative Laws: (p ∨ q) ∨ r ⇔ p ∨ (q ∨ r)
(p ∧ q) ∧ r ⇔ p ∧ (q ∧ r)
Distributive Laws: p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r)
p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r)
Absorption Laws: p ∧ (p ∨ q) ⇔ p
p ∨ (p ∧ q) ⇔ p
2. PROPOSITIONAL EQUIVALENCES 18
Tautology: p ∨ ¬p ⇔ T
Contradiction: p ∧ ¬p ⇔ F
Equivalence: (p → q) ∧ (q → p) ⇔ (p ↔ q)
Discussion
Study carefully what each of these equivalences is saying. With the possible
exceptions of the De Morgan Laws, they are fairly straight-forward to understand.
The main difficulty you might have with these equivalences is remembering their
names.
Example 2.4.1. Use the logical equivalences above and substitution to establish
the equivalence of the statements in Example 2.3.2.
Solution.
¬(p → q) ⇔ ¬(¬p ∨ q) Implication Law
⇔ ¬¬p ∧ ¬q De Morgan’s Law
⇔ p ∧ ¬q Double Negation Law
This method is very similar to simplifying an algebraic expression. You are using
the basic equivalences in somewhat the same way you use algebraic rules like 2x−3x =
(x + 1)(x − 3)
−x or = x + 1.
x−3
Exercise 2.4.1. Use the propositional equivalences in the list of important logical
equivalences above to prove [(p → q) ∧ ¬q] → ¬p is a tautology.
Exercise 2.4.2. Use truth tables to verify De Morgan’s Laws.
Example 2.5.1. Use the logical equivalences above to show that ¬(p ∨ ¬(p ∧ q))
is a contradiction.
Solution.
¬(p ∨ ¬(p ∧ q))
⇔ ¬p ∧ ¬(¬(p ∧ q)) De Morgan’s Law
⇔ ¬p ∧ (p ∧ q) Double Negation Law
⇔ (¬p ∧ p) ∧ q Associative Law
⇔F ∧q Contradiction
⇔F Domination Law and Commutative Law
Example 2.5.2. Find a simple form for the negation of the proposition “If the
sun is shining, then I am going to the ball game.”
Discussion
The main thing we should learn from Examples 2.3.2 and 2.5.2 is that the negation
of an implication is not equivalent to another implication, such as “If the sun is
shining, then I am not going to the ball game” or “If the sun is not shining, I am
going to the ball game.” This may be seen by comparing the corresponding truth
tables:
p q p → ¬q ¬(p → q) ⇔ (p ∧ ¬q) ¬p → q
T T F F T
T F T T T
F T T F T
F F T F F
If you were to construct truth tables for all of the other possible implications of the
form r → s, where each of r and s is one of p, ¬p, q, or ¬q, you will observe that
none of these propositions is equivalent to ¬(p → q).
2. PROPOSITIONAL EQUIVALENCES 20
(1) ¬(p → r) ∨ q
(2) (p ∧ ¬r) ∨ q
(3) (¬p → ¬r) ∨ q
(4) q → (p → r)
(5) ¬q → (¬p → ¬r)
(6) ¬q → (¬p ∨ r)
(7) ¬q → ¬(p → r)
Exercise 2.5.2. Which of the following is the negation of the statement “If you
go to the beach this weekend, then you should bring your books and study”?
(1) If you do not go to the beach this weekend, then you should not bring your
books and you should not study.
(2) If you do not go to the beach this weekend, then you should not bring your
books or you should not study.
(3) If you do not go to the beach this weekend, then you should bring your books
and study.
(4) You will not go to the beach this weekend, and you should not bring your
books and you should not study.
(5) You will not go to the beach this weekend, and you should not bring your
books or you should not study.
(6) You will go to the beach this weekend, and you should not bring your books
and you should not study.
(7) You will go to the beach this weekend, and you should not bring your books
or you should not study.
Exercise 2.5.3. p is the statement “I will prove this by cases”, q is the statement
“There are more than 500 cases,” and r is the statement “I can find another way.”
2.6. Implication.
Definition 2.6.1. We say the proposition r implies the proposition s and write
r ⇒ s if r → s is a tautology.
2. PROPOSITIONAL EQUIVALENCES 21
This is very similar to the ideas previously discussed regarding the ⇔ verses ↔.
We use r ⇒ s to imply that the statement r → s is true, while that statement r → s
alone does not imply any particular truth value. The symbol ⇒ is often used in proofs
as a shorthand for “implies.”
Exercise 2.6.1. Prove (p → q) ∧ ¬q ⇒ ¬p.
Exercise 2.6.2. Prove p ∧ (p → q) → ¬q is a contingency using a truth table.
Exercise 2.6.3. Prove p → (p ∨ q) is a tautology using a verbal argument.
Exercise 2.6.4. Prove (p ∧ q) → p is a tautology using the table of propositional
equivalences.
Exercise 2.6.5. Prove [(p → q) ∧ (q → r)] ⇒ (p → r) using a truth table.
Exercise 2.6.6. Prove [(p ∨ q) ∧ ¬p] ⇒ q using a verbal argument.
Exercise 2.6.7. Prove (p ∧ q) → (p ∨ q) is a tautology using the table of proposi-
tional equivalences.
Discussion
2.8. Examples.
Example 2.8.1. Construct a proposition in disjunctive normal form that is true
precisely when
Solution. (p ∧ ¬q) ∨ (p ∧ q)
(3) either p is true or q is true, and r is false
Solution. (p ∨ q) ∧ ¬r ⇔ (p ∧ ¬r) ∨ (q ∧ ¬r) (Distributive Law)
2. PROPOSITIONAL EQUIVALENCES 22
Discussion
The methods by which we arrived at the disjunctive normal form in these examples
may seem a little ad hoc. We now demonstrate, through further examples, a sure-fire
method for its construction.
p q p→q
T T T ←
T F F
F T T ←
F F T ←
Discussion
This example shows how a truth table can be used in a systematic way to construct
the disjunctive normal forms. Here is another example.
Example 2.9.2. Construct the disjunctive normal form of the proposition
(p → q) ∧ ¬r
p q r p → q ¬r (p → q) ∧ ¬r
T T T T F F
T T F T T T
T F T F F F
F T T T F F
T F F F T F
F T F T T T
F F T T F F
F F F T T T
The disjunctive normal form will be a disjunction of three conjunctions, one for each
row in the truth table that gives the truth value T for (p → q) ∧ ¬r. These rows have
been boxed. In each conjunction we will use p if the truth value of p in that row is T
and ¬p if the truth value of p is F, q if the truth value of q in that row is T and ¬q if
the truth value of q is F, etc. The disjunctive normal form for (p → q) ∧ ¬r is then
(p ∧ q ∧ ¬r) ∨ (¬p ∧ q ∧ ¬r) ∨ (¬p ∧ ¬q ∧ ¬r),
because each of these conjunctions is true only for the combination of truth values of
p, q, and r found in the corresponding row. That is, (p ∧ q ∧ ¬r) has truth value T
only for the combination of truth values in row 2, (¬p ∧ q ∧ ¬r) has truth value T only
for the combination of truth values in row 6, etc. Their disjunction will be true for
precisely the three combinations of truth values of p, q, and r for which (p → q) ∧ ¬r
is also true.
Thus, if you want to get the conjunctive normal form of a proposition, construct the
disjunctive normal form of its negation and then negate again and apply De Morgan’s
Laws.
Example 2.10.1. Find the conjunctive normal form of the proposition (p∧¬q)∨r.
Solution.
p q r ¬p ¬r ¬p ∨ q (¬p ∨ q) ∧ ¬r
T T T F F T F
T T F F T T T
T F T F F F F
F T T T F T F
T F F F T F F
F T F T T T T
F F T T F T F
F F F T T T T
The disjunctive normal form for (¬p ∨ q) ∧ ¬r is
(p ∧ q ∧ ¬r) ∨ (¬p ∧ q ∧ ¬r) ∨ (¬p ∧ ¬q ∧ ¬r).
(3) The conjunctive normal form for (p ∧ ¬q) ∨ r is then the negation of this last
expression, which, by De Morgan’s Laws, is
(¬p ∨ ¬q ∨ r) ∧ (p ∨ ¬q ∨ r) ∧ (p ∨ q ∨ r).
3. PREDICATES AND QUANTIFIERS 25
Discussion
Recall from the introduction to logic that the sentence “x + 2 = 2x” is not a
proposition, but if we assign a value for x then it becomes a proposition. The phrase
“x + 2 = 2x” can be treated as a function for which the input is a value of x and the
output is a proposition.
Another way we could turn this sentence into a proposition is to quantify its
variable. For example, “for every real number x, x + 2 = 2x” is a proposition (which
is, in fact, false, since it fails to be true for the number x = 0).
In general, the set of all x in the universe of discourse having the attibute P (x) is
called the truth set of P (x). That is, the truth set of P (x) is
{x ∈ U |P (x)}.
Discussion
Moral: Be very careful in your homework to specify the universe of discourse pre-
cisely!
universal quantifier
and the
existential quantifier.
Definition 3.3.1. The universal quantification of P (x) is the proposition
“There exists an element x in the universe of discourse such that P (x) is true.”
Notation: “There exists x such that P (x)” or “There is at least one x such that
P (x)” is written
∃xP (x).
Discussion
3. PREDICATES AND QUANTIFIERS 27
• ∀xP (x) is the proposition “For every x in {1, 2, 3} x + 2 = 2x.” This propo-
sition is false.
• ∃xP (x) is the proposition “There exists x in {1, 2, 3} such that x + 2 = 2x.”
This proposition is true.
Exercise 3.4.1. Let P (n, m) be the predicate mn > 0, where the domain for m
and n is the set of integers. Which of the following statements are true?
(1) P (−3, 2)
(2) ∀mP (0, m)
(3) ∃nP (n, −3)
F (x): x is a fox.
S(x): x is sly.
T (x): x is trustworthy.
and the universe of discourse for all three functions is the set of all animals.
Discussion
3. PREDICATES AND QUANTIFIERS 28
Notice that in this example the last proposition may be written symbolically in
the two ways given. Think about the how you could show they are the same using
the logical equivalences in Module 2.2.
Discussion
You would not be asked to state the definitions of the terminology given, but you
would be expected to know what is meant if you are asked a question like “Which of
the following assertions are satisfiable?”
3.7. Examples.
Example 3.7.1.
(1) If P (x) is the predicate x2 > 0, then ∀xP (x) is false, since P (0) is false.
(2) If P (x) is the predicate x2 − 3x − 4 = 0, then ∃xP (x) is true, since P (−1)
is true.
(3) If P (x) is the predicate x2 + x + 1 = 0, then ∃xP (x) is false, since there are
no real solutions to the equation x2 + x + 1 = 0.
(4) If P (x) is the predicate “If x 6= 0, then x2 ≥ 1’, then ∀xP (x) is false, since
P (0.5) is false.
Exercise 3.7.1. In each of the cases above give the truth value for the statement
if each of the ∀ and ∃ quantifiers are reversed.
3. PREDICATES AND QUANTIFIERS 29
3.8. Multiple Quantifiers. Multiple quantifiers are read from left to right.
Example 3.8.1. Suppose P (x, y) is “xy = 1”, the universe of discourse for x
is the set of positive integers, and the universe of discourse for y is the set of real
numbers.
(1) ∀x∀yP (x, y) may be read “For every positive integer x and for every real
number y, xy = 1. This proposition is false.
(2) ∀x∃yP (x, y) may be read “For every positive integer x there is a real number
y such that xy = 1. This proposition is true.
(3) ∃y∀xP (x, y) may be read “There exists a real number y such that, for every
positive integer x, xy = 1. This proposition is false.
Discussion
Study the syntax used in these examples. It takes a little practice to make it come
out right.
For example,
Discussion
The lesson here is that you have to pay careful attention to the order of the
quantifiers. The only cases in which commutativity holds are the cases in which both
quantifiers are the same. In the one case in which equivalence does not hold,
∀x∃yP (x, y) 6⇔ ∃y∀xP (x, y),
there is an implication in one direction. Notice that if ∃y∀xP (x, y) is true, then there
is an element c in the universe of discourse for y such that P (x, c) is true for all x in
the universe of discourse for x. Thus, for all x there exists a y, namely c, such that
P (x, y). That is, ∀x∃yP (x, y). Thus,
∃y∀xP (x, y) ⇒ ∀x∃yP (x, y).
Notice predicates use function notation and recall that the variable in function
notation is really a place holder. The statement ∀x∃yP (x, y) means the same as
3. PREDICATES AND QUANTIFIERS 30
∀s∃tP (s, t). Now if this seems clear, go a step further and notice this will also mean
the same as ∀y∃xP (y, x). When the domain of discourse for a variable is defined it
is in fact defining the domain for the place that variable is holding at that time.
(1) ∃x∀yR(x, y) is the proposition “There exists a student in this class who un-
derstands every example in these lecture notes.”
(2) ∀y∃xR(x, y) is the proposition “For every example in these lecture notes there
is a student in the class who understands that example.”
(3) ∀x∃yR(x, y) is the proposition “Every student in this class understands at
least one example in these notes.”
(4) ∃y∀xR(x, y) is the proposition “There is an example in these notes that every
student in this class understands.”
Exercise 3.9.1. Each of the propositions in Example 3.9.2 has a slightly different
meaning. To illustrate this, set up the following diagrams: Write the five letters
A, B, C, D, E on one side of a page, and put the numbers 1 through 6 on the other
side. The letters represent students in the class and the numbers represent examples.
For each of the propositions above draw the minimal number of lines connecting people
to examples so as to construct a diagram representing a scenario in which the given
proposition is true.
Notice that for any chosen pair of propositions above, you can draw diagrams that
would represent situations where the two propositions have opposite truth values.
Exercise 3.9.2. Give a scenario where parts 1 and 2 in Example 3.9.2 have
opposite truth values.
3. PREDICATES AND QUANTIFIERS 31
Exercise 3.9.3. Let P (x, y) be the predicate 2x + y = xy, where the domain of
discourse for x is {u ∈ Z|u 6= 1} and for y is {u ∈ Z|u 6= 2}. Determine the truth
value of each statement. Show work or briefly explain.
(1) P (−1, 1)
(2) ∃xP (x, 0)
(3) ∃yP (4, y)
(4) ∀yP (2, y)
(5) ∀x∃yP (x, y)
(6) ∃y∀xP (x, y)
(7) ∀x∀y[((P (x, y)) ∧ (x > 0)) → (y > 1)]
Notation: “There exists unique x such that P (x)” or “There is exactly one x P (x)”
is written
∃!xP (x).
Discussion
Exercise 3.10.1. Let P (n, m) be the predicate mn ≥ 0, where the domain for m
and n is the set of integers. Which of the following statements are true?
Exercise 3.10.2. Repeat Exercise 3.9.1 for the four propositions ∀x∃!yR(x, y),
∃!y∀xR(x, y), ∃!x∀yR(x, y), and ∀y∃!xR(x, y).
Remember: A predicate is not a proposition until all variables have been bound
either by quantification or by assignment of a value!
3. PREDICATES AND QUANTIFIERS 32
Discussion
The negation of a quantified statement are obtained from the De Morgan’s Laws
in Module 2.1.
So the negation of the proposition “Every fish in the sea has gills,” is the propo-
sition “there is at least one fish in the sea that does not have gills.”
If there is more than one quantifier, then the negation operator should be passed
from left to right across one quantifier at a time, using the appropriate De Morgan’s
Law at each step. Continuing further with Example 3.9.2, suppose we wish to negate
the proposition “Every student in this class understands at least one example in these
notes.” Apply De Morgan’s Laws to negate the symbolic form of the proposition:
The first proposition could be read “It is not the case that every student in this
class understands at least one example in these notes.” The goal, however, is to find
an expression for the negation in which the verb in each predicate in the scope of the
quantifiers is negated, and this is the intent in any exercise, quiz, or test problem that
asks you to “negate the proposition ... .” Thus, a correct response to the instruction to
negate the proposition “Every student in this class understands at least one example
in these notes” is the proposition “There is at least one student in this class that does
not understand any of the examples in these notes.”
Exercise 3.11.1. Negate the rest of the statements in Example 3.9.2.
It is easy to see why each of these rules of negation is just another form of De Mor-
gan’s Law, if you assume that the universe of discourse is finite: U = {x1 , x2 , ..., xn }.
For example,
∀xP (x) ⇔ P (x1 ) ∧ P (x2 ) ∧ · · · ∧ P (xn )
so that
3. PREDICATES AND QUANTIFIERS 33
(1) ∀y¬S(Margaret, y)
(2) ∃y∀xL(x, y)
(3) ∃x∀y[C(y) → S(x, y)]
(4) Give the negation for part 3 in symbolic form with the negation symbol to the
right of all quantifiers.
(5) state the negation of part 3 in English without using the phrase ”it is not the
case.”
Exercise 3.11.3. Suppose the universe of discourse for x is the set of all FSU
students, the universe of discourse for y is the set of courses offered at FSU, A(y) is
the predicate “y is an advanced course,” F (x) is “x is a freshman,” T (x, y) is “x is
taking y,” and P (x, y) is “x passed y.” Use quantifiers to express the statements
Here is a formidable example from the calculus. Suppose a and L are fixed real
numbers, and f is a real-valued function of the real variable x. Recall the rigorous
definition of what it means to say “the limit of f (x) as x tends to a is L”:
lim f (x) = L ⇔
x→a
for every > 0 there exists δ > 0 such that, for every x,
3. PREDICATES AND QUANTIFIERS 34
Here, the universe of discourse for the variables , δ, and x is understood to be the
set of all real numbers.
There exists > 0 such that, for every δ > 0 there exists x such that,
0 < |x − a| < δ and |f (x) − L| ≥ .
Discussion
Here we see that in only half of the four basic cases does a quantifier distribute
over an operator, in the sense that doing so produces an equivalent proposition.
Exercise 3.12.1. In each of the two cases in which the statements are not equiv-
alent, there is an implication in one direction. Which direction? In order to help you
analyze these two cases, consider the predicates P (x) = [x ≥ 0] and Q(x) = [x < 0],
where the universe of discourse is the set of all real numbers.
Exercise 3.12.2. Write using predicates and quantifiers.
(1) For every m, n ∈ N there exists p ∈ N such that m < p and p < n.
(2) For all nonnegative real numbers a, b, and c, if a2 + b2 = c2 , then a + b ≥ c.
3. PREDICATES AND QUANTIFIERS 35
1
(3) There does not exist a positive real number a such that a + < 2.
a
(4) Every student in this class likes mathematics.
(5) No student in this class likes mathematics.
(6) All students in this class that are CS majors are going to take a 4000 level
math course.
Exercise 3.12.3. Give the negation of each statement in example 3.12.2 using
predicates and quantifiers with the negation to the right of all quantifiers.
Exercise 3.12.4. Give the negation of each statement in example 3.12.2 using an
English sentence.