Mathematical Reasoning and Discrete Math

Chapter 6: Quantification, Informally and Medium-formally

We have developed propositional logic, and expanded it to predicate logic. We now continue the project. This time we expand predicate logic to what is called first-order logic.

This chapter introduces the intuitions and ideas. In the next chapter we will study the formal syntax and semantics.

Keep R\Bbb R in Your Heart

Throughout this chapter it will help to keep in mind how you would develop a language to talk about the real numbers.

Recall that the real numbers can be thought of, roughly, as “every possible decimal expansion”. The decimal expansion, for example, of 3/2 is 1.5. And the decimal expansion of 1/3 is the infinite expansion 0.333…

Later we’ll have more to say about decimal expansions and the formal construction of real numbers. But at least for now, this is a simple start to thinking about the real numbers.

Some examples: Every integer and rational number is a real number. But then there are some real numbers, like 2\sqrt 2 and π\pi, which are real numbers but not rational. Later in this course we will actually prove that 2\sqrt 2 is real but not rational, whereas proving this for π\pi is beyond the scope of this course.

Note that 2\sqrt 2 doesn’t look like a “decimal expansion”. But there is a sequence of decimal numerals which is equivalent to 2\sqrt 2.

2=1.4142...\sqrt 2 = 1.4142...

Now what does this have to do with logic?

First of all notice that the “number of real numbers” is enormous. It is clearly infinite. But even more than being infinite, there's just no good way to list all of the real numbers.

Reals cannot be listed.

We will have more to say about the fact that the real numbers cannot be listed. The more professional way to say this is that the real numbers are "uncountable".

Therefore a language cannot, in any practical sense, name every single real number. Therefore we must have some way to manage the fact that our names run out, before we run out of objects that we want to talk about.

In the chapter on predicate logic we had names for objects that we wanted to talk about. In this chapter we discuss the idea of "variables" and "quantifiers" which allow us to speak about infinite sets, since the variables are able to "vary over the infinite set".

“All” and “Some”

Consider a sentence like “every dog deserves pets”.

Pasted image 20261004205111.png

If we were to express this in predicate syntax, first we would need a name for every dog. That would be a lot of names, like

d1,d2,d3,...,d109{\tt d_1},{\tt d_2},{\tt d_3},...,{\tt d_{10^{9}}}

for each of about a billion doggies. Then we need a predicate, like D(x){\tt D}({\tt x}), to represent "x{\tt x} deserves pets".

Then we need to form the very long conjunction

D(d1)∧D(d2)∧⋯∧D(d109){\tt D}({\tt d_1}){\tt \land} {\tt D}({\tt d_2}){\tt \land}\cdots{\tt \land} {\tt D}({\tt d_{10^9}})

But in English, the sentence is much simpler and shorter—we just use a phrase like “all”.

"All doggies deserve pets."

Much simpler!

Of course there is a parallel idea for disjunction: Consider the sentence “Some chimpanzee deserves pets.” This one might deserve pets:

Pasted image 20261004211041.png

This one gives me "no pets" vibes.

Pasted image 20261004211251.png

To express “some chimps deserve pets” we’ll need to name every chimp,

c1,...,c106{\tt c_1},...,{\tt c_{10^6}}

and then assert

D(c1)∨⋯∨D(c106){\tt D}({\tt c_1}){\tt \lor}\cdots{\tt \lor} {\tt D}({\tt c_{10^6}})

The point being that “all” indicates a long conjunction of a predicate, over every individual in the domain. “Some” indicates a long disjunction of a predicate, over every individual in the domain.


The above only considers a finite domain, like the set of all doggies or the set of all chimps.

But in math we’ll often need to discuss an infinite domain, like in the sentence “Every number divisible by 4 is divisible by 2.” The natural domain for this statement is the set of integers, and so we are claiming

“If 0 is divisible by 4 then 0 is divisible by 2, and if 1 is divisible by 4 then 1 is divisible by 2, and if -1 …”

This is like an “infinitely long conjunction”, although an actual infinitely long sentence is not possible. Therefore we need a system of finite expressions, which is able to make claims about an infinite domain.

Of course we could repeat much of this for disjunction. In the sentence “there is an integer larger than π100\pi^{100}” we are essentially saying “either 0 is larger than π100\pi^{100}, or 1 is larger than π100\pi^{100}, or -1 is larger than π100\pi^{100}, or …”


Whenever we want to make a claim about all objects within the domain, we call this “universal quantification”. This is indicated by words like “all”, “every”, “each”, and so on.

Whenever we want to make a claim that there is some object within the domain, we call this “existential quantification”. This is indicated by words like “there is”, “there exists”, “some”, and so on.

Quantifiers

We are now going to add quantifiers to our predicate logic. The resulting language is called first-order logic, which we officially define later.

To express “every dog deserves pets” in first-order logic, we will write

∀xD(x){\tt \forall} {\tt x} {\tt D}({\tt x})

The upside-down ‘A’ is read as “for all”. So the literal reading of this expression is

For all x{\tt x} in the domain, x{\tt x} deserves pets.

This expresses that all dogs deserve pets, so long as the "domain of discourse" is the set of all dogs. If the domain were all chimps, then ∀xD(x){\tt \forall} {\tt x} {\tt D}({\tt x}) would express that all chimps deserve pets.

Exercise

Suppose that the domain is the set of all real numbers, TODO. Let S(x)S(x) be a property which means "x is less than 10."

Decide whether the proposition ∀xS(x)\forall x S(x) is true.

If the domain is instead all negative numbers, is ∀xS(x)\forall x S(x) true?

To express “some chimp deserves pets”, if the domain is all chimps, then we would write

∃xD(x){\tt \exists} {\tt x} {\tt D}({\tt x})

The backwards 'E' is read as "there exists". So the literal reading of this expression is

There exists an x{\tt x} in the domain, x{\tt x} deserves pets.

The symbols ∀{\tt \forall} and ∃{\tt \exists} are called "quantifiers".

Notice that the syntax uses a variable, like x{\tt x} above. However, we still want to have constant symbols, as we did with predicate logic. Variables and constants mean very different things! A variable "varies", i.e. takes on the value of several different domain elements. A constant has its meaning fixed to one specified domain element.

For example, suppose that the domain is all integers, o{\tt o} denotes the number 1, and the predicate D(x,y){\tt D}({\tt x},{\tt y}) denotes the relation "xx is divisible by yy".

We can continue to use the semantic notation from the previous chapter, and write

म=Zoइ=1Dइ={(x,y)∈Z2:x is divisible by y}\begin{aligned} म &= \Bbb Z\\ {\tt o}^इ &= 1\\ {\tt D}^इ &= \{(x,y)\in\Bbb Z^2: x \text{ is divisible by } y\} \end{aligned}

Then to express that every number is divisible by 1, we write

∀xD(x,o){\tt \forall} {\tt x} {\tt D}({\tt x},{\tt o})

Both variables and constants will be represented by lower-case letters, as you see above. And yet our logical language will need two kinds of object symbols, one for variables and one for constants, and we don't want them to get confused for each other.

Traditionally we will use the letters a{\tt a} through t{\tt t} for constants, and the letters u{\tt u} through z{\tt z} for variables. Of course we also allow indices, so that a101{\tt a_{101}} and t0{\tt t_0} may be constants, and u123{\tt u_{123}} could be a variable.

Exercise

Establish a reasonable domain and symbols to express the proposition

There is some integer greater than π\pi.

Note that we can also quantify over formulas, not just simple predicates. For example, suppose that the domain is all integers, t{\tt t} denotes 2, f{\tt f} denotes 4, and D(x,y){\tt D}({\tt x},{\tt y}) denotes "xx is divisible by yy". Then consider the expression

∀x(D(x,f)→D(x,t)){\tt \forall} {\tt x}({\tt D}({\tt x},{\tt f}) {\tt \to} {\tt D}({\tt x},{\tt t}))

This expresses that "for every integer xx, if xx is divisible by 4, then xx is divisible by 2".

If E{\tt E} expresses "is even" and P{\tt P} expresses "is prime" then

∃x(E(x)∧P(x)){\tt \exists} {\tt x} ({\tt E}({\tt x}){\tt \land} {\tt P}({\tt x}))

expresses that there exists an even prime integer.

Exercise

Choose a reasonable domain and symbols to express that "every differentiable function of a real variable is continuous".

Choose another reasonable domain and symbols to express that "every cat is a mammal".

Not only can we quantify over formulas, but in fact, we can make formulas out of quantified expressions. For example, if the domain is integers, E{\tt E} denotes "is even", O{\tt O} denotes "is odd", then the expression

(∃xE(x))∧(∃xO(x))\tt (\exists x E(x)) \land (\exists x O(x))

expresses that "there is some number which is even, and there is some number which is odd". This is a true proposition, since there does exist an even integer, 2, and there does exist an odd integer, 3.

Note how different this expression is from the seemingly similar expression

∃x(E(x)∧O(x)){\tt \exists} {\tt x}({\tt E}({\tt x}){\tt \land} {\tt O}({\tt x}))

This says that there exists an integer, x{\tt x}, which is both even and odd. That is not true, of course, since any number which is even cannot also be odd.

Exercise

Choose a domain and symbols to express "All cats are mammals but not all mammals are cats."

Exercise

Suppose that the domain is all polygons in a two dimensional plane. Just for example, this means that one of the elements in the domain is a triangle with vertices at (0,0), and (1,0), and (0,1). The domain also contains many other triangles, quadrilaterals, pentagons, and so on.

Suppose that E{\tt E} denotes the equilateral polygons, R{\tt R} the rectangles.

Part 1.

Interpret the meaning of the expression

∀x(¬(E(x)∧R(x))){\tt \forall} {\tt x}({\tt \neg}({\tt E}({\tt x}){\tt \land} {\tt R}({\tt x})))

and decide whether it's a true proposition.

Part 2.

Contrast this with the meaning of

{\tt \neg} {\tt \forall} {\tt x}({\tt E}({\tt x}){\tt \land} {\tt R}({\tt x})) $$ and decide wehther this is a true proposition. ***Part 3.*** Come up with symbols that express the proposition: > Every equilateral rectangle is a square. (This is, of course, a true proposition.)

Quantifiers as For-loops

In computer science it is common to have some set of data, and to "loop over" the data in order to perform some computation.

To give an example that is easy to understand, consider a program that looks at a list of numbers and prints a message every time it encounters a prime number.

This example is very simple.

Note that the example that I give here will seem kind of dumb. All it does is print "Found a prime!" every time it finds a prime. That's not very useful.

It may leave you wondering "Why not use an actually useful example?"

Well, any example of code that is actually useful, is always going to be so complicated that a beginner could not understand it. Therefore our earliest examples always have to be so simple that a beginner can understand, but will then necessarily be useless.

Let's assume the computer comes equipped with a function, isPrime, which returns True if the input is prime, and returns False if the input is not prime. So for example isPrime(1) evaluates to False and isPrime(2) evaluates to True.

Here is the program:

listOfNumbers = [1,2,3,4,5,6]
for num in listOfNumbers:
    if isPrime(num):
        print("Found a prime!")

This program will print the message "Found a prime!" three times. Here is the logic of how it works:

  1. The line listOfNumbers = [1,2,3,4,5,6] creates the list of numbers [1,2,3,4,5,6] and then stores this list into the variable listOfNumbers.

  2. The line for num in listOfNumbers: begins a "for-loop". This means that eventually every value in listOfNumbers will be placed into num. It starts by placing 1 in num.

  3. Then the line if isPrime(num): takes the current value in num and inputs it to the function isPrime. Because 1 is not prime, this returns False. Because isPrime(num) evaluates to False.

    Then this value gets read by the if. The if reads a truth-value and, if it is True, will cause the later code to execute. But if the truth-value is False then the later code does not execute.

    Because isPrime(num) evaluates to False then the if dictates the later code does not execute. Therefore, the command print("Found a prime!") is not run.

  4. Now that we have reached the end of the indented code, the for-loop repeats. We go back to the line for num in listOfNumbers: but this time the computer puts 2 into num. We now repeat the rest of the program.

  5. Again we evaluate isPrime(num), but because num now holds 2, this evaluates to True.

  6. The if now reads a True value, and therefore causes the later code to execute.

  7. The code print("Found a prime!") now executes, which causes the computer to display this message.

  8. We have again reached the end. Therefore the for-loop begins again. We go back up, place 3 in num. You can now understand why it's called a "loop".

  9. Since 3 is prime, isPrime(num) evaluates to True, and the program prints "Found a prime!".

  10. Do it all over again with 4, since 4 is not prime no message will be printed.

  11. Do it all over again with 5, since 5 is prime it will print the message.

  12. Do it all over again with 6, since 6 is not prime no message will be printed.

The evaluation of a quantifier is extremely similar.

Consider evaluating ∀xP(x)\tt \forall x P(x) where there are only the constants

Nested Quantifiers

Things get more interesting still when we consider multiple quantifiers.

Consider the domain of all humans on the planet, and the relation L(x,y){\tt L}({\tt x},{\tt y}) which represents “x{\tt x} loves y{\tt y}”.

Now consider the different meanings of each of the following propositions.

  • ∀x∀yL(x,y){\tt \forall} {\tt x}{\tt \forall} {\tt y} {\tt L}({\tt x},{\tt y}) "Everybody loves everybody" like a utopia.
  • ∀x∃yL(x,y){\tt \forall} {\tt x}{\tt \exists} {\tt y} {\tt L}({\tt x},{\tt y}) "Everybody loves somebody" like the Dean Martin song.
  • ∃x∀yL(x,y){\tt \exists} {\tt x}{\tt \forall} {\tt y} {\tt L}({\tt x},{\tt y}) "Somebody loves everybody" like a Jesus figure.
  • ∃x∃yL(x,y){\tt \exists} {\tt x}{\tt \exists} {\tt y} {\tt L}({\tt x},{\tt y}) "Somebody loves somebody", a statement that love is not dead.

I hope that the above gives you an intuition for what the quantifiers mean and how their order can impact the meaning of an expression.

But now let's take an example which is more computational. Suppose that our domain contains just four people, {Axel, Benicio, Cici, Dakota}. Moreover suppose that Axel loves Axel, Benicio, Cici, and Dakota. Benicio loves Cici and Dakota. Nobody else loves anyone else.

Then which of the expressions, ∀x∀yL(x,y),∀x∃yL(x,y),∃x∀yL(x,y),∃x∃yL(x,y)\tt \forall x\forall y L(x,y), \forall x\exists y L(x,y), \exists x\forall y L(x,y), \exists x\exists y L(x,y) are true?

∀x∀yL(x,y)\tt\forall x\forall y L(x,y)

Here is how we check ∀x∀yL(x,y)\tt \forall x\forall y L(x,y): First, run through every choice of assignment to the variable x\tt x.

  • If x\tt x is assigned Axel: Now run through every choice of assignment to y\tt y.

    • If y\tt y is assigned Axel: To evaluate L(x,y)\tt L(x,y) we must decide if Axel loves Axel. Because he does, then this is a true proposition.
    • If y\tt y is assigned Benicio: Because Axel loves Benicio then L(x,y)\tt L(x,y) is true.
    • If y\tt y is Cici: Axel loves Cici so L(x,y)\tt L(x,y) is true.
    • If y\tt y is Dakota: Axel loves Dakota so L(x,y)\tt L(x,y) is true. Because L(x,y)\tt L(x,y) is true for every choice of y\tt y, therefore ∀yL(x,y)\tt \forall y L(x,y) is true in the case where x\tt x is Axel.
  • If x\tt x is Benicio: Now run through every choice of assignment to y\tt y.

    • If y\tt y is Axel: To evaluate L(x,y)\tt L(x,y) we decide if Benicio loves Axel. Because he does not, therefore L(x,y)\tt L(x,y) is false.

    Because L(x,y)\tt L(x,y) is false for some choice of y\tt y then ∀yL(x,y)\tt \forall y L(x,y) is false.

Because ∀yL(x,y)\tt\forall y L(x,y) is false for some x\tt x, then ∀x∀yL(x,y)\tt\forall x\forall y L(x,y) is false.

It will help if we have some notation for the idea of a variable being assigned to some individual. It is common in mathematical logic to write, for example, s(x)=Axels({\tt x}) = \text{Axel} if the variable x\tt x is assigned to Axel.

Therefore we can summarize what we saw above: ∀x∀yL(x,y)\tt \forall x\forall y L(x,y) was false because, when s(x)=Benicios({\tt x}) = \text{Benicio} and s(y)=Axels({\tt y}) = \text{Axel} the proposition L(x,y)\tt L(x,y) was false.

Notice that, when variables are involved, the truth of a proposition can

∃x∀yL(x,y)\tt \exists x\forall y L(x,y)

Next let's assess the truth of ∃x∀yL(x,y)\tt \exists x\forall y L(x,y). We iterate through all assignments to x\tt x.

I won't continue to iterate through all bullet points, since we've seen the process a couple times by now. But you should feel invited to do the explicit iteration on your own paper.

In summary, you should find that when x\tt x is assigned Axel, then when y\tt y is Axel L(x,y)\tt L(x,y) is true, and then when y\tt y is Benicio L(x,y)\tt L(x,y) is true, and when y\tt y is Cici L(x,y)\tt L(x,y) is true, and when y\tt y is Dakota L(x,y)\tt L(x,y) is true.

Therefore when x\tt x denotes Axel, the proposition ∀L(x,y)\tt \forall L(x,y) is true.

Since ∀L(x,y)\tt \forall L(x,y) is true for some assignment to x\tt x, therefore ∃x∀yL(x,y)\tt \exists x\forall yL(x,y) is true.

Exercise

Complete the last evaluation by showing that ∃x∃yL(x,y)\tt\exists x\exists y L(x,y) is true.

Exercise

Using the same L\tt L as above, with the same meaning, decide the truth of the propositions ¬∀x∀yL(x,y)\tt \neg \forall x\forall y L(x,y) and ∀x∀y¬L(x,y)\tt \forall x\forall y \neg L(x,y), and ∃x∃y¬L(x,y)\tt \exists x \exists y \neg L(x,y).

Exercise

Consider a domain उ={a,b}उ =\{a,b\} of just two elements. Let c,d\tt c,d be constant symbols such that c\tt c denotes aa and d\tt d denotes bb. Let P\tt P be a property.

  1. Explain why ∀xP(x)\tt \forall x P(x) is equivalent to P(c)∧P(d)\tt P(c) \land P(d), regardless of the meaning of P\tt P. Also explain why ∃xP(x)\tt \exists x P(x) is equivalent to P(c)∨P(d)\tt P(c)\lor P(d).

  2. Now let Q\tt Q be another property. Then explain why ∀x∀y(P(x)∨Q(y))\tt \forall x \forall y (P(x) \lor Q(y)) is equivalent to (∀y(P(c)∨Q(y))∧(∀y(P(c)∨Q(y))\tt (\forall y (P(c)\lor Q(y)) \land (\forall y (P(c) \lor Q(y)), which is also equivalent to ((P(c)∨P(c))∧(P(c)∨P(d)))∧((P(d)∨P(c))∧(P(d)∨P(d))\tt ( (P(c)\lor P(c)) \land (P(c)\lor P(d))) \land ((P(d)\lor P(c)) \land (P(d)\lor P(d)).

  3. We could regard the equivalences above as a kind of "expansion" of the propositions. Find the expansion of ∃x∀y(P(x)→Q(y))\tt \exists x \forall y (P(x)\to Q(y)), and ∀x∀y∀z((P(x)∨Q(y))→¬P(z))\tt \forall x\forall y \forall z ((P(x)\lor Q(y))\to \neg P(z)).

  4. What changes if the number of domain elements increases to 3, and we have 3 constant symbols that refer to each domain element?

  5. Explain why ∀xP(x)\tt\forall xP(x) always implies ∃xP(x)\tt\exists x P(x).

Now we check ∀x∃yL(x,y)\tt\forall x\exists y L(x,y). Just as before, we iterate through every assignment of x\tt x.

  • If x\tt x is Axel: We now run through every choice of y\tt y.
    • If y\tt y is Axel: We've seen that in this case L(x,y)\tt L(x,y) is true.
      But already we can conclude that ∃yL(x,y)\tt \exists y L(x,y) is true when x\tt x is Axel.
  • If x\tt x is Benicio: Run through every choice of assignment to y\tt y.
    • If y\tt y is Axel: Here L(x,y)\tt L(x,y) is false.
    • If y\tt y is Benicio: Here L(x,y)\tt L(x,y) is false.
    • If y\tt y is Cici: Here L(x,y)\tt L(x,y) is true. We can conclude that ∃yL(x,y)\tt \exists y L(x,y) is true when x\tt x is Benicio.
  • If x\tt x is Cici: Run through every choice of assignment to y\tt y.
    • If y\tt y is Axel: Here L(x,y)\tt L(x,y) is false.
    • If y\tt y is Benicio: Here L(x,y)\tt L(x,y) is false.
    • If y\tt y is Cici: Here L(x,y)\tt L(x,y) is false.
    • If y\tt y is Dakota: Here L(x,y)\tt L(x,y) is false. Since L(x,y)\tt L(x,y) is false for every choice of y\tt y, then ∃yL(x,y)\tt \exists y L(x,y) is false when x\tt x is Cici.

Because ∃yL(x,y)\tt \exists y L(x,y) is false for some s(x)s({\tt x}), then ∀x∃yL(x,y)\tt \forall x\exists y L(x,y) is false.

∃x∀yL(x,y)\tt \exists x\forall y L(x,y)

Let’s use L(x,y){\tt L}({\tt x},{\tt y}) to mean “x{\tt x} is linked to y{\tt y} by a road”. So for example L(a,b){\tt L}({\tt a},{\tt b}) is true while L(a,d){\tt L}({\tt a},{\tt d}) is not.

Let’s also use N(x,y){\tt N}({\tt x},{\tt y}) to mean “x{\tt x} is lexically next after y{\tt y}”. Note that N(b,a){\tt N}({\tt b},{\tt a}) is true because b{\tt b} is lexically next after a{\tt a}. However, N(c,a){\tt N}({\tt c},{\tt a}) is not true.

Here is a sentence that should be true: For any two cities, x{\tt x} and y{\tt y}, if x{\tt x} is lexically next after y{\tt y} then x{\tt x} is linked to y{\tt y}. In a formula, this is

∀x∀y(N(x,y)→L(x,y)){\tt \forall} {\tt x}{\tt \forall} {\tt y}({\tt N}({\tt x},{\tt y}) {\tt \to} {\tt L}({\tt x},{\tt y}))

Intuitively this is true because we see four pairs where one city is lexically next: A and B, B and C, C and D, and D and E. In every case, the pair of cities are linked, as you can see in the graph.

To evaluate (∀x∀y(N(x,y)→L(x,y)))म({\tt \forall} {\tt x}{\tt \forall} {\tt y}({\tt N}({\tt x},{\tt y}){\tt \to} {\tt L}({\tt x},{\tt y})))^{म} formally, we need to consider five total possible assignments to x{\tt x}.

  • x↦a{\tt x}\mapsto {\tt a}
  • x↦b{\tt x}\mapsto {\tt b}
  • x↦c{\tt x}\mapsto {\tt c}
  • x↦d{\tt x}\mapsto {\tt d}
  • x↦e{\tt x}\mapsto {\tt e}

Let’s consider these each in turn.

  • x↦a{\tt x}\mapsto {\tt a}

With this assignment we now have to evaluate (∀y(N(a,y)→L(a,y)))म({\tt \forall} {\tt y} ({\tt N}({\tt a},{\tt y}){\tt \to} {\tt L}({\tt a},{\tt y})))^{म}. To do this we again need to consider five possible assignments to y{\tt y}.

  • y↦a{\tt y}\mapsto {\tt a}

    With this assignment we now have to evaluate (N(a,a)→L(a,a))म({\tt N}({\tt a},{\tt a}){\tt \to} {\tt L}({\tt a},{\tt a}))^{म}. Noting that N(a,a)म=फ{\tt N}({\tt a},{\tt a})^{म}=फ and L(a,a)म=ट{\tt L}({\tt a},{\tt a})^{म}=ट, then

    (N(a,a)→L(a,a))म=N(a,a)म⇝L(a,a)म=फ⇝ट=ट\begin{aligned} ({\tt N}({\tt a},{\tt a}){\tt \to} {\tt L}({\tt a},{\tt a}))^{म} &= {\tt N}({\tt a},{\tt a})^{म} \leadsto {\tt L}({\tt a},{\tt a})^{म} \\ &= फ\leadsto ट \\ &= ट \end{aligned}

  • y↦b{\tt y}\mapsto {\tt b}

    With this assignment

    (N(a,b)→L(a,b))म=N(a,b)म⇝L(a,b)म=फ⇝ट=ट\begin{aligned} ({\tt N}({\tt a},{\tt b}){\tt \to} {\tt L}({\tt a},{\tt b}))^{म} &= {\tt N}({\tt a},{\tt b})^{म} \leadsto {\tt L}({\tt a},{\tt b})^{म} \\ &= फ\leadsto ट \\ &= ट \end{aligned}

  • y↦c{\tt y}\mapsto {\tt c}

    (N(a,c)→L(a,c))म=N(a,c)म⇝L(a,c)म=फ⇝ट=ट\begin{aligned} ({\tt N}({\tt a},{\tt c}){\tt \to} {\tt L}({\tt a},{\tt c}))^{म} &= {\tt N}({\tt a},{\tt c})^{म} \leadsto {\tt L}({\tt a},{\tt c})^{म} \\ &= फ\leadsto ट \\ &= ट \end{aligned}

  • y↦d{\tt y}\mapsto {\tt d}

    (N(a,d)→L(a,d))म=N(a,d)म⇝L(a,d)म=फ⇝फ=ट\begin{aligned} ({\tt N}({\tt a},{\tt d}){\tt \to} {\tt L}({\tt a},{\tt d}))^{म} &= {\tt N}({\tt a},{\tt d})^{म} \leadsto {\tt L}({\tt a},{\tt d})^{म} \\ &= फ\leadsto फ \\ &= ट \end{aligned}

  • y↦e{\tt y}\mapsto {\tt e}

    (N(a,e)→L(a,e))म=N(a,e)म⇝L(a,e)म=फ⇝फ=ट\begin{aligned} ({\tt N}({\tt a},{\tt e}){\tt \to} {\tt L}({\tt a},{\tt e}))^{म} &= {\tt N}({\tt a},{\tt e})^{म} \leadsto {\tt L}({\tt a},{\tt e})^{म} \\ &= फ\leadsto फ \\ &= ट \end{aligned}

    As we see, when x{\tt x} is assigned to aa, then for every possible mapping of y{\tt y}, we get a true proposition.

    Therefore (∀y(N(a,y)→L(a,y)))म=ट({\tt \forall} {\tt y}({\tt N}({\tt a},{\tt y}){\tt \to} {\tt L}({\tt a},{\tt y})))^{म} = ट.

  • x↦b{\tt x}\mapsto {\tt b}

Exercise

Perform this assignment and evaluate (∀y(N(b,y)→L(b,y)))म({\tt \forall} {\tt y}({\tt N}({\tt b},{\tt y}){\tt \to} {\tt L}({\tt b},{\tt y})))^{म}.

  • x↦c{\tt x}\mapsto {\tt c}

Exercise

Perform this assignment and evaluate the relevant proposition.

  • x↦d{\tt x}\mapsto {\tt d}

    • y↦a{\tt y}\mapsto {\tt a}

      (N(d,a)→L(d,a))म=N(d,a)म⇝L(d,a)म=फ⇝फ=ट\begin{aligned} ({\tt N}({\tt d},{\tt a}){\tt \to} {\tt L}({\tt d},{\tt a}))^{म} &= {\tt N}({\tt d},{\tt a})^{म} \leadsto {\tt L}({\tt d},{\tt a})^{म} \\ &= फ\leadsto फ \\ &= ट \end{aligned}

    • y↦b{\tt y}\mapsto {\tt b}

      With this assignment

      (N(d,b)→L(d,b))म=N(d,b)म⇝L(d,b)म=फ⇝ट=ट\begin{aligned} ({\tt N}({\tt d},{\tt b}){\tt \to} {\tt L}({\tt d},{\tt b}))^{म} &= {\tt N}({\tt d},{\tt b})^{म} \leadsto {\tt L}({\tt d},{\tt b})^{म} \\ &= फ\leadsto ट \\ &= ट \end{aligned}

    • y↦c{\tt y}\mapsto {\tt c}

      (N(d,c)→L(d,c))म=N(d,c)म⇝L(d,c)म=ट⇝ट=ट\begin{aligned} ({\tt N}({\tt d},{\tt c}){\tt \to} {\tt L}({\tt d},{\tt c}))^{म} &= {\tt N}({\tt d},{\tt c})^{म} \leadsto {\tt L}({\tt d},{\tt c})^{म} \\ &= ट\leadsto ट \\ &= ट \end{aligned}

    • y↦d{\tt y}\mapsto {\tt d}

      (N(d,d)→L(d,d))म=N(d,d)म⇝L(d,d)म=फ⇝फ=ट\begin{aligned} ({\tt N}({\tt d},{\tt d}){\tt \to} {\tt L}({\tt d},{\tt d}))^{म} &= {\tt N}({\tt d},{\tt d})^{म} \leadsto {\tt L}({\tt d},{\tt d})^{म} \\ &= फ\leadsto फ \\ &= ट \end{aligned}

    • y↦e{\tt y}\mapsto {\tt e}

      (N(d,e)→L(d,e))म=N(d,e)म⇝L(d,e)म=फ⇝ट=ट\begin{aligned} ({\tt N}({\tt d},{\tt e}){\tt \to} {\tt L}({\tt d},{\tt e}))^{म} &= {\tt N}({\tt d},{\tt e})^{म} \leadsto {\tt L}({\tt d},{\tt e})^{म} \\ &= फ\leadsto ट \\ &= ट \end{aligned}

      As we see, when x↦d{\tt x}\mapsto {\tt d}, then for every possible mapping of y{\tt y}, we get a true proposition.

      Therefore (∀y(N(d,y)→L(d,y)))म=ट({\tt \forall} {\tt y}({\tt N}({\tt d},{\tt y}){\tt \to} {\tt L}({\tt d},{\tt y})))^{म} = ट.

  • x↦e{\tt x}\mapsto {\tt e}

We should check this case too, but I promise (∀y(N(e,y)→L(e,y)))म=ट({\tt \forall} {\tt y}({\tt N}({\tt e},{\tt y}){\tt \to} {\tt L}({\tt e},{\tt y})))^{म}=ट. However, you are invited to check for yourself if you would like more exercise.

The above now confirms that, for every possible assignment to x{\tt x}, the resulting proposition is true.

Therefore it demonstrates (∀x∀y(N(x,y)→L(x,y)))म({\tt \forall} {\tt x}{\tt \forall} {\tt y} ({\tt N}({\tt x},{\tt y}){\tt \to} {\tt L}({\tt x},{\tt y})))^{म}.

Exercise

Using the same city and road diagram, solve the following exercises.

You don’t always have to make every single assignment. For example, to show ∀x∃yL(x,y){\tt \forall} {\tt x}{\tt \exists} {\tt y} {\tt L}({\tt x},{\tt y}) is true, you do need to show that it is true for every possible assignment to x{\tt x}. So this means that you need to check at least five assignments to x{\tt x}.

Now if you were very flat-footed, you would then check five assignments to y{\tt y}. If at least one of those assignments is true, then the existential proposition is true.

But this is more effort than you really need to do. When it comes to an existential quantifier, you really just need to exhibit one instance of टट, not every instance of टट. So, for each assignment of x{\tt x}, if you find one satisfying assignment of टट, you can stop early!

  1. Show that

    ∀x∃yL(x,y){\tt \forall} {\tt x}{\tt \exists} {\tt y} {\tt L}({\tt x},{\tt y})

    is true. (Hint: With an appropriate choice of assignments, this only requires evaluating five propositions. Further hint: For any choice of x{\tt x}, it is not linked to itself!)

  2. Show that

    ∃x∀yL(x,y){\tt \exists} {\tt x}{\tt \forall} {\tt y} {\tt L}({\tt x},{\tt y})

    is true. (With an appropriate choice of assignments, this only requires evaluating five propositions.)

  3. Show that

    ∀x∀yL(x,y){\tt \forall} {\tt x}{\tt \forall} {\tt y} {\tt L}({\tt x},{\tt y})

    is false. (With an appropriate choice of assignments, this only requires evaluating one proposition!)

  4. Show that

    ∀x∀y(L(x,y)→N(x,y)){\tt \forall} {\tt x}{\tt \forall} {\tt y}({\tt L}({\tt x},{\tt y}){\tt \to} {\tt N}({\tt x},{\tt y}))

    is false. (With an appropriate choice of assignments, this only requires evaluating one proposition.)

  5. Show that

    ∃x∃y(L(x,y)∧¬N(x,y)){\tt \exists} {\tt x} {\tt \exists} {\tt y} ({\tt L}({\tt x},{\tt y}){\tt \land}{\tt \neg} {\tt N}({\tt x},{\tt y}))

    is true. (With an appropriate choice of assignments, this requires only evaluating one proposition.)

  6. Show that ∃xL(x,x){\tt \exists} {\tt x} {\tt L}({\tt x},{\tt x}) is false. This requires evaluating five propositions.

Quantifiers and Tables

There is a nice way to display these evaluations in a tabular form. Consider the domain उ={a,b,c,d}उ = \{a,b,c,d\}.

Further suppose that P\tt P and Q\tt Q are unary predicates, and the following table summarizes their truth-values.

x\tt x aa bb cc dd
P(x)\tt P(x) ट ट ट ट
Q(x)\tt Q(x) ट फ फ फ

This tells us that, for instance, P\tt P is true for aa, and Q\tt Q is false for bb.

Moreover, suppose that R\tt R is a binary relation, and the following table summarizes its truth values.

R(x,y)\tt R(x,y) aa bb cc dd
aa फ ट फ ट
bb ट फ ट फ
cc फ फ फ ट
dd फ फ फ फ

This tells us that, for example, R\tt R is false for the pair (a,a)(a,a) but is true for the pair (d,b)(d,b). We find the first one by looking at row a and column a, and the second we find in row d column b.

Note

These two tables are structured differently.

Note that the tables for P\tt P and Q\tt Q are "one dimensional". The columns indicate elements from the domain. The row indicates the predicate.

However, the table for R\tt R is "two dimensional". The columns indicate domain elements, yes, just like before. But now also the rows indicate domain elements too.

Where is the predicate indicated? Well, there's no room for it now that both rows and columns are taken up. So the predicate is indicated by the entire table (not just one row of the table).

So the two tables are not meant to be read in exactly the same way.

Now let's evaluate the proposition ∃xP(x)\tt \exists x P(x). The table makes this immediately obvious: The row for P\tt P has a ट and therefore ∃xP(x)\tt \exists x P(x) is true.

In fact, every cell of this row is ट and therefore we could even say that ∀xP(x)\tt \forall x P(x) is true.

How about ∃xQ(x)\tt \exists x Q(x)? There is some cell (under aa) where Q\tt Q is true, and therefore the existential claim is true. How about ∀xQ(x)\tt\forall x Q(x)? For that to be true we we need every cell to hold ट. Since not every cell is ट, therefore the universal claim is false.

Now let's assess each possible way of stacking quantifiers on R(x,y)\tt R(x,y).

  • ∀x∀yR(x,y)\tt \forall x \forall y R(x,y): This requires every row and every column to hold ट. Since there is some फफ, then this proposition is false.
  • ∀x∃yR(x,y)\tt \forall x \exists y R(x,y): This requires every row to contains some ट. Since there is some row (d) which contains no ट, then this proposition is false.
  • ∃x∀yR(x,y)\tt \exists x \forall y R(x,y): This requires some row to contain only ट. There is no row like this, and therefore this proposition is false.
  • ∃x∃yR(x,y)\tt \exists x \exists y R(x,y): This requires some row and some column to hold ट. This is true, and therefore the proposition is true.

Exercise

Using the same predicates and meaning above, assess the truth of the following propositions.

  1. ∀x¬P(x)\tt \forall x \neg P(x)
  2. ∀x(P(x)∨Q(x))\tt \forall x (P(x)\lor Q(x))
  3. ∀x(P(x)→Q(x))\tt \forall x(P(x)\to Q(x))
  4. ∀x∀y¬R(x,y)\tt \forall x\forall y \neg R(x,y)
  5. ∀x∃y¬R(x,y)\tt \forall x \exists y \neg R(x,y)

For more exercise, you can of course create more formulas like these and assess their truth.

Quantification over Infinite Domains

Now we've looked a lot at quantification over finite domains, because it's a good starting place.

However, one of the major motivations for having quantification is so that we can speak and reason about infinite domains.

Let's set the domain to be TODO=ZTODO = \Bbb Z, and define some predicates.

We could have P\tt P be the property that an integer, xx, is greater than 10. Then P\tt P is true for 11, 12, and so on.

We could have Q\tt Q be the property that an integer has no digit 0 (in its standard base-10 representation). Then Q\tt Q is true for 1, 2, and so on up to 9. And it is true for 11, 12, and so on.

Exercise

  1. Can you find a negative number for which P\tt P is true? Can you find a negative number for which Q\tt Q is true?

  2. Can you find a multiple of 10 for which Q\tt Q is true? Can you find a number which is true for Q\tt Q which is not a multiple of 10?

Also let R\tt R be the binary relation on integers x,yx,y which is true when xx has an equal or greater number of 0 digits than yy in its standard base-10 representation. So R\tt R is true for the ordered pair (1,2)(1,2) because 1 has an equal or greater number of 0 digits than 2. Also (2,1)(2,1) is true for R\tt R.

All and Some with Two Predicates

In the history of the study of logic, there is a famous diagram (called the "Square of Opposition" TODO) due to Aristotle which represents the relationships between "contraries" and "subalterns".

TODO: Diagram

Let A and B be two predicates. The corners of the square represent the propositions

  • "All A's are B's."
  • "No A's are B's."
  • "Some A's are B's."
  • "Not all A's are B's."

All

Consider the proposition

All cats are mammals.

This is the same as saying "If anything is a cat then it is a mammal." The direct translation of this into our logical symbols is therefore

∀x(C(x)→M(x))\forall x(C(x)\to M(x))

where the properties C and M respectively denote cats and mammals. We assume any reasonable domain (could be things, animals, any domain that holds all mammals will suffice).

Exercise

Write the formal symbols for the following propositions. Assume each has some reasonable domain.

  1. All mammals are cats.
  2. All primes are not square. (It is unimportant for this exercise, but the "square numbers" are 0, 1, 4, 9, 16, and so on. These are square because they are the square of some integer. 0 is the square of 0, 1 is the square of 1, 4 is the square of 2, and so on.)
  3. If anything is both triangular and equiangular, then it is equilateral.
  4. Every animal with a heart has a kidney, and every animal with a kidney has a heart.

Note that this is merely the assertion of a subset! The set of cats is a subset of the set of mammals. The set of primes are a subset of the non-square numbers. The proposition "all mammals are cats" is false because the set of mammals is not a subset of cats.

Therefore, if AA and BB are sets, then to state that A⊆BA\subseteq B is the same as the proposition

∀x(x∈A→x∈B)\forall x(x\in A\to x\in B)

Of course, to say that any two sets are equal is simply the conjunction of two subset statements. In symbols, A=BA=B if and only if A⊆BA\subseteq B and B⊆AB\subseteq A. In our logical formalism, A=BA=B is equivalent to

∀x(x∈A→x∈B)∧∀x(x∈B→x∈A)\forall x(x\in A\to x\in B)\land \forall x(x\in B\to x\in A)

It is worth wondering: Is this equivalent to ∀x(x∈A↔x∈B)\forall x(x\in A\leftrightarrow x\in B)? Intuitively the answer is "yes". It says that "for all objects in the domain, if it is in AA then it is in BB, and if it is in BB then it is in AA". We will see a rigorous proof of this fact later.

Here is another worthwhile observation: Suppose that we set the domain to be all cats, and then want to express "All cats are mammals.". Yes, we could continue to represent this as ∀x(C(x)→M(x))\forall x(C(x)\to M(x)). However, with the domain being set to all cats, this now just means the same as ∀xM(x)\forall x M(x). For now this is an idle observation, although when we discuss the idea of "types" we will make more use of this idea.

No

Let's turn our attention to a sentence like

No prime is square.

or

No polygon is cicular.

This states, equivalently, that "every prime is not square", or in symbols,

∀x(P(x)→¬S(x))\forall x(P(x)\to \neg S(x))

where the domain and meaning of the predicates are reasonable.

Vacuous Quantification

We're now finally in a good position to review something that we discussed much earlier: vacuous quantification. Recall that the empty set is a subset of every set. In formalism, if XX is any set then ∅⊆X\emptyset \subseteq X.

Recall that, if we translate what "subset" means, it says that

...

Exercise

Let X be a set and S a collection of properties. Define N(S) as the number of elements which satisfy every property. Show that if S = <>mptyset then N(S)=|X|.