Erdős–Szekeres monotone subsequence theorem
ProvedProofsInTheBook.Chapter26.chapter26book-chapter-28combinatoricslean4proofs-from-the-book
Let and let be injective. There exists a subset of indices with
such that either for every in , or for every in .
Thus every sequence of distinct real numbers contains a strictly increasing or strictly decreasing subsequence of at least terms.
Preamble
import Mathlib import Definitions.Def_ProofsInTheBook_Chapter26 open Finset Function open ProofsInTheBook.Chapter26
Formal statement
theorem ProofsInTheBook.Chapter26.chapter26 (n : ℕ) {a : Fin (n ^ 2 + 1) → ℝ} (ha : Injective a) :
(∃ t : Finset (Fin (n ^ 2 + 1)), n + 1 ≤ t.card ∧ StrictMonoOn a ↑t) ∨
(∃ t : Finset (Fin (n ^ 2 + 1)), n + 1 ≤ t.card ∧ StrictAntiOn a ↑t) := by sorrySource
Martin Aigner and Günter M. Ziegler, Proofs from THE BOOK, 6th edition, Springer, 2018, Chapter 28, “Pigeon-hole and double counting”, pp. 195–205 (https://doi.org/10.1007/978-3-662-57265-8_28). Formalization: https://github.com/xiangyazi24/proof_in_the_book/blob/88d88d141768cded75e782c525ef1bf04b8fe220/ProofsInTheBook/Chapter26.lean#L227. The chapter reference identifies the topic; it does not claim the Lean development reproduces every argument of that chapter.