3. Math 121 Notes Propositional Logic
3. Math 121 Notes Propositional Logic
3 PROPOSITIONAL LOGIC
Definition 3.1 (Proposition). A proposition is a declarative sentence that is either true
or false, but not both.
Example 3.1. The following sentences are propositions. Determine their truth or falsity.
(b) Two arbitrary numbers x, y ∈ Q whose sum is an integer are themselves integers.
(c) For every number a ∈ Z there is a number b ∈ Z with the property that a + b = 0.
Solution. (a) The proposition is false. This is because, if there is a number n0 ∈ N such
that n0 + m = m for every m ∈ N then (solving the equation n0 + m = m) n0 = 0.
However, 0 ∈
/ N.
(e) The proposition is true. To justify this we need to show that there exists at least one
element r ∈ N such that 2r = r2 . Let us choose 2 ∈ N. Then 22 = 4 = 22 . Hence
2n = n2 for some n ∈ N.
■
(a) x + 1 = 0.
(b) Is 0 an integer?
Solution. (a) Here, we are unable to determine whether x + 1 = 0 is true or false because
no value(s) has been assigned to x.
[email protected] 1
3 PROPOSITIONAL LOGIC
Propositions are denoted using letters. We usually use p, q, r, s, . . . or P , Q, R, S,
. . . . These letters are called propositional variables or statement variables. The truth
value of a proposition is true, denoted by T, if the proposition is true and false, denoted by F,
if it is a false proposition. We can form new propositions from one or more known propositions
using logical operators. The new propositions formed are called compound propositions.
Logical operators connecting two or more propositions are called connectives. To enable
us display the relationships between the truth values of propositions, we use truth tables.
A truth table is a table that displays how the truth or falsehood of the propositional
variables involved in a compound proposition affect the truth or falsehood of the compound
proposition.
Definition 3.2 (Negation of a proposition). Let p be a proposition. The statement “It
is not the case that p” is a proposition called the negation of p. The negation of p is denoted
by ¬p (also denoted by ∼ p or p̄). The proposition ¬p is read “not p.” The truth value of
¬p is true if p is false, and is false if p is true.
p ¬p
T F
F T
[email protected] 2
3 PROPOSITIONAL LOGIC
p q p∧q
T T T
T F F
F T F
F F F
Table 3.2: The truth table for the conjunction of two propositions
This can be written as “The integer 6 is > 0 and < 8,” or simply “0 < 6 < 8.” ■
Definition 3.4 (Disjunction of two propositions). Let p and q be propositions. The
disjunction of p and q, denoted by p ∨ q, is the proposition “p or q .” The disjunction p ∨ q
is false when both p and q are false and is true otherwise.
p q p∨q
T T T
T F T
F T T
F F F
Table 3.3: The truth table for the disjunction of two proposition.
■
Definition 3.5 (Conditional statement). Let p and q be propositions. The conditional
statement p → q is the proposition “if p, then q.” The conditional statement p → q is false
when p is true and q is false, and true otherwise. In the conditional statement p → q, p
is called the hypothesis (or antecedent or premise) and q is called the conclusion (or
consequence). A conditional statement is also called an implication.
[email protected] 3
3 PROPOSITIONAL LOGIC
p q p→q
T T T
T F F
F T T
F F T
■
We can write q ← p instead of p → q. What is important is the logical relationship, not
the order of writing p and q. In addition to writing “if p, then q,” we can also express p → q
using any of the following terminologies:
1. if p, q
2. q provided that p
3. p is sufficient for q
4. q if p
5. q when p
7. q given that p
8. p implies q
9. p only if q
11. q whenever p
[email protected] 4
3 PROPOSITIONAL LOGIC
c. For every integer c, c is even only if c + 1 is odd.
of the statement
[email protected] 5
3 PROPOSITIONAL LOGIC
p q p↔q
T T T
T F F
F T F
F F T
p if and only if q,
p is necessary and sufficient for q,
if p then q, and conversely.
We specify a rule that determines the order of application of the logical operators. This
is shown in the Table 3.6.
Operator ¬ ∧ ∨ → ↔
Precedence 1 2 3 4 5
Definition 3.7 (Tautology). A compound proposition that is always true, no matter what
the truth values of the propositions that occur in it, is called a tautology.
p ¬p p ∨ ¬p p ∧ ¬p
T F T F
F T T F
Example 3.9. Let q and q be propositions. Construct a truth table for the proposition
¬(p → q) ↔ (p ∧ ¬q).
[email protected] 6
3 PROPOSITIONAL LOGIC
Solution. We obtain the table below.
NB: Here, we see that the proposition ¬(p → q) ↔ (p ∧ ¬q) is a tautology. Note also that
the propositions ¬(p → q) and (p ∧ ¬q) have the same truth values. ■
Example 3.10. Let q, q and r be propositions. Construct a truth table for the proposition
(p ∨ q) → r.
p q r p∨q (p ∨ q) → r
T T T T T
T T F T F
T F T T T
T F F T F
F T T T T
F T F T F
F F T F T
F F F F T
■
Definition 3.9 (Logical equivalence). Compound propositions that have the same truth
values in all possible cases are called logically equivalent. In other words, the compound
propositions p and q are called logically equivalent if p ↔ q is a tautology. The notation
p ⇔ q denotes that p and q are logically equivalent.
Listed in the theorem below are some equivalences of statements that will be particularly
useful.
Theorem 3.1. Let P , Q and R be statements. Let T denote the compound proposition
that is always true and F the compound proposition that is always false.
1. P ∧ T ⇔ P and P ∨ F ⇔ P (Identity Laws).
[email protected] 7
3 PROPOSITIONAL LOGIC
4. ¬(¬P ) ⇔ P (Double Negation).
7. P ∨ (Q ∧ R) ⇔ (P ∨ Q) ∧ (P ∨ R) and P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R) (Distributive
Laws).
14. P → Q ⇔ ¬P ∨ Q and ¬P → Q ⇔ P ∨ Q.
15. P → Q ⇔ ¬Q → ¬P (Contrapositive).
Example 3.11. Let P and Q be propositions. Using a truth table, show that the statements
P → Q and ¬Q → ¬P are logically equivalent.
P Q ¬P ¬Q P → Q ¬Q → ¬P (P → Q) ↔ (¬Q → ¬P )
T T F F T T T
T F F T F F T
F T T F T T T
F F T T T T T
Note that we showed in Table 3.8 that the negation of P → Q is logically equivalent to
P ∧ ¬Q. ■
Example 3.12. Let P (x) be “x3 − 8 > 0” with D = Z. What are the truth values of P (2)
and P (3).
Solution. Let P (x) be “x3 − 8 > 0” with x ∈ Z. The proposition P (2) is “0 > 0,” which is
false. The proposition P (3) is “19 > 0,” which is true. ■
In general, a propositional function involving n variables x1 , x2 , . . . , xn can be denoted by
P (x1 , x2 , . . . , xn ).
[email protected] 8
3 PROPOSITIONAL LOGIC
2
Example 3.13. Let P (x, y) be “x − y < 1” with D = R . What are the truth values of
P (2, 0) and P (0, 2).
Solution. Let P (x, y) be “x − y < 1” with D = R2 . The proposition P (2, 0) is “2 < 1,”
which is false. The proposition P (0, 2) is “−2 < 1,” which is true. ■
Now, we know that when all variables in a propositional function are assigned values,
we obtain a proposition. However, we can also create a proposition from a propositional
function by quantification.
Definition 3.11 (Universal quantification). Let P (x) be a propositional function and let
x ∈ D (D the domain of discourse). The universal quantification of P (x) is the proposition
“P (x) for all x ∈ D,” denoted by ∀xP (x). The symbol ∀ is called the universal quantifier.
The statement ∀xP (x) can be expressed in many ways including the follows:
• for all x ∈ D, P (x)
• for every x ∈ D, P (x)
• for each x ∈ D, P (x)
• if x ∈ D, then P (x)
An example of a universal quantification is the following statement: For all x ∈ R, x2 ≥ 0.
Definition 3.12 (Existential quantification). Let P be a propositional function and let
x ∈ D where D is the domain of discourse. The existential quantification of P (x) is the
proposition “There exists an element x ∈ D such that P (x),” denoted by ∃xP (x). The
symbol ∃ is called the existential quantifier.
∃xP (x) can also be expressed in the following ways.
• There is an x ∈ D such that P (x).
• There is at least one x ∈ D such that P (x).
• For some x ∈ D, P (x).
The notation ∃!xP (x) denotes the proposition “There exists a unique x ∈ D such that
P (x).”
Example 3.14. Determine the truth or falsity of the following.
1. There is x ∈ N such that x ≤ 4.
2. The equation x = x + 1 holds for some x ∈ R.
Solution.
1. Choose 3 ∈ N. We see that 3 ≤ 4. Hence, the statement is true.
2. Suppose that x = x + 1 for some x ∈ R. Then, we get 0 = 1, which is a contradiction.
Hence, the statement is false.
■
[email protected] 9
3 PROPOSITIONAL LOGIC
Note that the negation of a universal statement is an existential statement and the negation
of an existential statement is a universal statement.
In summary, we have the following table.
p ¬p
∃xP (x) ∀x¬P (x)
∀xP (x) ∃x¬P (x)
∀x∀yP (x, y) ∃x∃y¬P (x, y)
∀x∃yP (x, y) ∃x∀y¬P (x, y)
∃x∀yP (x, y) ∀x∃y¬P (x, y)
∃x∃yP (x, y) ∀x∀y¬P (x, y)
3. For every x ∈ Z, x ≥ 0.
Solution.
1. For each x ∈ R, x2 ̸= 2.
NB: Showing that a statement is false entails showing that its negation is true. Thus, to
find a counterexample to the statement ∀xP (x), we must first obtain its negation ∃x¬P (x).
1. For every x ∈ R, x ≥ 0.
2. For all x, y ∈ Z, x + y = x − y.
√
3. For all positive real values of x, 3
x ≤ x.
Solution.
[email protected] 10
3 PROPOSITIONAL LOGIC
1. Choose −1 ∈ R. Then −1 ≱ 0, that is −1 < 0. The statement is false.
EXERCISE THREE
2. Rewrite each of the following implications using at least 5 different terminologies used
to express conditional statements? State the hypothesis and the conclusion.
3. Show that each of the these conditional statements is a tautology by using truth tables.
(a) [∼ p ∧ (p ∨ q)] → q
(b) [(p → q) ∧ (q → r)] → (p → r)
(c) [p ∧ (p → q)] → q
(d) [(p ∨ q) ∧ (p → r)] ∧ (q → r)] → r
4. Write the converse and the contrapositive of the following conditional statements.
[email protected] 11
3 PROPOSITIONAL LOGIC
2
(c) If a ∈ R, then a ≥ 0.
(d) For any (a, b) ∈ Z × Z, a and b are even only if a + b is even.
(e) The integer k is a multiple of 2, if k is a multiple of 4.
6. Determine the truth value of each of the following propositions, where {1, 2, 3} is the
domain of discourse.
7. Determine the truth value of each of the following statements, where R is the domain
of discourse.
(a) ∀x, | x |= x.
(b) ∃x, x2 = x.
(c) ∀x, x + 1 > x.
(d) ∃x, x + 2 = x.
(e) ∃x, x2 − 2x + 5 = 0.
10. Find a counterexample for each of the following where {3, 5, 7, 9} is the universal set.
[email protected] 12
3 PROPOSITIONAL LOGIC
(a) ∀ x, x + 3 ≤ 7.
(b) ∀ x, x is odd.
(c) ∀ x, x is prime.
(d) ∀ x, | x |= x.