Predicate Logic, Discrete Mathematics
Dr. Mohammad Salah Uddin
Associate Professor
Dept. of CSE
East West University
November 11, 2024
Limitations of Propositional Logic
■ Lack of Expressiveness:
Propositional logic cannot express statements involving variables or
quantifiers. For example, statements like “All humans are mortal”
or “Some dogs are friendly” cannot be represented.
■ No Relations Between Objects:
It cannot express relationships between multiple entities, such as
“John is taller than Sarah.”
■ Scalability Issues:
Propositional logic needs a separate statement for each fact. When
there are many facts to represent, it becomes hard to manage. For
example, describing each person in a large group would require
many individual statements, making it difficult to work with on a
large scale.
■ No Quantifiers:
Propositional logic lacks quantifiers like “for all” (∀) and “there
exists” (∃). Statements involving generalization or existence
2 of 42
Examples of Limitations in Propositional Logic
Example 1: Representing People in a Group
■ To express ”Shanto is a student,” “Urmi is a student,” and ”Wasim
is a student,” propositional logic requires separate statements:
Student Shanto, Student Urmi, Student Wasim
■ With 1000 students, 1000 statements would be needed, making it
hard to manage.
3 of 42
Examples of Limitations in Propositional Logic
(Contd.)
Example 2: Expressing Universal Truths
■ To represent “All dogs are friendly,” propositional logic requires a
statement for each dog:
Friendly Dog1, Friendly Dog2, Friendly Dog3, . . .
■ Predicate logic can simplify this as:
∀x (Dog(x) → Friendly(x))
4 of 42
Examples of Limitations in Propositional Logic
(Contd.)
Example 3: Describing Relationships
■ For statements like “John likes Mary” and “Alam likes Bithi,”
propositional logic needs unique statements for each pair:
Likes John Mary, Likes Alam Bithi
■ Predicate logic allows us to express “likes” as a relationship:
Likes(x, y )
■ This approach avoids listing every possible pair individually.
5 of 42
Predicate Logic (First-Order Logic)
Predicate logic overcomes the limitations of propositional logic by
introducing:
■ Objects and Predicates: Statements are constructed using
objects (e.g., John, Dog) and predicates (e.g., is mortal,
loves).
□ Example: Loves(John, Mary) means “John loves Mary.”
■ Quantifiers:
□ Universal Quantifier (∀): Used for statements true for all members
of a set.
∀x Human(x) → Mortal(x)
Meaning: “All humans are mortal.”
□ Existential Quantifier (∃): Used for statements where at least one
member of a set satisfies a condition.
∃x Dog(x) ∧ Friendly(x)
Meaning: “There exists a dog that is friendly.”
6 of 42
Complex Relationships in Predicate Logic
Predicate logic allows us to express complex relationships between
multiple objects, which is not possible in propositional logic. Here are
some examples:
■ Taller(John, Mary) means “John is taller than Mary.”
■ This relationship involves two objects (John and Mary) and the
predicate “Taller.”
■ Parent(Alice, Bob) means “Alice is a parent of Bob.”
■ Sibling(Bob, Sarah) means “Bob and Sarah are siblings.”
■ Predicate logic allows us to define relationships between family
members clearly.
■ Owns(Alam, BookJava) means “Alam owns java Book.”
■ Owns(John, Car) means “John owns a car.”
7 of 42
Relationships in Predicate Logic
■ WorksFor(Emma, CompanyA) means “Emma works for
CompanyA.”
■ Manages(Sarah, Emma) means “Sarah manages Emma.”
■ Teaches(ProfSmith, Calculus) means “Professor Smith
teaches Calculus.”
■ Studies(StudentX, Calculus) means “Student X studies
Calculus.”
8 of 42
Building Blocks of Predicate Logic
Predicate logic, also known as First-Order Logic, consists of several
key components that allow it to represent complex statements and
relationships. Here are the main building blocks:
■ Objects (Constants):
□ Objects represent specific entities or items within a domain.
□ Examples: John, Alice, Dog1, BookA
■ Predicates:
□ Predicates represent properties of objects or relationships between
objects.
□ Notation: Predicate(Object) or Predicate(Object1, Object2)
□ Examples: Human(John) means “John is a human”; Loves(John,
Mary) means “John loves Mary.”
■ Variables:
□ Variables are placeholders that can represent any object in the domain.
□ Notation: Typically denoted by lowercase letters such as x, y, z.
□ Example: In Loves(x, Mary), x can represent any person who might
love Mary.
9 of 42
Building Blocks of Predicate Logic
■ Quantifiers:
□ Universal Quantifier (∀): Asserts that a statement is true for all
objects in the domain.
∀x (Human(x) → Mortal(x))
Meaning: “All humans are mortal.”
□ Existential Quantifier (∃): Asserts that a statement is true for at
least one object in the domain.
∃x (Dog(x) ∧ Friendly(x))
Meaning: “There exists a dog that is friendly.”
■ Logical Connectives:
□ Connectives are used to form complex statements.
■ Conjunction (∧): And
■ Disjunction (∨): Or
■ Negation (¬): Not
■ Implication (→): If-then
□ Example: Human(x) ∧ Mortal(x) means “x is both human and
10 of 42
mortal.”
Domain in Predicate Logic
In predicate logic, the domain is the set of all possible objects that
variables in predicate statements can represent. The choice of domain
affects the truth value of statements, especially when using
quantifiers.
■ Definition of Domain
□ The domain is the collection of objects that variables can refer to in a
logical statement.
□ The domain is often specified based on the context, such as “all
people,” “all students,” or “all natural numbers.”
■ Example Domains and Their Impact on Truth Values
□ Example 1: Domain = {All people}
■ Predicate: Loves(x, y) - ”x loves y.”
■ Statement: ∀x ∃y Loves(x, y )
■ Meaning: ”Every person loves someone.”
■ Truth Value: True or false, depending on whether each person in the
domain has someone they love.
□ Example 2: Domain = {All natural numbers}
■ Predicate: Even(x) - “x is an even number.”
11 of 42 ■
Statement: ∀x (x > 0 → Even(x) ∨ ¬Even(x))
Identifying Predicates in Predicate Logic
In predicate logic, a predicate is an expression that represents a
property of objects or a relationship between objects. It takes one or
more arguments (objects or variables) and returns true or false.
■ Predicates (Valid):
□ Human(John) - Represents the property ”John is a human.”
□ Loves(Alice, Bob) - Represents the relationship ”Alice loves Bob.”
□ GreaterThan(x, y) - Represents the relationship ”x is greater than
y.”
□ Dog(D) - Represents the property ”D is a dog.”
■ Not Predicates (Invalid):
□ John - This is simply a constant representing an object, not a
predicate.
□ Human - Without any argument, it does not convey a complete
meaning (no specific object is described as human).
□ Loves(Alice) - Predicates require the correct number of arguments;
”Loves” expects two arguments to complete the relationship.
□ 3 + 4 - This is an arithmetic expression; it does not convey a
12 of 42 property or relationship that can be true or false.
Understanding Predicates
Predicates represent properties or relationships among objects. A
predicate P(x) assigns a truth value (true or false) to each x
depending on whether the property holds for x.
■ The assignment is best viewed as a big table with the variable x
substituted for objects from the universe of discourse
Example:
■ Let Student(x) denote a predicate where the universe of discourse
is people.
■ Student(John) T (if John is a student)
■ Student(Ann) T (if Ann is a student)
■ Student(Jane) F (if Jane is not a student)
13 of 42
Predicate Logic Example: Prime Numbers
Let P(x) be a predicate representing the statement:
“x is a prime number”
Determine the truth values for each statement below:
■ P(2) T
■ P(3) T
■ P(4) F
■ P(5) T
■ P(6) F
■ P(7) T
■ P(8) F
■ P(9) F
■ P(11) T
14 of 42
Predicate Logic Examples
Let P(x) represent the following statements. Determine the truth
values:
1. P(x): “x is an even number”
■ P(1) F
■ P(2) T
■ P(3) F
■ P(4) T
■ P(5) F
15 of 42
Predicate Logic Examples
2. Q(x): “x is a multiple of 3”
■ Q(3) T
■ Q(4) F
■ Q(6) T
■ Q(8) F
■ Q(9) T
3. R(x): “x is a positive number”
■ R(−2) F
■ R(0) F
■ R(1) T
■ R(5) T
■ R(−10) F
16 of 42
Example: Predicate vs. Proposition
Example: Let Q(x, y ) denote “x + 5 > y ”
■ Is Q(x, y ) a proposition? No! - Q(x, y ) depends on the values of x
and y and does not have a definite truth value without them. - It
is a predicate, not a proposition.
■ Is Q(3, 7) a proposition? Yes, it is true.
□ Truth Values:
■ Q(3, 7): T
■ Q(1, 6): F
■ Q(2, 2): T
■ Is Q(3, y ) a proposition? No! We cannot say if it is true or false
without a specific value for y .
17 of 42
Compound Statements and Logical Connectives
Compound statements combine simpler statements using logical
connectives.
Examples:
■ Student(Lucy) ∧ Student(Jack)
□ Translation: “Both Lucy and Jack are students”
□ Proposition: Yes
■ Country(Dhaka) ∨ River(Dhaka)
□ Translation: “Dhaka is a country or a river”
□ Proposition: Yes
■ CSE-major(x) → Student(x)
□ Translation: “If x is a CSE-major, then x is a student”
□ Proposition: No (depends on the value of x)
18 of 42
Compound Statements: More Examples
More examples of compound statements using logical connectives.
■ Tall(Alice) ∧ Athlete(Alice)
□ Translation: “Alice is tall and an athlete.”
□ Proposition: Yes
■ Animal(Dog) ∨ Plant(Dog)
□ Translation: “A dog is an animal or a plant.”
□ Proposition: Yes
■ Car(x) → Vehicle(x)
□ Translation: “If x is a car, then x is a vehicle.”
□ Proposition: No (depends on the value of x)
■ Rainy(yesterday) ∨ Sunny(today)
□ Translation: “It was rainy yesterday or sunny today.”
□ Proposition: Yes
19 of 42
Universal Quantification
The universal quantification of P(x) is the proposition:
“P(x) is true for all values of x in the domain of discourse.”
■ The notation ∀x P(x) denotes the universal quantification of P(x),
meaning “for every x, P(x) is true.”
Example:
■ Let P(x) denote x > x − 1.
■ What is the truth value of ∀x P(x)?
■ Assume the universe of discourse of x is all real numbers.
■ Answer: Since every real number x is greater than x − 1, ∀x P(x)
is true.
20 of 42
Counterexamples
A universal quantifier ∀x P(x) claims that P(x) is true for every x in
the domain. A single counterexample is enough to disprove it.
Example 1:
■ Let P(x) denote “x 2 ≥ x”.
■ Assume the domain of x is all real numbers.
■ Counterexample: If x = 0.5, then 0.52 = 0.25, which is not
greater than or equal to 0.5.
■ Therefore, ∀x P(x) is false.
Example 2:
■ Let Q(x) denote “x + 1 > x”.
■ Assume the domain of x is all real numbers.
■ There is no counterexample, since x + 1 is always greater than x.
■ Therefore, ∀x Q(x) is true.
21 of 42
Universally Quantified Statements
Example 1: CSE-major(x) → Student(x)
■ Translation: “If x is a CSE-major, then x is a student.”
■ Proposition: No (depends on the value of x)
Example 2: ∀x (CSE-major(x) → Student(x))
■ Translation: “For all people, if a person is a CSE-major, then
she/he is a student.”
■ Proposition: Yes (the statement holds universally across all values
of x)
22 of 42
Existential Quantification
The existential quantification of P(x) is the proposition:
“There exists an element in the domain of discourse such that P(x) is
true.”
■ The notation ∃x P(x) denotes the existential quantification of
P(x), meaning “there is an x such that P(x) is true.”
Example:
■ Let T (x) denote x > 5, where x is a real number.
■ What is the truth value of ∃x T (x)?
■ Answer: Since 10 > 5 is true, there exists an x (e.g., x = 10) such
that T (x) holds.
■ Therefore, ∃x T (x) is true.
23 of 42
More Examples of Existential Quantification
The existential quantifier ∃x P(x) states that there is at least one x in
the domain for which P(x) is true.
Example 1:
■ Let P(x) denote x 2 = 4 with x from real numbers.
■ Truth Value of ∃x P(x): True, since x = 2 or x = −2 satisfies
x 2 = 4.
Example 2:
■ Let Q(x) denote x < 0 where x is from the natural numbers.
■ Truth Value of ∃x Q(x): False, since no natural number is less
than 0.
Example 3:
■ Let R(x) denote x + 3 = 7 with x from the integers.
■ Truth Value of ∃x R(x): True, as x = 4 makes x + 3 = 7.
24 of 42
Statements About Groups of Objects
Example 1:
■ CSE-EWU-graduate(x) ∧ Honor-student(x)
■ Translation: “x is a CSE-EWU graduate and x is an honor
student.”
■ Proposition: No (depends on x, cannot be determined for all x)
Example 2:
■ ∃x (CSE-EWU-graduate(x) ∧ Honor-student(x))
■ Translation: “There exists a person who is both a CSE-EWU
graduate and an honor student.”
■ Proposition: Yes (since we can find such an x)
25 of 42
More Examples: Statements About Groups of Objects
Example 3:
■ Employee(x) ∧ Works-at(x, Company A)
■ Translation: “x is an employee and x works at Company A.”
■ Proposition: No (depends on x, cannot be determined for all x)
Example 4:
■ ∃x (Employee(x) ∧ Works-at(x, Company A))
■ Translation: “There exists a person who is an employee and works
at Company A.”
■ Proposition: Yes (since such an x could exist)
Example 5:
■ ∀x (Student(x) → Attends(x, University B))
■ Translation: “For all x, if x is a student, then x attends University
B.”
■ Proposition: No (depends on x, not necessarily true for all x)
26 of 42
Summary of Quantified Statements
When are ∀x P(x) and ∃x P(x) true or false?
Suppose the universe of discourse consists of x1 , x2 , . . . , xN . Then:
■ ∀x P(x) is true if P(x1 ) ∧ P(x2 ) ∧ · · · ∧ P(xN ) is true.
■ ∃x P(x) is true if P(x1 ) ∨ P(x2 ) ∨ · · · ∨ P(xN ) is true.
Summary Table:
Statement When True?
∀x P(x) P(x) true for all x
∃x P(x) There exists some x for which P(x) is true.
Statement When False?
∀x P(x) There exists an x where P(x) is false.
∃x P(x) P(x) is false for all x.
27 of 42
Translation with Quantifiers
Sentence:
■ All EWU students are smart.
Translations:
■ Case 1: Assume the domain of discourse is EWU students.
□ Translation: ∀x Smart(x)
■ Case 2: Assume the universe of discourse is all students.
□ Translation: ∀x (at(x, EWU) → Smart(x))
■ Case 3: Assume the universe of discourse is all people.
□ Translation: ∀x (student(x) ∧ at(x, EWU) → Smart(x))
28 of 42
Translation with Quantifiers
Sentence:
■ Someone at NSU is smart.
Translations:
■ Case 1: Assume the domain of discourse is all NSU affiliates.
□ Translation: ∃x Smart(x)
■ Case 2: Assume the universe of discourse is all people.
□ Translation: ∃x (at(x, NSU) ∧ Smart(x))
■ Case 3: Assume the universe of discourse is all university students.
□ Translation: ∃x (student(x) ∧ at(x, NSU) ∧ Smart(x))
29 of 42
Translation with Quantifiers
Sentence:
■ There is a vehicle that is electric.
Translations:
■ Case 1: Assume the domain of discourse is all electric vehicles.
□ Translation: ∃x ElectricVehicle(x)
■ Case 2: Assume the universe of discourse is all vehicles.
□ Translation: ∃x (Vehicle(x) ∧ Electric(x))
■ Case 3: Assume the universe of discourse is all type of
transportation.
□ Translation: ∃x (Transportation(x) ∧ Vehicle(x) ∧ Electric(x))
30 of 42
Universal and Existential Statements
Universal Statements:
■ Using Implications:
□ ”All S(x) are P(x)”
■ Translation: ∀x(S(x) → P(x))
□ ”No S(x) is P(x)”
■ Translation: ∀x(S(x) → ¬P(x))
Existential Statements:
■ Using Conjunctions:
□ ”Some S(x) are P(x)”
■ Translation: ∃x(S(x) ∧ P(x))
□ ”Some S(x) are not P(x)”
■ Translation: ∃x(S(x) ∧ ¬P(x))
31 of 42
Nested Quantifiers
■ More than one quantifier may be necessary to capture the meaning
of a statement in predicate logic.
Example:
■ Sentence: “Every real number has its corresponding negative.”
■ Translation:
□ Assume:
■ A real number is denoted as x and its negative as y .
■ A predicate P(x, y ) denotes: x + y = 0.
□ Formal Expression: ∀x∃y P(x, y )
32 of 42
Nested Quantifiers
■ More than one quantifier may be necessary to capture the meaning
of a statement in predicate logic.
Example:
■ Sentence: “There is a person who loves everybody.”
■ Translation:
□ Assume:
■ Variables x and y denote people.
■ A predicate L(x, y ) denotes: “x loves y ”.
□ Formal Expression: ∃x∀y L(x, y )
33 of 42
Order of Quantifiers
Order of Nested Quantifiers:
■ The order of nested quantifiers matters when the quantifiers are of
different types.
■ ∀x∃y L(x, y ) is not the same as ∃y ∀x L(x, y ).
Example:
■ Assume L(x, y ) denotes: ”x loves y”
■ ∀x∃y L(x, y ):
□ Translation: ”Everybody loves somebody.”
■ ∃y ∀x L(x, y ):
□ Translation: ”There is someone who is loved by everyone.”
The meanings of the two expressions are different due to the order of
quantifiers.
34 of 42
Order of Quantifiers (Same Type)
■ The order of nested quantifiers does not matter if the quantifiers
are of the same type (both universal or both existential).
Example:
■ Statement: ”For all x and y , if x is a parent of y , then y is a child
of x.”
■ Assume:
□ Parent(x, y ) denotes: ”x is a parent of y ”
□ Child(x, y ) denotes: ”x is a child of y ”
■ Two equivalent translations:
□ ∀x∀y (Parent(x, y ) → Child(y , x))
□ ∀y ∀x (Parent(x, y ) → Child(y , x))
The order of universal quantifiers (∀) does not affect the meaning in
this context.
35 of 42
Translation with Quantifiers
Suppose:
■ Variables x, y denote people
■ L(x, y ) denotes ”x loves y”
Translations:
■ Everybody loves Raymond:
∀x L(x, Raymond)
■ Everybody loves somebody:
∀x ∃y L(x, y )
■ There is somebody whom everybody loves:
∃y ∀x L(x, y )
■ There is somebody who Raymond doesn’t love:
∃y ¬L(Raymond, y )
■ There is somebody whom no one loves:
∃y ∀x ¬L(x, y )
36 of 42
Examples of Translation with Quantifiers
■ Every student likes some teacher.
Translation: ∀x (Student(x) → ∃y Teacher(y ) ∧ Likes(x, y ))
Explanation: For each student, there exists a teacher that the
student likes.
■ There is a person who likes all students.
Translation: ∃x ∀y (Student(y ) → Likes(x, y ))
Explanation: There exists someone who likes every student.
■ Some students don’t like any teacher.
Translation: ∃x (Student(x) ∧ ∀y (Teacher(y ) → ¬Likes(x, y )))
Explanation: There is a student who dislikes all teachers.
37 of 42
Negation of Quantifiers
English Statement:
Nothing is perfect.
Translation:
¬ ∃x Perfect(x)Alternative Expression:
Everything is imperfect.
∀x ¬ Perfect(x)
38 of 42
Negation of Quantifiers Example
English Statement:
“There is no student who failed the exam.”
Translation:
¬ ∃x Failed(x)
Alternatively:
∀x ¬ Failed(x)
■ English Statement: ”Everyone passed the exam.”
■ Translation: ∀x Passed(x)
■ English Statement: ”There is a student who passed the exam.”
■ Translation: ∃x Passed(x)
39 of 42
Negation of Quantifiers
English Statement:
“Nothing is perfect.”
Translation:
¬ ∃x Perfect(x)
Another way to express the same meaning:
“Everything is imperfect.”
Translation:
∀x ¬ Perfect(x)
¬ ∃x P(x) is equivalent to ∀x ¬ P(x)
40 of 42
Negation of Quantified Statements (DeMorgan’s
Laws)
Negation Equivalent
¬∃x P(x) ∀x ¬P(x)
¬∀x P(x) ∃x ¬P(x)
41 of 42
Negation of Quantified Statements (DeMorgan’s
Laws)
Negation Equivalent
¬∃x (x 2 = 4) ∀x (x 2 ̸= 4)
¬∀x (x + 2 > 5) ∃x (x + 2 ≤ 5)
■ ¬∃x (x 2 = 4) means “There does not exist an x such that x 2 = 4.”
■ The negation would be: ”For all x, x 2 ̸= 4.”
■ ¬∀x (x + 2 > 5) means “It is not true that for all x, x + 2 > 5.”
■ The negation would be: “There exists an x such that x + 2 ≤ 5.”
42 of 42