# Combinatorics/Ramsey's Theorem

Ramsey's theorem is a foundational result in combinatorics. The first version of this result was proved by F. P. Ramsey. This initiated the combinatorial theory, now called Ramsey theory, that seeks regularity amid disorder: general conditions for the existence of substructures with regular properties. The theorem states that

*r*,

*s*), there exists a least positive integer

*R*(

*r*,

*s*) such that for any complete graph on

*R*(

*r*,

*s*) vertices, whose edges are coloured

*red*or

*blue*, there exists either a complete subgraph on

*r*vertices which is entirely red, or a complete subgraph on

*s*vertices which is entirely blue. Here

*R(r,s)*signifies an integer that depends on both

*r*and

*s*. It is understood to represent the smallest integer for which the theorem holds.

An extension of this theorem applies to any finite number of colours, rather than just two. More precisely, the theorem states that for any given number of colours c, and any given integers n_{1},...,n_{c}, there is a number, R(n_{1},...,n_{c}), such that if the edges of a complete graph of order R(n_{1},...,n_{c}) are coloured with c different colours, then for some i between 1 and c, it must contain a complete subgraph of order n_{i} whose edges are all color i. The special case above has c = 2 (and n_{1} = r and n_{2} = s).

## Example: *R*(3,3)=6[edit | edit source]

Suppose the edges of a complete graph on 6 vertices are coloured red and blue. Pick a vertex *v*. There are 5 edges incident to *v* and so (by the pigeonhole principle) at least 3 of them must be the same colour. Without loss of generality we can assume at least 3 of these edges, connecting to vertices *r*, *s* and *t*, are blue. (If not, exchange red and blue in what follows.) If any of the edges (*r*, *s*), (*r*, *t*), (*s*, *t*) are also blue then we have an entirely blue triangle. If not, then those three edges are all red and we have an entirely red triangle. Since this argument works for any colouring, *any* *K*_{6} contains a monochromatic *K*_{3}, and therefore that *R*(3,3) ≤ 6. The popular version of this is called *the theorem on friends and strangers*.

An alternate proof works by double counting. It goes as follows: Count the number of ordered triples of vertices *x*, *y*, *z* such that the edge (*xy*) is red and the edge (*yz*) is blue. Firstly, any given vertex will be the middle of either 0×5=0, 1×4=4 or 2 × 3 = 6 such triples. Therefore there are at most 6×6=36 such triples. Secondly, for any non-monochromatic triangle (**xyz**), there exist precisely two such triples. Therefore there are at most 18 non-monochromatic triangles. Therefore at least 2 of the 20 triangles in the *K*_{6} are monochromatic.

Conversely, it is possible to 2-colour a *K*_{5} without creating any monochromatic *K*_{3}, showing that *R*(3,3) > 5. The unique colouring is shown to the right. Thus *R*(3,3) = 6.

## Proof of the theorem[edit | edit source]

First we prove the theorem for the 2-colour case, by induction on *r* + *s*.
It is clear from the definition that for all *n*, *R*(*n*, 1) = *R*(1, *n*) = *1*. This starts the induction.
We prove that *R*(*r*, *s*) exists by finding an explicit bound for it. By the inductive hypothesis *R*(*r* − 1, *s*) and *R*(*r*, *s* − 1) exist.

__Claim: R(r, s) ≤ R(r − 1, s) + R(r, s − 1):__
Consider a complete graph on

*R*(

*r*− 1,

*s*) +

*R*(

*r*,

*s*− 1) vertices. Pick a vertex

*v*from the graph, and partition the remaining vertices into two sets

*M*and

*N*, such that for every vertex

*w*,

*w*is in

*M*if (

*v*,

*w*) is blue, and

*w*is in

*N*if (

*v*,

*w*) is red.

Because the graph has *R*(*r* - 1, *s*) + *R*(*r*, *s* - 1) = |*M*| + |*N*| + 1 vertices, it follows that either |*M*| ≥ *R*(*r* − 1, *s*) or |*N*| ≥ *R*(*r*, *s* − 1). In the former case, if *M* has a red *K _{s}* then so does the original graph and we are finished. Otherwise

*M*has a blue

*K*

_{r−1}and so has blue

*K*by definition of

_{r}*M*. The latter case is analogous.

Thus the claim is true and we have completed the proof for 2 colours. We now prove the result for the general case of *c* colours. The proof is again by induction, this time on the number of colours *c*. We have the result for *c* = 1 (trivially) and for *c* = 2 (above). Now let *c* > 2.

__Claim: __*R*(*n*_{1}, ..., *n*_{c}) ≤ *R*(*n*_{1}, ..., *n*_{c−2}, *R*(*n*_{c−1}, *n*_{c}))

Note, that the right hand side only contains Ramsey numbers for *c* − 1 colours and 2 colours, and therefore exists and is the finite number *t*, by the inductive hypothesis. Thus, proving the claim will prove the theorem.

**Proof of claim**: Consider a graph on *t* vertices and colour its edges with *c* colours. Now 'go colour-blind' and pretend that *c* − 1 and *c* are the same colour. Thus the graph is now (*c* − 1)-coloured. By the inductive hypothesis, it contains either a *K _{n}_{i}* monochromatically coloured with colour

*i*for some 1 ≤

*i*≤ (

*c*− 2) or a

*K*

_{R(n}

_{c−1,nc)}-coloured in the 'blurred colour'. In the former case we are finished. In the latter case, we recover our sight again and see from the definition of

*R*(

*n*

_{c−1},

*n*

_{c}) we must have either a (

*c*− 1)-monochrome

*K*

_{n}

_{c−1}or a

*c*-monochrome

*K*

_{n}

_{c}. In either case the proof is complete.

## Extensions of the theorem[edit | edit source]

The theorem can also be extended to hypergraphs. An *m*-hypergraph is a graph whose "edges" are sets of *m* vertices - in a normal graph an edge is a set of 2 vertices. The full statement of Ramsey's theorem for hypergraphs is that for any integers *m* and *c*,
and any integers *n*_{1},...,*n*_{c},
there is an integer *R*(*n*_{1},...,*n*_{c};*c*,*m*) such that if the hyperedges of a complete *m*-hypergraph of order *R*(*n*_{1},...,*n*_{c};*c*,*m*) are coloured with *c* different colours, then for some *i* between 1 and *c*, the hypergraph must contain a complete sub-*m*-hypergraph of order *n*_{i} whose hyperedges are all colour *i*. This theorem is usually proved by induction on *m*, the 'hyper-ness' of the graph. The base case for the proof is *m*=2, which is exactly the theorem above.