Skip to main content

Section 2.3 Predicate Logic

Subsection 2.3.1 Background

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.2 Quantifiers

Subsubsection 2.3.2.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.3 Negation

Subsubsection 2.3.3.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.3.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.”

Checkpoint 2.3.9.
(c)

What do your answers to these two questions tell you about the efficiency of the operators and and or?

Subsubsection 2.3.3.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.3.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.15.

We will negate a natural language statement in steps.

(a)

Convert this statement to logic notation.

All moose love some mountain ash.

(b)

Negate the statement using the logic notation.

(c)

Convert your negated logic statement back to natural language.

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.

  • \(B(x)\text{:}\) x is a bee.
  • \(F(x)\text{:}\) x is a flower.
  • \(Y(x)\text{:}\) x is yellow.
  • \(L(x,y)\text{:}\) x likes y.
(a)

\(\forall x \: B(x) \rightarrow ( \forall y \: F(y) \rightarrow L(x,y) ).\)

Answer

\(\exists x \: B(x) \ni ( \exists y \: F(y) \ni \neg L(x,y) ).\)

Some bee does not love some flower.

(b)

\(\forall x \: B(x) \rightarrow ( \exists y \: F(y) \ni L(x,y) ).\)

Answer

\(\exists x \: B(x) \ni ( \forall y \: F(y) \rightarrow \neg L(x,y) ).\)

Some bee hates all flowers.

(c)

\(\exists x \: B(x) \ni ( \forall y \: F(y) \rightarrow L(x,y) ).\)

Answer

\(\forall x \: B(x) \rightarrow ( \exists y \: F(y) \ni \neg L(x,y) ).\)

Every bee dislikes some flower.

(d)

\(\exists x \: B(x) \ni ( \forall y \: F(y) \rightarrow \neg L(x,y) ).\)

Answer

\(\forall x \: B(x) \rightarrow ( \exists y \: F(y) \ni L(x,y) ).\)

Every bee loves some flower.

(e)

\(\exists x \: B(x) \ni ( \forall y \: [F(y) \wedge Y(y)] \rightarrow \neg L(x,y) ).\)

Answer

\(\forall x \: B(x) \rightarrow ( \exists y \: [F(y) \wedge Y(y)] \ni L(x,y) ).\)

Every bee loves some yellow flower.

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.4 Exercises

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.