{
  "id": "3571",
  "ident": "NS.03571",
  "slug": "erdos-900",
  "title": "Erdős Problem 900",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "There is a function $f:(1/2,\\infty)\\to \\mathbb{R}$ such that $f(c)\\to 0$ as $c\\to 1/2$ and\n$f(c)\\to 1$ as $c\\to \\infty$ and every random graph with $n$ vertices and $cn$ edges has (with\nhigh probability) a path of length at least $f(c)n$.\n\nConjectured by Erdős [Er78, p. 32] and proved by Ajtai, Komlós, and Szemerédi [AKS81]. We take\nthe uniform random graph with $\\lfloor cn\\rfloor$ edges, count the length of a path in edges, read\n\"with high probability\" as probability tending to $1$ as $n\\to\\infty$, and require $f(c)>0$ for\nevery $c>1/2$ (a path of linear length). The linked formal proof uses the same uniform model,\nwritten as uniformly random $0/1$ vectors of weight $\\lfloor cn\\rfloor$ indexed by the pairs of\nvertices.",
  "subjects": [
    "math.CO",
    "math.PR",
    "msc:05",
    "msc:60"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos900.erdos_900",
  "statement_lean": "theorem erdos_900 :\n    ∃ f : ℝ → ℝ, (∀ c : ℝ, 1 / 2 < c → 0 < f c) ∧\n      Tendsto f (𝓝[>] (1 / 2)) (𝓝 0) ∧ Tendsto f atTop (𝓝 1) ∧\n      ∀ c : ℝ, 1 / 2 < c → Tendsto (fun n : ℕ ↦\n        uniformEdgeProbability n ⌊c * n⌋₊ (HasLongPath n (f c))) atTop (𝓝 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 900\n\n*References:*\n- [erdosproblems.com/900](https://www.erdosproblems.com/900)\n- [AKS81] Ajtai, Miklós and Komlós, János and Szemerédi, Endre, *The longest path in a random\n  graph*. Combinatorica 1 (1981), 1--12.\n- [Er78] Erdős, Paul, *Problems and results in combinatorial analysis and combinatorial number\n  theory*. Proceedings of the Ninth Southeastern Conference on Combinatorics, Graph Theory, and\n  Computing (1978), 29-40. [PDF](https://www.renyi.hu/~p_erdos/1978-36.pdf)\n-/\n\n@[expose] public section\n\nopen Filter SimpleGraph\nopen scoped Topology\n\nnamespace Erdos900\n\n/-- The probability that a graph chosen uniformly at random among the graphs on the vertex set\n`Fin n` with exactly `m` edges satisfies `P`. If `n.choose 2 < m` there is no such graph, and\nthe value is `0` (the quotient is $0/0$). -/\nnoncomputable def uniformEdgeProbability (n m : ℕ) (P : SimpleGraph (Fin n) → Prop) : ℝ :=\n  (Set.ncard {G : SimpleGraph (Fin n) | G.edgeSet.ncard = m ∧ P G} : ℝ) /\n    ((n.choose 2).choose m : ℝ)\n\n/-- `HasLongPath n a G` says that the graph `G` on `Fin n` contains a path with at least $an$\nedges. That is, `G` contains a copy of the path graph on `⌈a * n⌉₊ + 1` vertices. -/\ndef HasLongPath (n : ℕ) (a : ℝ) (G : SimpleGraph (Fin n)) : Prop :=\n  pathGraph (⌈a * n⌉₊ + 1) ⊑ G\n\n/-- If $m > \\binom{n}{2}$ then no graph on `Fin n` has $m$ edges, and the probability is `0`. -/\n@[category API, AMS 5 60]\ntheorem uniformEdgeProbability_of_lt (n m : ℕ) (P : SimpleGraph (Fin n) → Prop)\n    (h : n.choose 2 < m) : uniformEdgeProbability n m P = 0 := by\n  simp [uniformEdgeProbability, Nat.choose_eq_zero_of_lt h]\n\nset_option linter.style.formal_proof_palomar false in\n/--\nThere is a function $f:(1/2,\\infty)\\to \\mathbb{R}$ such that $f(c)\\to 0$ as $c\\to 1/2$ and\n$f(c)\\to 1$ as $c\\to \\infty$ and every random graph with $n$ vertices and $cn$ edges has (with\nhigh probability) a path of length at least $f(c)n$.\n\nConjectured by Erdős [Er78, p. 32] and proved by Ajtai, Komlós, and Szemerédi [AKS81]. We take\nthe uniform random graph with $\\lfloor cn\\rfloor$ edges, count the length of a path in edges, read\n\"with high probability\" as probability tending to $1$ as $n\\to\\infty$, and require $f(c)>0$ for\nevery $c>1/2$ (a path of linear length). The linked formal proof uses the same uniform model,\nwritten as uniformly random $0/1$ vectors of weight $\\lfloor cn\\rfloor$ indexed by the pairs of\nvertices.\n-/\n@[category research solved, AMS 5 60, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos900.lean#L950\"]\ntheorem erdos_900 :\n    ∃ f : ℝ → ℝ, (∀ c : ℝ, 1 / 2 < c → 0 < f c) ∧\n      Tendsto f (𝓝[>] (1 / 2)) (𝓝 0) ∧ Tendsto f atTop (𝓝 1) ∧\n      ∀ c : ℝ, 1 / 2 < c → Tendsto (fun n : ℕ ↦\n        uniformEdgeProbability n ⌊c * n⌋₊ (HasLongPath n (f c))) atTop (𝓝 1) := by\n  sorry\n\nend Erdos900\n",
  "statement_hash": "93321eb8664a27e02f66c7554384b91d2400e4d4b1b69cf1cd39a2851296f868",
  "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."
}