Folioby Interconnected
Log InSign Up

The Pigeonhole Principle and Ramsey Theory: Existential Combinatorics

We develop the generalized pigeonhole principle, prove the Erd\H{o}s--Szekeres theorem on monotone subsequences, establish the existence of Ramsey numbers R(s,t), give a complete proof that R(3,3) = 6, and derive the probabilistic lower bound R(k,k) > 2^{k/2}.

FO
Folio Official
March 1, 2026

1 The Pigeonhole Principle

Theorem 1 (Pigeonhole principle).
If n+1 objects are placed into n boxes, then at least one box contains two or more objects.
Proof.
We prove the contrapositive. If every box contains at most one object, then the total number of objects is at most n, contradicting the assumption that there are n+1 objects. □
Theorem 2 (Generalized pigeonhole principle).
If kn+1 objects are placed into n boxes, then at least one box contains k+1 or more objects.
Proof.
If every box contained at most k objects, the total would be at most kn, a contradiction. □

2 The Erdős–Szekeres Theorem

Theorem 3 (Erd\H{o}s–Szekeres theorem).
Every sequence of length at least rs+1 contains a monotonically increasing subsequence of length r+1 or a monotonically decreasing subsequence of length s+1.
Proof.
Let the sequence be a1​,a2​,…,ars+1​. For each ai​, let ℓi​ denote the length of the longest increasing subsequence starting at ai​. If ℓi​≥r+1 for some i, we are done.

Assume ℓi​≤r for all i. Then ℓi​ takes values in {1,2,…,r}, and there are rs+1 indices. By the pigeonhole principle, at least s+1 indices share the same value of ℓi​, say ℓi1​​=ℓi2​​=⋯=ℓis+1​​ with i1​<i2​<⋯<is+1​. The subsequence ai1​​,ai2​​,…,ais+1​​ must be monotonically decreasing. Indeed, if aij​​≤aik​​ for some j<k, then the longest increasing subsequence starting at aij​​ would have length at least ℓik​​+1>ℓij​​, contradicting ℓij​​=ℓik​​. □

3 Ramsey Numbers

Definition 4 (Ramsey number).
The Ramsey numberR(s,t) is the smallest positive integer N such that every 2-coloring (red/blue) of the edges of KN​ contains either a red Ks​ or a blue Kt​.
Theorem 5 (Existence of Ramsey numbers).
For all positive integers s,t≥2, R(s,t)≤(s−1s+t−2​). In particular, R(s,t) is finite.
Proof.
We argue by induction on s+t.

Base cases.R(s,2)=s and R(2,t)=t. Indeed, in any 2-coloring of Ks​, either there is a red edge (a red K2​) or all edges are blue, giving a blue Ks​. The argument for R(2,t)=t is symmetric.

Inductive step. Let s,t≥3 and assume R(s−1,t) and R(s,t−1) are finite. Set N=R(s−1,t)+R(s,t−1) and 2-color the edges of KN​. Fix any vertex v and let A be the set of vertices joined to v by red edges and B the set joined by blue edges. Since ∣A∣+∣B∣=N−1=R(s−1,t)+R(s,t−1)−1, the pigeonhole principle gives ∣A∣≥R(s−1,t) or ∣B∣≥R(s,t−1).

If ∣A∣≥R(s−1,t): by definition, A contains either a red Ks−1​ or a blue Kt​. A blue Kt​ finishes the proof. A red Ks−1​ together with v (which is joined to every vertex of A by a red edge) forms a red Ks​.

If ∣B∣≥R(s,t−1): similarly, B contains a red Ks​ or a blue Kt−1​. In the latter case, adding v yields a blue Kt​.

This establishes R(s,t)≤R(s−1,t)+R(s,t−1).

The upper bound. We prove R(s,t)≤(s−1s+t−2​) by induction on s+t. The base cases are R(s,2)=s=(s−1s​) and R(2,t)=t=(1t​). For the inductive step,
R(s,t)≤R(s−1,t)+R(s,t−1)≤(s−2s+t−3​)+(s−1s+t−3​)=(s−1s+t−2​),
where the last equality is Pascal's identity. □

4 Proof ThatR(3,3)=6

Theorem 6.
R(3,3)=6.
Proof.
Upper bound.R(3,3)≤R(2,3)+R(3,2)=3+3=6.

Lower bound. We exhibit a 2-coloring of K5​ with no monochromatic triangle. Color the edges of C5​ (the 5-cycle) red and the edges of the complement C5​​ (which is isomorphic to C5​) blue. Since C5​ contains no triangle, there is no red triangle. Since C5​​≅C5​, there is no blue triangle either. Hence R(3,3)>5. □

5 A Probabilistic Lower Bound

Theorem 7 (Erd\H{o}s, 1947).
If (kN​)21−(2k​)<1, then R(k,k)>N. In particular, R(k,k)>2k/2.
Proof.
Color each edge of KN​ independently red or blue with equal probability 1/2. For a fixed set S of k vertices, the probability that S induces a monochromatic complete graph is 2⋅2−(2k​). By the union bound,
Pr[a monochromatic Kk​ exists]≤(kN​)⋅2⋅2−(2k​)=(kN​)21−(2k​).
If this quantity is strictly less than 1, then with positive probability no monochromatic Kk​ exists, so there is at least one coloring that avoids it. Hence R(k,k)>N. Taking N=⌊2k/2⌋ satisfies the condition, yielding R(k,k)>2k/2. □

The probabilistic method, pioneered by Erdős, is one of the most powerful techniques in combinatorics. It yields non-constructive existence proofs by showing that a randomly chosen object satisfies the desired property with positive probability.

CombinatoricsDiscrete MathematicsTextbookPigeonhole PrincipleRamsey Theory
FO
Folio Official

Mathematics "between the lines" — exploring the intuition textbooks leave out, written in LaTeX on Folio.

1 followers·107 articles
Combinatorics TextbookPart 9 of 13
Previous
Catalan Numbers and Lattice Paths: The Reflection Principle and Bijective Proofs
Next
Burnside's Lemma and P\'olya Enumeration: Counting Under Symmetry

Share your expertise with the world

Write articles with LaTeX support, build your audience, and earn from your knowledge.

Start Writing — It's Free

More from Folio Official

Folio Official·March 1, 2026

Recurrence Relations and Counting: Solving Linear Recurrences

We present the method of characteristic equations for solving linear recurrences with constant coefficients, treat the case of repeated roots, discuss nonhomogeneous recurrences, establish the equivalence with generating functions, and introduce matrix exponentiation and the Kitamasa method.

CombinatoricsDiscrete MathematicsTextbook
Folio Official·March 1, 2026

The Inclusion--Exclusion Principle: Counting by Alternating Sums

We prove the inclusion--exclusion principle and apply it to derive the formula for the number of derangements D_n, Euler's totient function, the relationship between surjections and Stirling numbers of the second kind, and the M\"{o}bius inversion formula.

CombinatoricsDiscrete MathematicsTextbook
Folio Official·March 1, 2026

Combinatorial Designs and Latin Squares: Balanced Arrangements

We define Latin squares and prove their existence, introduce mutually orthogonal Latin squares (MOLS), develop the theory of balanced incomplete block designs (BIBDs), prove Fisher's inequality, and discuss the connection with finite projective planes.

CombinatoricsDiscrete MathematicsTextbook
Folio Official·March 1, 2026

Burnside's Lemma and P\'olya Enumeration: Counting Under Symmetry

Starting from the definitions of group actions, orbits, and stabilizers, we prove Burnside's lemma (the Cauchy--Frobenius theorem), introduce the cycle index of a permutation group, and derive P\'olya's enumeration theorem. Applications to necklace and bracelet counting are given.

CombinatoricsDiscrete MathematicsTextbook