Mathematical Logic Lecture Notes
Mathematical Logic Lecture Notes
Propositional Logic
Solved Problems
A. Define the following:
1. Angle 3. Theorem
2. Polygon 4. Annuity
1. PUP 3. House
Answers:
4. An annuity is a positive amount of money from which regular withdrawals are made.
Truth Table
A truth table lists out all the possible values (true or false) of several statements. For example,
with two statements, A and B, there are four possibilities: both could be true, both could be false,
A could be true and B false, or A could be false and B true.
1
2 CHAPTER 1. PROPOSITIONAL LOGIC
1.1 Propositions
Definition 1
A proposition is a declarative sentence that is either true or false, but not both. If a
proposition is true, then its truth value is “true” and is denoted by T or 1; otherwise, its
truth value is false and is denoted by F or 0.
The building blocks of logic are statements: sentences which must be either true or false. For
example, Mercury is more dense than copper is a statement. We might not know if it is true
or false, but the sentence leaves no third possibility. A sentence like You are 6 feet tall is not
a statement unless it is very clear to whom you refers. Opinions like Paris is beautiful are best
avoided in science, logic, and mathematics because they can be true for some people and false for
others.
Example 1. Determine whether each of the following statements is a proposition or not a propo-
sition. If the given is a proposition, give its truth value (if possible).
7. 1 is a prime number. P, F
√
8. 2 is a irrational number. P, T
14. Buy me a milkshake. NP, This is a command and not a true or false statement
Given a proposition, its truth table shows all its possible truth values.
p p q p q r
1 1 1 1 1 1
0 1 0 1 1 0
0 1 1 0 1
0 0 1 0 0
0 1 1
0 1 0
0 0 1
0 0 0
Definition 2
Let p be a proposition. The negation of p, denoted by ¬p, is the statement “It is not the
case that p.” The proposition ¬p is read “not p.” The truth table for ¬p is
p ¬p
1 0
0 1
3. q : 3 is a composite number.
¬q : 3 is not a composite number.
¬q : 3 is a prime number.
√
4. s : 2 is an irrational number.
√
¬s : 2 is not an irrational number.
√
¬s : 2 is a rational number.
Definition 3
Let p and q be propositions. The conjunction of p and q, denoted by p ∧ q, is the
proposition “p and q”. The conjunction p ∧ q is true when both p and q are true, and is false
otherwise. The propositions p and q are called conjuncts. The truth table of p ∧ q is
p q p∧q
1 1 1
1 0 0
0 1 0
0 0 0
Definition 4
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.
The propositions p and q are called disjuncts. The truth table of p ∨ q is
p q p∨q
1 1 1
1 0 1
0 1 1
0 0 0
Solved Problems
1. Suppose statements A, B, and F were true and C, D, and E were known false. Find the truth
value (true or false) for each of the following:
1. A ∧ C 4. E ∨ F 7. ¬(B ∧ D)
2. ¬(B) ∨ ¬(F ) 5. (A ∧ B) ∨ C 8. (A ∨ B) ∧ C
3. A ∧ B 6. ¬B ∧ D 9. A ∨ (B ∧ C)
6 CHAPTER 1. PROPOSITIONAL LOGIC
Definition 5
Let p and q be propositions. The exclusive or of p and q, denoted by “p Y q” or “p ⊕ q”, is
the proposition that is true when exactly one of p and q is true, and is false otherwise. The
truth table of p Y q is
p q pYq
1 1 0
1 0 1
0 1 1
0 0 0
Example 5.
Definition 6
Let p and q be propositions. The conditional statement p → q is the proposition “If p,
then q.” or “p implies 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). The truth table
of p → q is
p q p→q
1 1 1
1 0 0
0 1 1
0 0 1
1. if p, q 5. q if p
2. p only if q
3. p is sufficient for q
8. q is necessary for p
Remark: If p → q, then
Definition 7
Let p and q be propositions. The biconditional statement p ↔ q is the proposition “p if
and only if q” (or simply “p iff q”). The biconditional statement p ↔ q is true when p and q
have the same truth values, and is false otherwise. Biconditional statements are also called
bi-implications. The truth table of p ↔ q is
p q p↔q
1 1 1
1 0 0
0 1 0
0 0 1
1. Either every rabbit that lay eggs studies at PUP or today is Sunday.
Answer: q ∨ r, T
6. If 2 is an even prime, then either today is Sunday or the moon is made of cheese.
Answer: p → (r ∨ s), F
7. Every rabbit that lay eggs studies at PUP if and only if either the moon is made of cheese
or 2 is an even prime.
Answer: r ↔ (s ∨ p), T
8. If 2 is not an even prime, then every rabbit that lay eggs studies at PUP implies that today
is Sunday.
Answer: ¬p → (q → r), T
9. The moon is made of cheese whenever either 2 is an even prime or today is Sunday.
Answer: (p ∨ r) → s, F, q whenever p is p → q
10. Every rabbit that lay eggs studies at PUP is necessary for 2 is an even prime.
Answer: p → q, T, q is necessary for p
Definition 8
A compound proposition that is always true, no matter what the truth values of the propo-
sitional variables that occur in it, is called a tautology. A compound proposition that is
always false is called a contradiction. A compound proposition that is neither a tautology
nor a contradiction is called a contingency.
1. De Morgan’s Law
(a) ¬(p ∧ q) ↔ ¬p ∨ ¬q
10 CHAPTER 1. PROPOSITIONAL LOGIC
2. ¬(p → q) ↔ (p ∧ ¬q)
Proof using truth tables:
Example 10. Using truth tables, determine if the following compound propositions is a tautology,
contingency, or contradiction.
p q r (p ∨ q) ¬p (¬p ∨ r) (p ∨ q) ∧ (¬p ∨ r) (q ∨ r) y
1 1 1 1 0 1 1 1 1
1 1 0 1 0 0 0 1 1
1 0 1 1 0 1 1 1 1
1 0 0 1 0 0 0 0 1
0 1 1 1 1 1 1 1 1
0 1 0 1 1 1 1 1 1
0 0 1 0 1 1 0 1 1
0 0 0 0 1 1 0 0 1
p q r (p → r) (q → r) (p → r) ∧ (q → r) (p ∨ q) ¬r (p ∨ q) ∧ ¬r y
1 1 1 1 1 1 1 0 0 0
1 1 0 0 0 0 1 1 1 0
1 0 1 1 1 1 1 0 0 0
1 0 0 0 1 0 1 1 1 0
0 1 1 1 1 1 1 0 0 0
0 1 0 1 0 0 1 1 1 0
0 0 1 1 1 1 0 0 0 0
0 0 0 1 1 1 0 1 0 0
3. z : [(p → q) → r] ↔ [p → (q → r)]
p q r (p → q) (p → q) → r (q → r) p → (q → r) z
1 1 1 1 1 1 1 1
1 1 0 1 0 0 0 1
1 0 1 0 1 1 1 1
1 0 0 0 1 1 1 1
0 1 1 1 1 1 1 1
0 1 0 1 0 0 1 0
0 0 1 1 1 1 1 1
0 0 0 1 0 1 1 0