Skip to main content
Logo image

Section 2.3 Predicate Logic

In the context of this course, predicates are an opporunity to understand quantifiers and to practice negation of statements. We need some notation to do this, but remembering the notation beyond the course is not a goal. Be aware many textbooks use slightly different notation for these (e.g., using commas instead of \(\ni\) and \(\rightarrow\)).
In order to efficiently communicate logic statements we use predicates. These are simply functions with a codomain of β€˜true’ and β€˜false.’ For example \(R(x)=x\) is red. Thus \(R(\)stop sign\()=\)true and \(R(\)Seawolf logo\()=\)false. More complicated statements can be expressed as well. The following example converts the statement β€œ\(n\) is a positive, even number” into symbols using predicates.
Define the following statements.
  • \(E(n)\) is the statement \(n\) is even.
  • \(P(n)\) is the statement \(n>0\text{.}\)
The statement: \(n\) is a positive, even number can now be written as \(P(n) \wedge E(n).\)

Subsection 2.3.1 Quantifiers

Subsubsection 2.3.1.1 Terminology

For predicates we often ask the questions, β€œdoes any object satisfy the predicate (condition)” and β€œwhat is true of all objects that satisfy the predicate (condition).” The first we call existential and use the symbol \(\exists\) for β€œthere exists.” The second we call universal and use the symbol \(\forall\) for β€œfor all.” These two questions add quantifiers to logic. Another symbol used is \(\ni\) for β€œsuch that.”
Consider the following predicates for examples of the notation.
\begin{align*} E(n) = \amp n \text{ is even}\\ P(n) = \amp n \text{ is prime}\\ Q(n) = \amp n \text{ is a multiple of 4} \end{align*}
Using these predicates (symbols) we can express statements such as those in TableΒ 2.3.1
Table 2.3.1. Quantified Statements
There is some number that is even and prime. \(\exists n \ni E(n) \wedge P(n).\)
All multiples of four are even. \(\forall n \: Q(n) \rightarrow E(n)\)
Checkpoint 2.3.2.
Write the following statement using predicates and quantifiers. β€œAll computer science majors must take Introduction to Discrete Mathematics and Data Structures and Algorithms.”

Subsection 2.3.2 Negation

Subsubsection 2.3.2.1 Negate a statement

One of the logical operations is negation. We can negate whole statements or parts of statements. A useful skill is to simplify the negation of a statement. This typically enables us to understand the meaning of the negation more easily and to optimize conditional statements.
Example 2.3.3.
This example demonstrates negating a statement involving conjunctions, but no quantifiers. Suppose the following claim is false.
β€œGuido owns a sail boat and has either a type rating for the Cessna Citation X or likes to cook.”
First we define predicates for each part of the statement.
\begin{align*} S(x) = \amp x \text{ owns a sail boat.}\\ C(x) = \amp x \text{ has a type rating for the Cessna Citation X.}\\ K(x) = \amp x \text{ likes to cook.} \end{align*}
Now we write the negation of this statement as
\(\neg ( S(Guido) \wedge (C(Guido) \vee K(Guido) ) \leftrightarrow\)
Using DeMorgan’s Law we show this is the same as
\(\neg S(Guido) \vee \neg (C(Guido) \vee K(Guido) ) \leftrightarrow\)
Then we apply the other DeMorgan’s Law to show it is the same as
\(\neg S(Guido) \vee (\neg C(Guido) \wedge \neg K(Guido) ).\)
Returning this to English gives us
β€œEither Guido does not own a sailboat, or he does not have the Cessna Citation X type rating and he does not like to cook.”

Subsubsection 2.3.2.2 Discover

In addition to DeMorgan’s Laws (negation of and and or), the negations of the two quantifiers are needed. The negation of for all and there exists statements can be recognized from examples. Try the ones below.
Table 2.3.4. Friends
Name Hair Eye
Guido Brown Brown
Wolfgang Red Brown
Ludwig Brown Hazel
Franz Brown Brown
Maria Gray Brown
Checkpoint 2.3.5.
How would you show that the statement β€œAll of the five friends have brown hair” is false?
Checkpoint 2.3.6.
How would you show that the statement β€œSome of the five friends have blue eyes” is false?
Checkpoint 2.3.7.
What is the negation of the following statement. β€œAll Apple fanboys own an iPad.”
Checkpoint 2.3.8.
What is the negation of the following statement. β€œSome chemist likes to cook.”

Subsubsection 2.3.2.3 Examples

Example 2.3.10.
We will write the statement: β€œSome flower is loved by all bees.” First we must define all the terms.
\begin{align*} B(x) = \amp x \text{ is a bee.}\\ F(x) = \amp x \text{ is a flower.}\\ Y(x) = \amp x \text{ is yellow.}\\ L(x,y) = \amp x \text{ likes } y. \end{align*}
Now we can write the statement in symbols. \(\exists y \: F(y) \ni ( \forall x \: B(x) \rightarrow L(x,y) ). \)
Next we will negate the statement. We will use knowledge of negating all/some and DeMorgan’s laws.
\begin{align*} \neg [\exists y \: F(y) \ni ( \forall x \: B(x) \rightarrow L(x,y) )] \amp \leftrightarrow\\ \forall y \: F(y) \rightarrow \neg ( \forall x \: B(x) \rightarrow L(x,y) ) \amp \leftrightarrow\\ \forall y \: F(y) \rightarrow ( \exists x \: B(x) \ni \neg L(x,y) ). \end{align*}
The negation is the statement: β€œEach flower is distasteful to some bee.”
Example 2.3.11.
Next we will write the statement: β€œAll red berries are loved by some bear.”
\begin{align*} U(x) = \amp x \text{ is a bear.}\\ B(x) = \amp x \text{ is a berry.}\\ R(x) = \amp x \text{ is red.}\\ L(x,y) = \amp x \text{ likes } y. \end{align*}
\(\forall y \: (B(y) \wedge R(y)) \rightarrow [\exists x \: U(x) \ni L(x,y)] \)
We can now negate the statement.
\begin{align*} \neg (\forall y \: (B(y) \wedge R(y)) \rightarrow [\exists x \: U(x) \ni L(x,y)]) \amp \leftrightarrow\\ \exists y \: (B(y) \wedge R(y)) \ni \neg [\exists x \: U(x) \ni L(x,y)]) \amp \leftrightarrow\\ \exists y \: (B(y) \wedge R(y)) \ni [\forall x \: U(x) \rightarrow \neg L(x,y)]). \end{align*}
The negation is the statement: β€œSome red berry is not loved by any bear.”
If you wonder why DeMorgan’s law was not applied in the first step, look at the first example. When the \(\exists\) (first clause) is negated, the exists statement becomes a for all statement and the negation is passed over the condition to the next clause. The negation changes exists/for all but does not change their condition.

Subsubsection 2.3.2.4 Practice

Checkpoint 2.3.12.
Negate the statement: β€œEither the person is a math major, or the person is a computer science major and has taken MATH A265.”
Checkpoint 2.3.13.
Negate: \(\forall n \: C(n) \rightarrow \left( \exists m T(m) \ni \left[ R(n,m) \vee S(n,m) \right] \right). \) Meanings for the predicates are not required.
Checkpoint 2.3.14.
Negate: \(\forall x \: (A(x) \vee B(x)) \rightarrow \left( \exists y C(y) \ni \left[ D(x,y) \vee E(x,y) \right] \right). \) Meanings for the predicates are not required.
Checkpoint 2.3.16.
These demonstrate the full spectrum of what can happen and will require careful attention to grammar. Negate the following statements and re-write in English.
(a)
\(\forall x \: B(x) \rightarrow ( \forall y \: F(y) \rightarrow L(x,y) ).\)
(b)
\(\forall x \: B(x) \rightarrow ( \exists y \: F(y) \ni L(x,y) ).\)
(c)
\(\exists x \: B(x) \ni ( \forall y \: F(y) \rightarrow L(x,y) ).\)
(d)
\(\exists x \: B(x) \ni ( \forall y \: F(y) \rightarrow \neg L(x,y) ).\)
(e)
\(\exists x \: B(x) \ni ( \forall y \: [F(y) \wedge Y(y)] \rightarrow \neg L(x,y) ).\)
Checkpoint 2.3.17.
The following two statements are not logically equivalent. Demonstrate why by finding a case that is true for one statement but false for the other statement.
  • Some tree is loved by all moose.
  • Every moose loves some tree.
Hint.
Consider whether each moose has to love the same tree.

Exercises 2.3.3 Exercises

Exercise Group.

Use the following predicates below.
  • \(M(x)\text{:}\) x is a moose.
  • \(G(x)\text{:}\) x is a patch of grass.
  • \(N(x)\text{:}\) x is new.
  • \(E(x,y)\text{:}\) x eats y.
1.
Write the following statements using predicate notation.
  1. All moose eat some patch of new grass.
  2. Some moose eats all patches of new grass.
  3. Some moose eats no patch of new grass.
  4. All moose do not eat some patch of new grass.
2.
Negate the following statements using predicate notation.
  1. All moose eat some patch of new grass.
  2. Some moose eats all patches of new grass.
  3. Some moose eats no patch of new grass.
  4. All moose do not eat some patch of new grass.
3.
Write the negations of the following statements in English.
  1. All moose eat some patch of new grass.
  2. Some moose eats all patches of new grass.
  3. Some moose eats no patch of new grass.
  4. All moose do not eat some patch of new grass.

4.

What must you show to prove the following true?
  1. All moose eat some patch of new grass.
  2. Some moose eats all patches of new grass.

5.

What must you show to prove the following false?
  1. Some patch of new grass is eaten by no moose.
  2. No moose does not eat some patch of grass.