# Lecture 3: Working with Quantifiers

• reading: chapter 1 (finishing up material from last week)

• how to prove and disprove "for all" and "there exists" statements
• propositions and predicates
• nested quantifiers
• example proofs

## Quantifiers

• A proposition is a statement that is either true or false. For example, "3 ≥ 7", "2 ≤ 5", or "it is raining"

• A predicate is a statement that is true or false depending on the value of a variable. For example, "$$x ≥ 7$$".

• the phrases/symbols "For all" and "there exists" are called quantifiers. they turn predicates into propositions. For example, "for all $$x \in \mathbb{N}$$, $$x ≥ 7$$" is false, while "there exists an $$x \in \mathbb{N}$$ such that $$x ≥ 7$$" is true.

• "for all" and "there exists" are dual in the following sense: to disprove "for all $$x$$, P(x)", you must prove that there exists an $$x$$ such that $$P$$ is false. For example, disproving "for all $$x$$, $$x ≥ 7$$" is the same as proving "for some $$x$$, $$x$$ is not $$≥ 7$$".

• quantifiers can be nested. For example, $$∀ x \in \mathbb{N}, x ≥ y$$ is a predicate; its' truth depends on $$y$$. But $$∃ y, ∀ x, x ≥ y$$ is a proposition (which happens to be false).

• The order of quantifiers matters. For example it may be the case that everybody loves somebody (their mother, say). This would be written $$∀ x, ∃ y$$ such that $$x$$ loves $$y$$. However, if we switch the quantifiers, we have $$∃ y$$ such that $$∀ x$$, $$x$$ loves $$y$$. There might not be somebody that everybody loves (though if there was, we might call him "Raymond").

• However, you can rearrange two "there exist" quantifiers, or two "for all" quantifiers. You just can't mix the two.

## Proofs

A proof is just a logical argument. If you have played Sudoku, you have done hundreds of proofs in your head. The important new skill you are developing in 2800 is writing proofs down so that they are clear to others.

To check whether an argument is a good proof, you should check the following:

1. Is each sentence clear? Each word you use should have already been given a precise and unambiguous definition.

2. Is each sentence true (in context)? As you are writing a proof, it is good to pause and try to think of examples and counterexamples to what you are saying. (Note: in the context of a proof by contradiction, you may some things that are not true by themselves, but follow based on faulty assumptions you have made, which is ok).

3. Does each sentence obviously follow from the earlier sentences or other things that have already been proved?

The most common way that students fail the third condition is a backwards proof. This is a proof that starts with what the question asks, and reduces it to something that is known to be true.

It is useful to write down or simplify what you are trying to prove, but you must clearly distinguish your argument from your restatement of what you are trying to show. Otherwise, it looks like you are "begging the question"; assuming what you are trying to show. I often use the phrases "we want to show" (or "WTS" for short) and "well, ..." to demarcate what I want to show and my argument respectively, but it's just English, you can find your own style.

## Proving quantified statements

• To prove that something exists having a property $$P$$ ($$∃x$$ such that $$P(x)$$), tell me what it is, and convince me that it satisfies property $$P$$. For example, to show that there is somebody with red hair in the room, you could point to them and say "look, they have red hair".

Example claim: in the following sudoku board, there exists a $$j \in N$$ such that $$s(3,j) = 7$$:

Proof: if $$j = 9$$, then clearly $$s(3,j) = 7$$.

• To prove that all $$x$$ in a set $$X$$ have property $$P$$ ($$∀x$$, $$P(x)$$), you have to give a proof for every $$x$$.

Example claim: in the above board, for all rows $$i$$, $$s(i,1) \gt 0$$.

Proof: $$s(1,1) = 9 \gt 0$$, $$s(2,1) = 7 \geq 0$$, $$s(3,1) = 2 \geq 0$$, etc.

• Alternatively, one can give a "general proof" about an arbitrary $$x$$ in $$X$$. You can think of this as a "proof template" that you can plug any $$x$$ in $$X$$ to.

Example claim: in the above board, for all rows $$i$$, $$s(i,1)$$ is positive.

Proof: choose an arbitrary row $$i$$. Since $$s : C → N$$, we know that $$s(i,1) \in N$$. Since every element of $$N$$ is positive, $$s(i,1)$$ must be positive. Thus $$s(i,1)$$ is positive. Since $$i$$ was chosen arbitrarily, $$s(i,1)$$ must be positive for all $$i$$.

## Finishing up Sudoku example

For a less trivial example, we started to show that the two styles of definition for "sudoku solution" are equivalent.

Recall that we defined a sudoku solution as a function $$s : C → N$$ satisfying three properties, including:

Property 1: every number appears once in every row ($$∀ i, ∀ n, ∃ j, s(i,j) = n$$).

We could alternatively require a different property:

Property 1': no number appears twice in the same row ($$∀ i, j_1, j_2$$, if $$j_1 \neq j_2$$ then $$s(i,j_1) ≠ s(i,j_2)$$).

We can prove that these two properties are equivalent. That is, assuming one of then, you can prove that the other must hold, and vice-versa. We prove one direction here.

Claim: Property 1 implies property 1'. That is, if $$s : C → N$$ satisfies property 1, then it must also satisfy property 1'.

Proof given in class: Suppose $$s$$ satisfies property 1, that is, suppose that every number appears once in every row. We want to show that no number appears twice in any row. Well, if a number did appear twice, then there would only be 7 cells for the remaining 8 numbers. But each cell can only have one number, so one of the numbers must be left out. But that means you lied when you claimed that $$s$$ satisfied property 1.

This is a pretty good proof. It would probably receive full credit. We could make it a little bit clearer:

• avoiding pronouns is helpful. If you want to talk about a particular row, instead of saying "the row", give it a name (like "$$i$$") and use the name. It matters less here because there is only one row, but this habit avoids confusion in longer proofs.

• this is a proof by contradiction. It helps the reader if you point that out.

Here is a rewrite:

Proof: Suppose $$s$$ satisfies property 1, that is, suppose that every number appears once in every row. We want to show that no number appears twice in any row. Suppose for the sake of contradiction that some number $$n$$ appeared in both column $$j_1$$ and $$j_2 ≠ j_1$$ of some row $$i$$. By property 1, the remaining 8 numbers (those other than $$s(i,j_1)$$) must appear in the remaining 7 columns (those other than $$j_1$$ and $$j_2$$). But this is impossible, because $$s$$ is a function, so each column can give only one number. This is a contradiction, so our assumption that $$s$$ did not satisfy property 1' was false.

Which proof is better? Whichever one is clearer. Remember always that the goal is clarity and communication.

Note: we used the duality of "for all" and "there exists" in this proof. To prove property 1' ($$∀ i, ∀j_1, ∀j_2$$, if $$j_1 ≠ j_2$$ then $$s(i,j_1) ≠ s(i,j_2)$$), we assumed that it was false by assuming ($$∃i, ∃j_1, ∃j_2$$ such that $$j_1 ≠ j_2$$ but $$s(i,j_1) = s(i,j_2)$$) and arrived at a contradiction. Note that the $$∀$$s turned into $$∃$$s, and the conclusion ($$s(i,j_1) ≠ s(i,j_2)$$) was negated.