By [A]2 we denote the family of size two subsets of A, interpreted as edges in the undirected graph with nodes A. If K is a metric space and A is a set, we say that kK is the limit of a function f:[A]2K if for any ϵ>0, there is some finite subset CA such that the image of f, when restricted to [AC]2, is contained in the ball of radius ϵ and center k.

FormalPara Theorem 1

Let K be a metric compact space, B a countably infinite set, and f:[B]2K. Then there exists a kK and an infinite subset AB such that the restriction of f to [A]2 has limit k.

Ramsey’s theorem is a special case of the above theorem, when K is equipped with a discrete metric. The proof is a simple adaptation of the proof of Ramsey’s theorem.

FormalPara Proof

Without loss of generality we assume that B=ω. By induction, we will construct a sequence of sequences a 0,a 1,a 2,…∈B ω, such that a n is a subsequence of a n−1. We write \(a^{n}_{m}\) for the m-the element of the n-th sequence a n.

Let \(a^{0}_{m} = m\). For n>0, let a n be a subsequence of a n−1 such that \(a^{n}_{m} = a^{n-1}_{m}\) for mn, and the sequence

is convergent to some k n . This subsequence exists because K is compact. Moreover, we can choose the sequence a n so that for all m>n the distance from \(f(\{a^{n}_{n}, a^{n}_{m}\})\) to k n is at most 1/n.

Let (q n ) be a sequence of numbers such that \(k_{q_{n}}\) is convergent to some k and moreover, \(\delta(k_{q_{n}}, k) \leq1/n\). Define A as \(\{a^{q_{n}}_{q_{n}} : n \in\omega\}\).

Let n<m. Since \(a^{q_{m}}\) is a subsequence of \(a^{q_{n}}\), we have that \(a^{q_{m}}_{q_{m}} = a^{q_{n}}_{z}\) for some z>q m >q n >n.

Since \(\delta(f(\{a^{q_{n}}_{q_{n}}, a^{q_{m}}_{q_{m}}\}), k) < 2/n\), the set A satisfies our claim. □

The theorem assumes that the space K is metric. We show a space K which is compact but not metric, and where the statement of the theorem fails. Let K be any compact space where not every sequence has a convergent subsequence. For instance, K can be an uncountable product of unit intervals. Take some sequence a 1,a 2,… in K which does not have any convergent subsequence, and define f:[ω]2K by f({i,j})=a i . The theorem, when applied to this function f, would imply that there is a converging subsequence of a 1,a 2,… .

By induction on k, one can generalize the theorem to functions f defined on k-element subsets.

In the following corollary, we see what happens when K has a semigroup structure. If xK ω is a sequence of elements from a semigroup K, we write x[i..j) for the multiplication of x i x j−1.

FormalPara Corollary 1

If in Theorem 1, the space K has a semigroup structure with continuous multiplication, B=ω, and f is obtained from a sequence xK ω by setting f({i,j})=x[i..j), then the limit k is idempotent, i.ek=kk.

FormalPara Proof

Apply Theorem 1, yielding a set A={u 1<u 2<…}⊆ω. If the action is continuous, then k is idempotent, since

$$k \cdot k = \lim_{n \rightarrow \infty} x\big|^{u_n}_{u_{n+1}} \cdot \lim_{n \rightarrow \infty} x\big|^{u_{n+1}}_{u_{n+2}} = \lim_{n \rightarrow \infty} x\big|^{u_n}_{u_{n+1}} \cdot x\big|^{u_{n+1}}_{u_{n+2}} = \lim_{n \rightarrow \infty} x\big|^{u_n}_{u_{n+2}} = k. $$


In some papers, e.g. [1], a compact semigroup is a semigroup S with compact topology such that the mapping tst is required to be continuous for each sS. This assumption is weaker than our assumption from Corollary 1 that the action in S is continuous.

However, the weaker assumption is not sufficient for idempotence of s in Corollary 1. Indeed, consider the semigroup S={0,1,2,…,ω,ω+1}, with the action ab=min(a+b,ω+1), and the distance δ(a,b)=|f(a)−f(b)|, where f(n)=1/(n+1),f(ω)=0,f(ω+1)=−1. This semigroup is a compact semigroup in the meaning from [1]. Now, let x n =n. If we apply Corollary 1 to x, s has to be ω, but ω is not idempotent: ωω=ω+1.