CSE 103: Discrete Mathematics
Chapter 1.1.-1.3: Propositional Logic
1 / 21
Outline
1 Propositions
2 Logical Equivalences
Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 1.1-1.3 2 / 21
Propositions
A proposition is a declarative sentence that is either true or false
but not both. Examples of propositions:
The Moon is made of green cheese.
Trenton is the capital of New
Jersey. Toronto is the capital of
Canada.
1+0=1
0+0=2
Examples that are not propositions.
Sit down!
What time is it?
x+1=2
x+y=z
3 / 21
Propositional Logic
Constructing Propositions
Propositional Variables: p, q, r , s, . . .
The proposition that is always true is denoted by T and
the proposition that is always false is denoted by F.
Compound Propositions; constructed from logical connectives and
other propositions
Negation ¬
Conjunction ∧
Disjunction ∨
Implication →
Biconditional ↔
4 / 21
Propositional Logic -
negation
Suppose p is a proposition.
The negation of p is written p and has meaning:
“It is not the case that p.”
Ex. CS1207 is NOT Belal’s favorite class.
p p
Truth table for negation:
T F Notice
F T that p is
a
propositio
n!
Disjunction
The disjunction of propositions p and q is denoted by p ∨ q and
has this truth table:
Disjunction corresponds to English “or.”
p q is when p or q (or both) are true.
Ex. Michael is brave OR nuts.
p q p ∨q
T T T
T F T
F T T
F F F
6 / 21
Conjunction
The disjunction of propositions p and q is denoted by p ∧ q and
has this truth table:
Conjunction corresponds to English “and.”
p q is true exactly when p and q are both true.
Ex. Amy is curious AND clever.
p q p∧q
T T T
T F F
F T F
F F F
7 / 21
Implication
If p and q are propositions, then p → q is a conditional statement
or implication which is read as “if p, then q” and has this truth
table: 2 meaning
1.If p then q that means if p is true then q must be true, the p→q
will be true.
2. p implies q means if p true then q will be true.
p q p →q
T T T
T F F
F T T
F F T
In p → q, p is the hypothesis (antecedent or premise) and q is the
conclusion (or consequence).
Implication can be expressed by p → q ≡ ¬p ∨ q
8 / 21
Understanding Implication
In p → q there does not need to be any connection between the
antecedent or the consequent. The meaning depends only on the
truth values of p and q.
One way to view the logical conditional is to think of an obligation
or contract. “If I am elected, then I will lower taxes.”
Let p = I am elected & q = I will lower taxes
9 / 21
Different Ways of Expressing p → q
if p, then q p implies q
if p, p only if q
q unless ¬p q when p
q if p q
p is sufficient for q whenever
q is necessary for p p
a sufficient q follows
condition for q is p from p
a
necessary
condition
for p is q
10 / 21
Converse, Contrapositive, and Inverse
q → p is the converse of p → q
¬q → ¬p is the contrapositive of p → q
¬p → ¬q is the inverse of p → q
Example: Find the converse, inverse, and contrapositive of
“It is raining is a sufficient condition for my not going to
town.” Solution:
converse: If I do not go to town, then it is raining.
inverse: If it is not raining, then I will go to town.
contrapositive: If I go to town, then it is not
raining.
How do the converse, contrapositive, and inverse
relate to p → q ?
p → q ≡ ¬p ∨ q so ¬(p → q)≡ p ∨ ¬q so p q
q p
converse ≡ contrapositive ?
11 / 21
Biconditional
If p and q are propositions, then the biconditional proposition p ↔ q
has this truth table. “If I am elected, then I will lower taxes.”
p q p ↔q
T T T
T F F
F T F
F F T
p ↔ q also reads as
p if and only if q
p iff q.
p is necessary and
sufficient for q
if p then q, and
conversely 12 / 21
Precedence of Logical Operators
¬
∧
∨
→
↔
Thus p ∨ q → ¬r is equivalent to (p ∨ q) → ¬r .
If the intended meaning is p ∨ (q → ¬r ) then parentheses must be
used.
13 / 21
Satisfiability, Tautology, Contradiction
A proposition is
satisfiable,
if its truth
table
contains
true at
least once.
Example:
p ∧ q.
a
tautology,
if it is
always
true. 14 / 21
Logical Equivalence
Definition
Two compound propositions p and q are logically equivalent if
the columns in a truth table giving their truth values agree.
This is written as p ≡ q.
It is easy to show:
Fact
p ≡ q if and only if p ↔ q is a tautology.
15 / 21
De Morgan’s Laws
¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q
Truth table proving De
Morgan’s second law.
p q ¬p ¬q (p∨q) ¬(p∨q) ¬p∧¬q
T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T T
16 / 21
Important Logical Equivalences
Domination laws: p ∨ T ≡ T, p ∧ F ≡ F
Identity laws: p ∧ T ≡ p, p ∨ F ≡ p
Idempotent laws: p ∧ p ≡ p, p ∨ p ≡ p
Double negation law: ¬(¬p) ≡ p
Negation laws: p ∨ ¬p ≡ T, p ∧ ¬p ≡ F
The first of the Negation laws is also called “law of excluded middle”.
Latin: “tertium non datur”.
Commutative laws: p ∧ q ≡ q ∧ p, p ∨ q ≡ q ∨ p
Associative laws: (p ∧ q) ∧ r ≡ p ∧ (q ∧ r
) (p ∨ q) ∨ r ≡ p ∨ (q ∨
Distributive laws: r)
p ∨ (q ∧ r ) ≡ (p ∨ q) ∧
Absorption laws: (p ∨ r )
p ∧ (q ∨ r ) ≡ (p ∧ q) ∨ (p ∧ r )
p ∨ (p ∧ q) ≡ p, p ∧ (p ∨ q) ≡
p
17 / 21
More Logical Equivalences
18 / 21
A Proof in Propositional Logic
To prove: ¬(p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬q
¬(p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) by De Morgan’s 2nd law
≡ ¬p ∧ (¬(¬p) ∨ ¬q) by De Morgan’s first law
≡ ¬p ∧ (p ∨ ¬q) by the double negation law
≡ (¬p ∧ p) ∨ (¬p ∧ ¬q) by the 2nd distributive law
≡ F ∨ (¬p ∧ ¬q) because ¬p ∧ p ≡ F
≡ (¬p ∧ ¬q) ∨ F by commutativity of disj.
≡ ¬p ∧ ¬q by the identity law for F
19 / 21
Reference:
Discrete Mathematics and Its Applications
- Rosen
20 / 21