Skip to main content
Mathematics LibreTexts

2.3: Predicate Logic

  • Page ID
    88846
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    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.

    The statement: n is a positive, even number can now be written as \(P(n) \wedge E(n)\).

    Quantifiers

    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.

    \[E(n)=n is even\]

    \[P(n)=n is prime\]

    \[Q(n)=n is a multiple of 4 \]

    Using these predicates (symbols) we can express statements such as those in Table \(\PageIndex{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 \(\PageIndex{2}\)Write the following statement using predicates and quantifiers. “All computer science majors must take Introduction to Discrete Mathematics and Data Structures and Algorithms.”

    Negation

    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 \(\PageIndex{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.

    S(x)=x owns a sail boat.

    C(x)=x has a type rating for the Cessna Citation X.

    K(x)=x likes to cook.

    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.”

    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 \(\PageIndex{4}\) Friends
    Name Hair Eye
    Guido Brown Brown
    Wolfgang Red Brown
    Ludwig Brown Hazel
    Franz Brown Brown
    Maria Gray Brown

    Checkpoint \(\PageIndex{5}\)

    How would you show that the statement “All of the five friends have brown hair” is false?

    Checkpoint \(\PageIndex{6}\)

    How would you show that the statement “Some of the five friends have blue eyes” is false?

    Checkpoint \(\PageIndex{7}\)

    What is the negation of the following statement. “All Apple fanboys own an iPad.”

    Checkpoint \(\PageIndex{8}\)

    What is the negation of the following statement. “Some chemist likes to cook.”

    Checkpoint \(\PageIndex{9}\)

    (a) For Checkpoint \(\PageIndex{5}\) how many entries in the table did you have to check?

    (b) For Checkpoint \(\PageIndex{6}\) how many entries in the table did you have to check?

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

    Examples
    Example \(\PageIndex{10}\)

    We will write the statement: “Some flower is loved by all bees.” First we must define all the terms.

    B(x)=x is a bee.

    F(x)=x is a flower.

    Y(x)=x is yellow.

    L(x,y)=x likes y.

    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) )] \leftrightarrow\\
    \forall y \: F(y) \rightarrow \neg ( \forall x \: B(x) \rightarrow L(x,y) ) \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 \(\PageIndex{11}\)

    Next we will write the statement: “All red berries are loved by some bear.”

    U(x)=x is a bear.

    B(x)=x is a berry.

    R(x)=x is red.

    L(x,y)=x likes y.

    \(\forall y \: (B(y) \wedge R(y)) \rightarrow [\exists x \: U(x) \ni L(x,y)]\)

    We can now negate the statement.

    \(\neg (\forall y \: (B(y) \wedge R(y)) \rightarrow [\exists x \: U(x) \ni L(x,y)]) \leftrightarrow\)

    \(\exists y \: (B(y) \wedge R(y)) \ni \neg [\exists x \: U(x) \ni L(x,y)]) \leftrightarrow\)

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

    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.

    Practice

    Checkpoint \(\PageIndex{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 \(\PageIndex{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 \(\PageIndex{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 \(\PageIndex{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 \(\PageIndex{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): x is a bee.
    • F(x): x is a flower.
    • Y(x): x is yellow.
    • L(x,y): 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 \(\PageIndex{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

    Use the following predicates below.

    • M(x): x is a moose.
    • G(x): x is a patch of grass.
    • N(x): x is new.
    • E(x,y): x eats y.

    1. Write the following statements using predicate notation.

    All moose eat some patch of new grass.

    Some moose eats all patches of new grass.

    Some moose eats no patch of new grass.

    All moose do not eat some patch of new grass.

    2. Negate the following statements using predicate notation.

    All moose eat some patch of new grass.

    Some moose eats all patches of new grass.

    Some moose eats no patch of new grass.

    All moose do not eat some patch of new grass.

    3. Write the negations of the following statements in English.

    All moose eat some patch of new grass.

    Some moose eats all patches of new grass.

    Some moose eats no patch of new grass.

    All moose do not eat some patch of new grass.

    4. What must you show to prove the following true?

    All moose eat some patch of new grass.

    Some moose eats all patches of new grass.

    5. What must you show to prove the following false?

    a. Some patch of new grass is eaten by no moose.

    b. No moose does not eat some patch of grass.


    This page titled 2.3: Predicate Logic is shared under a GNU Free Documentation License 1.3 license and was authored, remixed, and/or curated by Mark A. Fitch via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?