SlideShare a Scribd company logo
Predicate Logic
Predicate & Quantifier
Dr. S. Jeevadoss
Assistant Professor
Department of Applied Mathematics & Computational Sciences
PSG College of Technology, Coimbatore.
February 19, 2021
1 / 53
From Proposition to Predicate
Propositional logic studied earlier cannot express the meanings
of statements in mathematics and in natural language.
Predicate logic extends (is more powerful than) propositional
logic.
3 + 2 = 5 is a proposition. But is X + 2 = 5 a proposition?
Because it has a variable X in it, we cannot say it is TRUE or
FALSE.
So, it is not a proposition. It is called a predicate.
2 / 53
Predicate vs. Proposition
Example
1 Every computer connected to the university network is
functioning properly.
2 Someone in this room is sleeping now.
3 Not all birds fly
4 Everyone in this class will pass the midterm.
Example
1 There exists an integer x such that 3x2 = 0.
2 The square of every real number is greater than 0.
3 If p is a prime and a is any integer not divisible by p, then
ap−1 − 1 is divisible by p.
4 There are infinitely many prime numbers.
3 / 53
Predicate vs. Proposition
Definition
A predicate is a sentence with variables and becomes a
proposition, when specific values are substituted for the
variables.
A predicate is a function. It takes some variable(s) as
arguments; it returns either True or False (but not both) for
each combination of the argument values.
Note:
In contrast, a proposition is not a function. It does not have any
variable as argument. It is either True or False (but not both).
4 / 53
Predicates
Let P(x) be the statement involving the variable x.
P denotes the predicate and x is variable
P(x) is also said to be the value of the propositional function
P at x
Let P(x) denote the sentence “x is greater than 3”.
It has two parts.
1 The variable “x”: The subject of the sentence.
2 The predicate “is greater than 3” : The property that the
subject can have.
5 / 53
Predicates -Example 1
Example
Let P(x) denotes “x > 3”.
P(5) is TRUE
P(2) is FALSE
P(3) is FALSE
6 / 53
Predicates-Example 2
Example
Let P(x, y, z) denote that x + y = z and D be the integers for all
three variables.
P(−4, 6, 2) is TRUE
P(5, 2, 10) is FALSE
P(1, 2.5, 3.5) is not a proposition
P(2, y, 6) is not a proposition
7 / 53
Predicates-Example 3
Example
A(x) = Computer x is under attack by a hacker.
Suppose only CS2 and MATH1 are currently under attack. What
are the truth values of
A(CS1) ≡
A(CS2) ≡
A(MATH1) ≡
8 / 53
Domain of discourse
Definition (Domain)
The variables are always associated with a universe (or domain)
of discourse, which tells us what combinations of the argument
values are allowed.
The domain of a predicate variable is the set of all values that
may be substituted in place of the variable.
The domain is often denoted by U (the universe) or D (the
domain).
Suppose P(x) is a predicate, where the universe of discourse
for x is {1, 2, 3}. Then P(x) is not a proposition, but P(1) is a
proposition as well as P(5) is not a proposition.
In general, a predicate is not a proposition. But when you assign
values to all its argument variables, you get a proposition.
9 / 53
Domain - Example-1
Example
P(x, y) :“x + 2 = y” is a predicate.
It has two variables x and y;
Universe of Discourse: x is in {1, 2, 3}; y is in {4, 5, 6}.
1 P(1, 4) : 1 + 2 = 4 is a proposition (it is FALSE);
2 P(2, 4) : 2 + 2 = 4 is a proposition (it is TRUE);
3 P(2, 3) : meaningless (in this example), because 3 is not in
the specified universe of discourse for y.
10 / 53
Domain - Practice Problem-1
Example
1 P(x) : “(x > 3) ∨ (x < 3) ”.
What are the truth values of P(2), P(3), and P(4)?
2 Q(x, y) : x = y + 3.
What are the truth values of the propositions
Q(1, 2) =
Q(3, 0) =
Example
1 Every computer connected to the university network is
functioning properly.
2 The square of every real number is greater than 0.
3 There are infinitely many prime numbers.
4 Not all birds fly
5 Everyone in this class will pass the midterm.
11 / 53
Domain - Practice Problem-2
Question
Suppose Q(x, y) : “x + y > 4,” where the universe of discourse is
all integer pairs.
Which of the following are predicates? Which are propositions?
1 Q(1, 2)
2 Q(1000, 2)
3 Q(x, 2)
4 Q(1000, y)
5 Q(x, y)
12 / 53
Exercise
Let Q(x, y, z) denote that x − y = z and D be the integers.
Which of the following are predicates? Which are propositions?
1 P(1, 2, 3) ∧ Q(5, 4, 1)
2 P(1, 2, 4) → Q(5, 4, 0)
3 P(1, 2, 3) ↔ Q(5, 4, 0)
4 P(1, 2, 4) ∨ Q(x, 4, 0)
13 / 53
Quantifiers
Quantification is another way of converting a predicate into a
proposition.
We need quantifiers to formally express the meaning of the
words “all” and “some”.
In English, the words all, some, many, none, and few are used
in quantifications.
1 Universal quantification
2 Existential quantification
3 Uniqueness quantifier
4 Quantifiers with restricted domains
14 / 53
Universal quantification & Existential quantification
(The two most important quantifiers are:)
Universal quantifier, “For all”. Symbol: ∀
Existential quantifier, “There exists”. Symbol: ∃
15 / 53
Universal quantification
Definition
Suppose P(x) is a predicate on some domain D. The universal
quantification of P(x) is the proposition:
“P(x) for all values of x in the domain ” We write ∀x, P(x).
∀ : Universal Quantifier
∀x P(x) ≡ T : if P(x) is true for every x in D
∀x P(x) ≡ F : if P(x) is false for at least one x in D
The truth values depends not only on P, but also on the domain
D.
16 / 53
Existential quantification
Definition
Suppose P(x) is a predicate on some domain D. The existential
quantification of P(x) is the proposition:
“There exists an element x in the domain such that P(x). ” We
write ∃x, P(x).
∃ : Existential Quantifier
∃x P(x) ≡ T : if P(x) is true for any (at least one) x in D
∃x P(x) ≡ F : if P(x) is false for every x in D
The truth values depends not only on P, but also on the domain
D.
17 / 53
Universal quantification & Existential quantification
18 / 53
Universal quantification Example
Example
P(x) : x + 2 = 5, Domain: {1, 2, 3}.
∀x, P(x) means: “for all x in {1, 2, 3}, x + 2 = 5”.
In other words, it means: “1+2=5, 2+2=5, and 3+2=5”, which is
false. So it is a proposition.
Example
A(x) : x = 1, B(x) : x > 2, C(x) : x < 2
Domain: {1, 2, 3}.
TRUE or FLASE?
1 ∀x, (C(x) → A(x))
2 ∀x, (C(x) ∨ B(x))
19 / 53
Existential quantification Example
Example
P(x) : x + 2 = 5, Domain: {1, 2, 3}.
∃x, P(x) means: “for some x in {1, 2, 3}, x + 2 = 5”.
In other words, it means: “1+2=5, 2+2=5, and 3+2=5”, which is
True. So it is a proposition.
Example
A(x) : x = 1, B(x) : x > 2, C(x) : x < 2
Domain: {1, 2, 3}.
TRUE or FLASE?
1 ∃x, (C(x) → A(x))
2 ∃x, (¬B(x))
20 / 53
Translating from English into Logical Expressions
Question
Express the statements “Every student in this class has studied
calculus” and “Some student in this class has visited Mexico” using
predicates and quantifiers.
21 / 53
Translating from English into Logical Expressions
Example
Using the predicate symbols
S(x) : x is a student,
I(x) : x is intelligent,
M(x) : x likes music,
write wffs that express the following statements. The domain is
the collection of all people.
1 All students are intelligent.
2 Some intelligent students like music.
3 Everyone who likes music is a stupid student.
4 Only intelligent students like music.
22 / 53
Translating from English into Logical Expressions
Exercise1
A(x) : “x lives in Chennai.”
B(x) : “x is a CSE student.”
C(x) : “x has a good GPA.”
D(x) : “x majors in mathematics.”
Domain: all PSG students
1 All CSE students have good GPA
2 No CSE student lives in Chennai
3 CSE students who do not live in Chennai major in
mathematics
23 / 53
Translating from English into Logical Expressions
Exercise2
Translate each of these statements into logical expressions using
predicates, quantifiers, and logical connectives.
P(x) : “x is perfect.”
F(x) : “x is your friend.”
Domain: all people
1 No one is perfect.
2 Not everyone is perfect.
3 All your friends are perfect.
4 At least one of your friends is perfect.
5 Everyone is your friend and is perfect.
6 Not everybody is your friend or someone is not perfect.
24 / 53
Problem
Example
What is the truth value of ∀x(x2 ≥ x) if the domain consists of all
real numbers? What is the truth value of this statement if the
domain consists of all integers?
25 / 53
Example
If no domain of discourse has been identified, a proposition such
as ∀x, (x2 6= 2) is ambiguous.
If the domain of discourse is the set of real numbers, the
proposition is false, with x =
√
2 as counterexample.
If the domain is the set of naturals, the proposition is true, since
2 is not the square of any natural number.
26 / 53
Precedence of Quantifiers
The quantifiers ∀ and ∃ have higher precedence than all logical
operators from propositional logic.
∀xP(x) ∧ Q(x) means (∀xP(x)) ∧ Q(x). In particular, this
expression contains a free variable.
∀x(P(x) ∧ Q(x)) means something different.
27 / 53
Problem
Domain is empty. What is the truth value of ∀xP(x) and ∃xP(x)?
28 / 53
Binding Variables
When a quantifier is used on the variable x, we say that this
occurrence of the variable is bound.
An occurrence of a variable that is not bound by a quantifier
or set equal to a particular value is said to be free.
The part of a logical expression to which a quantifier is applied
is called the scope of this quantifier.
A variable is free if it is outside the scope of all quantifiers in
the formula that specify this variable.
A statement with free variable is not a proposition.
Example
1 ∃x(x + y = 1)
2 ∃x(P(x) ∧ Q(x)) ∨ ∀xR(x)
29 / 53
Question
30 / 53
Logical Equivalences Involving Quantifiers
Definition
Statements involving predicates and quantifiers are logically
equivalent if they have the same truth value no matter which
predicates are substituted into these statements and which domain
of discourse is used for the variables in these propositional
functions.
Example
1 ∀x (P(x) ∧ Q(x)) ≡ ∀xP(x) ∧ ∀x Q(x)
2 ∃x (P(x) ∨ Q(x)) ≡ ∃xP(x) ∨ ∃x Q(x)
3 ∀x (P(x) ∨ Q(x)) 6≡ ∀xP(x) ∨ ∀x Q(x)
4 ∃x (P(x) ∧ Q(x)) 6≡ ∃xP(x) ∧ ∃x Q(x)
5 ∀x (P(x) → Q(x)) 6≡ ∀xP(x) → ∀x Q(x)
6 ∃x (P(x) → Q(x)) 6≡ ∃xP(x) → ∃x Q(x)
31 / 53
Distribution of ∀ over ∧
∀x (P(x) ∧ Q(x)) ≡ ∀x P(x) ∧ ∀x Q(x)
32 / 53
Distribution of ∀ over ∨
∀x (P(x) ∨ Q(x)) 6≡ ∀x P(x) ∨ ∀x Q(x)
P(x) : x is odd
Q(x) : x is even
Domain : Set of all integers.
33 / 53
Distribution of ∃ over ∧
∃x (P(x) ∧ Q(x)) 6≡ ∃x P(x) ∧ ∃x Q(x)
P(x) : x is odd
Q(x) : x is even
Domain : Set of all integers.
34 / 53
Quantifiers as Conjunctions& Disjunctions
If the domain is finite then universal/existential quantifiers can
be expressed by conjunctions/disjunctions.
If D consists of the integers 1,2, and 3, then sub
∀xP(x) ≡ P(1) ∧ P(2) ∧ P(3)
∃xP(x) ≡ P(1) ∨ P(2) ∨ P(3)
Even if the domains are infinite, you can still think of the
quantifiers in this fashion, but the equivalent expressions
without quantifiers will be infinitely long.
35 / 53
De Morgan’s Law for Quantifiers
The rules for negating quantifiers are:
¬∀xP(x) ≡ ∃x¬P(x)
¬∃xP(x) ≡ ∀x¬P(x)
Example (Do these two statements have the same meaning?)
1 Not every PSG student majors in computer science.
2 There is PSG student who does not major in computer
science.
Example (Do these two statements have the same meaning?)
1 There is no PSG student living in Chennai
2 Every PSG student lives in a town other than Chennai
36 / 53
Quantifier negation
Example (Find the negation of the following quantified
statements.)
1 Every student in your class has taken a course in calculus.
2 Some people are born lucky.
3 All dogs bark
4 Most cars are inexpensive.
37 / 53
Exercise
Negation of Quantified Statements
1 Every day I bring breakfast to college.
2 (∀x ∈ Z) ( x is a multiple of 2).
3 (∃x ∈ Z)(x3 > 0).
4 Some math majors have red hair
38 / 53
Nested Quantifiers
39 / 53
Commutativity and Distributivity of quantifiers
∀x∀y P(x, y) ≡ ∀y ∀x P(x, y)
∃x∃y P(x, y) ≡ ∃y ∃x P(x, y)
∀x∃y P(x, y) 6≡ ∃y ∀x P(x, y)
40 / 53
Translating from Logical Expressions into English
Example
Translate the statement ∀x(C(x) ∨ ∃y(C(y) ∧ F(x, y))) into
English, where
C(x) : “x has a computer”
F(x, y) is “x and y are friends”
the domain for both x and y is the set of all students in your
college.
41 / 53
Translating from Logical Expressions into English
Example
Translate the statement ∀x(C(x) ∨ ∃y(C(y) ∧ F(x, y))) into
English, where
C(x) : “x has a computer”
F(x, y) is “x and y are friends”
the domain for both x and y is the set of all students in your
college.
The statement says that
For every student x in your college x has a computer or there
is a student y such that y has a computer and x and y are
friends.
In other words, every student in your school has a computer or
has a friend who has a computer.
41 / 53
Translating from Logical Expressions into English
Example
Translate the statement “Everyone has exactly one best friend” as
a logical expression.
B(x, y) : y is the best friend of x.
∀x∃y∀z(B(x, y) ∧ ((z 6= y) → ¬B(x, z)))
42 / 53
An Example from Calculus
Example
Express that the limit of a real-valued function f at point a is L.
lim
x→a
f (x) = L
In predicate logic
∀ ∃δ ∀x (| x − a | δ →| f (x) − L | )
where the domain of  and δ are the positive real numbers and the
domain of x are all real numbers.
Now express its negation, i.e., lim
x→a
f (x) 6= L
∃ ∀δ ∃x (| x − a | δ ∧ | f (x) − L |≥ )
43 / 53
Rules of Inference for Quantified Statements
44 / 53
Combining Rules of Inference for Propositions and
Quantified Statements
These inference rules are frequently used and combine propositions
and quantified statements:
45 / 53
Problem-1
Example
Show that the premises “Everyone in this discrete mathematics
class has taken a course in computer science” and “Megha is a
student in this class” imply the conclusion “Megha has taken a
course in computer science.”
D(x) : “x is in this discrete mathematics class
C(x) : “x has taken a course in computer science.
Hypotheses: ∀x (D(x) → C(x)) and D(Megha).
Conclusion: C(Megha).
46 / 53
Problem-2
Example
Show that the premises:
A student in this class has not read the book.
Everyone in this class passed the first exam.
imply the conclusion
Someone who passed the first exam has not read the book.
47 / 53
Problem-2
Example
Show that the premises:
A student in this class has not read the book.
Everyone in this class passed the first exam.
imply the conclusion
Someone who passed the first exam has not read the book.
A(x) : “x is in this class”
B(x) : “x read the book”
P(x) : “x passed the first exam”
47 / 53
Problem-2
Example
Show that the premises:
A student in this class has not read the book.
Everyone in this class passed the first exam.
imply the conclusion
Someone who passed the first exam has not read the book.
A(x) : “x is in this class”
B(x) : “x read the book”
P(x) : “x passed the first exam”
Hypotheses: ∃x (A(x) ∧ ¬B(x)) and ∀x (A(x) → P(x)).
Conclusion: ∃x (P(x) ∧ ¬B(x)).
47 / 53
Problem-2 - Solution
Hypotheses: ∃x (A(x) ∧ B(x)) and ∀x (A(x) → P(x)).
Conclusion: ∃x (P(x) ∧ ¬B(x)).
48 / 53
Problem-2 - Solution
Hypotheses: ∃x (A(x) ∧ B(x)) and ∀x (A(x) → P(x)).
Conclusion: ∃x (P(x) ∧ ¬B(x)).
48 / 53
Problem-3
Example
Every man has two legs.
John Smith is a man.
Therefore, John Smith has two legs.
Define the predicates:
M(x) : x is a man
L(x) : x has two legs
J : John Smith, a member of the domain
49 / 53
Problem-4
Is the wff a valid argument? Prove or disprove.
Example
∃x R(x)
¬∃x [R(x) ∧ S(x)]
Therefore, ∃x ¬S(x)
50 / 53
Exercise-1
Question
Verify the validity of the argument:
Hypotheses: ∀x (P(x) ∨ Q(x)) and
∀x ((¬P(x) ∧ Q(x)) → R(x))
Conclusion: ∀x (¬R(x) → P(x)).
51 / 53
Exercise-2
Question
Show that the following argument is valid:
All Canny integers are non-Slotty
3 is Canny
All Bumpy integers are Slotty
Therefore, There is an integer that is not Bumpy
C(x) : x is a Canny integer
S(x) : x is a Slotty integer
B(x) : x is a Bumpy integer
52 / 53
Exercise-3
Question
Show that the following argument is valid: “Every laptop has an
internal disk drive. Some laptops have a DVD drive. Therefore
some laptops have both an internal disk drive and a DVD drive.”
Using the following predicates:
L(x) is “x is a laptop.”
I(x) is “x has an internal disk drive.”
D(x) is “x has a DVD drive.”
53 / 53

More Related Content

Similar to Predicate Logic and Propositional Logic in Discrete Structure (20)

PPTX
Disc.Math-ppt.pptx it is very informative presentation for bachelor students ...
aligohark35
 
PPTX
Math
Hafiz Safwan
 
PPT
CSci102_Module 4.ppt
HarleyGotardo
 
DOCX
PredicatesQuantifiers.docx
WaqasSami6
 
PPT
Predicates and Quantifiers
blaircomp2003
 
PPTX
Quantifiers and its Types
HumayunNaseer4
 
PPTX
Slide subtopic 3
Eli Lilly and Company
 
PPTX
Predicates and Quantifiers
Istiak Ahmed
 
PPTX
Predicates and quantifiers
Istiak Ahmed
 
PPT
Per3 logika
Evert Sandye Taasiringan
 
PDF
Chapter 01 - p2.pdf
smarwaneid
 
PPT
PredicateLogic (1).ppt
keerthana592112
 
PPTX
PredicateLogic.pptx
santhosh sriprada
 
PPT
Nested loop
Lal Bdr. Saud
 
PDF
Discrete Mathematics: Lecture 2 - Predicate Logic
saharsoussa
 
PDF
Predicate_Logic.pdf
KiranNats
 
DOCX
Chapter 3
Eli Lilly and Company
 
PPTX
predicate and appliedmathemeticsfour.pptx
PallaviPandey64
 
PPTX
Propositional Logic.pptx discrete mathmatics
muhammadali82230
 
PPT
Predicate Logic
giki67
 
Disc.Math-ppt.pptx it is very informative presentation for bachelor students ...
aligohark35
 
CSci102_Module 4.ppt
HarleyGotardo
 
PredicatesQuantifiers.docx
WaqasSami6
 
Predicates and Quantifiers
blaircomp2003
 
Quantifiers and its Types
HumayunNaseer4
 
Slide subtopic 3
Eli Lilly and Company
 
Predicates and Quantifiers
Istiak Ahmed
 
Predicates and quantifiers
Istiak Ahmed
 
Chapter 01 - p2.pdf
smarwaneid
 
PredicateLogic (1).ppt
keerthana592112
 
PredicateLogic.pptx
santhosh sriprada
 
Nested loop
Lal Bdr. Saud
 
Discrete Mathematics: Lecture 2 - Predicate Logic
saharsoussa
 
Predicate_Logic.pdf
KiranNats
 
predicate and appliedmathemeticsfour.pptx
PallaviPandey64
 
Propositional Logic.pptx discrete mathmatics
muhammadali82230
 
Predicate Logic
giki67
 

Recently uploaded (20)

PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PPTX
ENG8_Q1_WEEK2_LESSON1. Presentation pptx
marawehsvinetshe
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PPTX
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PDF
WATERSHED MANAGEMENT CASE STUDIES - ULUGURU MOUNTAINS AND ARVARI RIVERpdf
Ar.Asna
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Workbook de Inglés Completo - English Path.pdf
shityouenglishpath
 
PPTX
SD_GMRC5_Session 6AB_Dulog Pedagohikal at Pagtataya (1).pptx
NickeyArguelles
 
PPTX
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
ENG8_Q1_WEEK2_LESSON1. Presentation pptx
marawehsvinetshe
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
Introduction presentation of the patentbutler tool
MIPLM
 
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
WATERSHED MANAGEMENT CASE STUDIES - ULUGURU MOUNTAINS AND ARVARI RIVERpdf
Ar.Asna
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Workbook de Inglés Completo - English Path.pdf
shityouenglishpath
 
SD_GMRC5_Session 6AB_Dulog Pedagohikal at Pagtataya (1).pptx
NickeyArguelles
 
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
Ad

Predicate Logic and Propositional Logic in Discrete Structure

  • 1. Predicate Logic Predicate & Quantifier Dr. S. Jeevadoss Assistant Professor Department of Applied Mathematics & Computational Sciences PSG College of Technology, Coimbatore. February 19, 2021 1 / 53
  • 2. From Proposition to Predicate Propositional logic studied earlier cannot express the meanings of statements in mathematics and in natural language. Predicate logic extends (is more powerful than) propositional logic. 3 + 2 = 5 is a proposition. But is X + 2 = 5 a proposition? Because it has a variable X in it, we cannot say it is TRUE or FALSE. So, it is not a proposition. It is called a predicate. 2 / 53
  • 3. Predicate vs. Proposition Example 1 Every computer connected to the university network is functioning properly. 2 Someone in this room is sleeping now. 3 Not all birds fly 4 Everyone in this class will pass the midterm. Example 1 There exists an integer x such that 3x2 = 0. 2 The square of every real number is greater than 0. 3 If p is a prime and a is any integer not divisible by p, then ap−1 − 1 is divisible by p. 4 There are infinitely many prime numbers. 3 / 53
  • 4. Predicate vs. Proposition Definition A predicate is a sentence with variables and becomes a proposition, when specific values are substituted for the variables. A predicate is a function. It takes some variable(s) as arguments; it returns either True or False (but not both) for each combination of the argument values. Note: In contrast, a proposition is not a function. It does not have any variable as argument. It is either True or False (but not both). 4 / 53
  • 5. Predicates Let P(x) be the statement involving the variable x. P denotes the predicate and x is variable P(x) is also said to be the value of the propositional function P at x Let P(x) denote the sentence “x is greater than 3”. It has two parts. 1 The variable “x”: The subject of the sentence. 2 The predicate “is greater than 3” : The property that the subject can have. 5 / 53
  • 6. Predicates -Example 1 Example Let P(x) denotes “x > 3”. P(5) is TRUE P(2) is FALSE P(3) is FALSE 6 / 53
  • 7. Predicates-Example 2 Example Let P(x, y, z) denote that x + y = z and D be the integers for all three variables. P(−4, 6, 2) is TRUE P(5, 2, 10) is FALSE P(1, 2.5, 3.5) is not a proposition P(2, y, 6) is not a proposition 7 / 53
  • 8. Predicates-Example 3 Example A(x) = Computer x is under attack by a hacker. Suppose only CS2 and MATH1 are currently under attack. What are the truth values of A(CS1) ≡ A(CS2) ≡ A(MATH1) ≡ 8 / 53
  • 9. Domain of discourse Definition (Domain) The variables are always associated with a universe (or domain) of discourse, which tells us what combinations of the argument values are allowed. The domain of a predicate variable is the set of all values that may be substituted in place of the variable. The domain is often denoted by U (the universe) or D (the domain). Suppose P(x) is a predicate, where the universe of discourse for x is {1, 2, 3}. Then P(x) is not a proposition, but P(1) is a proposition as well as P(5) is not a proposition. In general, a predicate is not a proposition. But when you assign values to all its argument variables, you get a proposition. 9 / 53
  • 10. Domain - Example-1 Example P(x, y) :“x + 2 = y” is a predicate. It has two variables x and y; Universe of Discourse: x is in {1, 2, 3}; y is in {4, 5, 6}. 1 P(1, 4) : 1 + 2 = 4 is a proposition (it is FALSE); 2 P(2, 4) : 2 + 2 = 4 is a proposition (it is TRUE); 3 P(2, 3) : meaningless (in this example), because 3 is not in the specified universe of discourse for y. 10 / 53
  • 11. Domain - Practice Problem-1 Example 1 P(x) : “(x > 3) ∨ (x < 3) ”. What are the truth values of P(2), P(3), and P(4)? 2 Q(x, y) : x = y + 3. What are the truth values of the propositions Q(1, 2) = Q(3, 0) = Example 1 Every computer connected to the university network is functioning properly. 2 The square of every real number is greater than 0. 3 There are infinitely many prime numbers. 4 Not all birds fly 5 Everyone in this class will pass the midterm. 11 / 53
  • 12. Domain - Practice Problem-2 Question Suppose Q(x, y) : “x + y > 4,” where the universe of discourse is all integer pairs. Which of the following are predicates? Which are propositions? 1 Q(1, 2) 2 Q(1000, 2) 3 Q(x, 2) 4 Q(1000, y) 5 Q(x, y) 12 / 53
  • 13. Exercise Let Q(x, y, z) denote that x − y = z and D be the integers. Which of the following are predicates? Which are propositions? 1 P(1, 2, 3) ∧ Q(5, 4, 1) 2 P(1, 2, 4) → Q(5, 4, 0) 3 P(1, 2, 3) ↔ Q(5, 4, 0) 4 P(1, 2, 4) ∨ Q(x, 4, 0) 13 / 53
  • 14. Quantifiers Quantification is another way of converting a predicate into a proposition. We need quantifiers to formally express the meaning of the words “all” and “some”. In English, the words all, some, many, none, and few are used in quantifications. 1 Universal quantification 2 Existential quantification 3 Uniqueness quantifier 4 Quantifiers with restricted domains 14 / 53
  • 15. Universal quantification & Existential quantification (The two most important quantifiers are:) Universal quantifier, “For all”. Symbol: ∀ Existential quantifier, “There exists”. Symbol: ∃ 15 / 53
  • 16. Universal quantification Definition Suppose P(x) is a predicate on some domain D. The universal quantification of P(x) is the proposition: “P(x) for all values of x in the domain ” We write ∀x, P(x). ∀ : Universal Quantifier ∀x P(x) ≡ T : if P(x) is true for every x in D ∀x P(x) ≡ F : if P(x) is false for at least one x in D The truth values depends not only on P, but also on the domain D. 16 / 53
  • 17. Existential quantification Definition Suppose P(x) is a predicate on some domain D. The existential quantification of P(x) is the proposition: “There exists an element x in the domain such that P(x). ” We write ∃x, P(x). ∃ : Existential Quantifier ∃x P(x) ≡ T : if P(x) is true for any (at least one) x in D ∃x P(x) ≡ F : if P(x) is false for every x in D The truth values depends not only on P, but also on the domain D. 17 / 53
  • 18. Universal quantification & Existential quantification 18 / 53
  • 19. Universal quantification Example Example P(x) : x + 2 = 5, Domain: {1, 2, 3}. ∀x, P(x) means: “for all x in {1, 2, 3}, x + 2 = 5”. In other words, it means: “1+2=5, 2+2=5, and 3+2=5”, which is false. So it is a proposition. Example A(x) : x = 1, B(x) : x > 2, C(x) : x < 2 Domain: {1, 2, 3}. TRUE or FLASE? 1 ∀x, (C(x) → A(x)) 2 ∀x, (C(x) ∨ B(x)) 19 / 53
  • 20. Existential quantification Example Example P(x) : x + 2 = 5, Domain: {1, 2, 3}. ∃x, P(x) means: “for some x in {1, 2, 3}, x + 2 = 5”. In other words, it means: “1+2=5, 2+2=5, and 3+2=5”, which is True. So it is a proposition. Example A(x) : x = 1, B(x) : x > 2, C(x) : x < 2 Domain: {1, 2, 3}. TRUE or FLASE? 1 ∃x, (C(x) → A(x)) 2 ∃x, (¬B(x)) 20 / 53
  • 21. Translating from English into Logical Expressions Question Express the statements “Every student in this class has studied calculus” and “Some student in this class has visited Mexico” using predicates and quantifiers. 21 / 53
  • 22. Translating from English into Logical Expressions Example Using the predicate symbols S(x) : x is a student, I(x) : x is intelligent, M(x) : x likes music, write wffs that express the following statements. The domain is the collection of all people. 1 All students are intelligent. 2 Some intelligent students like music. 3 Everyone who likes music is a stupid student. 4 Only intelligent students like music. 22 / 53
  • 23. Translating from English into Logical Expressions Exercise1 A(x) : “x lives in Chennai.” B(x) : “x is a CSE student.” C(x) : “x has a good GPA.” D(x) : “x majors in mathematics.” Domain: all PSG students 1 All CSE students have good GPA 2 No CSE student lives in Chennai 3 CSE students who do not live in Chennai major in mathematics 23 / 53
  • 24. Translating from English into Logical Expressions Exercise2 Translate each of these statements into logical expressions using predicates, quantifiers, and logical connectives. P(x) : “x is perfect.” F(x) : “x is your friend.” Domain: all people 1 No one is perfect. 2 Not everyone is perfect. 3 All your friends are perfect. 4 At least one of your friends is perfect. 5 Everyone is your friend and is perfect. 6 Not everybody is your friend or someone is not perfect. 24 / 53
  • 25. Problem Example What is the truth value of ∀x(x2 ≥ x) if the domain consists of all real numbers? What is the truth value of this statement if the domain consists of all integers? 25 / 53
  • 26. Example If no domain of discourse has been identified, a proposition such as ∀x, (x2 6= 2) is ambiguous. If the domain of discourse is the set of real numbers, the proposition is false, with x = √ 2 as counterexample. If the domain is the set of naturals, the proposition is true, since 2 is not the square of any natural number. 26 / 53
  • 27. Precedence of Quantifiers The quantifiers ∀ and ∃ have higher precedence than all logical operators from propositional logic. ∀xP(x) ∧ Q(x) means (∀xP(x)) ∧ Q(x). In particular, this expression contains a free variable. ∀x(P(x) ∧ Q(x)) means something different. 27 / 53
  • 28. Problem Domain is empty. What is the truth value of ∀xP(x) and ∃xP(x)? 28 / 53
  • 29. Binding Variables When a quantifier is used on the variable x, we say that this occurrence of the variable is bound. An occurrence of a variable that is not bound by a quantifier or set equal to a particular value is said to be free. The part of a logical expression to which a quantifier is applied is called the scope of this quantifier. A variable is free if it is outside the scope of all quantifiers in the formula that specify this variable. A statement with free variable is not a proposition. Example 1 ∃x(x + y = 1) 2 ∃x(P(x) ∧ Q(x)) ∨ ∀xR(x) 29 / 53
  • 31. Logical Equivalences Involving Quantifiers Definition Statements involving predicates and quantifiers are logically equivalent if they have the same truth value no matter which predicates are substituted into these statements and which domain of discourse is used for the variables in these propositional functions. Example 1 ∀x (P(x) ∧ Q(x)) ≡ ∀xP(x) ∧ ∀x Q(x) 2 ∃x (P(x) ∨ Q(x)) ≡ ∃xP(x) ∨ ∃x Q(x) 3 ∀x (P(x) ∨ Q(x)) 6≡ ∀xP(x) ∨ ∀x Q(x) 4 ∃x (P(x) ∧ Q(x)) 6≡ ∃xP(x) ∧ ∃x Q(x) 5 ∀x (P(x) → Q(x)) 6≡ ∀xP(x) → ∀x Q(x) 6 ∃x (P(x) → Q(x)) 6≡ ∃xP(x) → ∃x Q(x) 31 / 53
  • 32. Distribution of ∀ over ∧ ∀x (P(x) ∧ Q(x)) ≡ ∀x P(x) ∧ ∀x Q(x) 32 / 53
  • 33. Distribution of ∀ over ∨ ∀x (P(x) ∨ Q(x)) 6≡ ∀x P(x) ∨ ∀x Q(x) P(x) : x is odd Q(x) : x is even Domain : Set of all integers. 33 / 53
  • 34. Distribution of ∃ over ∧ ∃x (P(x) ∧ Q(x)) 6≡ ∃x P(x) ∧ ∃x Q(x) P(x) : x is odd Q(x) : x is even Domain : Set of all integers. 34 / 53
  • 35. Quantifiers as Conjunctions& Disjunctions If the domain is finite then universal/existential quantifiers can be expressed by conjunctions/disjunctions. If D consists of the integers 1,2, and 3, then sub ∀xP(x) ≡ P(1) ∧ P(2) ∧ P(3) ∃xP(x) ≡ P(1) ∨ P(2) ∨ P(3) Even if the domains are infinite, you can still think of the quantifiers in this fashion, but the equivalent expressions without quantifiers will be infinitely long. 35 / 53
  • 36. De Morgan’s Law for Quantifiers The rules for negating quantifiers are: ¬∀xP(x) ≡ ∃x¬P(x) ¬∃xP(x) ≡ ∀x¬P(x) Example (Do these two statements have the same meaning?) 1 Not every PSG student majors in computer science. 2 There is PSG student who does not major in computer science. Example (Do these two statements have the same meaning?) 1 There is no PSG student living in Chennai 2 Every PSG student lives in a town other than Chennai 36 / 53
  • 37. Quantifier negation Example (Find the negation of the following quantified statements.) 1 Every student in your class has taken a course in calculus. 2 Some people are born lucky. 3 All dogs bark 4 Most cars are inexpensive. 37 / 53
  • 38. Exercise Negation of Quantified Statements 1 Every day I bring breakfast to college. 2 (∀x ∈ Z) ( x is a multiple of 2). 3 (∃x ∈ Z)(x3 > 0). 4 Some math majors have red hair 38 / 53
  • 40. Commutativity and Distributivity of quantifiers ∀x∀y P(x, y) ≡ ∀y ∀x P(x, y) ∃x∃y P(x, y) ≡ ∃y ∃x P(x, y) ∀x∃y P(x, y) 6≡ ∃y ∀x P(x, y) 40 / 53
  • 41. Translating from Logical Expressions into English Example Translate the statement ∀x(C(x) ∨ ∃y(C(y) ∧ F(x, y))) into English, where C(x) : “x has a computer” F(x, y) is “x and y are friends” the domain for both x and y is the set of all students in your college. 41 / 53
  • 42. Translating from Logical Expressions into English Example Translate the statement ∀x(C(x) ∨ ∃y(C(y) ∧ F(x, y))) into English, where C(x) : “x has a computer” F(x, y) is “x and y are friends” the domain for both x and y is the set of all students in your college. The statement says that For every student x in your college x has a computer or there is a student y such that y has a computer and x and y are friends. In other words, every student in your school has a computer or has a friend who has a computer. 41 / 53
  • 43. Translating from Logical Expressions into English Example Translate the statement “Everyone has exactly one best friend” as a logical expression. B(x, y) : y is the best friend of x. ∀x∃y∀z(B(x, y) ∧ ((z 6= y) → ¬B(x, z))) 42 / 53
  • 44. An Example from Calculus Example Express that the limit of a real-valued function f at point a is L. lim x→a f (x) = L In predicate logic ∀ ∃δ ∀x (| x − a | δ →| f (x) − L | ) where the domain of and δ are the positive real numbers and the domain of x are all real numbers. Now express its negation, i.e., lim x→a f (x) 6= L ∃ ∀δ ∃x (| x − a | δ ∧ | f (x) − L |≥ ) 43 / 53
  • 45. Rules of Inference for Quantified Statements 44 / 53
  • 46. Combining Rules of Inference for Propositions and Quantified Statements These inference rules are frequently used and combine propositions and quantified statements: 45 / 53
  • 47. Problem-1 Example Show that the premises “Everyone in this discrete mathematics class has taken a course in computer science” and “Megha is a student in this class” imply the conclusion “Megha has taken a course in computer science.” D(x) : “x is in this discrete mathematics class C(x) : “x has taken a course in computer science. Hypotheses: ∀x (D(x) → C(x)) and D(Megha). Conclusion: C(Megha). 46 / 53
  • 48. Problem-2 Example Show that the premises: A student in this class has not read the book. Everyone in this class passed the first exam. imply the conclusion Someone who passed the first exam has not read the book. 47 / 53
  • 49. Problem-2 Example Show that the premises: A student in this class has not read the book. Everyone in this class passed the first exam. imply the conclusion Someone who passed the first exam has not read the book. A(x) : “x is in this class” B(x) : “x read the book” P(x) : “x passed the first exam” 47 / 53
  • 50. Problem-2 Example Show that the premises: A student in this class has not read the book. Everyone in this class passed the first exam. imply the conclusion Someone who passed the first exam has not read the book. A(x) : “x is in this class” B(x) : “x read the book” P(x) : “x passed the first exam” Hypotheses: ∃x (A(x) ∧ ¬B(x)) and ∀x (A(x) → P(x)). Conclusion: ∃x (P(x) ∧ ¬B(x)). 47 / 53
  • 51. Problem-2 - Solution Hypotheses: ∃x (A(x) ∧ B(x)) and ∀x (A(x) → P(x)). Conclusion: ∃x (P(x) ∧ ¬B(x)). 48 / 53
  • 52. Problem-2 - Solution Hypotheses: ∃x (A(x) ∧ B(x)) and ∀x (A(x) → P(x)). Conclusion: ∃x (P(x) ∧ ¬B(x)). 48 / 53
  • 53. Problem-3 Example Every man has two legs. John Smith is a man. Therefore, John Smith has two legs. Define the predicates: M(x) : x is a man L(x) : x has two legs J : John Smith, a member of the domain 49 / 53
  • 54. Problem-4 Is the wff a valid argument? Prove or disprove. Example ∃x R(x) ¬∃x [R(x) ∧ S(x)] Therefore, ∃x ¬S(x) 50 / 53
  • 55. Exercise-1 Question Verify the validity of the argument: Hypotheses: ∀x (P(x) ∨ Q(x)) and ∀x ((¬P(x) ∧ Q(x)) → R(x)) Conclusion: ∀x (¬R(x) → P(x)). 51 / 53
  • 56. Exercise-2 Question Show that the following argument is valid: All Canny integers are non-Slotty 3 is Canny All Bumpy integers are Slotty Therefore, There is an integer that is not Bumpy C(x) : x is a Canny integer S(x) : x is a Slotty integer B(x) : x is a Bumpy integer 52 / 53
  • 57. Exercise-3 Question Show that the following argument is valid: “Every laptop has an internal disk drive. Some laptops have a DVD drive. Therefore some laptops have both an internal disk drive and a DVD drive.” Using the following predicates: L(x) is “x is a laptop.” I(x) is “x has an internal disk drive.” D(x) is “x has a DVD drive.” 53 / 53