Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Predicate Logic Lecture Notes

Predicate logic involves sentences with variables that become statements when values are substituted, with a truth set defined as all values that make the predicate true. Quantifiers, such as universal (∀) and existential (∃), express the extent to which a predicate holds over a domain. The document provides definitions, examples, and methods for determining truth values and translating between formal and informal language.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Predicate Logic Lecture Notes

Predicate logic involves sentences with variables that become statements when values are substituted, with a truth set defined as all values that make the predicate true. Quantifiers, such as universal (∀) and existential (∃), express the extent to which a predicate holds over a domain. The document provides definitions, examples, and methods for determining truth values and translating between formal and informal language.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

PREDICATE LOGIC

Definition: A predicate is a sentence that contains a finite number of


variables and becomes a statement when specific values are substituted for
the variables.
The domain of a predicate variable is the set of all values that may be
substituted in place of the variable.
Example: Consider the statement
p : x is an even number
The truth value of p depends on the value of x.
p is true when x = 4, and false when x = 11.
The phrase “is an even number” is the predicate, while x is the subject or
the variable.
Thus, we can define, a predicate p(x) as an expression having the quality
that on an assignment of values to the variable x, from an appropriate
domain D, a statement results.
When an element in the domain of the variable of a one-variable predicate
is substituted for the variable, the resulting statement is either true or false.
The set of all such elements that make the predicate true is called the truth
set of the 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

Page 1 of 19
“x > 3.” Hence, P(4), which is the statement “4 > 3,” is true. However, P(2),
which is the statement “2 > 3,”is false.

Example: Let P(x) be the predicate “x2 > x” with domain the set R of all real
numbers. Write P(2), P( 1/2 ), and P(−1/2 ), and indicate which of these
statements are true and which are false.

Example: Let Q(x, y) denote the statement “x = y + 3.” What are the truth
values of the propositions
a) Q(1, 2)
b) 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.

Example: Let R(x, y, z) denote the statement` ‘x + y = z.” When values are
assigned to the variables x, y, and z, this statement has a truth value.
What are the truth values of the propositions R(1, 2, 3) and R(0, 0, 1)?
Solution: The proposition R(1, 2, 3) is obtained by setting x = 1, y = 2, and
Page 2 of 19
z = 3 in the statement R(x, y, z).
We see that R(1, 2, 3) is the statement “1 + 2 = 3,” which is true.
Also note that R(0, 0, 1), which is the statement “0 + 0 = 1,” is false.

In general, a statement involving the n variables x1, x2, . . . , xn can be


denoted by P(x1, x2, . . . , xn).
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 a n-ary predicate.

Definition
If P(x) is a predicate and x has domain D, the truth set of P(x) is the set of
all elements of D that make P(x) true when they are substituted for x. The
truth set of P(x) is denoted {x ∈ D | P(x)}.

Example: Let Q(n) be the predicate “n is a factor of 8.” Find the truth set of
Q(n) if
a. the domain of n is the set Z+ of all positive integers
b. the domain of n is the set Z of all integers.

Solution
a. The truth set is {1, 2, 4, 8} because these are exactly the positive integers
that divide 8 evenly.
b. The truth set is {1, 2, 4, 8,−1,−2,−4,−8} because the negative integers−1,−2,−
4, and −8 also divide into 8 without leaving a remainder.
Page 3 of 19
Quantifiers
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. In English,
the words all, some, many, none, and few are used in quantifications.
The Universal Quantifier
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 x P(x)” or “for every x P(x).”
Some other expressions that can be used instead of for all are
for arbitrary, for any, for each, and given any.
An element for which P(x) is false is called a counterexample of ∀xP(x).

Definition: Let Q(x) be a predicate and D the domain of x. A universal


statement is a statement of the form “∀x ∈ D, Q(x).” It is defined to be true
if, and only if, Q(x) is true for every x in D. It is defined to be false if, and
only if, Q(x) is false for at least one x in D. A value for x for which Q(x) is
false is called a counterexample to the universal statement.

Example: Let D = {1, 2, 3, 4, 5}, and consider the statement


∀x ∈ D, x2 ≥ x. Show that this statement is true.

Page 4 of 19
Solution
Check that “x2 ≥ x” is true for each individual x in D.
12 ≥ 1, 22 ≥ 2, 32 ≥ 3, 42 ≥ 4, 52 ≥ 5.
Hence “∀x ∈ D, x2 ≥ x” is true.
The technique used to show the truth of the universal statement in this
Example is called the method of exhaustion. It consists of showing the
truth of the predicate separately for each individual element of the domain.
(The idea is to exhaust the possibilities before you exhaust yourself!) This
method can, in theory, be used whenever the domain of the predicate
variable is finite.
Example: Consider the statement ∀x ∈ R, x2 ≥ x.
Find a counterexample to show that this statement is false.

Example: 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.

Page 5 of 19
Example Let Q(x) be the statement “x < 2.” What is the truth value of the
quantification ∀xQ(x), where the domain consists of all real numbers?
Solution: Q(x) is not true for every real number x, because, for instance,
Q(3) is false. That is,x = 3 is a counterexample for the statement ∀xQ(x).
Thus ∀xQ(x)is false.

Example: Suppose that P(x) is “x2 > 0.” To show that the statement ∀xP(x)
is false where the universe of discourse consists of all integers, we give a
counterexample. We see that x = 0 is a counterexample because x2 = 0 when
x = 0, so that x2 is not greater than 0 when x = 0.

The Universal Quantifier and the connective “and”


When all the elements in the domain can be listed—say, x1, x2, . . ., xn—it
follows that the universal quantification ∀xP(x) is the same as the
conjunction P(x1) ∧ P(x2) ∧ · · · ∧ P(xn), because this conjunction is true if
and only if P(x1), P(x2), . . . , P (xn) are all true.
Example What is the truth value of ∀xP(x), where P(x) is the statement
“x2 < 10” and the domain consists of the positive integers not exceeding 4?
Solution: The statement ∀xP(x) is the same as the conjunction
P(1) ∧ P(2) ∧ P(3) ∧ P(4), because the domain consists of the integers 1, 2, 3,
and 4. Because P(4), which is the statement “42 < 10,” is false, it follows that
∀xP(x) is false.

Page 6 of 19
Example:

The Existential Quantifier: ∃


The symbol ∃ denotes “there exists” and is called the existential quantifier.
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).
Definition
Let Q(x) be a predicate and D the domain of x. An existential statement is a
statement of the form “∃x ∈ D such that Q(x).” It is defined to be true if,
and only if, Q(x) is true for at least one x in D. It is false if, and only if, Q(x)
is false for all x in D.

Remark: A domain must always be specified when a statement ∃xP(x) is


used. Furthermore, the meaning of ∃xP(x) changes when the domain
changes. Without specifying the domain, the statement ∃xP(x) has no
meaning.

Page 7 of 19
Besides the phrase “there exists,”we can also express existential
quantification in many other ways, such as by using the words:
there is a, we can find a, there is, at least one, for some, for at least one.

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.
Example: Consider the statement ∃m ∈ Z+ such that m2 = m.
Show that this statement is true.
Solution: Observe that 12 = 1. Thus “m2 = m” is true for at least one integer
m. Hence “∃m ∈ Z such that m2 = m” is true.
Example: Let E = {5, 6, 7, 8} and consider the statement ∃m ∈ E such that
m2 = m. Show that this statement is false.
Solution: Note that m2 = m is not true for any integers m from 5 through 8:
52 = 25 ≠ 5, 62 = 36 ≠6, 72 = 49 ≠7, 82 = 64 ≠ 8.
Thus “∃m ∈ E such that m2 = m” is false.

Page 8 of 19
The Existential Quantifier and the connective OR
When all elements in the domain can be listed—say, x1, x2, . . . , xn—the
existential quantification ∃xP(x) is the same as the disjunction
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.

Example: 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.

Translating from Formal to Informal Language


Example:

Solution:
a. All real numbers have nonnegative squares.

Page 9 of 19
Or: Every real number has a nonnegative square.
Or: Any real number has a nonnegative square.
Or: The square of each real number is nonnegative.

b. All real numbers have squares that are not equal to −1.
Or: No real numbers have squares equal to −1.
(The words none are or no . . . are are equivalent to the words all are not.)

c. There is a positive integer whose square is equal to itself.


Or: We can find at least one positive integer equal to its own square.
Or: Some positive integer equals its own square.
Or: Some positive integers equal their own squares.

Another way to restate universal and existential statements informally is to


place the quantification at the end of the sentence. For instance, instead of
saying “For any real number x, x2 is nonnegative,” you could say “x2 is
nonnegative for any real number x.”
In such a case the quantifier is said to “trail” the rest of the sentence.
Example:
Rewrite the following statements so that the quantifier trails the rest of the
sentence.
a. For any integer n, 2n is even.
b. There exists at least one real number x such that x2 ≤ 0.
Solution
a. 2n is even for any integer n.
Page 10 of 19
b. x2 ≤ 0 for some real number x.
Or: x2 ≤ 0 for at least one real number x.

Translating from Informal to Formal Language


Example; Rewrite each of the following statements formally. Use
quantifiers and variables.
a. All triangles have three sides.
b. No dogs have wings.
c. Some programs are structured.
Solution
a. ∀ triangles t, t has three sides.
Or: ∀t ∈ T, t has three sides (where T is the set of all triangles).

b. ∀ dogs d, d does not have wings.


Or: ∀d ∈ D, d does not have wings (where D is the set of all dogs).

c. ∃ a program p such that p is structured.


Or: ∃p ∈ P such that p is structured (where P is the set of all programs).

Precedence of Quantifiers
The quantifiers ∀ and ∃ have higher precedence than all logical operators
from propositional logic. 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)).

Page 11 of 19
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. 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 this quantifier. Consequently, a variable is free if it is outside the
scope of all quantifiers in the formula that specify this variable.

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 this variable. This
illustrates that in the statement ∃x(x + y = 1), x is bound, but y is free.
EXAMPLE : 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.

Page 12 of 19
Universal Conditional Statements
A reasonable argument can be made that the most important form of
statement in mathematics is the universal conditional statement:
∀x, if P(x) then Q(x).
Example :
Rewrite the following statement informally, without quantifiers or
variables. ∀x ∈ R, if x > 2 then x2 > 4.
Solution: If a real number is greater than 2 then its square is greater than 4.
Or: Whenever a real number is greater than 2, its square is greater than 4.
Or: The square of any real number greater than 2 is greater than 4.
Or: The squares of all real numbers greater than 2 are greater than 4.
Example:
Rewrite each of the following statements in the form
∀ , if…………. then………… .
a. If a real number is an integer, then it is a rational number.
b. All bytes have eight bits.
c. No fire trucks are green.
Solution
a. ∀ real numbers x, if x is an integer, then x is a rational number.
Or: ∀x ∈ R, if x ∈ Z then x ∈ Q.
b. ∀x, if x is a byte, then x has eight bits.
c. ∀x, if x is a fire truck, then x is not green.

Page 13 of 19
Notation
Let P(x) and Q(x) be predicates and suppose the common domain of x is D.
• The notation P(x) ⇒ Q (x) means that every element in the truth set of
P(x) is in the truth set of Q(x), or, equivalently, ∀x, P(x) → Q(x).
• The notation P(x) ⇔ Q (x) means that P(x) and Q(x) have identical truth
sets, or, equivalently, ∀x, P(x) ↔ Q(x).

Example: Let
Q(n) be “n is a factor of 8,”
R(n) be “n is a factor of 4,”
S(n) be “n < 5 and n ≠ 3,”
and suppose the domain of n is Z+, the set of positive integers. Use the ⇒
and ⇔ symbols to indicate true relationships among Q(n), R(n), and S(n).
Solution
1. The truth set of Q(n) is {1, 2, 4, 8} when the domain of n is Z+.
By similar reasoning the truth set of R(n) is {1, 2, 4}.
Thus it is true that every element in the truth set of R(n) is in the truth set of
Q(n), or, equivalently, ∀n in Z+ , R(n) → Q(n).
So R(n) ⇒ Q(n), or, equivalently n is a factor of 4 ⇒ n is a factor of 8.

2. The truth set of S(n) is {1, 2, 4}, which is identical to the truth set of R(n),
or, equivalently,
∀n in Z+ , R(n) ↔ S(n). So R(n) ⇔ S(n), or, equivalently,
n is a factor of 4 ⇔ n < 5 and n ≠3.

Page 14 of 19
Moreover, since every element in the truth set of S(n) is in the truth set of
Q(n), or, equivalently,
∀n in Z+, S(n) → Q(n), then S(n) ⇒ Q(n), or, equivalently,
n < 5 and n ≠ 3 ⇒ n is a factor of 8.

Negation of a Universal Statement


The negation of a statement of the form ∀x in D, Q(x) is logically equivalent
to a statement of the form ∃x in D such that ∼Q(x). Symbolically,
∼(∀x ∈ D, Q(x)) ≡ ∃x ∈ D such that ∼Q(x).
Thus
The negation of a universal statement (“all are”) is logically equivalent to
an existential statement (“some are not” or “there is at least one that is
not”).
Note that when we speak of logical equivalence for quantified
statements, we mean that the statements always have identical truth values
no matter what predicates are substituted for the predicate symbols and no
matter what sets are used for the domains of the predicate variables.

Negation of an Existential Statement


The negation of a statement of the form ∃x in D such that Q(x)
is logically equivalent to a statement of the form ∀x in D,∼Q(x).
Symbolically, ∼(∃x ∈ D such that Q(x)) ≡ ∀x ∈ D,∼Q(x).
Thus
The negation of an existential statement (“some are”) is logically
equivalent to a universal statement (“none are” or “all are not”).

Page 15 of 19
Example:
Write formal negations for the following statements:
a. ∀ primes p, p is odd.
b. ∃ a triangle T such that the sum of the angles of T equals 200◦.
Solution
a. By applying the rule for the negation of a ∀ statement, you can see that
the answer is
∃a prime p such that p is not odd.
b. By applying the rule for the negation of a ∃ statement, you can see that
the answer is
∀ triangles T, the sum of the angles of T does not equal 200◦

Example :
Rewrite the following statement formally. Then write formal and informal
negations.
No politicians are honest.
Solution Formal version: ∀ politicians x, x is not honest.
Formal negation: ∃ a politician x such that x is honest.
Informal negation: Some politicians are honest.
.
Negations of Universal Conditional Statements
By definition of the negation of a for all statement,
∼(∀x, P(x) → Q(x)) ≡ ∃x such that ∼(P(x) → Q(x)).
But the negation of an if-then statement is logically equivalent to an and
statement. More precisely,

Page 16 of 19
∼(P(x) → Q(x)) ≡ P(x) ∧ ∼Q(x).
Substituting we get
∼(∀x, P(x) → Q(x)) ≡ ∃x such that (P(x)∧ ∼Q(x)).
Written less symbolically, this becomes
∼(∀x, if P(x) then Q(x)) ≡ ∃x such that P(x) and ∼Q(x).
Example :
Write a formal negation for statement (a) and an informal negation for
statement (b).
a. ∀ people p, if p is blond then p has blue eyes.
b. If a computer program has more than 100,000 lines, then it contains a
bug.
Solution
a. ∃ a person p such that p is blond and p does not have blue eyes.
b. There is at least one computer program that has more than 100,000 lines
and does not contain a bug.

Variants of Universal Conditional Statements


Recall that a conditional statement has a contrapositive, a converse,
and an inverse. The definitions of these terms can be extended to universal
conditional statements.
•Definition
Consider a statement of the form: ∀x ∈ D, if P(x) then Q(x).
1. Its contrapositive is the statement: ∀x ∈ D, if ∼Q(x) then ∼P(x).
2. Its converse is the statement: ∀x ∈ D, if Q(x) then P(x).
3. Its inverse is the statement: ∀x ∈ D, if ∼P(x) then ∼Q(x).

Page 17 of 19
Example: Write a formal and an informal contrapositive, converse, and
inverse for the following statement:
If a real number is greater than 2, then its square is greater than 4.
Solution The formal version of this statement is
∀x ∈ R, if x > 2 then x2 > 4.
Contrapositive: ∀x ∈ R, if x2 ≤ 4 then x ≤ 2.
Or: If the square of a real number is less than or equal to 4, then the number
is less than or equal to 2.
Converse: ∀x ∈ R, if x2 > 4 then x > 2.
Or: If the square of a real number is greater than 4, then the number is
greater than 2.
Inverse: ∀x ∈ R, if x ≤ 2 then x2 ≤ 4.
Or: If a real number is less than or equal to 2, then the square of the number
is less than or equal to 4.
Note that in solving this example, we have used the equivalence of “x ≯ a”
and “x ≤ a” for all real numbers x and a.
Note that:

Page 18 of 19
Example: Rewrite the following statements as quantified conditional
statements. Do not use the word necessary or sufficient.
a. Squareness is a sufficient condition for rectangularity.
b. Being at least 35 years old is a necessary condition for being President of
the United States.
Solution
a. A formal version of the statement is
∀x, if x is a square, then x is a rectangle.
Or, in informal language:
If a figure is a square, then it is a rectangle.

b. Using formal language, you could write the answer as


∀ people x, if x is younger than 35, then x cannot be President of the United
States.
Or, by the equivalence between a statement and its contrapositive:
∀ people x, if x is President of the United States, then x is at least 35 years
old.

Page 19 of 19

You might also like