Is this a counterexample for the Erdös-Szekeres Theorem

combinatoricsdiscrete mathematics

As I understand, the Erdös-Szekeres theorem says that for every sequence $a_1$,$a_2$,…,$a_{n^2+1}$ of $n^2+1$ real numbers, there is a subsequence of length $n+1$ which is either increasing or decreasing.

If I set $n=2$ and select my sequence to be ${1,3,2,5,4}$

Then I should have a subsequence of length $3$ which is either increasing or decreasing right?

I can't really see it happening, what am I doing wrong? Thanks

Best Answer

Numberphile covered this theorem. By $n^2+1$ it's forced to escape all positive lattice points, in an n by n grid, since they need to be distinct in at least 1 coordinate, they are forced to $n+1$ in one of the coordinates. They also don't need to be consecutive as has been pointed out.

Related Question