by ocfnash · 7y ago · 0 comments
A few months ago I decided to try formalising some old mathematics olympiad problems in Coq. Part of my motivation was to get a sense for how much work would be involved in proving something slightly non-trivial but still very elementary. I managed it, but it was _a lot_ more work than expected (results here: https://github.com/ocfnash/imo-coq).
Partly based on this exercise, I think that while it is possible that mathematics may go the way of chess, so to speak, it is a lot more distant than the ten years mentioned in this article.
I strongly support, very much hope, and even expect, that the use of proof assistants may become mainstream in mathematics within a generation or so but I think it is impossible to guess the exact role they will play accurately.
Reusing the notation of my post, here's how the formula arises.
The argument based on counting cells that are either row/column good/bad requires the following of the parameter k:
1. k-1 < r/m
2. k-1 < c/n
3. k−1 < cr/(c(m-1) + r(n-1))
These are equivalent to: 1. k <= ceil r m
2. k <= ceil c n
3. k <= ceil cr (c(m-1) + r(n-1))
And so it is sufficient to have: k <= min (ceil r m) (ceil c n) (ceil cr (c(m-1) + r(n-1)))
We can then rearrange this to the headline formula by noting: * ceil r m = ceil (cr) (cm)
* ceil c n = ceil (cr) (mr)
And then simplifying by repeatedly using the fact that for any x, y, z: * min (ceil x y) (ceil x z) = ceil x (max y z)
All this is of course in the Coq code. E.g., the last fact mentioned above is here: https://github.com/ocfnash/imo-coq/blob/f6d2e8337fadf00583fd... k <= ceil cr (c(m-1) + r(n-1))
The rest is clear.Without knowing anything about k except that k-1 < r/m, I counted how many cells are column-bad for this value of k. By the pigeon-hole-principle argument in the post this is at most c(m-1)(k-1) cells. Similarly, and still knowing nothing about k except that k-1 < c/n, I count how many cells are row-bad for this value of k and see that it is at most r(n-1)(k-1). Combining these two I know that as long as we have k-1 < r/m and k-1 < c/n the number of cells that are either column-bad or row-bad (or both) is at most:
* c(m-1)(k-1) + r(n-1)(k-1)
Since I want to be able to conclude that there is a cell that is neither column-bad nor row-bad, and since there are rc cells in total, I then further require that k is such that: * c(m-1)(k-1) + r(n-1)(k-1) < rc
(The point is that this is a strict inequality and so there must be a cell that is neither column-bad nor row-bad.)And then solve this to get the formula for k. Of course when expositing it in the post, I _start_ with the formula which perhaps makes things seem mysterious at first, but I thought was efficient.