In one of his books, Peter Winkler includes the following problem:
A disease is spreading on a $n\times n$ chessboard as follows: if a healthy cell is neighboring at least 2 infected cells, it becomes infected. Using the property that the perimeter of the infected area never increases, it’s easy to prove that it’s impossible to infect the entire chessboard with fewer than $n$ infected cells.
If the chessboard is a torus, the result no longer holds (verified on some instances of $n$). It seems that $n-1$ is the smallest number of infected cells required to infect the chessboard. The perimeter argument can’t be used here. Does anyone know any other ‘invariant’ that can be used?
Note: two cells are neighbors if they share one side.
EDIT: This answer is actually totally wrong! I'm leaving it up so that others do not make the same mistake as I, but here is an example (thanks to Anton Petrunin) which shows that my supposed non-increasing quantity actually can increase. Initially, three cells are infected, and the restricted perimeter is $10$, but after 3 moves, the restricted perimeter increases to $12$.
Suppose there are only $n-2$ infected cells. Without loss of generality, these infected cells occur in the lower left $(n-1)\times (n-1)$ subgrid of the torus. If not, rotate the torus until one of the columns with no infections is on the right (such a column must exist, since there are at most $n-2$ infections), then rotate until a row with no infections is on top.
To prove invariance, note that a cell which becomes infected in the top row or right column does not affect the restricted perimeter at all. On the other hand, a cell in the lower left $(n-1)\times (n-1)$ subgrid becoming infected does not increase the restricted perimeter for the same reason as in the non-torus case.
With this definition, the same argument goes through. If there are initially $n-2$ infected cells, then the restricted perimeter is at most $4(n-2)$. But when if the entire torus is infected, the restricted perimeter would be $4(n-1)$.
Here is an example when $n=4$. The left grid is the initial infection, with two infected cells. The restricted perimeter is initially $8$. The right grid is the infection one step later, and the restricted perimeter is still $8$. The edges contributing to the restricted perimeter are highlighted in orange. The topmost orange edge in the second picture might appear strange, since it is between two black squares. But remember, you have to mentally delete the top row and right edge, then consider the perimeter of what remains.