{
  "id": "2259",
  "ident": "NS.02259",
  "slug": "erdos-49",
  "title": "Erdős Problem 49",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $A=\\{a_1<\\cdots<a_t\\}\\subseteq \\{1,\\ldots,N\\}$ be such that $\\phi(a_1)<\\cdots<\\phi(a_t)$.\nThe primes are such an example. Are they the largest possible? Can one show that\n$\\lvert A\\rvert<(1+o(1))\\pi(N)$ or even $\\lvert A\\rvert=o(N)$?\n\nErdős remarks that the last conjecture is probably easy, and that similar questions can be asked\nabout $\\sigma(n)$.\n\nSolved by Tao [Ta24d], who proved that\n$$ \\lvert A\\rvert \\leq \\left(1+O\\left(\\frac{(\\log\\log x)^5}{\\log x}\\right)\\right)\\pi(x).$$\n\nIn [Er95c] Erdős further asks about the situation when $\\phi(a_1)\\leq \\cdots \\leq \\phi(a_t)$.\n\nSee also [415](https://www.erdosproblems.com/415).",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos49.erdos_49",
  "statement_lean": "theorem erdos_49 : ∀ ε : ℝ, 0 < ε →\n    ∀ᶠ N : ℕ in atTop, (f N : ℝ) ≤ (1 + ε) * Nat.primeCounting N",
  "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 49\n\n*References:*\n- [erdosproblems.com/49](https://www.erdosproblems.com/49)\n- [Er95] Erdős, Paul, *Some of my favourite problems in number theory, combinatorics, and\n  geometry*. Resenhas (1995), 165-186.\n- [Er95c] Erdős, Paul, *Some problems in number theory*. Octogon Math. Mag. (1995), 3-5.\n- [Ta24d] Tao, Terence, *Monotone nondecreasing sequences of the Euler totient function*.\n  Matematica (2024), 793-820.\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\n\nnamespace Erdos49\n\n/-- The largest size of a set $A\\subseteq\\{1,\\ldots,N\\}$ on which Euler's totient function is\nstrictly increasing. -/\nnoncomputable def f (N : ℕ) : ℕ :=\n  sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ StrictMonoOn Nat.totient (A : Set ℕ) ∧\n    A.card = k}\n\n/-- The largest size of a set $A\\subseteq\\{1,\\ldots,N\\}$ on which Euler's totient function is\nnon-decreasing. -/\nnoncomputable def g (N : ℕ) : ℕ :=\n  sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ MonotoneOn Nat.totient (A : Set ℕ) ∧\n    A.card = k}\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $A=\\{a_1<\\cdots<a_t\\}\\subseteq \\{1,\\ldots,N\\}$ be such that $\\phi(a_1)<\\cdots<\\phi(a_t)$.\nThe primes are such an example. Are they the largest possible? Can one show that\n$\\lvert A\\rvert<(1+o(1))\\pi(N)$ or even $\\lvert A\\rvert=o(N)$?\n\nErdős remarks that the last conjecture is probably easy, and that similar questions can be asked\nabout $\\sigma(n)$.\n\nSolved by Tao [Ta24d], who proved that\n$$ \\lvert A\\rvert \\leq \\left(1+O\\left(\\frac{(\\log\\log x)^5}{\\log x}\\right)\\right)\\pi(x).$$\n\nIn [Er95c] Erdős further asks about the situation when $\\phi(a_1)\\leq \\cdots \\leq \\phi(a_t)$.\n\nSee also [415](https://www.erdosproblems.com/415).\n-/\n@[category research solved, question, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos49.lean#L120\"]\ntheorem erdos_49 : ∀ ε : ℝ, 0 < ε →\n    ∀ᶠ N : ℕ in atTop, (f N : ℝ) ≤ (1 + ε) * Nat.primeCounting N := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- The weaker statement $\\lvert A\\rvert=o(N)$. -/\n@[category research solved, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos49.lean#L340\"]\ntheorem erdos_49.variants.little_o :\n    (fun N : ℕ ↦ (f N : ℝ)) =o[atTop] fun N ↦ (N : ℝ) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nTao [Ta24d] proved that\n$\\lvert A\\rvert \\leq \\left(1+O\\left(\\frac{(\\log\\log N)^5}{\\log N}\\right)\\right)\\pi(N)$, even for\nsets on which $\\phi$ is merely non-decreasing.\n-/\n@[category research solved, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos49.lean#L120\"]\ntheorem erdos_49.variants.tao : ∃ C : ℝ, 0 ≤ C ∧ ∀ N : ℕ, 10 ≤ N →\n    (g N : ℝ) ≤ (1 + C * (Real.log (Real.log N) ^ 5 / Real.log N)) *\n      Nat.primeCounting N := by\n  sorry\n\n/-- Are the primes the largest possible example, i.e. is $f(N) = \\pi(N)$ for all $N \\geq 2$? -/\n@[category research open, question, AMS 11]\ntheorem erdos_49.variants.primes_maximal :\n    ∀ N : ℕ, 2 ≤ N → f N = Nat.primeCounting N := by\n  sorry\n\nend Erdos49\n",
  "statement_hash": "a4fa31a42be9bd340c873356b9d3c45b8c23a2f99ed79ccb6cc0615087c376d9",
  "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."
}