Math 2.0

Combinatorics Proof

Proof of the Erdős–Szekeres theorem by the pigeonhole principle

Builds on Pigeonhole principleRule of product

Proof

We argue by contradiction, with the pigeonhole principle.

  1. Let r,s≥1r, s \ge 1 be integers, let N=(r−1)(s−1)+1N = (r - 1)(s - 1) + 1, and let a1,…,aNa_1, \dots, a_N be distinct real numbers.
  2. A subsequence of length mm is given by indices i1<i2<⋯<imi_1 < i_2 < \dots < i_m. It is increasing if ai1<⋯<aima_{i_1} < \dots < a_{i_m}, and decreasing if ai1>⋯>aima_{i_1} > \dots > a_{i_m}. It ends at aima_{i_m}.
  3. For each index ii, let xix_i be the largest length of an increasing subsequence that ends at aia_i. Let yiy_i be the largest length of a decreasing subsequence that ends at aia_i.
  4. These maxima exist, because lengths are at most NN. Also xi≥1x_i \ge 1 and yi≥1y_i \ge 1, because the single term aia_i is both increasing and decreasing.
  5. Let i<ji < j. We claim that (xi,yi)≠(xj,yj)(x_i, y_i) \ne (x_j, y_j). Since the terms are distinct, either ai<aja_i < a_j or ai>aja_i > a_j.
  6. If ai<aja_i < a_j, take an increasing subsequence of length xix_i that ends at aia_i. Appending aja_j gives an increasing subsequence of length xi+1x_i + 1 that ends at aja_j. So xj≥xi+1x_j \ge x_i + 1.
  7. If ai>aja_i > a_j, the same argument with a decreasing subsequence gives yj≥yi+1y_j \ge y_i + 1.
  8. In both cases the pairs differ. So the map g:i↦(xi,yi)g : i \mapsto (x_i, y_i) on {1,…,N}\set{1, \dots, N} is injective.
  9. Suppose, for a contradiction, that there is no increasing subsequence of length rr and no decreasing subsequence of length ss.
  10. Then xi≤r−1x_i \le r - 1 for all ii. Otherwise an increasing subsequence of length xi≥rx_i \ge r exists, and its last rr terms form one of length rr.
  11. In the same way, yi≤s−1y_i \le s - 1 for all ii.
  12. By steps 4, 10 and 11, gg maps {1,…,N}\set{1, \dots, N} into P={1,…,r−1}×{1,…,s−1}P = \set{1, \dots, r - 1} \times \set{1, \dots, s - 1}.
  13. By the rule of product, ∣P∣=(r−1)(s−1)<N|P| = (r - 1)(s - 1) < N.
  14. By the pigeonhole principle, gg is not injective. This contradicts step 8.
  15. Hence the sequence has an increasing subsequence of length rr or a decreasing subsequence of length ss.

Idea

Label each term by the lengths of the longest increasing and decreasing runs that end there. A later term always improves one of the two labels, so all labels differ. If both kinds of subsequence were short, there would be too few labels for NN terms.

Reading path

To understand this page from the ground up, read these 44 pages in order. The foundations come first. The path takes the proofs Proof that a composition of injections is injective, Proof that a function is bijective iff it has a two-sided inverse, Proof of the rule of product, Proof of the complement principle, Proof of the pigeonhole principle, Proof that a composition of surjections is surjective, Proof of the rule of sum, Proof of the bijection principle.

  1. Cardinality of a finite set definition
  2. Element definition
  3. Proposition concept
  4. Set definition
  5. Conjunction definition
  6. Implication definition
  7. Predicate definition
  8. Empty set object
  9. Ordered pair definition
  10. Intersection definition
  11. Existential quantifier definition
  12. Universal quantifier definition
  13. Cartesian product definition
  14. Disjoint sets definition
  15. Subset definition
  16. Uniqueness quantifier definition
  17. Binary relation definition
  18. Function definition
  19. Codomain definition
  20. Function composition definition
  21. Identity function definition
  22. Injective function definition
  23. Image of a set definition
  24. Surjective function definition
  25. Left inverse definition
  26. Right inverse definition
  27. Proof that a composition of injections is injective proof
  28. Proof that a composition of surjections is surjective proof
  29. Bijective function definition
  30. Composition of injections is injective statement
  31. Composition of surjections is surjective statement
  32. Proof of the rule of sum proof
  33. Proof that a function is bijective iff it has a two-sided inverse proof
  34. Rule of sum statement
  35. Bijective iff it has a two-sided inverse statement
  36. Proof of the complement principle proof
  37. Proof of the rule of product proof
  38. Proof of the bijection principle proof
  39. Complement principle statement
  40. Rule of product statement
  41. Bijection principle statement
  42. Proof of the pigeonhole principle proof
  43. Pigeonhole principle statement
  44. Proof of the Erdős–Szekeres theorem by the pigeonhole principle proof

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Erdős–Szekeres_theorem, Proofs, Pigeonhole principle
About this page
Tag22G1VPJW6Y
URIm2://22G1VPJW6Y
Kindproof
WritingW0 stub
MSC05A05
ProvesErdős–Szekeres theorem
UsesPigeonhole principle, Rule of product
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.