How to negate nested quantifiers

For a domain DD, and predicate PP, we know that,

¬xP(x)x¬P(x),\neg \forall x P(x)\equiv \exists x \neg P(x),

and

¬xP(x)x¬P(x).\neg \exists x P(x)\equiv \forall x \neg P(x).

This is due to the DeMorgan’s laws. If we have nested quantifiers, we can use the same knowledge to deal with them.

Negation of xyP(x,y)\forall x \forall y P(x,y)

Assume an arbitrary domain and predicate on two variables, both quantified universally.

We can apply DeMorgan’s law twice as follows.

¬x[yP(x,y)]x¬[yP(x,y)].\neg \forall x [\forall y P(x,y)] \equiv \exists x \neg[\forall y P(x,y)].

In the second step, we have,

x¬[yP(x,y)]xy¬P(x,y).\exists x \neg[\forall y P(x,y)]\equiv \exists x \exists y \neg P(x,y).

Therefore,

¬xyP(x,y)xy¬P(x,y).\neg \forall x \forall y P(x,y) \equiv \exists x \exists y \neg P(x,y).

Let’s look at some examples to see the effect of negation.

Examples


Assume the domain of integers and define the following predicate.

  • P(x,y)P(x,y): x×y>x+y.x\times y>x + y.

Let’s make a statement ss by quantifying PP as follows:

  • s=xyP(x,y)s=\forall x \forall y P(x,y): The product of any two integers is greater than their sum.

The truth value of ss is false. We can construct a counterexample by taking xx to be three and yy to be a negative one. Because (3)×(1)(3)+(1)(3)\times(-1) \ngtr (3)+(-1), ss is false.

Let’s look at ¬s\neg s:

  • ¬s=¬xyP(x,y).\neg s= \neg \forall x \forall y P(x,y).

  • ¬sxy¬P(x,y).\neg s\equiv \exists x \exists y \neg P(x,y).

  • ¬s\neg s: There exists a pair of integers, such that, x×yx+y.x\times y \ngtr x+y.

The truth value of ¬s\neg s is true, as we have already observed that such a pair (x=3,y=1)(x=3,y=-1) exists.


Again, assume the domain of integers and define the following predicate:

  • P(x,y)P(x,y): x>yx2>y2.x>y \Rightarrow x^2>y^2.

Let’s quantify PP to make a statement tt as follows:

  • t=xyP(x,y)t=\forall x \forall y P(x,y): For every pair of integers, the greater number has a greater square.

We can represent the negation of tt as follows:

  • ¬txy¬P(x,y)\neg t\equiv \exists x \exists y \neg P(x,y): There exists a pair of integers such that the square of the greater number is not greater.

If we take x=2x=2 and y=3y=-3, we observe a counterexample for tt.

((2>3)(49)).\left(\left(2>-3\right) \land \left(4\le9\right)\right).

Therefore, tt is false and ¬t\neg t is true.

Negation of xyP(x,y)\exists x \exists y P(x,y)

Apply DeMorgan’s law twice as follows:

¬x[yP(x,y)]x¬[yP(x,y)].\neg \exists x [\exists y P(x,y)] \equiv \forall x \neg[\exists y P(x,y)].

In the second step, we have,

x¬[yP(x,y)]xy¬P(x,y).\forall x \neg[\exists y P(x,y)]\equiv \forall x \forall y \neg P(x,y).

Therefore,

¬xyP(x,y)xy¬P(x,y).\neg \exists x \exists y P(x,y) \equiv \forall x \forall y \neg P(x,y).

Examples

Let’s go through some examples.


Take the domain of integers and define the following predicate:

  • P(x,y)P(x,y): xy>yx.x^y > y^x.

Let’s quantify the variables in PP to make a statement rr as follows:

  • r=xyP(x,y)r=\exists x \exists y P(x,y): There exists a pair of integers, (a,b)(a,b), such that, ab>ba.a^b>b^a.

If we look at ¬r\neg r, it will follow.

  • ¬rxy¬P(x,y)\neg r \equiv \forall x \forall y \neg P(x,y): For every pair (a,b)(a,b) of integers, abba.a^b \le b^a.

If we take x=3x=3 and y=2y=2, we observe that, 32>233^2>2^3.

So, rr is true and ¬r\neg r is false.


Again, consider the domain of integers and define the following predicate:

  • P(x,y)P(x,y): 5x+2y=0.5x+2y=0.

Let’s make a statement gg by quantifying PP as follows.

  • g=xyP(x,y)g=\exists x \exists y P(x,y): There exists a pair (a,b)(a,b) of integers, such that, 5a+2b=0.5a+2b=0.

The negation of statement gg is as follows:

  • ¬gxy¬P(x,y)\neg g \equiv \forall x\forall y \neg P(x,y): For every pair (a,b)(a,b) of integers, 5a+2b0.5a+2b \ne 0.

Let’s see if gg is true or its negation. If we take x=2x=2 and y=5y=-5, we observe that 5x+2y5x+2y evaluates to zero. Therefore, gg is true.

Negation of xyP(x,y)\forall x \exists y P(x,y)

Again, we deal with nested quantifiers by applying DeMorgan’s law twice.

¬x[yP(x,y)]x¬[yP(x,y)].\neg \forall x [\exists y P(x,y)] \equiv \exists x \neg[\exists y P(x,y)].

In the second step, we have,

x¬[yP(x,y)]xy¬P(x,y).\exists x \neg[\exists y P(x,y)]\equiv \exists x \forall y \neg P(x,y).

So,

¬xyP(x,y)xy¬P(x,y).\neg \forall x \exists y P(x,y) \equiv \exists x \forall y \neg P(x,y).

Examples


Take integers as the domain and define the following predicate:

  • P(x,y)P(x,y): x+y=0.x + y = 0.

Let’s make a statement hh by quantifying PP as follows:

  • h=xyP(x,y)h = \forall x \exists y P(x,y): For every integer aa, we have an integer bb such that their sum is zero.

The negation of hh is as follows:

  • ¬hxyP(x,y)\neg h \equiv \exists x \forall y P(x,y): There is an integer whose sum with any integer is not zero.

If we take any non-zero integer as xx, then by taking y=xy=-x, their sum is zero. For x=0x=0, take y=0y=0. Therefore, hh is true.


Consider the set, SS, of students enrolled in a discrete mathematics class and a set of grades G={A,B,C,D,F}.G=\{A,B,C,D,F\}. Taking these two sets, we define the following predicate:

  • P(x,y)P(x,y): xx has yy grade in discrete mathematics.

Let’s quantify PP to make a statement gg as follows:

  • g=xSyGP(x,y)g = \forall_{ x \in S} \exists_{ y \in G} P(x,y): Every student in the discrete mathematics class got some grade.

The negation of gg is as follows:

  • ¬g=xSyG¬P(x,y)\neg g = \exists_{x\in S} \forall_{y \in G} \neg P(x,y): There is a student in the discrete mathematics class who got no grade.

Negation of xyP(x,y)\exists x \forall y P(x,y)

We can apply DeMorgan’s law twice as follows:

¬x[yP(x,y)]x¬[yP(x,y)].\neg \exists x [\forall y P(x,y)] \equiv \forall x \neg[\forall y P(x,y)].

In the second step, we have,

x¬[yP(x,y)]xy¬P(x,y).\forall x \neg[\forall y P(x,y)]\equiv \forall x \exists y \neg P(x,y).

So,

¬xyP(x,y)xy¬P(x,y).\neg \exists x \forall y P(x,y) \equiv \forall x \exists y \neg P(x,y).

Examples


Consider a town named Happyhill. Let SS be the set of people, and BB be the set of buildings in the Happyhill. With this, we can construct the following predicate.

  • P(x,y)P(x,y): xx is a post office, and yy can post his mail through it.

We can quantify PP to make a statement ss as follows.

  • s=xBySP(x,y)s=\exists_{x \in B} \forall_{y \in S} P(x,y): There is at least one post office building in Happyhill, and everyone in Happyhill can post their mail through it.

We can write it in simple words as follows:

  • s=xBySP(x,y)s=\exists_{x \in B} \forall_{y \in S} P(x,y): Happyhill has one or more post offices for everyone to post their mail.

We can negate ss as follows:

  • ¬s=xByS¬P(x,y)\neg s = \forall_{x \in B} \exists_{y \in S} \neg P(x,y): For every building, there is someone who can not post their mail through that building in Happyhill.

Considering the set of integers, we can construct the following predicate:

  • P(x,y)P(x,y) : xx is an additive inverse of yy.

We can quantify PP to make a statement tt as follows:

  • t=xyP(x,y)t=\exists x \forall y P(x,y): There exists an integer that is an additive inverse of all integers.

We know that tt is a false statement. Let’s look at its negation:

  • ¬t=xy¬P(x,y)\neg t = \forall x \exists y \neg P(x,y): Every integer is not additive inverse of some integer.

The negation of tt is true. We can take any integer; it is not an additive inverse of it’s successor.

Summary

Let’s summarize the results regarding the negation of nested quantifiers covered in this lesson.

¬xyP(x,y)xy¬P(x,y).\neg \forall x \forall y P(x,y) \equiv \exists x \exists y \neg P(x,y).

¬xyP(x,y)xy¬P(x,y).\neg \exists x \exists y P(x,y) \equiv \forall x \forall y \neg P(x,y).

¬xyP(x,y)xy¬P(x,y).\neg \forall x \exists y P(x,y) \equiv \exists x \forall y \neg P(x,y).

¬xyP(x,y)xy¬P(x,y).\neg \exists x \forall y P(x,y) \equiv \forall x \exists y \neg P(x,y).