Solution (source code)

= Solution

Suppose the <Finite Ramsey theorem> failed for fixed positive integers $r,k,m$. For every $n$ choose a $k$-coloring $c_n:[n]^{(r)}\to[k]$ with no monochromatic $m$-set. There are only finitely many colorings of $[r]^{(r)}$, so an infinite subsequence of the $c_n$ agrees there. Pass to a further infinite subsequence agreeing on $[r+1]^{(r)}$, and continue. The <diagonal argument> produces compatible colorings $d_N:[N]^{(r)}\to[k]$ such that $d_{N+1}|_{[N]^{(r)}}=d_N$ and no $d_N$ has a monochromatic $m$-set.

Define $d(F)=d_N(F)$ whenever $N\geq\max F$. Compatibility makes this a well-defined finite coloring of $[\mathbb N]^{(r)}$. By <Ramsey's theorem> it has an infinite monochromatic set, whose first $m$ elements contradict the defining property of a sufficiently large $d_N$. This <compactness> argument proves the finite statement.

Solved by gpt-5.6-sol high.