{
  "id": "404",
  "ident": "NS.00404",
  "slug": "erdos-1026",
  "title": "Erdős Problem 1026",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $x_1,\\ldots,x_n$ be a sequence of distinct real numbers. Determine\n$$\n\\max\\left(\\sum x_{i_r}\\right),\n$$\nwhere the maximum is taken over all monotonic subsequences.\n\nThis is as Erdős posed the problem in [Er71], which is rather ambiguous. Discussion between\nseveral users in the comments section has led to the following precise possible question, as\nposed by van Doorn:\n\nWhat is the largest constant $c$ such that, for all sequences of $n$ real numbers\n$x_1,\\ldots,x_n$,\n$$\n\\max\\left(\\sum x_{i_r}\\right) > (c-o(1))\\frac{1}{\\sqrt{n}}\\sum x_i\n$$\n(where again the maximum is taken over all monotonic subsequences)?\n\nCambie makes the stronger conjecture that if $x_1,\\ldots,x_{k^2}$ are distinct positive real\nnumbers with $\\sum x_i=1$ then there is always a monotonic subsequence with sum at least $1/k$.\n\nThis stronger conjecture appears to have been first proved by Tidor, Wang, and Yang [TWY16],\nand is also implicit in work of Wagner [Wa17]. A proof was given and formalised by Aristotle\n(see the comments), with an alternative proof provided by Chan. In particular, this shows that\n$c=1$.",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1026.erdos_1026",
  "statement_lean": "theorem erdos_1026 : IsGreatest admissibleConstants 1",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 1026\n\n*References:*\n- [erdosproblems.com/1026](https://www.erdosproblems.com/1026)\n- [Er71] Erdős, P., *Some unsolved problems in graph theory and combinatorial analysis*.\n  Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97-109.\n- [Ha57] Hanani, Haim, *On the number of monotonic subsequences*. Bull. Res. Council Israel\n  Sect. F (1957/58), 11-13.\n- [St95] Steele, J. Michael, *Variations on the monotone subsequence theme of Erdős and\n  Szekeres*. (1995), 111-131.\n- [TWY16] Tidor, J. and Wang, V. and Yang, B., *$1$-color avoiding paths, special tournaments,\n  and incidence geometry*. arXiv:1608.04153 (2016).\n- [Wa17] Wagner, Adam Zsolt, *Large subgraphs in rainbow-triangle free colorings*. J. Graph\n  Theory (2017), 141-148.\n-/\n\n@[expose] public section\n\nnamespace Erdos1026\n\nopen Filter\n\n/--\nThe set of sums $\\sum x_{i_r}$, where $x_{i_1},\\ldots,x_{i_r}$ ranges over the monotonic\nsubsequences of the sequence $x_1,\\ldots,x_n$.\n-/\ndef monotonicSubsequenceSums {n : ℕ} (x : Fin n → ℝ) : Set ℝ :=\n  {S | ∃ I : Finset (Fin n), (MonotoneOn x ↑I ∨ AntitoneOn x ↑I) ∧ (∑ i ∈ I, x i) = S}\n\n/--\nThe set of constants $c$ such that, for all sequences of $n$ distinct positive real numbers\n$x_1,\\ldots,x_n$,\n$$\n\\max\\left(\\sum x_{i_r}\\right) > (c-o(1))\\frac{1}{\\sqrt{n}}\\sum x_i\n$$\n(where the maximum is taken over all monotonic subsequences).\n\nThe source reduces to positive sequences. With signed sequences the condition is not a vanishing\nerror term: for $\\varepsilon > |c|$ and $x_i = -i$ the right-hand side is positive while every\nsubsequence sum is nonpositive, so no constant would be admissible.\n-/\ndef admissibleConstants : Set ℝ :=\n  {c : ℝ | ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, ∀ x : Fin n → ℝ, Function.Injective x →\n    (∀ i, 0 < x i) →\n    ∃ S ∈ monotonicSubsequenceSums x, (c - ε) / Real.sqrt (n : ℝ) * (∑ i, x i) ≤ S}\n\n/--\nLet $x_1,\\ldots,x_n$ be a sequence of distinct real numbers. Determine\n$$\n\\max\\left(\\sum x_{i_r}\\right),\n$$\nwhere the maximum is taken over all monotonic subsequences.\n\nThis is as Erdős posed the problem in [Er71], which is rather ambiguous. Discussion between\nseveral users in the comments section has led to the following precise possible question, as\nposed by van Doorn:\n\nWhat is the largest constant $c$ such that, for all sequences of $n$ real numbers\n$x_1,\\ldots,x_n$,\n$$\n\\max\\left(\\sum x_{i_r}\\right) > (c-o(1))\\frac{1}{\\sqrt{n}}\\sum x_i\n$$\n(where again the maximum is taken over all monotonic subsequences)?\n\nCambie makes the stronger conjecture that if $x_1,\\ldots,x_{k^2}$ are distinct positive real\nnumbers with $\\sum x_i=1$ then there is always a monotonic subsequence with sum at least $1/k$.\n\nThis stronger conjecture appears to have been first proved by Tidor, Wang, and Yang [TWY16],\nand is also implicit in work of Wagner [Wa17]. A proof was given and formalised by Aristotle\n(see the comments), with an alternative proof provided by Chan. In particular, this shows that\n$c=1$.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_1026 : IsGreatest admissibleConstants 1 := by\n  sorry\n\n/--\nA construction of Cambie in the comments shows that $c\\leq 1$.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_1026.variants.upper_bound : 1 ∈ upperBounds admissibleConstants := by\n  sorry\n\n/--\nHanani [Ha57] showed that every sequence is the disjoint union of at most\n$(\\sqrt{2}+o(1))\\sqrt{n}$ many monotonic subsequences, whence $c\\geq 1/\\sqrt{2}$.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_1026.variants.lower_bound : 1 / Real.sqrt 2 ∈ admissibleConstants := by\n  sorry\n\n/--\nHanani [Ha57] showed that every sequence is the disjoint union of at most\n$(\\sqrt{2}+o(1))\\sqrt{n}$ many monotonic subsequences.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_1026.variants.hanani (ε : ℝ) (hε : 0 < ε) :\n    ∀ᶠ n : ℕ in atTop, ∀ x : Fin n → ℝ, Function.Injective x →\n      ∃ (m : ℕ) (I : Fin m → Finset (Fin n)),\n        (∀ j, MonotoneOn x ↑(I j) ∨ AntitoneOn x ↑(I j)) ∧\n        (Pairwise fun j k => Disjoint (I j) (I k)) ∧\n        (Finset.univ : Finset (Fin m)).biUnion I = Finset.univ ∧\n        (m : ℝ) ≤ (Real.sqrt 2 + ε) * Real.sqrt (n : ℝ) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nCambie makes the stronger conjecture that if $x_1,\\ldots,x_{k^2}$ are distinct positive real\nnumbers with $\\sum x_i=1$ then there is always a monotonic subsequence with sum at least $1/k$.\nThis is a weighted-form of the Erdős-Szekeres theorem, and is also mentioned (as an open\nquestion) in a survey on the latter by Steele [St95].\n\nThis stronger conjecture appears to have been first proved by Tidor, Wang, and Yang [TWY16],\nand is also implicit in work of Wagner [Wa17]. A proof was given and formalised by Aristotle\n(see the comments), with an alternative proof provided by Chan.\n-/\n@[category research solved, AMS 5, formal_proof using lean4 at \"https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos1026.lean\"]\ntheorem erdos_1026.variants.weighted_erdos_szekeres (k : ℕ) (hk : 0 < k) (x : Fin (k ^ 2) → ℝ)\n    (hx : Function.Injective x) (hx' : ∀ i, 0 < x i) (hsum : (∑ i, x i) = 1) :\n    ∃ S ∈ monotonicSubsequenceSums x, 1 / (k : ℝ) ≤ S := by\n  sorry\n\nend Erdos1026\n",
  "statement_hash": "d3dcf64bc13018668574f63048dddb124f22356f4586d53dcacc84c9f02a76a7",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}