Professional Documents
Culture Documents
Propositional Logic, Predicates and Quantifiers: Antonio Montero
Propositional Logic, Predicates and Quantifiers: Antonio Montero
Antonio Montero
York University
Math1190
Introduction to sets and logic
Winter 2020
Q: how do we do Mathematics?
I We usually do not state facts.
Q: how do we do Mathematics?
I We usually do not state facts.
I Instead, we say things like IF . . . THEN . . . .
Q: how do we do Mathematics?
I We usually do not state facts.
I Instead, we say things like IF . . . THEN . . . .
I An then we PROVE them.
Q: how do we do Mathematics?
I We usually do not state facts.
I Instead, we say things like IF . . . THEN . . . .
I An then we PROVE them.
I Proofs make Mathematics different to other sciences.
Q: how do we do Mathematics?
I We usually do not state facts.
I Instead, we say things like IF . . . THEN . . . .
I An then we PROVE them.
I Proofs make Mathematics different to other sciences.
I The key is to always follow the rules: logic.
Definition
If p is a proposition, then the negation of p, denoted by ¬p, the
proposition that has exactly the opposite truth-vale of p.
p ¬p
T F
F T
Table: The truth-table of ¬p.
Definition
If p is a proposition, then the negation of p, denoted by ¬p, the
proposition that has exactly the opposite truth-vale of p.
p ¬p
T F
F T
Table: The truth-table of ¬p.
Definition
If p is a proposition, then the negation of p, denoted by ¬p, the
proposition that has exactly the opposite truth-vale of p.
p ¬p
T F
F T
Table: The truth-table of ¬p.
Definition
If p is a proposition, then the negation of p, denoted by ¬p, the
proposition that has exactly the opposite truth-vale of p.
p ¬p
T F
F T
Table: The truth-table of ¬p.
Definition
If p and q are propositions, the conjunction p ∧ q is the proposition
“p and q”
Definition
If p and q are propositions, the conjunction p ∧ q is the proposition
“p and q”
p q p∧q
T T T
T F F
F T F
F F F
Definition
If p and q are propositions, the conjunction p ∧ q is the proposition
“p and q”
p q p∧q
T T T
T F F
F T F
F F F
Definition
If p and q are propositions, the conjunction p ∧ q is the proposition
“p and q”
p q p∧q
T T T
T F F
F T F
F F F
Definition
If p and q are propositions, the disjunction p ∨ q is the proposition
“p or q”
Definition
If p and q are propositions, the disjunction p ∨ q is the proposition
“p or q”
p q p∨q
T T T
T F T
F T T
F F F
Definition
If p and q are propositions, the disjunction p ∨ q is the proposition
“p or q”
p q p∨q
T T T
T F T
F T T
F F F
Definition
If p and q are propositions, the disjunction p ∨ q is the proposition
“p or q”
p q p∨q
T T T
T F T
F T T
F F F
Definition
If p and q are propositions, the exclusive or p ⊕ q is the proposition that
has as truth-table
p q p⊕q
T T F
T F T
F T T
F F F
“If you study mathematics, then you will find a good job”
“If you study mathematics, then you will find a good job”
Definition
Let p and q are propositions, then conditional proposition p → q is the
proposition that has the following truth-table
p q p→q
T T T
T F F
F T T
F F T
If p, then q.
If p, then q.
If p, q.
If p, then q.
If p, q.
p if sufficient for q.
If p, then q.
If p, q.
p if sufficient for q.
q if p.
If p, then q.
If p, q.
p if sufficient for q.
q if p.
q when p.
If p, then q.
If p, q.
p if sufficient for q.
q if p.
q when p.
A necessary condition for p is
q.
If p, then q.
If p, q.
p if sufficient for q.
q if p.
q when p.
A necessary condition for p is
q.
q unless ¬p.
If p, then q. p implies q.
If p, q.
p if sufficient for q.
q if p.
q when p.
A necessary condition for p is
q.
q unless ¬p.
If p, then q. p implies q.
If p, q. p only if q
p if sufficient for q.
q if p.
q when p.
A necessary condition for p is
q.
q unless ¬p.
If p, then q. p implies q.
If p, q. p only if q
p if sufficient for q. A sufficient condition for q is
q if p. p.
q when p.
A necessary condition for p is
q.
q unless ¬p.
If p, then q. p implies q.
If p, q. p only if q
p if sufficient for q. A sufficient condition for q is
q if p. p.
q when p. q whenever p.
A necessary condition for p is
q.
q unless ¬p.
If p, then q. p implies q.
If p, q. p only if q
p if sufficient for q. A sufficient condition for q is
q if p. p.
q when p. q whenever p.
A necessary condition for p is q is necessary for p
q.
q unless ¬p.
If p, then q. p implies q.
If p, q. p only if q
p if sufficient for q. A sufficient condition for q is
q if p. p.
q when p. q whenever p.
A necessary condition for p is q is necessary for p
q. q follows from p.
q unless ¬p.
If p, then q. p implies q.
If p, q. p only if q
p if sufficient for q. A sufficient condition for q is
q if p. p.
q when p. q whenever p.
A necessary condition for p is q is necessary for p
q. q follows from p.
q unless ¬p. q provided that p.
Definition
Consider the proposition p → q.
The converse is q → p.
Definition
Consider the proposition p → q.
The converse is q → p.
The contrapositive is ¬q → ¬p.
Definition
Consider the proposition p → q.
The converse is q → p.
The contrapositive is ¬q → ¬p.
The inverse is ¬p → ¬q.
Definition
Consider the proposition p → q.
The converse is q → p.
The contrapositive is ¬q → ¬p.
The inverse is ¬p → ¬q.
Example
Find the converse, the contrapositive and the inverse of
Example
Find the converse, the contrapositive and the inverse of
Definition
Let p and q propositions. The biconditional p ↔ q is the proposition that
is true exactly then p and q have the same truth-value. This reads “p if
and only if q”.
Definition
Let p and q propositions. The biconditional p ↔ q is the proposition that
is true exactly then p and q have the same truth-value. This reads “p if
and only if q”.
Definition
Let p and q propositions. The biconditional p ↔ q is the proposition that
is true exactly then p and q have the same truth-value. This reads “p if
and only if q”.
Definition
Let p and q propositions. The biconditional p ↔ q is the proposition that
is true exactly then p and q have the same truth-value. This reads “p if
and only if q”.
Precedence Operator
1 ¬
∧,
2
∨
→,
3
↔
Precedence Operator
1 ¬
∧,
2
∨
→,
3
↔
So that ¬p → r ∧ s means (¬p) → (r ∧ s) and not ¬ p → (r ∧ s) or
¬(p → r) ∧ s.
Precedence Operator
1 ¬
∧,
2
∨
→,
3
↔
So that ¬p → r ∧ s means (¬p) → (r ∧ s) and not ¬ p → (r ∧ s) or
¬(p → r) ∧ s.
Keep in mind that ∧ and ∨ have the same precedence so that we do
need parenthesis for expressions like p ∧ q ∨ r (this is not the case
with + and −).
1 You study the theory and work on exercises, but you don’t understand
the material.
2 Studying the theory is sufficient for understanding the material.
3 In order to work on exercises, you need to study the theory.
4 When you study the theory and work on exercises, you understand the
material.
5 You don’t understand the material unless you study the theory and
work on exercises.
Definition
A tautology is a proposition that is always true. On the other hand a
contradiction is a proposition that is always false.
Definition
A tautology is a proposition that is always true. On the other hand a
contradiction is a proposition that is always false.
p ∨ ¬p is a tautology.
p ∧ ¬p is a contradiction. (why?)
Definition
A tautology is a proposition that is always true. On the other hand a
contradiction is a proposition that is always false.
p ∨ ¬p is a tautology.
p ∧ ¬p is a contradiction. (why?)
Definition
A tautology is a proposition that is always true. On the other hand a
contradiction is a proposition that is always false.
p ∨ ¬p is a tautology.
p ∧ ¬p is a contradiction. (why?)
p ¬p p ∨ ¬p p ∧ ¬p
T F T F
F T T F
Definition
Let p and q two propositions, we say that p and q are equivalent if the
proposition p ↔ q is a tautology. In this situation, we write
p ≡ q.
Definition
Let p and q two propositions, we say that p and q are equivalent if the
proposition p ↔ q is a tautology. In this situation, we write
p ≡ q.
Q: Given p and q,
how do we prove that p ≡ q?
Q: Given p and q,
how do we prove that p ≡ q?
how do we prove that p 6≡ q?
Q: Given p and q,
how do we prove that p ≡ q?
how do we prove that p 6≡ q?
Q: Given p and q,
how do we prove that p ≡ q?
how do we prove that p 6≡ q?
¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q
¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q
p q ¬p ¬q ¬(p ∧ q) ¬p ∨ ¬q ¬(p ∨ q) ¬p ∧ ¬q
T T F F F F F F
T F F T T T F F
F T T F T T F F
F F T T T T T T
p q ¬p p→q ¬p ∨ q
T T F T T
T F F F F
F T T T T
F F T T T
Example
What is the negation of the sentence “If you study math, then you will get
a good job”?
Example
What is the negation of the sentence “If you study math, then you will get
a good job”?
Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.
Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.
Solution:
¬ (p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) DeMorgan’s law.
Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.
Solution:
¬ (p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) DeMorgan’s law.
≡ ¬p ∧ (¬(¬p) ∨ ¬q) DeMorgan’s law
Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.
Solution:
¬ (p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) DeMorgan’s law.
≡ ¬p ∧ (¬(¬p) ∨ ¬q) DeMorgan’s law
≡ ¬p ∧ (p ∨ ¬q) Double negation.
Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.
Solution:
¬ (p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) DeMorgan’s law.
≡ ¬p ∧ (¬(¬p) ∨ ¬q) DeMorgan’s law
≡ ¬p ∧ (p ∨ ¬q) Double negation.
≡ (¬p ∧ p) ∨ (¬p ∧ ¬q) Distributive law.
Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.
Solution:
¬ (p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) DeMorgan’s law.
≡ ¬p ∧ (¬(¬p) ∨ ¬q) DeMorgan’s law
≡ ¬p ∧ (p ∨ ¬q) Double negation.
≡ (¬p ∧ p) ∨ (¬p ∧ ¬q) Distributive law.
≡ F ∨ (¬p ∧ ¬q) Negation law.
Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.
Solution:
¬ (p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) DeMorgan’s law.
≡ ¬p ∧ (¬(¬p) ∨ ¬q) DeMorgan’s law
≡ ¬p ∧ (p ∨ ¬q) Double negation.
≡ (¬p ∧ p) ∨ (¬p ∧ ¬q) Distributive law.
≡ F ∨ (¬p ∧ ¬q) Negation law.
≡ ¬p ∧ ¬q Identity law.
Example
Let P (x) denote the predicate
x > 3.
Example
Let P (x) denote the predicate
x > 3.
4 > 3,
2 > 3,
Example
Let Q(x, y) denote the predicate
x = y + 3.
Example
Let Q(x, y) denote the predicate
x = y + 3.
In English, we use words as all, some, many, few and none to express
quantification.
In English, we use words as all, some, many, few and none to express
quantification.
Definition
The universal quantification of P (x) is the statement
Definition
The universal quantification of P (x) is the statement
Definition
The universal quantification of P (x) is the statement
Definition
The universal quantification of P (x) is the statement
Example
Let P (x) be the statement
x + 1 > x.
What is the truth value for the proposition ∀x P (x) if the domain consists
of all real numbers?
Example
Let P (x) be the statement
x + 1 > x.
What is the truth value for the proposition ∀x P (x) if the domain consists
of all real numbers?
Example
Let Q(x) be the statement
x < 2.
What is the truth value for the proposition ∀x Q(x) if the domain consists
of the integer numbers?
Example
Let Q(x) be the statement
x < 2.
What is the truth value for the proposition ∀x Q(x) if the domain consists
of the integer numbers?
Solution: Q(x) is not true for every integer, for example Q(3) is F.
Therefore, 3 is a counterexample. Thus ∀x Q(x) is F.
Example
Let S(x) be the statement
x2 > 0.
What is the truth value for the proposition ∀x S(x) if
the domain consists of the integer numbers?
the domain consists of the positive integers?
Example
Let S(x) be the statement
x2 > 0.
What is the truth value for the proposition ∀x S(x) if
the domain consists of the integer numbers?
the domain consists of the positive integers?
Example
Let S(x) be the statement
x2 > 0.
What is the truth value for the proposition ∀x S(x) if
the domain consists of the integer numbers?
the domain consists of the positive integers?
Example
Let S(x) be the statement
x2 > 0.
What is the truth value for the proposition ∀x S(x) if
the domain consists of the integer numbers?
the domain consists of the positive integers?
Example
Let S(x) be the statement
x2 > 0.
What is the truth value for the proposition ∀x S(x) if
the domain consists of the integer numbers?
the domain consists of the positive integers?
Definition
The existential quantification of P (x) is the statement
Definition
The existential quantification of P (x) is the statement
Besides “there exists” we can use “for some”, “for at least one” or
“there is”.
Definition
The existential quantification of P (x) is the statement
Besides “there exists” we can use “for some”, “for at least one” or
“there is”.
The universal quantification depends on the domain. In fact, if the
domain is not specified, the expression ∃x P (x) makes no sense.
Example
Let P (x) be the statement
x > 3.
What is the truth value for the proposition ∃x P (x) if the domain consists
of all real numbers?
Example
Let P (x) be the statement
x > 3.
What is the truth value for the proposition ∃x P (x) if the domain consists
of all real numbers?
Example
Let Q(x) be the statement
x = x + 1.
What is the truth value for the proposition ∃x Q(x) if the domain consists
of the integer numbers?
Example
Let Q(x) be the statement
x = x + 1.
What is the truth value for the proposition ∃x Q(x) if the domain consists
of the integer numbers?
Example
Let Q(x) be the statement
x = x + 1.
What is the truth value for the proposition ∃x Q(x) if the domain consists
of the integer numbers?
Definition
Two propositional formulas P and Q are logically equivalent if any
predicates resulting from them have the same value for any given domain.
We write P ≡ Q
Definition
Two propositional formulas P and Q are logically equivalent if any
predicates resulting from them have the same value for any given domain.
We write P ≡ Q
Example
The formulas ∀x (P (x) ∧ Q(x)) and (∀x P (x)) ∧ (∀x Q(x)) are equivalent.
Example
What is the negation of the statement
Example
What is the negation of the statement
Solution: The statement has the form (∀x G(x)) ∧ (∃x T (x)), hence the
negation is evaluated as follows
Example
Show that the statements ¬ (∀x (P (x) → Q(x))) and ∃x (P (x) ∧ ¬Q(x))
are logically equivalent.
Example
Show that the statements ¬ (∀x (P (x) → Q(x))) and ∃x (P (x) ∧ ¬Q(x))
are logically equivalent.
Solution:
¬ (∀x (P (x) → Q(x)))
Example
Show that the statements ¬ (∀x (P (x) → Q(x))) and ∃x (P (x) ∧ ¬Q(x))
are logically equivalent.
Solution:
¬ (∀x (P (x) → Q(x))) ≡ ∃x ¬ (P (x) → Q(x))
Example
Show that the statements ¬ (∀x (P (x) → Q(x))) and ∃x (P (x) ∧ ¬Q(x))
are logically equivalent.
Solution:
¬ (∀x (P (x) → Q(x))) ≡ ∃x ¬ (P (x) → Q(x))
≡ ∃x ¬ (¬P (x) ∨ Q(x))
Example
Show that the statements ¬ (∀x (P (x) → Q(x))) and ∃x (P (x) ∧ ¬Q(x))
are logically equivalent.
Solution:
¬ (∀x (P (x) → Q(x))) ≡ ∃x ¬ (P (x) → Q(x))
≡ ∃x ¬ (¬P (x) ∨ Q(x))
≡ ∃x (P (x) ∧ ¬Q(x))
“For every student in this class there is a pizza in the menu such that the
student likes the pizza”
“For every student in this class there is a pizza in the menu such that the
student likes the pizza”
“For every student in this class there is a pizza in the menu such that the
student likes the pizza”
“For every student in this class there is a pizza in the menu such that the
student likes the pizza”
“For every student in this class there is a pizza in the menu such that the
student likes the pizza”
∀s ∃p L(s, p)
Example
Consider the expression
∀x ∀y(x + y = y + x)
Example
Consider the expression
∀x ∀y(x + y = y + x)
Example
Consider the expression
∀x ∀y(x + y = y + x)
Example
Two numbers are additive inverse of each other if their sum is 0. How do
we write in symbols the statement “Every real number has an aditive
inverse”?
Example
Consider the expression
∀x ∀y(x + y = y + x)
Example
Two numbers are additive inverse of each other if their sum is 0. How do
we write in symbols the statement “Every real number has an aditive
inverse”?
∀x ∃y (x + y = 0)
Recall the example L(s, p) of the students and the pizzas, and consider
the following two expressions.
Recall the example L(s, p) of the students and the pizzas, and consider
the following two expressions.
No, ∀s∃p L(s, p) says that every student has a favorite pizza, whereas
∃p∀s L(s, p) says that there is a very popular kind of pizza.
∃x (x = 5)
∃x (x = 5) T
∀x∀y(x + y = 5)
∃x (x = 5) T
∀x∀y(x + y = 5) F
∀x∃y(x + y = 5)
∃x (x = 5) T
∀x∀y(x + y = 5) F
∀x∃y(x + y = 5) T
∃y∀y(x + y = 5)
∃x (x = 5) T
∀x∀y(x + y = 5) F
∀x∃y(x + y = 5) T
∃y∀y(x + y = 5) F
∀x∃y∀z(x + y = z)
∃x (x = 5) T
∀x∀y(x + y = 5) F
∀x∃y(x + y = 5) T
∃y∀y(x + y = 5) F
∀x∃y∀z(x + y = z) F
∀x∀z∃y(x + y = z)
∃x (x = 5) T
∀x∀y(x + y = 5) F
∀x∃y(x + y = 5) T
∃y∀y(x + y = 5) F
∀x∃y∀z(x + y = z) F
∀x∀z∃y(x + y = z) T
Example
Let the set of all the students of MATH1190 the domain of the variable x.
Let C(x) be the statement “x has a computer” and let F (x, y) be “x and
y are friends”. Translate the statement to English:
Example
Let the set of all the students of MATH1190 the domain of the variable x.
Let C(x) be the statement “x has a computer” and let F (x, y) be “x and
y are friends”. Translate the statement to English:
Example
∃x∀y∀z (F (x, y) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y, z)
Example
∃x∀y∀z (F (x, y) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y, z)
This says that if y and z are different common friends of x, then they are
not friends.
Example
∃x∀y∀z (F (x, y) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y, z)
This says that if y and z are different common friends of x, then they are
not friends. Then the original statement says that there is a student such
that the previous condition holds for every pair y, z. In other words, there
is a student whose friends are not friends of each other.
Example
Translate the sentence “If a person is female and is a parent, then this
person is somebody’s mother”
Example
Translate the sentence “If a person is female and is a parent, then this
person is somebody’s mother”
Example
Express the statement “Everyone has exactly one best friend” using
B(x, y): “x is best friend of y”
Example
Express the statement “Everyone has exactly one best friend” using
B(x, y): “x is best friend of y”
Solution:
∀x ∃y B(x, y) ∧ ∀z ((y 6= z) → ¬B(x, z))
Example
Compute the negation of (∀x∃y(xy = 1)).
Example
Compute the negation of (∀x∃y(xy = 1)).
Solution:
¬(∀x∃y(xy = 1))
Example
Compute the negation of (∀x∃y(xy = 1)).
Solution:
¬(∀x∃y(xy = 1)) ≡ ∃x¬(∃y(xy = 1))
Example
Compute the negation of (∀x∃y(xy = 1)).
Solution:
¬(∀x∃y(xy = 1)) ≡ ∃x¬(∃y(xy = 1))
≡ ∃x∀y¬(xy = 1)
Example
Compute the negation of (∀x∃y(xy = 1)).
Solution:
¬(∀x∃y(xy = 1)) ≡ ∃x¬(∃y(xy = 1))
≡ ∃x∀y¬(xy = 1)
≡ ∃x∀y(xy 6= 1)