You are on page 1of 238

1.

Propositional logic, predicates and quantifiers

Antonio Montero

York University

Math1190
Introduction to sets and logic
Winter 2020

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 1 / 59


Table of contents:
1 Propositions
2 Logical connectors
Negation
Conjunction
Disjunction
Conditionals
Biconditionals
3 Applications
4 Logical equivalences
DeMorgan’s laws
Other examples
5 Predicates and Quantifiers
Quantifiers
Nested quantifiers

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 2 / 59


Q: what is Mathematics?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 3 / 59


Q: what is Mathematics?
I The truth, I don’t know.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 3 / 59


Q: what is Mathematics?
I The truth, I don’t know.
I I usually think of them as a language to communicate ideas.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 3 / 59


Q: what is Mathematics?
I The truth, I don’t know.
I I usually think of them as a language to communicate ideas.

Q: how do we do Mathematics?
I We usually do not state facts.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 3 / 59


Q: what is Mathematics?
I The truth, I don’t know.
I I usually think of them as a language to communicate ideas.

Q: how do we do Mathematics?
I We usually do not state facts.
I Instead, we say things like IF . . . THEN . . . .

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 3 / 59


Q: what is Mathematics?
I The truth, I don’t know.
I I usually think of them as a language to communicate ideas.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 3 / 59


Q: what is Mathematics?
I The truth, I don’t know.
I I usually think of them as a language to communicate ideas.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 3 / 59


Q: what is Mathematics?
I The truth, I don’t know.
I I usually think of them as a language to communicate ideas.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 3 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!
Is today Wednesday?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!
Is today Wednesday? NO!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!
Is today Wednesday? NO!
The area of a square of side 1 is 35.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!
Is today Wednesday? NO!
The area of a square of side 1 is 35. YES!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!
Is today Wednesday? NO!
The area of a square of side 1 is 35. YES!
x + 1 = 2.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!
Is today Wednesday? NO!
The area of a square of side 1 is 35. YES!
x + 1 = 2. NO!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!
Is today Wednesday? NO!
The area of a square of side 1 is 35. YES!
x + 1 = 2. NO!
a2 + b2 = c2 .

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions
Definition
A proposition is a declarative sentence that is either true or false

Example: are the following sentences propositions?


The Moon is made of cheese. YES!
Sit down! NO!
Toronto is the capital of Canada. YES!
1 + 1 = 3. YES!
What time is it? NO!
Is today Wednesday? NO!
The area of a square of side 1 is 35. YES!
x + 1 = 2. NO!
a2 + b2 = c2 . NO!

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 4 / 59


Propositions

We use Propositional Variables: p, q, r . . .

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 5 / 59


Propositions

We use Propositional Variables: p, q, r . . .

If a proposition is true we say that its truth-value is “true” (or T).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 5 / 59


Propositions

We use Propositional Variables: p, q, r . . .

If a proposition is true we say that its truth-value is “true” (or T).

Similarly, if a proposition is false we say that its truth-value is “false”


(or F).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 5 / 59


Propositions

We use Propositional Variables: p, q, r . . .

If a proposition is true we say that its truth-value is “true” (or T).

Similarly, if a proposition is false we say that its truth-value is “false”


(or F).

If a proposition that cannot be expressed in terms of simpler


propositions is called atomic, otherwise it is called compound.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 5 / 59


Propositions

We use Propositional Variables: p, q, r . . .

If a proposition is true we say that its truth-value is “true” (or T).

Similarly, if a proposition is false we say that its truth-value is “false”


(or F).

If a proposition that cannot be expressed in terms of simpler


propositions is called atomic, otherwise it is called compound.
I My shirt is black.
I My shirt is black and my jeans are blue.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 5 / 59


Compound proposition and logical operators
Negation

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 6 / 59


Compound proposition and logical operators
Negation

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.

The propositions p and ¬p cannot have the same truth-value.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 6 / 59


Compound proposition and logical operators
Negation

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.

The propositions p and ¬p cannot have the same truth-value.


¬p can be read as “not p” or “it is not the case that p”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 6 / 59


Compound proposition and logical operators
Negation

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.

The propositions p and ¬p cannot have the same truth-value.


¬p can be read as “not p” or “it is not the case that p”.
Other forms of denoting ¬p: p̃, −p, p̄, p0 , !p.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 6 / 59


Compound proposition and logical operators
Negation

Find the negation of the following propositions:


Antonio’s computer runs Linux.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 7 / 59


Compound proposition and logical operators
Negation

Find the negation of the following propositions:


Antonio’s computer runs Linux.
Betty loves pizza.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 7 / 59


Compound proposition and logical operators
Negation

Find the negation of the following propositions:


Antonio’s computer runs Linux.
Betty loves pizza.
The Earth is round.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 7 / 59


Compound proposition and logical operators
Conjunction

Definition
If p and q are propositions, the conjunction p ∧ q is the proposition

“p and q”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 8 / 59


Compound proposition and logical operators
Conjunction

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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 8 / 59


Compound proposition and logical operators
Conjunction

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

In other words p ∧ q is true exactly when both p and q are true.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 8 / 59


Compound proposition and logical operators
Conjunction

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

In other words p ∧ q is true exactly when both p and q are true.


If p is “The Earth is round” and q is “The Earth travels around the
Sun”, what is p ∧ q?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 8 / 59


Compound proposition and logical operators
Disjunction

Definition
If p and q are propositions, the disjunction p ∨ q is the proposition

“p or q”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 9 / 59


Compound proposition and logical operators
Disjunction

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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 9 / 59


Compound proposition and logical operators
Disjunction

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

In other words p ∨ q is true exactly when any, p or q is true.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 9 / 59


Compound proposition and logical operators
Disjunction

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

In other words p ∨ q is true exactly when any, p or q is true.


Find p and q such that “Marco and Jessica will drink coffee or go to
the movies tonight” is p ∨ q.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 9 / 59


Compound proposition and logical operators
A note on “or”

When the sentence “I will use all my savings to go to Europe or to


buy a new car” is true?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 10 / 59


Compound proposition and logical operators
A note on “or”

When the sentence “I will use all my savings to go to Europe or to


buy a new car” is true?

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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 10 / 59


Compound proposition and logical operators

We can now build very complicated propositions using ¬, ∧ and ∨ (and


even ⊕):

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 11 / 59


Compound proposition and logical operators

We can now build very complicated propositions using ¬, ∧ and ∨ (and


even ⊕):
(p ∧ q) ∧ s can be written as p ∧ q ∧ s.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 11 / 59


Compound proposition and logical operators

We can now build very complicated propositions using ¬, ∧ and ∨ (and


even ⊕):
(p ∧ q) ∧ s can be written as p ∧ q ∧ s.
Similarly, (p ∨ q) ∨ s can be written as p ∨ q ∧ s.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 11 / 59


Compound proposition and logical operators

We can now build very complicated propositions using ¬, ∧ and ∨ (and


even ⊕):
(p ∧ q) ∧ s can be written as p ∧ q ∧ s.
Similarly, (p ∨ q) ∨ s can be written as p ∨ q ∧ s.
Can we write (p ∨ q) ∧ s as p ∨ q ∧ s?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 11 / 59


Compound proposition and logical operators

We can now build very complicated propositions using ¬, ∧ and ∨ (and


even ⊕):
(p ∧ q) ∧ s can be written as p ∧ q ∧ s.
Similarly, (p ∨ q) ∨ s can be written as p ∨ q ∧ s.
Can we write (p ∨ q) ∧ s as p ∨ q ∧ s?
Be careful, more on this later.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 11 / 59


The most important connector in mathematics
Consider the proposition

“If you study mathematics, then you will find a good job”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 12 / 59


The most important connector in mathematics
Consider the proposition

“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

This can be read as “If p, then q”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 12 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

If p, then q.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

If p, then q.
If p, q.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

If p, then q.
If p, q.
p if sufficient for q.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

If p, then q.
If p, q.
p if sufficient for q.
q if p.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

If p, then q.
If p, q.
p if sufficient for q.
q if p.
q when p.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Other ways of reading (and understanding) p → q

If it is winter, then it gets cold.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 13 / 59


The most important connector in mathematics
Converse, contrapositive and inverse

Definition
Consider the proposition p → q.
The converse is q → p.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 14 / 59


The most important connector in mathematics
Converse, contrapositive and inverse

Definition
Consider the proposition p → q.
The converse is q → p.
The contrapositive is ¬q → ¬p.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 14 / 59


The most important connector in mathematics
Converse, contrapositive and inverse

Definition
Consider the proposition p → q.
The converse is q → p.
The contrapositive is ¬q → ¬p.
The inverse is ¬p → ¬q.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 14 / 59


The most important connector in mathematics
Converse, contrapositive and inverse

Definition
Consider the proposition p → q.
The converse is q → p.
The contrapositive is ¬q → ¬p.
The inverse is ¬p → ¬q.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 14 / 59


The most important connector in mathematics

Example
Find the converse, the contrapositive and the inverse of

“The Toronto Bluejays win whenever it is raining”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 15 / 59


The most important connector in mathematics

Example
Find the converse, the contrapositive and the inverse of

“The Toronto Bluejays win whenever it is raining”.

Which of them are equivalent?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 15 / 59


Biconditionals

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”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 16 / 59


Biconditionals

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”.

p and q could be Tor F, but they have to be the same.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 16 / 59


Biconditionals

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”.

p and q could be Tor F, but they have to be the same.


p ↔ q is another way of writing (p → q) ∧ (p → q) (how could we
prove this?).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 16 / 59


Biconditionals

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”.

p and q could be Tor F, but they have to be the same.


p ↔ q is another way of writing (p → q) ∧ (p → q) (how could we
prove this?).
Warning: In English, we sometimes use the expression “If . . . , then
. . . ” to actually mean a biconditional. Consider
“If you have a ticket, then you can board the plane”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 16 / 59


Biconditionals

Other ways of reading p ↔ q are:

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 17 / 59


Biconditionals

Other ways of reading p ↔ q are:


“p is necessary and sufficient for q”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 17 / 59


Biconditionals

Other ways of reading p ↔ q are:


“p is necessary and sufficient for q”
“If p then q, and conversely”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 17 / 59


Biconditionals

Other ways of reading p ↔ q are:


“p is necessary and sufficient for q”
“If p then q, and conversely”.
“p iff q”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 17 / 59


Precedence of logical operations
Just as we have a precedence of arithmetic operators (+, −, ×,÷, etc.),
we have a precedence of logical operators.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 18 / 59


Precedence of logical operations
Just as we have a precedence of arithmetic operators (+, −, ×,÷, etc.),
we have a precedence of logical operators.

Precedence Operator
1 ¬
∧,
2

→,
3

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 18 / 59


Precedence of logical operations
Just as we have a precedence of arithmetic operators (+, −, ×,÷, etc.),
we have a precedence of logical operators.

Precedence Operator
1 ¬
∧,
2

→,
3


So that ¬p → r ∧ s means (¬p) → (r ∧ s) and not ¬ p → (r ∧ s) or
¬(p → r) ∧ s.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 18 / 59


Precedence of logical operations
Just as we have a precedence of arithmetic operators (+, −, ×,÷, etc.),
we have a precedence of logical operators.

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 −).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 18 / 59


Let’s think

Translate the following English sentences to propositional logic:

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 19 / 59


Some real-world applications

1 System specifications (programming).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 20 / 59


Some real-world applications

1 System specifications (programming).


2 Boolean searches (Google!).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 20 / 59


Some real-world applications

1 System specifications (programming).


2 Boolean searches (Google!).
3 Logical circuits.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 20 / 59


Logical equivalences

Definition
A tautology is a proposition that is always true. On the other hand a
contradiction is a proposition that is always false.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 21 / 59


Logical equivalences

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?)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 21 / 59


Logical equivalences

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?)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 21 / 59


Logical equivalences

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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 21 / 59


Logical equivalences

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 22 / 59


Logical equivalences

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.

≡ is not a logical connector, p ≡ q is short for the expression “p ↔ q


is a tautology”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 22 / 59


Logical equivalences

Q: Given p and q,
how do we prove that p ≡ q?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 23 / 59


Logical equivalences

Q: Given p and q,
how do we prove that p ≡ q?
how do we prove that p 6≡ q?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 23 / 59


Logical equivalences

Q: Given p and q,
how do we prove that p ≡ q?
how do we prove that p 6≡ q?

If we want to prove that p ≡ q all we can do (for now) is to check the


complete truth-table.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 23 / 59


Logical equivalences

Q: Given p and q,
how do we prove that p ≡ q?
how do we prove that p 6≡ q?

If we want to prove that p ≡ q all we can do (for now) is to check the


complete truth-table. If we want to prove that p 6≡ q we only need one row
of the truth-table where p and q do not agree.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 23 / 59


Logical equivalences
DeMorgan’s laws

Example (DeMorgan’s laws)


If p and q are propositions, then

¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 24 / 59


Logical equivalences
DeMorgan’s laws

Example (DeMorgan’s laws)


If p and q are propositions, then

¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q

How do we prove this?

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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 24 / 59


Logical equivalences

Example (Conditional-disjunction equivalence)


Prove that if p and q are propositions, then p → q is equivalent to ¬p ∨ q.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 25 / 59


Logical equivalences

Example (Conditional-disjunction equivalence)


Prove that if p and q are propositions, then p → q is equivalent to ¬p ∨ q.

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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 25 / 59


Logical equivalences

We can continue for ever proving new logical equivalences.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 26 / 59


Logical equivalences

We can continue for ever proving new logical equivalences. It makes


no sense.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 26 / 59


Logical equivalences

We can continue for ever proving new logical equivalences. It makes


no sense.

There is a document in the course website (moodle) with some tables


of important logical equivalences.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 26 / 59


Logical equivalences

We can continue for ever proving new logical equivalences. It makes


no sense.

There is a document in the course website (moodle) with some tables


of important logical equivalences.

We better learn how to use them:

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 26 / 59


Logical equivalences

Example
What is the negation of the sentence “If you study math, then you will get
a good job”?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 27 / 59


Logical equivalences

Example
What is the negation of the sentence “If you study math, then you will get
a good job”?

In fact, we just proved that ¬(p → q) ≡ p ∧ ¬q.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 27 / 59


Logical equivalences

Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 28 / 59


Logical equivalences

Example
Show that ¬ (p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent.

Solution:
¬ (p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) DeMorgan’s law.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 28 / 59


Logical equivalences

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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 28 / 59


Logical equivalences

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 28 / 59


Logical equivalences

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 28 / 59


Logical equivalences

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 28 / 59


Logical equivalences

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 28 / 59


Predicates

Propositional logic is limited.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 29 / 59


Predicates

Propositional logic is limited.


I “Every computer connected to the university is working properly ”.
I “MATH03 is working properly”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 29 / 59


Predicates

Propositional logic is limited.


I “Every computer connected to the university is working properly ”.
I “MATH03 is working properly”.
I “CS02 is under the attack of an intruder”
I “There is a computer that is under the attack of an intruder”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 29 / 59


Predicates

Propositional logic is limited.


I “Every computer connected to the university is working properly ”.
I “MATH03 is working properly”.
I “CS02 is under the attack of an intruder”
I “There is a computer that is under the attack of an intruder”.

We understand those sentences in English, but propositional logic is


not enough. We need predicate logic.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 29 / 59


Predicates

Consider the following statements:


“x > 3 ”
“Computer x is under the attack of an intruder”
“Computer x is connected to computer y”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 30 / 59


Predicates

Consider the following statements:


“x > 3 ”
“Computer x is under the attack of an intruder”
“Computer x is connected to computer y”.

Those are examples of predicates.


They involve variables.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 30 / 59


Predicates

Consider the following statements:


“x > 3 ”
“Computer x is under the attack of an intruder”
“Computer x is connected to computer y”.

Those are examples of predicates.


They involve variables.
Once we assign values to all the variables, they become propositions.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 30 / 59


Predicates

Example
Let P (x) denote the predicate

x > 3.

What are the truth values of P (4) and P (2)?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 31 / 59


Predicates

Example
Let P (x) denote the predicate

x > 3.

What are the truth values of P (4) and P (2)?

Solution: P (4) is the statement

4 > 3,

which is true (T). On the other hand P (2) is the proposition

2 > 3,

which is false (F).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 31 / 59


Predicates

Example
Let Q(x, y) denote the predicate

x = y + 3.

What are the truth values of Q(1, 2) and Q(3, 0)?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 32 / 59


Predicates

Example
Let Q(x, y) denote the predicate

x = y + 3.

What are the truth values of Q(1, 2) and Q(3, 0)?

Solution: Q(1, 2) is the statement 1 = 2 + 3, which is F. Q(3, 0) is the


proposition 3 = 0 + 3, which is T

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 32 / 59


Predicates

In general, a predicate can involve several variables, one involving n


variable looks like
P (x1 , x2 , . . . , xn ).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 33 / 59


Predicates

In general, a predicate can involve several variables, one involving n


variable looks like
P (x1 , x2 , . . . , xn ).

The number of variables of a predicate is called the arity. We have


seen some unary and binary predicates. The one above is a n-ary one.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 33 / 59


Predicates

In general, a predicate can involve several variables, one involving n


variable looks like
P (x1 , x2 , . . . , xn ).

The number of variables of a predicate is called the arity. We have


seen some unary and binary predicates. The one above is a n-ary one.

P is called the propositional formula of the predicate.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 33 / 59


Predicates

In general, a predicate can involve several variables, one involving n


variable looks like
P (x1 , x2 , . . . , xn ).

The number of variables of a predicate is called the arity. We have


seen some unary and binary predicates. The one above is a n-ary one.

P is called the propositional formula of the predicate.

Sometimes it is useful to think a predicate as a machine that


produces propositions.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 33 / 59


Quantifiers

There is another way of obtaining propositions from propositional


formulas: quantification.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 34 / 59


Quantifiers

There is another way of obtaining propositions from propositional


formulas: quantification.

Quantification express the extend to which a predicate is true over a


range of elements.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 34 / 59


Quantifiers

There is another way of obtaining propositions from propositional


formulas: quantification.

Quantification express the extend to which a predicate is true over a


range of elements.

In English, we use words as all, some, many, few and none to express
quantification.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 34 / 59


Quantifiers

There is another way of obtaining propositions from propositional


formulas: quantification.

Quantification express the extend to which a predicate is true over a


range of elements.

In English, we use words as all, some, many, few and none to express
quantification.

In mathematics we use just three: Universal, Existential and


Uniqueness.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 34 / 59


Quantifiers
Universal quantifier

Definition
The universal quantification of P (x) is the statement

“P (x) for all the elements x in the domain.”

The symbols ∀x P (x) denotes the universal quantification. ∀ is the


universal quantifier.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 35 / 59


Quantifiers
Universal quantifier

Definition
The universal quantification of P (x) is the statement

“P (x) for all the elements x in the domain.”

The symbols ∀x P (x) denotes the universal quantification. ∀ is the


universal quantifier.

∀x P (x) is read “for all x, P (x)” or “for every x, P (x).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 35 / 59


Quantifiers
Universal quantifier

Definition
The universal quantification of P (x) is the statement

“P (x) for all the elements x in the domain.”

The symbols ∀x P (x) denotes the universal quantification. ∀ is the


universal quantifier.

∀x P (x) is read “for all x, P (x)” or “for every x, P (x).


The universal quantification depends on the domain and this must be
always specified.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 35 / 59


Quantifiers
Universal quantifier

Definition
The universal quantification of P (x) is the statement

“P (x) for all the elements x in the domain.”

The symbols ∀x P (x) denotes the universal quantification. ∀ is the


universal quantifier.

∀x P (x) is read “for all x, P (x)” or “for every x, P (x).


The universal quantification depends on the domain and this must be
always specified.
An element x which makes ∀x P (x) false is called a counterexample.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 35 / 59


Quantifiers
Universal quantifier

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?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 36 / 59


Quantifiers
Universal quantifier

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?

Solution: For every real number x, the number x + 1 > x. Therefore


∀x P (x) is T.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 36 / 59


Quantifiers
Universal quantifier

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?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 37 / 59


Quantifiers
Universal quantifier

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 37 / 59


Quantifiers
Universal quantifier

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?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 38 / 59


Quantifiers
Universal quantifier

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?

Solution: In the first case ∀x S(x) is F, in the second it is T.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 38 / 59


Quantifiers
Universal quantifier

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?

Solution: In the first case ∀x S(x) is F, in the second it is T.

The truth-value of ∀x S(x) depends on the domain.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 38 / 59


Quantifiers
Universal quantifier

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?

Solution: In the first case ∀x S(x) is F, in the second it is T.

The truth-value of ∀x S(x) depends on the domain.


∀x S(x) is false if there exists a counterexample.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 38 / 59


Quantifiers
Universal quantifier

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?

Solution: In the first case ∀x S(x) is F, in the second it is T.

The truth-value of ∀x S(x) depends on the domain.


∀x S(x) is false if there exists a counterexample.
If the domain is empty, then ∀x S(x) is T. There is no
counterexample.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 38 / 59


Quantifiers
Existential quantifier

Definition
The existential quantification of P (x) is the statement

“There exists an element x in the domain such that P (x) ”

The symbols ∃x P (x) denotes the existential quantification. ∃ is the


existential quantifier.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 39 / 59


Quantifiers
Existential quantifier

Definition
The existential quantification of P (x) is the statement

“There exists an element x in the domain such that P (x) ”

The symbols ∃x P (x) denotes the existential quantification. ∃ is the


existential quantifier.

Besides “there exists” we can use “for some”, “for at least one” or
“there is”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 39 / 59


Quantifiers
Existential quantifier

Definition
The existential quantification of P (x) is the statement

“There exists an element x in the domain such that P (x) ”

The symbols ∃x P (x) denotes the existential quantification. ∃ is the


existential quantifier.

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 39 / 59


Quantifiers
Existential quantifier

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?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 40 / 59


Quantifiers
Existential quantifier

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?

Solution: P (x) is true for several examples, for instance, when x = 4.


Therefore ∃x P (x) is T.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 40 / 59


Quantifiers
Existential quantifier

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?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 41 / 59


Quantifiers
Existential quantifier

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?

Solution: Q(x) is false for every x. Therefore ∃x Q(x) is F.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 41 / 59


Quantifiers
Existential quantifier

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?

Solution: Q(x) is false for every x. Therefore ∃x Q(x) is F.

If the domain is empty, then ∃x S(x) is always F (for any


propositional formula S).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 41 / 59


Quantifiers
The uniqueness quantifier

We could define other quantifiers:


There exists a unique element x such that P (x).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 42 / 59


Quantifiers
The uniqueness quantifier

We could define other quantifiers:


There exists a unique element x such that P (x).
There are at least two elements x such that P (x).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 42 / 59


Quantifiers
The uniqueness quantifier

We could define other quantifiers:


There exists a unique element x such that P (x).
There are at least two elements x such that P (x).
There are exactly two elements x such that P (x).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 42 / 59


Quantifiers
The uniqueness quantifier

We could define other quantifiers:


There exists a unique element x such that P (x).
There are at least two elements x such that P (x).
There are exactly two elements x such that P (x).
...

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 42 / 59


Quantifiers
The uniqueness quantifier

We could define other quantifiers:


There exists a unique element x such that P (x).
There are at least two elements x such that P (x).
There are exactly two elements x such that P (x).
...
Among those, only the first one has a name:
Definition
The uniqueness quantification of P , denoted by ∃!x P (x) is the
proposition
(∃x P (x)) ∧ (∀y (x 6= y → ¬P (y)))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 42 / 59


Quantifiers

Quantifiers have higher precedence than any logical operator so that


∀x P (x) ∧ Q(x) means (∀x P (x)) ∧ Q(x) and not ∀x (P (x) ∧ Q(x)).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 43 / 59


Quantifiers

Quantifiers have higher precedence than any logical operator so that


∀x P (x) ∧ Q(x) means (∀x P (x)) ∧ Q(x) and not ∀x (P (x) ∧ Q(x)).
In order to turn an expression of propositional formulas to a
proposition every variable must have an assigned value or be under
the scope of a quantifier.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 43 / 59


Quantifiers

Quantifiers have higher precedence than any logical operator so that


∀x P (x) ∧ Q(x) means (∀x P (x)) ∧ Q(x) and not ∀x (P (x) ∧ Q(x)).
In order to turn an expression of propositional formulas to a
proposition every variable must have an assigned value or be under
the scope of a quantifier.
If Q(x, y) is the expression x + y = 1, then ∀x Q(x, y) is not a
proposition but ∀x Q(x, 1) is.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 43 / 59


Quantifiers

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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 44 / 59


Quantifiers

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 44 / 59


Quantifiers
Negating quantifiers

What is the negation of the following sentences?:


All swans are black.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 45 / 59


Quantifiers
Negating quantifiers

What is the negation of the following sentences?:


All swans are black.
I There exists a swan that is not black

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 45 / 59


Quantifiers
Negating quantifiers

What is the negation of the following sentences?:


All swans are black.
I There exists a swan that is not black
Every math professor is handsome.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 45 / 59


Quantifiers
Negating quantifiers

What is the negation of the following sentences?:


All swans are black.
I There exists a swan that is not black
Every math professor is handsome.
I There is a math professor that is not handsome

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 45 / 59


Quantifiers
Negating quantifiers

What is the negation of the following sentences?:


All swans are black.
I There exists a swan that is not black
Every math professor is handsome.
I There is a math professor that is not handsome
There is a student in MATH 1190 that is also taking Calculus.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 45 / 59


Quantifiers
Negating quantifiers

What is the negation of the following sentences?:


All swans are black.
I There exists a swan that is not black
Every math professor is handsome.
I There is a math professor that is not handsome
There is a student in MATH 1190 that is also taking Calculus.
I Every student in MATH 1190 is not taking calculus.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 45 / 59


Quantifiers
Negating quantifiers

What is the negation of the following sentences?:


All swans are black.
I There exists a swan that is not black
Every math professor is handsome.
I There is a math professor that is not handsome
There is a student in MATH 1190 that is also taking Calculus.
I Every student in MATH 1190 is not taking calculus.

Proposition (DeMorgan’s laws for quantifiers)


¬ (∀x P (x)) ≡ ∃x (¬P (x))
¬ (∃x P (x)) ≡ ∀x (¬P (x))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 45 / 59


Quantifiers

Quantifier When it is T When it is F


∀x P (x) Whenever P (x) When there
is T for every exists an element
element x of the x in the domain
domain. such that P (x)
is F.
∃x P (x) Whenever there When P (x) is F
is an element x for every element
in the domain x of the domain.
such that P (x)
is T.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 46 / 59


Quantifiers

Quantifier When it is T When it is F


∀x P (x) Whenever P (x) When there
is T for every exists an element
element x of the x in the domain
domain. such that P (x)
is F.
∃x P (x) Whenever there When P (x) is F
is an element x for every element
in the domain x of the domain.
such that P (x)
is T.

Note: In general, it is harder to prove that an expression ∀x P (x) is T.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 46 / 59


Quantifiers

Example
What is the negation of the statement

∀x (x2 > x) and ∃x (x2 = 2)?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 47 / 59


Quantifiers

Example
What is the negation of the statement

∀x (x2 > x) and ∃x (x2 = 2)?

Solution: The statement has the form (∀x G(x)) ∧ (∃x T (x)), hence the
negation is evaluated as follows

¬ ((∀x G(x)) ∧ (∃x T (x))) ≡ ¬(∀x G(x)) ∨ ¬(∃x T (x))


≡ ∃x ¬G(x) ∨ ∀x ¬T (x)

Which is “There exists x such that (x2 6 x) or for all x, x2 6= 2”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 47 / 59


Quantifiers

Example
Show that the statements ¬ (∀x (P (x) → Q(x))) and ∃x (P (x) ∧ ¬Q(x))
are logically equivalent.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 48 / 59


Quantifiers

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)))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 48 / 59


Quantifiers

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))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 48 / 59


Quantifiers

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))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 48 / 59


Quantifiers

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))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 48 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

“There exists a student in this class that has visited Mexico”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

“There exists a student in this class that has visited Mexico”


I ∃x M (x),

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

“There exists a student in this class that has visited Mexico”


I ∃x M (x),
I ∃x (S(x) ∧ M (x)),

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

“There exists a student in this class that has visited Mexico”


I ∃x M (x),
I ∃x (S(x) ∧ M (x)),why not ∃x (S(x) → M (x)) ?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

“There exists a student in this class that has visited Mexico”


I ∃x M (x),
I ∃x (S(x) ∧ M (x)),why not ∃x (S(x) → M (x)) ?

“Every student in this class has visited Mexico or Europe”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

“There exists a student in this class that has visited Mexico”


I ∃x M (x),
I ∃x (S(x) ∧ M (x)),why not ∃x (S(x) → M (x)) ?

“Every student in this class has visited Mexico or Europe”


I ∀x (M (x) ∨ E(x)),

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

“There exists a student in this class that has visited Mexico”


I ∃x M (x),
I ∃x (S(x) ∧ M (x)),why not ∃x (S(x) → M (x)) ?

“Every student in this class has visited Mexico or Europe”


I ∀x (M (x) ∨ E(x)),
I ∀x (S(x) → M (x) ∨ E(x))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Quantifiers
Translating from English

“Every student in this class has taken calculus”


I If the domain is the students in this class, and C(x) means “x has
taken calculus”: ∀x C(x),
I If the domain is the people in York University: ∀x (S(x) → C(x)),
where S(x) means “x is a student in this class”.

“There exists a student in this class that has visited Mexico”


I ∃x M (x),
I ∃x (S(x) ∧ M (x)),why not ∃x (S(x) → M (x)) ?

“Every student in this class has visited Mexico or Europe”


I ∀x (M (x) ∨ E(x)),
I ∀x (S(x) → M (x) ∨ E(x)) why not ∀x (S(x) ∧ (M (x) ∨ E(x)))?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 49 / 59


Nested quantifiers
Consider he following expression:

“For every student in this class there is a pizza in the menu such that the
student likes the pizza”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 50 / 59


Nested quantifiers
Consider he following expression:

“For every student in this class there is a pizza in the menu such that the
student likes the pizza”

This can be expressed as


∀s (∃p L(s, p))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 50 / 59


Nested quantifiers
Consider he following expression:

“For every student in this class there is a pizza in the menu such that the
student likes the pizza”

This can be expressed as


∀s (∃p L(s, p))

The expression ∃p L(s, p) is a predicate that is under the scope of a


universal cuantifier.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 50 / 59


Nested quantifiers
Consider he following expression:

“For every student in this class there is a pizza in the menu such that the
student likes the pizza”

This can be expressed as


∀s (∃p L(s, p))

The expression ∃p L(s, p) is a predicate that is under the scope of a


universal cuantifier. For a given s, L(s, p) determines a propositional
fomula Ls (p).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 50 / 59


Nested quantifiers
Consider he following expression:

“For every student in this class there is a pizza in the menu such that the
student likes the pizza”

This can be expressed as


∀s (∃p L(s, p))

The expression ∃p L(s, p) is a predicate that is under the scope of a


universal cuantifier. For a given s, L(s, p) determines a propositional
fomula Ls (p). We usually write:

∀s ∃p L(s, p)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 50 / 59


Nested quantifiers

Example
Consider the expression

∀x ∀y(x + y = y + x)

where the domain of both variables is the set of real numbers.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 51 / 59


Nested quantifiers

Example
Consider the expression

∀x ∀y(x + y = y + x)

where the domain of both variables is the set of real numbers.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 51 / 59


Nested quantifiers

Example
Consider the expression

∀x ∀y(x + y = y + x)

where the domain of both variables is the set of real numbers.

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”?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 51 / 59


Nested quantifiers

Example
Consider the expression

∀x ∀y(x + y = y + x)

where the domain of both variables is the set of real numbers.

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)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 51 / 59


Nested quantifiers
does the order matter?

Recall the example L(s, p) of the students and the pizzas, and consider
the following two expressions.

∀s∃p L(s, p) ∃p∀s L(s, p).

Are they equivalent?

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 52 / 59


Nested quantifiers
does the order matter?

Recall the example L(s, p) of the students and the pizzas, and consider
the following two expressions.

∀s∃p L(s, p) ∃p∀s L(s, p).

Are they equivalent?

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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 52 / 59


Nested quantifiers
In the following examples, assume that the domain is the set of real
numbers.
∀x (x = 5)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 53 / 59


Nested quantifiers
In the following examples, assume that the domain is the set of real
numbers.
∀x (x = 5) F

∃x (x = 5)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 53 / 59


Nested quantifiers
In the following examples, assume that the domain is the set of real
numbers.
∀x (x = 5) F

∃x (x = 5) T

∀x∀y(x + y = 5)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 53 / 59


Nested quantifiers
In the following examples, assume that the domain is the set of real
numbers.
∀x (x = 5) F

∃x (x = 5) T

∀x∀y(x + y = 5) F

∀x∃y(x + y = 5)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 53 / 59


Nested quantifiers
In the following examples, assume that the domain is the set of real
numbers.
∀x (x = 5) F

∃x (x = 5) T

∀x∀y(x + y = 5) F

∀x∃y(x + y = 5) T

∃y∀y(x + y = 5)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 53 / 59


Nested quantifiers
In the following examples, assume that the domain is the set of real
numbers.
∀x (x = 5) F

∃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)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 53 / 59


Nested quantifiers
In the following examples, assume that the domain is the set of real
numbers.
∀x (x = 5) F

∃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)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 53 / 59


Nested quantifiers
In the following examples, assume that the domain is the set of real
numbers.
∀x (x = 5) F

∃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

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 53 / 59


Nested quantifiers
“The sum of two positive integers is positive”:

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 54 / 59


Nested quantifiers
“The sum of two positive integers is positive”:

∀x∀y ((x > 0) ∧ (y > 0) → x + y > 0) .

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 54 / 59


Nested quantifiers
“The sum of two positive integers is positive”:

∀x∀y ((x > 0) ∧ (y > 0) → x + y > 0) .

“Given any number, there is a number greater than it”:

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 54 / 59


Nested quantifiers
“The sum of two positive integers is positive”:

∀x∀y ((x > 0) ∧ (y > 0) → x + y > 0) .

“Given any number, there is a number greater than it”:

∀x∃y(y > x).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 54 / 59


Nested quantifiers
“The sum of two positive integers is positive”:

∀x∀y ((x > 0) ∧ (y > 0) → x + y > 0) .

“Given any number, there is a number greater than it”:

∀x∃y(y > x).

“Every non-zero number has a multiplicative inverse”:

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 54 / 59


Nested quantifiers
“The sum of two positive integers is positive”:

∀x∀y ((x > 0) ∧ (y > 0) → x + y > 0) .

“Given any number, there is a number greater than it”:

∀x∃y(y > x).

“Every non-zero number has a multiplicative inverse”:

∀x ((x 6= 0) → ∃y(xy = 1)) .

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 54 / 59


Nested quantifiers
“The sum of two positive integers is positive”:

∀x∀y ((x > 0) ∧ (y > 0) → x + y > 0) .

“Given any number, there is a number greater than it”:

∀x∃y(y > x).

“Every non-zero number has a multiplicative inverse”:

∀x ((x 6= 0) → ∃y(xy = 1)) .

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 54 / 59


Nested quantifiers

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:

∀x (C(x) ∨ ∃y(C(y) ∧ F (x, y)))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 55 / 59


Nested quantifiers

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:

∀x (C(x) ∨ ∃y(C(y) ∧ F (x, y)))

Solution: “Every student of MATH1190 either has a computer or has a


friend who has a computer”.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 55 / 59


Nested quantifiers

Example

∃x∀y∀z (F (x, y) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y, z)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 56 / 59


Nested quantifiers

Example

∃x∀y∀z (F (x, y) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y, z)

Solution: First consider the statement

(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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 56 / 59


Nested quantifiers

Example

∃x∀y∀z (F (x, y) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y, z)

Solution: First consider the statement

(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.

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 56 / 59


Nested quantifiers

Example
Translate the sentence “If a person is female and is a parent, then this
person is somebody’s mother”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 57 / 59


Nested quantifiers

Example
Translate the sentence “If a person is female and is a parent, then this
person is somebody’s mother”

Solution: Consider the predicates F (x): “x is female”, P (x): “x is a


parent” and M (x, y): “x is the mother of y”. Then the statement is

∀x ((F (x) ∧ P (x)) → ∃yM (x, y)) .

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 57 / 59


Nested quantifiers

Example
Express the statement “Everyone has exactly one best friend” using
B(x, y): “x is best friend of y”

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 58 / 59


Nested quantifiers

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))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 58 / 59


Nested quantifiers
Negating nested quantifiers

Example
Compute the negation of (∀x∃y(xy = 1)).

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 59 / 59


Nested quantifiers
Negating nested quantifiers

Example
Compute the negation of (∀x∃y(xy = 1)).

Solution:
¬(∀x∃y(xy = 1))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 59 / 59


Nested quantifiers
Negating nested quantifiers

Example
Compute the negation of (∀x∃y(xy = 1)).

Solution:
¬(∀x∃y(xy = 1)) ≡ ∃x¬(∃y(xy = 1))

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 59 / 59


Nested quantifiers
Negating nested quantifiers

Example
Compute the negation of (∀x∃y(xy = 1)).

Solution:
¬(∀x∃y(xy = 1)) ≡ ∃x¬(∃y(xy = 1))
≡ ∃x∀y¬(xy = 1)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 59 / 59


Nested quantifiers
Negating nested quantifiers

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)

A. Montero (YorkU) 1. Propositional logic, predicates and quantifiers Math 1190 59 / 59

You might also like