0% found this document useful (0 votes)
10 views

PPT2-PredicateLogic

happy to see you

Uploaded by

23cs01063
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

PPT2-PredicateLogic

happy to see you

Uploaded by

23cs01063
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Predicate Logic

Joy Mukherjee

Indian Institute of Technology Bhubaneswar

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 1 / 50
Table of Contents

1 Predicate Logic or Predicate Calculus

2 Logical Equivalences Involving Quantifiers

3 Applications of Predicates, Single/Nested Quantifiers

4 Rules of Inference for Predicate Logic

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 2 / 50
Predicate

The statement “x is greater than 3” has two parts.


The first part, the variable x, is the subject of the statement.
The second part - the predicate, “is greater than 3” - refers to a
property that the subject of the statement can have.
We can denote the statement “x is greater than 3” by P(x), where P
denotes the predicate “is greater than 3” and x is the variable.
The statement P(x) is also said to be the value of the propositional
function P at x.
Once a value has been assigned to the variable x, the statement P(x)
becomes a proposition and has a truth value.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 3 / 50
Predicate

Example
Let P(x) denote the statement “x > 3”. What are the truth values of P(4)
and P(2)?
Solution: We obtain the statement P(4) by setting x = 4 in the statement
“x > 3”. Hence, P(4), which is the statement “4 > 3”, is true. However,
P(2), which is the statement “2 > 3”, is false.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 4 / 50
Predicate

Example
Let Q(x, y) denote the statement “x = y + 3”. What are the truth values
of the propositions Q(1, 2) and Q(3, 0)?
Solution: To obtain Q(1, 2), set x = 1 and y = 2 in the statement Q(x,
y). Hence, Q(1, 2) is the statement “1 = 2 + 3”, which is false. The
statement Q(3, 0) is the proposition “3 = 0 + 3”, which is true.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 5 / 50
n-ary Predicate and Quantification

In general, a statement of the form P(x1 , x2 , . . . , xn ) is the value of


the propositional function P at the n-tuple (x1 , x2 , . . . , xn ), and P is
also called an n-place predicate or an n-ary predicate.
When 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. We will focus on two types of quantification here.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 6 / 50
Universal Quantification

Definition (Universal Quantification)


A predicate is true for all values of a variable in a particular domain, called
the domain of discourse or the universe of discourse, often just referred
to as the domain. The domain must always be specified when a universal
quantifier is used; without it, the universal quantification of a statement is
not defined.
The universal quantification of P(x) is the statement
“P(x) for all values of x in the domain”.
The notation ∀xP(x) denotes the universal quantification of P(x). Here ∀
is called the universal quantifier. We read ∀xP(x) as “for all xP(x)” or “for
every xP(x)”. An element for which P(x) is false is called a counter
example to ∀xP(x).

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 7 / 50
Universal Quantification

Example
What is the truth value of ∀x(x 2 ≥ x) if the domain consists of all real
numbers? What is the truth value of this statement if the domain consists
of all positive integers?
Solution: The universal quantification ∀x(x 2 ≥ x), where the domain
consists of all real numbers, is false for all real numbers x with 0 < x < 1.
Note that x 2 ≥ x if and only if x 2 ≥ x = x(x − 1) ≥ 0. Consequently,
x 2 ≥ x if and only if x ≤ 0 or x ≥ 1. It follows that ∀x(x 2 ≥ x) is false if
the domain consists of all real numbers.
However, if the domain consists of the positive integers, ∀x(x 2 ≥ x) is
true, because there are no integers x with 0 < x < 1.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 8 / 50
Existential Quantification

Definition (Existential quantification)


A predicate is true for one or more values of a variable in a particular
domain, called the domain of discourse or the universe of discourse,
often just referred to as the domain.
The existential quantification of P(x) is the proposition
“There exists an element x in the domain such that P(x)”,
“There is an x such that P(x)”,
“There is at least one x such that P(x)”, or
“For some xP(x)”.
We use the notation ∃xP(x) for the existential quantification of P(x). Here
∃ is called the existential quantifier. To prove ∃xP(x) is false, one has to
show that either the domain is empty or P(x) is false for every x.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 9 / 50
Existential Quantification

Example
Let P(x) denote the statement “x > 3”. What is the truth value of the
quantification ∃xP(x), where the domain consists of all real numbers?
Solution: Because “x > 3” is sometimes true - for instance, when x = 4 -
the existential quantification of P(x), which is ∃xP(x), is true.

Example
Let Q(x) denote the statement “x = x + 1”. What is the truth value of the
quantification ∃xQ(x), where the domain consists of all real numbers?
Solution: Because Q(x) is false for every real number x, the existential
quantification of Q(x), which is ∃xQ(x), is false.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 10 / 50
Predicate Logic

The area of logic that deals with predicates and quantifiers is called the
predicate logic or predicate calculus.
Precedence of Quantifiers: The quantifiers ∀ and ∃ have higher
precedence than all logical operators from propositional calculus. For
example, ∀xP(x) ∨ Q(x) is the disjunction of ∀xP(x) and Q(x). In other
words, it means (∀xP(x)) ∨ Q(x) rather than ∀x(P(x) ∨ Q(x)).

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 11 / 50
Quantifiers over Finite Domains

When the domain of a quantifier is finite, that is, when all its elements can
be listed, quantified statements can be expressed using propositional logic.
In particular, when the elements of the domain are x1 , x2 , . . ., xn , where n
is a positive integer, the universal quantification ∀xP(x) = P(x1 ) ∧ P(x2 )
∧ . . . ∧ P(xn ), because this conjunction is true if and only if P(x1 ), P(x2 ),
. . ., P(xn ) are all true.
Similarly, when the elements of the domain are x1 , x2 , . . ., xn , where n is a
positive integer, the existential quantification ∃xP(x) = P(x1 ) ∨ P(x2 ) ∨
. . . ∨ P(xn ), because this disjunction is true if and only if at least one of
P(x1 ), P(x2 ), . . ., P(xn ) is true.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 12 / 50
Quantifiers with Restricted Domains

To restrict a domain, a condition a variable must satisfy is included after


the quantifier.
The restriction of a universal quantification is the same as the universal
quantification of a conditional statement. For instance, ∀x < 0(x 2 > 0) is
another way of expressing ∀x(x < 0 → x 2 > 0), where the domain consists
of the real numbers.
The restriction of an existential quantification is the same as the existential
quantification of a conjunction. For instance, ∃z > 0(z 2 = 2) is another
way of expressing ∃z(z > 0 ∧ z 2 = 2), where the domain consists of the
real numbers.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 13 / 50
Free and Bound 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. All the
variables that occur in a propositional function must be bound or set equal
to a particular value to turn it into a proposition. This can be done using a
combination of universal quantifiers, existential quantifiers, and value
assignments.
The part of a logical expression to which a quantifier is applied is called the
scope of the quantifier. Consequently, a variable is free if it is outside the
scope of all quantifiers in the formula that specify the variable.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 14 / 50
Free and Bound Variables
Example
In the statement ∃ x(x + y = 1), the variable x is bound by the existential
quantification ∃ x, but the variable y is free because it is not bound by a
quantifier and no value is assigned to y. This illustrates that in the
statement ∃ x(x + y = 1), x is bound, but y is free.
In the statement ∃ x(P(x) ∧ Q(x)) ∨ ∀ xR(x), all variables are bound. The
scope of the first quantifier, ∃ x, is the expression P(x) ∧ Q(x), because ∃
x is applied only to P(x) ∧ Q(x) and not to the rest of the statement.
Similarly, the scope of the second quantifier, ∀ x, is the expression R(x).
That is, the existential quantifier binds the variable x in P(x) ∧ Q(x) and
the universal quantifier ∀ x binds the variable x in R(x).
Observe that we could have written our statement using two different
variables x and y, as ∃ x(P(x) ∧ Q(x)) ∨ ∀ yR(y), because the scopes of
the two quantifiers do not overlap.
The reader should be aware that in common usage, the same letter is often
used to represent variables bound by different quantifiers with scopes that
Joy do not overlap.
Mukherjee (Indian Institute of Technology Bhubaneswar)
Predicate Logic 15 / 50
Table of Contents

1 Predicate Logic or Predicate Calculus

2 Logical Equivalences Involving Quantifiers

3 Applications of Predicates, Single/Nested Quantifiers

4 Rules of Inference for Predicate Logic

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 16 / 50
Example
Show that ∀x(P(x) ∧ Q(x)) ≡ ∀xP(x) ∧ ∀xQ(x) (where the same domain
is used throughout). This logical equivalence shows that we can distribute
a universal quantifier over a conjunction.
Solution: Suppose that ∀x(P(x) ∧ Q(x)) is true. This means that if a is
in the domain, then P(a) ∧ Q(a) is true. Hence, P(a) is true and Q(a) is
true. Because P(a) is true and Q(a) is true for every element a in the
domain, we can conclude that ∀xP(x) and ∀xQ(x) are both true. This
means that ∀xP(x) ∧ ∀xQ(x) is true.
Suppose that ∀xP(x) ∧ ∀xQ(x) is true. It follows that ∀xP(x) is true and
∀xQ(x) is true. Hence, if a is in the domain, then P(a) is true and Q(a) is
true [because P(x) and Q(x) are both true for all elements in the domain,
there is no conflict using the same value of a here]. It follows that for all a,
P(a) ∧ Q(a) is true. It follows that ∀x(P(x) ∧ Q(x)) is true.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 17 / 50
Example
Show that ∃x(P(x) ∨ Q(x)) ≡ ∃xP(x) ∨ ∃xQ(x) (where the same domain
is used throughout). This logical equivalence shows that we can distribute
an existential quantifier over a disjunction.
Solution: Suppose that ∃x(P(x) ∨ Q(x)) is true. This means that if a is
in the domain, then P(a) ∨ Q(a) is true. Hence, P(a) is true or Q(a) is
true. Because P(a) is true or Q(a) is true for at least one element a in the
domain, we can conclude that ∃xP(x) or ∃xQ(x) are true. This means that
∃xP(x) ∨ ∃xQ(x) is true.
Suppose that ∃xP(x) ∨ ∃xQ(x) is true. It follows that ∃xP(x) is true or
∃xQ(x) is true. Hence, for some a in the domain, P(a) is true or Q(a) is
true [because P(x) or Q(x) is true for at least one element in the domain,
there is no conflict using the same value of a here]. It follows that for some
a, P(a) ∨ Q(a) is true. It follows that ∃x(P(x) ∨ Q(x)) is true.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 18 / 50
Example
Show that ¬∀xP(x) ≡ ∃x¬P(x).
Solution: To show that ¬∀xP(x) and ∃x¬P(x) are logically equivalent no
matter what the propositional function P(x) is and what the domain is,
first note that ¬∀xP(x) is true if and only if ∀xP(x) is false. Next, note
that ∀xP(x) is false if and only if there is an element x in the domain for
which P(x) is false. This holds if and only if there is an element x in the
domain for which ¬P(x) is true. Finally, note that there is an element x in
the domain for which ¬P(x) is true if and only if ∃x¬P(x) is true. Putting
these steps together, we can conclude that ¬∀xP(x) is true if and only if
∃x¬P(x) is true. It follows that ¬∀xP(x) and ∃x¬P(x) are logically
equivalent.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 19 / 50
When the domain has n elements x1 , x2 , . . . , xn , it follows that ¬∀xP(x) is
the same as ¬(P(x1 ) ∧ P(x2 ) ∧ . . . ∧ P(xn )), which is equivalent to
¬P(x1 ) ∨ ¬P(x2 ) ∨ . . . ∨ ¬P(xn ) by De Morgan’s laws, and this is the same
as ∃x¬P(x).

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 20 / 50
Example
Show that ¬∃xP(x) ≡ ∀x¬P(x).
Solution: To show that ¬∃xP(x) and ∀x¬P(x) are logically equivalent no
matter what the propositional function P(x) is and what the domain is,
first note that ¬∃xP(x) is true if and only if ∃xP(x) is false. Next, note
that ∃xP(x) is false if and only if for all element x in the domain, P(x) is
false. This holds if and only if for all element x in the domain for which
¬P(x) is true. Finally, note that for all element x in the domain for which
¬P(x) is true if and only if ∀x¬P(x) is true. Putting these steps together,
we can conclude that ¬∃xP(x) is true if and only if ∀x¬P(x) is true. It
follows that ¬∃xP(x) and ∀x¬P(x) are logically equivalent.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 21 / 50
When the domain has n elements x1 , x2 , . . . , xn , it follows that ¬∃xP(x) is
the same as ¬(P(x1 ) ∨ P(x2 ) ∨ . . . ∨ P(xn )), which is equivalent to
¬P(x1 ) ∧ ¬P(x2 ) ∧ . . . ∧ ¬P(xn ) by De Morgan’s laws, and this is the same
as ∀x¬P(x).
The rules for negations for quantifiers are called De Morgan’s laws for
quantifiers.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 22 / 50
Table of Contents

1 Predicate Logic or Predicate Calculus

2 Logical Equivalences Involving Quantifiers

3 Applications of Predicates, Single/Nested Quantifiers

4 Rules of Inference for Predicate Logic

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 23 / 50
Translating Sentences
Example
Express the statement “Every student in this class has studied calculus”
using predicates and quantifiers.
Solution: we introduce a variable x that represents a person.
“For every person x, if person x is a student in this class, then x has studied
calculus”. If S(x) represents the statement that person x is in this class,
and C(x) represents the statement “x has studied calculus”, we see that our
statement can be expressed as ∀ x(S(x) → C(x)).
Caution: Our statement cannot be expressed as ∀ x(S(x) ∧ C(x)) because
this statement says that all people are students in this class and have
studied calculus.
Finally, when we are interested in the background of people in subjects
besides calculus, we may prefer to use the two-variable quantifier Q(x, y)
for the statement “Student x has studied subject y”. Then we would replace
C(x) by Q(x, calculus) in both approaches to obtain ∀ xQ(x, calculus) or ∀
x(S(x) → Q(x, calculus)).
Joy Mukherjee (Indian Institute of Technology Bhubaneswar)
Predicate Logic 24 / 50
Translating Sentences

Example
Express the statement “Some student in this class has visited Mexico” using
predicates and quantifiers.
Solution: We introduce M(x), which is the statement “x has visited
Mexico”. If the domain for x consists of the students in this class, we can
translate this first statement as ∃ xM(x).
If the domain for the variable x consists of all people. We introduce S(x) to
represent “x is a student in this class”. Our solution becomes ∃ x(S(x) ∧
M(x)) because the statement is that there is a person x who is a student in
this class and who has visited Mexico.
Caution: Our statement cannot be expressed as ∃ x(S(x) → M(x)), which
is true when there is someone not in the class because, in that case, for
such a person x, S(x) → M(x) becomes either F → T or F → F, both of
which are true.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 25 / 50
Translating Sentences

Example
Express the statement “Every student in this class has visited either Canada
or Mexico” using predicates and quantifiers.
Solution: “For every person x, if x is a student in this class, then x has
visited Mexico or x has visited Canada”. In this case, the statement can be
expressed as ∀ x(S(x) → (C(x) ∨ M(x))).

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 26 / 50
Translating Sentences

Example
Express the statement “Every student in your school has a computer or has
a friend who has a computer” using predicates and quantifiers.
Solution: C(x) is “x has a computer”, F(x, y) is “x and y are friends”, and
the domain for both x and y consists of all students in your school. In this
case, the statement can be expressed as ∀ x(C (x) ∨ ∃ y (C (y ) ∧ F (x, y )))

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 27 / 50
Translating Sentences

Example
Translate the statement
∃ x∀ y ∀ z((F (x, y ) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y , z)) into English, where
F(a, b) means a and b are friends and the domain for x, y, and z consists of
all students in your school.
Solution: This expression says that if students x and y are friends, and
students x and z are friends, and furthermore, if y and z are not the same
student, then y and z are not friends. It follows that the original statement,
which is triply quantified, says that there is a student x such that for all
students y and all students z other than y, if x and y are friends and x and
z are friends, then y and z are not friends. In other words, there is a
student none of whose friends are also friends with each other.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 28 / 50
Translating Sentences

Example
Express the statement “If a person is female and is a parent, then this
person is someone’s mother” as a logical expression involving predicates,
quantifiers with a domain consisting of all people, and logical connectives.
Solution: The statement “If a person is female and is a parent, then this
person is someone’s mother” can be expressed as “For every person x, if
person x is female and person x is a parent, then there exists a person y
such that person x is the mother of person y”. We introduce the
propositional functions F(x) to represent “x is female”, P(x) to represent “x
is a parent”, and M(x, y) to represent “x is the mother of y”. The original
statement can be represented as ∀ x((F (x) ∧ P(x)) → ∃ yM(x, y )), or
∀ x∃ y ((F (x) ∧ P(x)) → M(x, y )).

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 29 / 50
Translating Sentences

Example
Express the statement “Everyone has exactly one best friend” as a logical
expression involving predicates, quantifiers with a domain consisting of all
people, and logical connectives.
Solution: The statement “Everyone has exactly one best friend” can be
expressed as “For every person x, person x has exactly one best friend”.
Introducing the universal quantifier, we see that this statement is the same
as “∀ x(person x has exactly one best friend)”, where the domain consists
of all people. To say that x has exactly one best friend means that there is
a person y who is the best friend of x, and furthermore, that for every
person z, if person z is not person y, then z is not the best friend of x.
When we introduce the predicate B(x, y) to be the statement “y is the best
friend of x”. Consequently, our original statement can be expressed as
∀ x∃ y (B(x, y ) ∧ ∀ z((z 6= y ) → ¬B(x, z))).

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 30 / 50
Translating Sentences

Example
Express the statement “There is a woman who has taken a flight on every
airline in the world”. using predicates and quantifiers.
Solution: Let P(w, f) be “w has taken f ” and Q(f, a) be “f is a flight on
a”. We can express the statement as

∃ w ∀ a∃ f (P(w , f ) ∧ Q(f , a))

, where the domains of discourse for w, f, and a consist of all the women in
the world, all airplane flights, and all airlines, respectively.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 31 / 50
Translating Sentences

Example
Use quantifiers to express the statement that “There does not exist a
woman who has taken a flight on every airline in the world.”
Solution:
∀ w ∃ a∀ f (¬P(w , f ) ∨ ¬Q(f , a))
This last statement states “For every woman there is an airline such that
for all flights, this woman has not taken that flight or that flight is not on
this airline.”

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 32 / 50
Translating Mathematical Statements

Example
Translate the statement “The sum of two positive integers is always
positive” into a logical expression.
Solution: ∀x∀y ((x > 0) ∧ (y > 0) → (x + y > 0)), where the domain for
both variables consists of all integers.
∀x∀y (x + y > 0), where the domain for both variables consists of all
positive integers.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 33 / 50
Translating Mathematical Statements

Example
A multiplicative inverse of a real number x is a real number y such that
xy = 1. Translate the statement “Every real number except zero has a
multiplicative inverse.”
Solution: We first rewrite this as “For every real number x except zero, x
has a multiplicative inverse.” We can rewrite this as “For every real number
x, if x 6= 0, then there exists a real number y such that xy = 1.” This can
be rewritten as ∀x((x 6= 0) → ∃y (xy = 1)).

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 34 / 50
Translating Mathematical Statements
Example
Recall that the definition of the statement

lim f (x) = L
x→a

is: For every real number  > 0 there exists a real number δ > 0 such that
|f (x) − L| <  whenever 0 < |x − a| < δ.
Use quantifiers to express the definition of the limit of a real-valued
function f (x) of a real variable x at a point a in its domain.
Solution: This definition of a limit can be phrased in terms of quantifiers
by
∀ ∃δ ∀x (0 < |x − a| < δ → |f (x) − L| < )
, where the domain for the variables  and δ consists of all positive real
numbers and for x consists of all real numbers.
This definition can also be expressed as

∀ > 0 ∃δ > 0 ∀x (0 < |x − a| < δ → |f (x) − L| < )


Joy Mukherjee (Indian Institute of Technology Bhubaneswar)
Predicate Logic 35 / 50
Translating Mathematical Statements
Example
To say that limx→a f (x) does not exist means that for all real numbers L,

lim f (x) 6= L
x→a

Use quantifiers and predicates to express the fact that limx→a f (x) does
not exist, where f(x) is a real-valued function of a real variable x and a
belongs to the domain of f.
Solution: This definition of a limit can be expressed as

∀ > 0 ∃δ > 0 ∀x (0 < |x − a| < δ → |f (x) − L| < )

where the domain for the variables , δ and x consists of all real numbers,
rather than just the positive real numbers. Here, restricted quantifiers have
been used. Recall that ∀x >0 P(x) means that for all x with x > 0, P(x) is
true.
Joy Mukherjee (Indian Institute of Technology Bhubaneswar)
Predicate Logic 36 / 50
Expressing System Specifications

Example
Use predicates and quantifiers to express the system specification “Every
mail message larger than one megabyte will be compressed”.
Solution: Let M(x, y) be “Mail message x is larger than y megabytes”,
where the variable x has the domain of all mail messages and the variable y
is a positive real number, and let C(x) denote “Mail message x will be
compressed”. Then the specification can be represented as ∀ x (M(x, 1) →
C(x)).

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 37 / 50
Expressing System Specifications

Example
Use predicates and quantifiers to express the system specification “If a user
is active, at least one network link will be available.”
Solution: ∀ x (A(x) → ∃ y (N(y) ∧ V(y)))

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 38 / 50
Table of Contents

1 Predicate Logic or Predicate Calculus

2 Logical Equivalences Involving Quantifiers

3 Applications of Predicates, Single/Nested Quantifiers

4 Rules of Inference for Predicate Logic

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 39 / 50
Rules of Inference: Predicate Logic

We have discussed rules of inference for propositions. We will now describe


some important rules of inference for statements involving quantifiers.
These rules of inference are used extensively in mathematical arguments,
often without being explicitly mentioned.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 40 / 50
Rules of Inference: Predicate Logic

Rule of Inference Name


∀ xP(x)
——————————– Universal instantiation
∴ P(c)
P(c) for an arbitrary c
——————————– Universal generalization
∴ ∀ xP(x)
∴ ∃ xP(x)
——————————– Existential instantiation
∴ P(c) for some element c
P(c) for some element c
——————————– Existential generalization
∴ ∃ xP(x)
Table: Rules of Inference for Quantified Statements

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 41 / 50
Rules of Inference: Predicate Logic

Rule of Inference Name


∀ x(P(x) → Q(x))
P(a), where a is a particular element in the domain Universal
————————————————————— modus ponens
∴ Q(a)
∀ x(P(x) → Q(x))
¬ Q(a), where a is a particular element in the domain Universal
————————————————————— modus tollens
∴ ¬ P(a)
Table: Rules of Inference for Quantified Statements

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 42 / 50
Universal instantiation

is the rule of inference used to conclude that P(c) is true, where c is a


particular member of the domain, given the premise ∀ xP(x). Universal
instantiation is used when we conclude from the statement “All women are
wise” that “Lisa is wise”, where Lisa is a member of the domain of all
women.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 43 / 50
Universal generalization

is the rule of inference to conclude that ∀ xP(x) is true, given the premise
that P(c) is true for all elements c in the domain. Universal generalization
is used when we show that ∀ xP(x) is true by taking an arbitrary element c
from the domain and showing that P(c) is true. We have no control over c
and cannot make any other assumptions about c other than it comes from
the domain.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 44 / 50
Existential instantiation

is the rule that allows us to conclude that there is an element c in the


domain for which P(c) is true if we know that ∃ xP(x) is true. We cannot
select an arbitrary value of c here, but rather it must be a c for which P(c)
is true. Usually we have no knowledge of what c is, only that it exists.
Because it exists, we may give it a name (c) and continue our argument.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 45 / 50
Existential generalization

is the rule of inference that is used to conclude that ∃ xP(x) is true when a
particular element c with P(c) true is known. That is, if we know one
element c in the domain for which P(c) is true, then we know that ∃ xP(x)
is true.

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 46 / 50
Example
Show that the premises “Everyone in this discrete mathematics class has
taken a course in computer science” and “Marla is a student in this class”
imply the conclusion “Marla has taken a course in computer science”.
Solution: Let D(x) denote “x is in this discrete mathematics class”, and let
C(x) denote “x has taken a course in computer science”. Then the premises
are ∀ x(D(x) → C(x)) and D(Marla). The conclusion is C(Marla). The
following steps can be used to establish the conclusion from the premises.
Step Reason
1. ∀ x(D(x) → C(x)) Premise
2. D(Marla) → C(Marla) Universal instantiation from (1)
3. D(Marla) Premise
4. C(Marla) Modus ponens from (2) and (3)

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 47 / 50
Example
Show that the premises “A student in this class has not read the book”, and
“Everyone in this class passed the first exam” imply the conclusion
“Someone who passed the first exam has not read the book”.
Solution: Let C(x) be “x is in this class”, B(x) be “x has read the book”,
and P(x) be “x passed the first exam”. The premises are ∃ x(C(x) ∧ ¬B(x))
and ∀ x(C(x) → P(x)). The conclusion is ∃ x(P(x) ∧ ¬B(x)). These steps
can be used to establish the conclusion from the premises.
Step Reason
1. ∃ x(C(x) ∧ ¬B(x)) Premise
2. C(a) ∧ ¬B(a) Existential instantiation from (1)
3. C(a) Simplification from (2)
4. ∀ x(C(x) → P(x)) Premise
5. C(a) → P(a) Universal instantiation from (4)
6. P(a) Modus ponens from (3) and (5)
7. ¬B(a) Simplification from (2)
8. P(a) ∧ ¬B(a) Conjunction from (6) and (7)
9. ∃ x(P(x) ∧ ¬B(x)) Existential generalization from (8)
Joy Mukherjee (Indian Institute of Technology Bhubaneswar)
Predicate Logic 48 / 50
Example
Assume that “For all positive integers n, if n is greater than 4, then n2 is
less than 2n ” is true. Use universal modus ponens to show that
1002 < 2100 .
Solution: Let P(n) denote “n > 4” and Q(n) denote “n2 < 2n ”. The
statement “For all positive integers n, if n is greater than 4, then n2 is less
than 2n ” can be represented by ∀ n(P(n) → Q(n)), where the domain
consists of all positive integers. We are assuming that ∀ n(P(n) → Q(n)) is
true. Note that P(100) is true because 100 > 4. It follows by universal
modus ponens that Q(100) is true. Therefore, 1002 < 2100 .

Joy Mukherjee (Indian Institute of Technology Bhubaneswar)


Predicate Logic 49 / 50
Example
Consider these statements. The first two are called premises and the third
is called the conclusion. The entire set is called an argument.
“All lions are fierce.”
“Some lions do not drink coffee.”
“Some fierce creatures do not drink coffee.”
Determine whether the conclusion is a valid consequence of the premises.
Solution: Let the domain consists of all creatures. Let P(x), Q(x), and
R(x) be the statements “x is a lion”, “x is fierce”, and “x drinks coffee”,
respectively.We can express the statements in the argument as
∀ x(P(x) → Q(x)).
∃ x(P(x) ∧ ¬R(x)).
∃ x(Q(x) ∧ ¬R(x)).
Step Reason
1. ∃ x(P(x) ∧ ¬R(x)) Premise
2. P(c) ∧ ¬R(c) Existential instantiation from (1)
3. P(c) Simplification from (2)
4. ¬R(c) Simplification from (2)
5. ∀ x(P(x) → Q(x)) Premise
Joy Mukherjee (Indian Institute of Technology Bhubaneswar)
Predicate Logic 50 / 50

You might also like