- board image
- Notation: "for all" (∀) and "there exists" (∃)
- More on proofs
- Direct proof example
- Proof by contradiction example
- Backwards proofs

- Functions and their properties
- Important note: my terminology is slightly different from MCS!
- Key terms: injective, surjective, bijective, function, partial/total function

Even if something is "obvious", be sure to state it clearly, and at least think about how you would prove it. There's always a bit of judgement involved in how much detail to include; you want to capture what's "interesting" without flooding the reader with detail. For this course, especially at the beginning, err on the side of more detail.

If there's a fact you're going to use again and again, prove it once as a lemma, then refer to the lemma as necessary. It's just like a helper function when you're programming.

A proof by contradiction always starts by assuming the **opposite** (logical negation) of the fact to be proven, and then arrives at a logical contradiction.

**NEVER** Start a proof by assuming what you are trying to prove.

Example proof by contradiction in the context of the sudoku problem from last lecture:

Claim: iffis a sudoku solution, then each row, column, and box offcontains each number. In other words, - for alli,k, there exists ajsuch thatf(i,j)=k- for allj,k, there exists anisuch thatf(i,j)=k- for allb,k, there exists aniand ajsuch thatbox(i,j)=bandf(i,j)=k

Proof: We prove the first part by contradiction. The other two are similar. Suppose that there exists someiandksuch that there is nojwithf(i,j)=k[NOTE: you should make sure you are convinced that this is the opposite of the claim]. Then the nine numbersf(i, 1),f(i, 2), ...,f(i, 9) are each one of the eight numbers {1, 2, …,k− 1,k+ 1, …, 9}. There are nine cells, but only 8 numbers to put in them, so two different cells must contain the same number. But this contradicts the fact thatfis a sudoku solution. Thus the original assumption, that there is a row that is missing a particular number, must have been false. Thus every row contains every number.

Example direct proof, using the lemma (Note, we gave this proof last time, but without the lemma it was incomplete):

Suppose we are working on the following puzzle:

8 1 5 7 3 7 1 2 6 8 1 6 5 3 5 9 2 1 5 3 7 1 4 8 7 4 _ 9 It is clear that the last entry of the third column (cell (9,3)) must be 1. Let's prove it.

Claim: iffis a sudoku solution compatible with the above board (that is, iff(2, 2)=1,f(1, 5)=8,f(2, 5)=5 and so on), thenf(9, 3)=1.

Proof: There must be a 1 somewhere in box 3 (in other words, there exists some (i,j) such thatsquare(i,j)=3 andf(i,j)=1). By rule 2,jcannot be 1, becausef(4, 1)=1. Similarly, sincef(2, 2)=1,jcannot be 2. Thusjmust be 3; andf(7, 3)≠1, andf(8, 3)≠1. The only cell left is (9, 3), sof(9, 3) must be 1.

Example **bogus** proof:

Claim: iffis a sudoku solution compatible with the above board, thenf(8, 5)=1.

Bogus proof: assumef(8, 5)=1. We know 1 must appear in the lower right square. It cannot be in row 7 by rule 1, becausef(7, 7)=1. Our assumption lets us conclude that it cannot be in row 8. Therefore it must be in row 9. It can't be in cell (9, 1) by rule 2 (becausef(4, 1)=1), so it must be in cell (9, 3). We proved above thatf(9, 3)=1, so our assumption must be correct.

Example **bogus** proof:

Claim: ifx^{2}+ 3x+ 2 = 0 thenx= −1.

Proof: ( − 1)^{2}+ 3(−1)+2 = 1 − 3 + 2 = 0.

In the last lecture, I defined a function as follows:

A

functionffrom a setAto a setBis anunambiguousrule, which gives an element ofBforeachelement ofA.Ais called thedomainoff, whileBis called thecodomainoff. We often writef:A→Bto represent the statement "fis a function fromAtoB".The domain and codomain are different: every element of the domain must have a corresponding element of the codomain, but an element of the codomain may have any number (including 0) of elements of the domain that map to it.

MCS allows functions to be **partial**; to only provide outputs for *some* of their inputs (both of us refer to functions that provide outputs for *all* inputs as **total** functions).

I prefer to reserve the word **function** for total functions.

*f* : *A* → *B* is **injective** if, for all *x*_{1}, *x*_{2} ∈ *A*, if *f*(*x*_{1})=*f*(*x*_{2}) then *x*_{1} = *x*_{2}. Informally, two different inputs can't map to the same output.

*f* : *A* → *B* is **surjective** if, for all *y* ∈ *B*, there exists an *x* in *A* such that *f*(*x*)=*y*. Informally, every element of the codomain gets hit by the function.

*f* : *A* → *B* is **bijective** if it is both injective and surjective.