Solution (source code)

= Solution

For $m=1$ the conclusion is immediate, so suppose $m\ge2$ and index the terms of an <arithmetic progression> by $0,\ldots,m-1$. There are only finitely many <equivalence relations> on this index <set>. Consequently, recording which terms have equal colours produces a <finite colouring> of the positive parameter pairs $(a,d)$, even though the original colouring need not be finite.

We use the <Gallai theorem for an integer lattice> in this form: a <finite colouring> of the positive integer lattice contains a <monochromatic> <homothetic copy> of any prescribed finite integer pattern. Patterns with negative coordinates are allowed here by first translating them into the positive quadrant; the translation is absorbed into the base point of the resulting copy.

Consider the finite pattern
$$
F=\bigcup_{0\le r<s<m}\{(su-rv,v-u):0\le u,v<m\}\subseteq\mathbb Z^2.
$$
The <Gallai theorem for an integer lattice> supplies integers $a_0,d_0$ and $q>0$ such that every point of $(a_0,d_0)+qF$ lies in the positive quadrant and has the same equality <equivalence relation> $E$. If $E$ has only singleton classes, any parameter pair in this copy gives an <arithmetic progression> whose colours are pairwise distinct, so the original colouring is <injective> on it.

Otherwise choose $r<s$ with $r\mathrel E s$. For every $u,v\in\{0,\ldots,m-1\}$, the parameter pair
$$
(a,d)=(a_0+q(su-rv),\ d_0+q(v-u))
$$
has relation $E$. Its terms at indices $r$ and $s$ are therefore equally coloured. But these terms simplify to
$$
a+rd=a_0+rd_0+q(s-r)u=:A_u,\qquad
a+sd=a_0+sd_0+q(s-r)v=:B_v.
$$
Thus $c(A_u)=c(B_v)$ for every $u,v$. Fixing $v=0$ proves that all $A_u$ have the same colour. Every $A_u$ is positive, because it is a term of one of the positive-parameter progressions above, and the <common difference> $q(s-r)$ is positive. Hence $(A_u)_{u=0}^{m-1}$ is a <monochromatic> <arithmetic progression> of length $m$.

The <canonical arithmetic progression dichotomy> is therefore \b[constant or injective on an <arithmetic progression> of the prescribed length]. The key point is that one equal-colour index pair has been made to vary independently over two complete progressions; a merely <monochromatic> block of parameter pairs would not by itself give this conclusion.