DS - Chapter 2.1 - Predicate Logic
DS - Chapter 2.1 - Predicate Logic
Text Books:
T1. Kenneth H. Rosen, Discrete Mathematics and its Applications, Tata McGraw Hill,
7th Ed., 2018.
Logic and Proofs:
1.3. Predicates and Quantifiers
Introduction:
Predicate Logic
Predicates and Quantifiers :
A more powerful type of logic called predicate logic. We will see how predicate logic can be used to express
the meaning of a wide range of statements in mathematics and computer science in ways that permit us to
reason and explore relationships between objects. To understand predicate logic, we first need to introduce the
concept of a predicate. Afterward, we will introduce the notion of quantifiers, which enable us to reason with
statements that assert that a certain property holds for all objects of a certain type and with statements that assert
the existence of an object with a particular property.
Predicates
Statements involving variables, such as are often found in mathematical assertions, in computer programs, and in
system specifications. These statements are neither true nor false when the values of the variables are not
specified.
• Propositional logic (recall) treats simple propositions (sentences) as atomic entities. • Predicate
logic is an extension of propositional logic that permits concisely reasoning about whole
classes of entities.
• In the sentence “Krishna is sleeping”:
• The phrase “Krishna” denotes the subject - the object or entity that the sentence is about. •
The phrase “is sleeping” denotes the predicate- a property that is true of the subject. • In
predicate logic, a predicate is modeled as a function P(·) from objects to propositions. •
P(x) = “x is sleeping” (where x is any object).
• It is the basis for clearly expressed formal specifications for any complex system. • It is
basis for automatic theorem provers and many other Artificial Intelligence systems. • E.g.
automatic program verification systems.
• Predicate-logic like statements are supported by some of the more sophisticated database query
engines and container class libraries
• Convention:
• Lowercase variables x, y, z... denote objects/entities;
• uppercase variables P, Q, R… denote propositional functions (predicates).
E.g. if P(x) = “x is a prime number”,
P(3) is the proposition “3 is a prime number.”
19Z304 - DISCRETE STRUCTURES 7
GENERALIZATION
EXAMPLE : Let A(c, n) denote the statement “Computer c is connected to network n,” where c is a variable
representing a computer and n is a variable representing a network. Suppose that the computer MATH1 is connected to
network CAMPUS2, but not to network CAMPUS1. What are the values of
i. A(MATH1, CAMPUS1) ?
ii. A(MATH1, CAMPUS2)?
Solution: Because MATH1 is not connected to the CAMPUS1 network, we see that A(MATH1,
CAMPUS1) is false. However, because MATH1 is connected to the CAMPUS2 network, we
see that A(MATH1, CAMPUS2) is true.
19Z304 - DISCRETE STRUCTURES 8
Quantifiers
∙ If the variables in a propositional function are assigned values, the resulting statement becomes a proposition
with a certain truth value.
∙ However, there is another important way, called quantification, to create a proposition from a propositional
function.
∙ Quantification expresses the extent to which a predicate is true over a range of elements. ∙
In English, the words all, some, many, none, and few are used in quantifications. ∙ We will focus
on two types of quantification here:
⮚ Universal quantification, which tells us that a predicate is true for every element under consideration.
⮚ Existential quantification, which tells us that there is one or more element under consideration for
which the predicate is true.
∙ The area of logic that deals with predicates and quantifiers is called the predicate calculus.
• DEFINITION :
• The universal quantification of P(x) is the statement “P(x) for all values of x in the domain.”
• Notation : ∀xP(x)
• ∀ is called the universal quantifier.
• We read ∀xP(x) as “for all xP(x)” or “for every xP(x).”
• Example: “Every computer on campus is connected to the network.”
Let x is computers on campus
N(x) is “Computer x is connected to the network”
the statement “Every computer on campus is connected to the network.”: ∀x N(x)
DEFINITION 2 The existential quantification of P(x) is the proposition “There exists an element x in the
domain such that P(x).” We use the notation ∃xP(x) for the existential quantification of P(x). Here ∃ is called the
existential quantifier
• Example: “Some student in CSE branch has joined the course under CISCO”
Let x is student in CSE branch
C(x) is “has joined the course under CISCO”
Therefore the statement “Some student in CSE branch has joined the course under CISCO” has
the Symbolic Form: ∃x C(x)
There is a student in your class who has not taken a course in calculus.
There is a student at your school who can speak Tamil but who doesn’t know Hindi.
19Z304 - DISCRETE STRUCTURES 15
Universal Quantifiers
EXAMPLE 8: Let P(x) be the statement “x + 1 > x.” What is the truth value of the quantification ∀xP(x),
where the domain consists of all real numbers?
Solution: Because P(x) is true for all real numbers x, the quantification ∀xP(x) is true.
EXAMPLE 13 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?
Solution: The universal quantification ∀x(x2 ≥ x), where the domain consists of all real
numbers, is false. For example, ( 1/2 )2 ≥ 1/2 . Note that x2 ≥ x if and only if x2 − x = x(x − 1) ≥
0.
Consequently, x2 ≥ x if and only if x ≤ 0 or x ≥ 1. It follows that ∀x(x2 ≥ x) is false if the domain consists of all real
numbers (because the inequality is false for all real numbers x with (0 < x < 1).
If the domain consists of the integers, ∀x(x2 ≥ x) is true, because there are no integers x with 0 < x < 1.
EXAMPLE 16 What is the truth value of ∃xP(x), where P(x) is the statement “x2 > 10” and the universe of
discourse consists of the positive integers not exceeding 4?
Solution: Because the domain is {1, 2, 3, 4}, the proposition ∃xP(x) is the same as the
disjunction P(1) ∨ P(2) ∨ P(3) ∨ P(4).
Because P(4), which is the statement “42 > 10,” is true, it follows that ∃xP(x) is true.
PRECENDENCE OF QUANTIFIER
DEFINITION : Statements involving predicates and quantifiers are logically equivalent if and only 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. We use the notation S ≡ T to indicate that two
statements S and T involving predicates and quantifiers are logically equivalent.
THANKS
19Z304 - DISCRETE STRUCTURES 24