Monotone subsequences (Erdős–Szekeres)
Statement
Let . Prove that every sequence of distinct real numbers contains an increasing subsequence of length or a decreasing subsequence of length .
Hint
To each term attach the pair , where is the length of the longest increasing subsequence ending at and the length of the longest decreasing subsequence ending at . Show that these pairs are pairwise distinct.
Show solutionHide solution
Solution
Idea. Label every term by two numbers, and show that the labels never repeat.
Distinct labels. Let .
- If , any increasing subsequence ending at can be extended by , so .
- If , any decreasing subsequence ending at can be extended by , so .
In both cases .
Counting. Suppose, for contradiction, that all increasing and decreasing subsequences have length at most . Then for all , so there are at most possible pairs. But we have terms with pairwise distinct pairs: contradiction.
Remark. The bound is sharp.
Lesson. When pigeonhole directly fails, build a cleverly chosen label for each object so that distinct objects get distinct labels.