# Ramsey's theorem

In combinatorial mathematics, Ramsey's theorem states that one will find monochromatic cliques in any edge labelling (with colours) of a sufficiently large complete graph. To demonstrate the theorem for two colours (say, blue and red), let r and s be any two positive integers. Ramsey's theorem states that there exists a least positive integer R(r, s) for which every blue-red edge colouring of the complete graph on R(r, s) vertices contains a blue clique on r vertices or a red clique on s vertices. (Here R(r, s) signifies an integer that depends on both r and s.)

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. In this application it is a question of the existence of monochromatic subsets, that is, subsets of connected edges of just one colour.

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 n1, …, nc, there is a number, R(n1, …, nc), such that if the edges of a complete graph of order R(n1, ..., nc) are coloured with c different colours, then for some i between 1 and c, it must contain a complete subgraph of order ni whose edges are all colour i. The special case above has c = 2 (and n1 = r and n2 = s).

## Example: R(3, 3) = 6

A 2-edge-labeling of K5 with no monochromatic K3

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 the vertex, v, 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 K6 contains a monochromatic K3, and therefore R(3, 3) ≤ 6. The popular version of this is called the theorem on friends and strangers.

An alternative 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 (all edges from the vertex are the same colour), 1 × 4 = 4 (four are the same colour, one is the other colour), or 2 × 3 = 6 (three are the same colour, two are the other colour) 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 K6 are monochromatic.

Conversely, it is possible to 2-colour a K5 without creating any monochromatic K3, showing that R(3, 3) > 5. The unique[1] colouring is shown to the right. Thus R(3, 3) = 6.

The task of proving that R(3, 3) ≤ 6 was one of the problems of William Lowell Putnam Mathematical Competition in 1953, as well as in the Hungarian Math Olympiad in 1947.

## Proof of the theorem

### 2-colour case

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.

Lemma 1. R(r, s) ≤ R(r − 1, s) + R(r, s − 1):

Proof. Consider a complete graph on R(r − 1, s) + R(r, s − 1) vertices whose edges are coloured with two colours. 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 Ks then so does the original graph and we are finished. Otherwise M has a blue Kr−1 and so M ∪ {v} has blue Kr by definition of M. The latter case is analogous. Thus the claim is true and we have completed the proof for 2 colours.

Note. In the 2-colour case, if R(r − 1, s) and R(r, s − 1) are both even, the induction inequality can be strengthened to:[2]

R(r, s) ≤ R(r − 1, s) + R(r, s − 1) − 1.

Proof. Suppose p=R(r − 1, s) and q=R(r, s − 1) are both even. Let t=p+q-1 and consider a two-coloured graph of t vertices. If ${\displaystyle d_{i}}$ is degree of ${\displaystyle i}$-th vertex in the blue subgraph, then, according to Handshaking lemma, ${\displaystyle \textstyle \sum _{i=1}^{t}d_{i}\displaystyle }$is even. Given that t is odd, there must be an even ${\displaystyle d_{i}}$. Assume ${\displaystyle d_{1}}$is even, M and N are the vertices incident to vertex 1 in blue and red subgraphs respectively. Then both ${\displaystyle |M|=d_{1}}$and ${\displaystyle |N|=t-1-d_{1}}$are even. According to Pigeonhole principle, either ${\displaystyle |M|\geq p-1}$, or ${\displaystyle N\geq q}$. Since ${\displaystyle |M|}$ is even, while ${\displaystyle p-1}$ is odd, the first inequality can be strengthen, so either ${\displaystyle |M|\geq p}$ or ${\displaystyle |N|\geq q}$. Suppose ${\displaystyle |M|\geq p=R(r-1,s)}$. Then either M-subgraph has a red ${\displaystyle K_{s}}$ and the proof is complete, or it has a blue ${\displaystyle K_{r-1}}$ which along with vertex 1 makes a blue ${\displaystyle K_{r}}$ . Case ${\displaystyle |N|\geq q=R(r,s-1)}$ is treated similarly.

### Case of more colours

Lemma 2. If c>2, then R(n1, …, nc) ≤ R(n1, …, nc−2, R(nc−1, nc)).

Proof. Consider a graph of R(n1, …, nc−2, R(nc−1, nc)) 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. Due to the definition of R(n1, …, nc−2, R(nc−1, nc)), such a graph contains either a Kni mono-chromatically coloured with colour i for some 1 ≤ ic − 2 or a KR(nc − 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(nc−1, nc) we must have either a (c − 1)-monochrome Knc−1 or a c-monochrome Knc. In either case the proof is complete.

Lemma 1 implies that any R(r,s) is finite. The right hand side of the inequality in Lemma 2 expresses a Ramsey number for c colours in terms of Ramsey numbers for fewer colours. Therefore any R(n1, …, nc) is finite for any number of colours. This proves the theorem.

## Ramsey numbers

The numbers R(r, s) in Ramsey's theorem (and their extensions to more than two colours) are known as Ramsey numbers. The Ramsey number, R(m, n), gives the solution to the party problem, which asks the minimum number of guests, R(m, n), that must be invited so that at least m will know each other or at least n will not know each other. In the language of graph theory, the Ramsey number is the minimum number of vertices, v = R(m, n), such that all undirected simple graphs of order v, contain a clique of order m, or an independent set of order n. Ramsey's theorem states that such a number exists for all m and n.

By symmetry, it is true that R(m, n) = R(n, m). An upper bound for R(r, s) can be extracted from the proof of the theorem, and other arguments give lower bounds. (The first exponential lower bound was obtained by Paul Erdős using the probabilistic method.) However, there is a vast gap between the tightest lower bounds and the tightest upper bounds. There are also very few numbers r and s for which we know the exact value of R(r, s).

Computing a lower bound L for R(r, s) usually requires exhibiting a blue/red colouring of the graph KL−1 with no blue Kr subgraph and no red Ks subgraph. Such a counterexample is called a Ramsey graph. Brendan McKay maintains a list of known Ramsey graphs.[3] Upper bounds are often considerably more difficult to establish: one either has to check all possible colourings to confirm the absence of a counterexample, or to present a mathematical argument for its absence. A sophisticated computer program does not need to look at all colourings individually in order to eliminate all of them; nevertheless it is a very difficult computational task that existing software can only manage on small sizes. Each complete graph Kn has 1/2n(n − 1) edges, so there would be a total of cn(n − 1)/2 graphs to search through (for c colours) if brute force is used.[4] Therefore, the complexity for searching all possible graphs (via brute force) is O(cn2) for c colourings and an upper bound of n nodes.

As described above, R(3, 3) = 6. It is easy to prove that R(4, 2) = 4, and, more generally, that R(s, 2) = s for all s: a graph on s − 1 nodes with all edges coloured red serves as a counterexample and proves that R(s, 2) ≥ s; among colourings of a graph on s nodes, the colouring with all edges coloured red contains a s-node red subgraph, and all other colourings contain a 2-node blue subgraph (that is, a pair of nodes connected with a blue edge.)

Using induction inequalities, it can be concluded that R(4, 3) ≤ R(4, 2) + R(3, 3) − 1 = 9, and therefore R(4, 4) ≤ R(4, 3) + R(3, 4) ≤ 18. There are only two (4, 4, 16) graphs (that is, 2-colourings of a complete graph on 16 nodes without 4-node red or blue complete subgraphs) among 6.4 × 1022 different 2-colourings of 16-node graphs, and only one (4, 4, 17) graph (the Paley graph of order 17) among 2.46 × 1026 colourings.[3] (This was proven by Evans, Pulham and Sheehan in 1979.) It follows that R(4, 4) = 18.

The fact that R(4, 5) = 25 was first established by Brendan McKay and Stanisław Radziszowski in 1995.[5]

The exact value of R(5, 5) is unknown, although it is known to lie between 43 (Geoffrey Exoo (1989)) and 48 (Angeltveit and McKay (2017)[6]) (inclusive).

In 1997, McKay, Radziszowski and Exoo employed computer-assisted graph generation methods to conjecture that R(5, 5) = 43. They were able to construct exactly 656 (5, 5, 42) graphs, arriving at the same set of graphs through different routes. None of the 656 graphs can be extended to a (5, 5, 43) graph.[8]

For R(r, s) with r, s > 5, only weak bounds are available. Lower bounds for R(6, 6) and R(8, 8) have not been improved since 1965 and 1972, respectively.[9]

R(r, s) with r, s ≤ 10 are shown in the table below. Where the exact value is unknown, the table lists the best known bounds. R(r, s) with r, s < 3 are given by R(1, s) = 1 and R(2, s) = s for all values of s. The standard survey on the development of Ramsey number research is the Dynamic Survey 1 of the Electronic Journal of Combinatorics.[9] It was written and is updated by Stanisław Radziszowski. Its latest update was in March 2017. In general, there are a few years between the updates. Where not cited otherwise, entries in the table below are taken from this dynamic survey. Note that since R(r, s) = R(s, r), there is a trivial symmetry across the diagonal.

Values / known bounding ranges for Ramsey numbers R(r, s) (sequence A212954 in the OEIS)
s
r
1 2 3 4 5 6 7 8 9 10
1 1 1 1 1 1 1 1 1 1 1
2 2 3 4 5 6 7 8 9 10
3 6 9 14 18 23 28 36 40–42
4 18 25[5] 36–41 49–61 59[10]–84 73–115 92–149
5 43–48 58–87 80–143 101–216 133–316 149[10]–442
6 102–165 115[10]–298 134[10]–495 183–780 204–1171
7 205–540 217–1031 252–1713 292–2826
8 282–1870 329–3583 343–6090
9 565–6588 581–12677
10 798–23556

## Asymptotics

The inequality R(r, s) ≤ R(r − 1, s) + R(r, s − 1) may be applied inductively to prove that

${\displaystyle R(r,s)\leq {\binom {r+s-2}{r-1}}.}$

In particular, this result, due to Erdős and Szekeres, implies that when r = s,

${\displaystyle R(s,s)\leq [1+o(1)]{\frac {4^{s-1}}{\sqrt {\pi s}}}.}$

An exponential lower bound,

${\displaystyle R(s,s)\geq [1+o(1)]{\frac {s}{{\sqrt {2}}e}}2^{s/2},}$

was given by Erdős in 1947 and was instrumental in his introduction of the probabilistic method. There is obviously a huge gap between these two bounds: for example, for s = 10, this gives 101 ≤ R(10, 10) ≤ 48620. Nevertheless, exponential growth factors of either bound have not been improved to date and still stand at 4 and 2 respectively. There is no known explicit construction producing an exponential lower bound. The best known lower and upper bounds for diagonal Ramsey numbers currently stand at

${\displaystyle [1+o(1)]{\frac {{\sqrt {2}}s}{e}}2^{\frac {s}{2}}\leq R(s,s)\leq s^{-(c\log s)/(\log \log s)}4^{s},}$

due to Spencer and Conlon respectively.

For the off-diagonal Ramsey numbers R(3, t), it is known that they are of order ${\displaystyle {\tfrac {t^{2}}{\log t}}}$; this may be stated equivalently as saying that the smallest possible independence number in an n-vertex triangle-free graph is

${\displaystyle \Theta \left({\sqrt {n\log n}}\right).}$

The upper bound for R(3, t) is given by Ajtai, Komlós, and Szemerédi, the lower bound was obtained originally by Kim, and was improved by Griffiths, Morris, Fiz Pontiveros, and Bohman and Keevash, by analysing the triangle-free process. More generally, for off-diagonal Ramsey numbers, R(s, t), with s fixed and t growing, the best known bounds are

${\displaystyle c'_{s}{\frac {t^{\frac {s+1}{2}}}{(\log t)^{{\frac {s+1}{2}}-{\frac {1}{s-2}}}}}\leq R(s,t)\leq c_{s}{\frac {t^{s-1}}{(\log t)^{s-2}}},}$

due to Bohman and Keevash and Ajtai, Komlós and Szemerédi respectively.

## A multicolour example: R(3, 3, 3) = 17

The only two 3-colourings of K16 with no monochromatic K3. The untwisted colouring (above) and the twisted colouring (below).

A multicolour Ramsey number is a Ramsey number using 3 or more colours. There is (up to symmetries) only one non-trivial multicolour Ramsey number for which the exact value is known, namely R(3, 3, 3) = 17.[9]

Suppose that we have an edge colouring of a complete graph using 3 colours, red, green and blue. Suppose further that the edge colouring has no monochromatic triangles. Select a vertex v. Consider the set of vertices that have a red edge to the vertex v. This is called the red neighbourhood of v. The red neighbourhood of v cannot contain any red edges, since otherwise there would be a red triangle consisting of the two endpoints of that red edge and the vertex v. Thus, the induced edge colouring on the red neighbourhood of v has edges coloured with only two colours, namely green and blue. Since R(3, 3) = 6, the red neighbourhood of v can contain at most 5 vertices. Similarly, the green and blue neighbourhoods of v can contain at most 5 vertices each. Since every vertex, except for v itself, is in one of the red, green or blue neighbourhoods of v, the entire complete graph can have at most 1 + 5 + 5 + 5 = 16 vertices. Thus, we have R(3, 3, 3) ≤ 17.

To see that R(3, 3, 3) ≥ 17, it suffices to draw an edge colouring on the complete graph on 16 vertices with 3 colours that avoids monochromatic triangles. It turns out that there are exactly two such colourings on K16, the so-called untwisted and twisted colourings. Both colourings are shown in the figures to the right, with the untwisted colouring on the top, and the twisted colouring on the bottom.

If we select any colour of either the untwisted or twisted colouring on K16, and consider the graph whose edges are precisely those edges that have the specified colour, we will get the Clebsch graph.

It is known that there are exactly two edge colourings with 3 colours on K15 that avoid monochromatic triangles, which can be constructed by deleting any vertex from the untwisted and twisted colourings on K16, respectively.

It is also known that there are exactly 115 edge colourings with 3 colours on K14 that avoid monochromatic triangles, provided that we consider edge colourings that differ by a permutation of the colours as being the same.

## Extensions of the theorem

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 n1, …, nc, there is an integer R(n1, …, nc;c, m) such that if the hyperedges of a complete m-hypergraph of order R(n1, …, nc;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 ni 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.

## Infinite Ramsey theorem

A further result, also commonly called Ramsey's theorem, applies to infinite graphs. In a context where finite graphs are also being discussed it is often called the "Infinite Ramsey theorem". As intuition provided by the pictorial representation of a graph is diminished when moving from finite to infinite graphs, theorems in this area are usually phrased in set-theoretic terminology.[11]

Theorem. Let X be some infinite set and colour the elements of X(n) (the subsets of X of size n) in c different colours. Then there exists some infinite subset M of X such that the size n subsets of M all have the same colour.

Proof: The proof is by induction on n, the size of the subsets. For n = 1, the statement is equivalent to saying that if you split an infinite set into a finite number of sets, then one of them is infinite. This is evident. Assuming the theorem is true for nr, we prove it for n = r + 1. Given a c-colouring of the (r + 1)-element subsets of X, let a0 be an element of X and let Y = X \ {a0}. We then induce a c-colouring of the r-element subsets of Y, by just adding a0 to each r-element subset (to get an (r + 1)-element subset of X). By the induction hypothesis, there exists an infinite subset Y1 of Y such that every r-element subset of Y1 is coloured the same colour in the induced colouring. Thus there is an element a0 and an infinite subset Y1 such that all the (r + 1)-element subsets of X consisting of a0 and r elements of Y1 have the same colour. By the same argument, there is an element a1 in Y1 and an infinite subset Y2 of Y1 with the same properties. Inductively, we obtain a sequence {a0, a1, a2, …} such that the colour of each (r + 1)-element subset (ai(1), ai(2), …, ai(r + 1)) with i(1) < i(2) < ... < i(r + 1) depends only on the value of i(1). Further, there are infinitely many values of i(n) such that this colour will be the same. Take these ai(n)'s to get the desired monochromatic set.

## Infinite version implies the finite

It is possible to deduce the finite Ramsey theorem from the infinite version by a proof by contradiction. Suppose the finite Ramsey theorem is false. Then there exist integers c, n, T such that for every integer k, there exists a c-colouring of ${\displaystyle [k]^{(n)}}$ without a monochromatic set of size T. Let Ck denote the c-colourings of ${\displaystyle [k]^{(n)}}$ without a monochromatic set of size T.

For any k, the restriction of a colouring in Ck+1 to ${\displaystyle [k]^{(n)}}$ (by ignoring the colour of all sets containing k + 1) is a colouring in Ck. Define ${\displaystyle C_{k}^{1}}$ to be the colourings in Ck which are restrictions of colourings in Ck+1. Since Ck+1 is not empty, neither is ${\displaystyle C_{k}^{1}}$.

Similarly, the restriction of any colouring in ${\displaystyle C_{k+1}^{1}}$ is in ${\displaystyle C_{k}^{1}}$, allowing one to define ${\displaystyle C_{k}^{2}}$ as the set of all such restrictions, a non-empty set. Continuing so, define ${\displaystyle C_{k}^{m}}$ for all integers m, k.

Now, for any integer k, ${\displaystyle C_{k}\supseteq C_{k}^{1}\supseteq C_{k}^{2}\supseteq \cdots }$, and each set is non-empty. Furthermore, Ck is finite as ${\displaystyle |C_{k}|\leq c^{\frac {k!}{n!(k-n)!}}}$. It follows that the intersection of all of these sets is non-empty, and let ${\displaystyle D_{k}=C_{k}\cap C_{k}^{1}\cap C_{k}^{2}\cap \cdots }$. Then every colouring in Dk is the restriction of a colouring in Dk+1. Therefore, by unrestricting a colouring in Dk to a colouring in Dk+1, and continuing doing so, one constructs a colouring of ${\displaystyle \mathbb {N} ^{(n)}}$ without any monochromatic set of size T. This contradicts the infinite Ramsey theorem.

If a suitable topological viewpoint is taken, this argument becomes a standard compactness argument showing that the infinite version of the theorem implies the finite version.[12]

## Directed graph Ramsey numbers

It is also possible to define Ramsey numbers for directed graphs. (These were introduced by P. Erdős & L. Moser.) Let R(n) be the smallest number Q such that any complete graph with singly directed arcs (also called a "tournament") and with ≥ Q nodes contains an acyclic (also called "transitive") n-node subtournament.

This is the directed-graph analogue of what (above) has been called R(nn; 2), the smallest number Z such that any 2-colouring of the edges of a complete undirected graph with ≥ Z nodes, contains a monochromatic complete graph on n nodes. (The directed analogue of the two possible arc colours is the two directions of the arcs, the analogue of "monochromatic" is "all arc-arrows point the same way"; i.e., "acyclic.")

We have R(0) = 0, R(1) = 1, R(2) = 2, R(3) = 4, R(4) = 8, R(5) = 14, R(6) = 28, 32 ≤ R(7) ≤ 55, and R(8) is again a problem, according to Erdős[citation needed], that one does not want powerful aliens to pose.

## Ramsey computation and quantum computers

Ramsey numbers can be determined by some universal quantum computers. The decision question is solved by determining whether the probe qubit exhibits resonance dynamics.[13]

## Notes

1. ^ up to automorphisms of the graph
2. ^
3. ^ a b
4. ^ 2.6 Ramsey Theory from Mathematics Illuminated
5. ^ a b Brendan D. McKay, Stanislaw P. Radziszowski (May 1995). "R(4,5) = 25" (PDF). Journal of Graph Theory. 19 (3): 309–322. doi:10.1002/jgt.3190190304.
6. ^ Vigleik Angeltveit; Brendan McKay (2017). "${\displaystyle R(5,5)\leq 48}$". arXiv: [math.CO].
7. ^ Joel H. Spencer (1994), Ten Lectures on the Probabilistic Method, SIAM, p. 4, ISBN 978-0-89871-325-1
8. ^ Brendan D. McKay, Stanisław P. Radziszowski (1997). "Subgraph Counting Identities and Ramsey Numbers" (PDF). Journal of Combinatorial Theory. 69 (2): 193–209. doi:10.1006/jctb.1996.1741.
9. ^ a b c
10. ^ a b c d Exoo, Geoffrey; Tatarevic, Milos (2015). "New Lower Bounds for 28 Classical Ramsey Numbers". The Electronic Journal of Combinatorics. 22 (3): 3.
11. ^ Martin Gould. "Ramsey Theory" (pdf).
12. ^ Diestel, Reinhard (2010). "Chapter 8, Infinite Graphs". Graph Theory (4 ed.). Heidelberg: Springer-Verlag. pp. 209––2010. ISBN 978-3-662-53621-6.
13. ^ https://arxiv.org/abs/1510.01884