Lecture 2 summary: notation and modeling

We finished our modeling of sudoku solutions. Along the way, we introduced some new notation and discussed definition and proof techniques in detail.

New Notation

Important lessons about definitions and proofs

Finishing Sudoku

A sudoku solution f is a function f: C → N satisfying the following properties:

  1. For all i, j, and jʹ, if j ≠ jʹ then f(i, j) ≠ f(i, jʹ)
  2. For all i, iʹ, and j, if i ≠ iʹ then f(i, j) ≠ f(iʹ, j)
  3. For all c1 and c2 ∈ C, if c1 ≠ c2 and box(c1) = box(c2), then f(c1) ≠ f(c2).

It's often easier to work with the contrapositives (this is an equivalent definition):

  1. For all i, j, and jʹ, if f(i, j) = f(i, jʹ) then j = jʹ
  2. For all i, iʹ, and j, if f(i, j) = f(iʹ, j) then i = iʹ
  3. For all c1 and c2 ∈ C with box(c1) = box(c2), if f(c1) = f(c2) then c1 = c2.

Here box is a function that gives the number of the large box that contains the cell. Here are three styles of definition of box; decide which one you like best (my favorite is the first):

  1. box(i, j) is the number of the large box that contains the (i, j) cell, where we number the large 9x9 grids as follows:
1 4 7
2 5 8
3 6 9
  1. box(i, j) is the (i, j)th entry in the following table:
1 1 1 4 4 4 7 7 7
1 1 1 4 4 4 7 7 7
1 1 1 4 4 4 7 7 7
2 2 2 5 5 5 8 8 8
2 2 2 5 5 5 8 8 8
2 2 2 5 5 5 8 8 8
3 3 3 6 6 6 9 9 9
3 3 3 6 6 6 9 9 9
3 3 3 6 6 6 9 9 9
  1. (using integer division) box: C → N given by box: (i, j) ↦ 1 + ⌊(i − 1) / 3⌋ + 3 ⋅ (1 + ⌊(j − 1) / 3⌋)

A Proof by contradiction

As you play sudoku, you are generating in your head lots of proofs. This is overkill, but let's write down one such proof as an example of proving something from definitions.

Suppose we are working on the following puzzle:

1 2 3    5 6 7 8 9

It is clear that the 4th entry of the 5th row must be 5. Let's prove it.

Claim: if f is a sudoku solution and if f(5, 1) = 1, and f(5, 2) = 2, and f(5, 3) = 3, and (note I'm not assuming anything about f(5, 4)) f(5, 5) = 5, and f(5, 6) = 6, and so on,

then f(5, 4) = 4.

Proof: First, we can summarize the assumptions: for all k ≠ 4, f(5, k) = k. Now, we can proceed to prove the claim by contradiction.

Suppose that f(5, 4) ≠ 4. Well, we know f(5, 4) = k for some k; and we've assumed that k ≠ 4. Therefore we can apply the assumption to conclude that f(5, k) = k. Since f is assumed to be a sudoku solution, it must satisfy rule 1, and therefore since f(5, 4) = f(5, k), we conclude that 4 = k. But this is nonsense: we've assumed that k ≠ 4!

Therefore, our assumption that f(5, 4) ≠ 4 must have been incorrect.