{
  "id": "3072",
  "ident": "NS.03072",
  "slug": "erdos-745",
  "title": "Erdős Problem 745: Second-largest component of a random graph",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "In $G(n,1/n)$ the second-largest component has order $n^{2/3}$ in probability.\nThe two positive constants may depend on the probability tolerance.",
  "subjects": [
    "math.CO",
    "math.PR",
    "msc:05",
    "msc:60"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": "https://www.erdosproblems.com/745",
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos745.erdos_745",
  "statement_lean": "theorem erdos_745 :\n    ∀ ε : ℝ, 0 < ε → ∃ c C : ℝ, 0 < c ∧ c < C ∧\n      ∃ N : ℕ, ∀ n : ℕ, N ≤ n →\n        1 - ε ≤ criticalProbability n (fun G ↦\n          c * (n : ℝ) ^ (2 / 3 : ℝ) ≤ (secondLargestComponentOrder G : ℝ) ∧\n          (secondLargestComponentOrder G : ℝ) ≤ C * (n : ℝ) ^ (2 / 3 : ℝ))",
  "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 745: Second-largest component of a random graph\n\n*Reference:* [erdosproblems.com/745](https://www.erdosproblems.com/745)\n\nAt the stated parameter $p=1/n$, the second-largest component has order\n$n^{2/3}$ in probability. The logarithmic bound applies to fixed\n$p=\\lambda/n$ with $\\lambda>1$.\n\n[Al97] Aldous, D., Brownian excursions, critical random graphs and the multiplicative\ncoalescent. Ann. Probab. 25 (1997), 812–854.\n\n[KSS80] Komlós, J., Sulyok, M. and Szemerédi, E., Second largest component in a random\ngraph. Studia Sci. Math. Hungar. 15 (1980), 391–395.\n-/\n\n@[expose] public section\n\nopen MeasureTheory\nopen scoped Topology unitInterval\n\nnamespace Erdos745\n\n/-- The edge probability $1/n$, with zero at the empty index. -/\nnoncomputable def criticalEdgeProbability (n : ℕ) : unitInterval :=\n  if hn : n = 0 then 0 else\n    ⟨(1 : ℝ) / n, unitInterval.div_mem (by positivity) (Nat.cast_nonneg n)\n      (by exact_mod_cast (Nat.one_le_iff_ne_zero.mpr hn))⟩\n\n/-- The independent-edge random graph $G(n,1/n)$. -/\nnoncomputable def criticalRandomGraph (n : ℕ) : Measure (SimpleGraph (Fin n)) :=\n  SimpleGraph.binomialRandom (Fin n) (criticalEdgeProbability n)\n\n/-- The multiset of component sizes, retaining repetitions. -/\nnoncomputable def componentOrders {V : Type*} [Fintype V] [DecidableEq V]\n    (G : SimpleGraph V) : Multiset ℕ := by\n  classical\n  exact (Finset.univ : Finset G.ConnectedComponent).val.map fun C ↦ C.supp.ncard\n\n/-- Component sizes listed in decreasing order. -/\nnoncomputable def rankedComponentOrders {V : Type*} [Fintype V] [DecidableEq V]\n    (G : SimpleGraph V) : List ℕ :=\n  (componentOrders G).sort (· ≥ ·)\n\n/-- The second-largest component size, or zero if fewer than two components exist. -/\nnoncomputable def secondLargestComponentOrder {V : Type*} [Fintype V]\n    [DecidableEq V] (G : SimpleGraph V) : ℕ :=\n  (rankedComponentOrders G).getD 1 0\n\n/-- The probability of an event in $G(n,1/n)$. -/\nnoncomputable def criticalProbability (n : ℕ)\n    (P : SimpleGraph (Fin n) → Prop) : ℝ :=\n  (criticalRandomGraph n).real {G | P G}\n\n/-- The edge probability $\\lambda/n$, clipped to $[0,1]$ at small indices. -/\nnoncomputable def edgeProbability (lam : ℝ) (n : ℕ) : unitInterval :=\n  ⟨max 0 (min 1 (lam / n)), le_max_left _ _,\n    max_le zero_le_one (min_le_left _ _)⟩\n\n/-- The independent-edge random graph with clipped edge probability $\\lambda/n$. -/\nnoncomputable def randomGraph (lam : ℝ) (n : ℕ) : Measure (SimpleGraph (Fin n)) :=\n  SimpleGraph.binomialRandom (Fin n) (edgeProbability lam n)\n\n/-- The probability of an event in the model with parameter $\\lambda$. -/\nnoncomputable def probability (lam : ℝ) (n : ℕ)\n    (P : SimpleGraph (Fin n) → Prop) : ℝ :=\n  (randomGraph lam n).real {G | P G}\n\nset_option linter.style.formal_proof_palomar false in\n/-- In $G(n,1/n)$ the second-largest component has order $n^{2/3}$ in probability.\nThe two positive constants may depend on the probability tolerance. -/\n@[category research solved, AMS 5 60,\n  formal_proof using lean4 at \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos745.lean\"]\ntheorem erdos_745 :\n    ∀ ε : ℝ, 0 < ε → ∃ c C : ℝ, 0 < c ∧ c < C ∧\n      ∃ N : ℕ, ∀ n : ℕ, N ≤ n →\n        1 - ε ≤ criticalProbability n (fun G ↦\n          c * (n : ℝ) ^ (2 / 3 : ℝ) ≤ (secondLargestComponentOrder G : ℝ) ∧\n          (secondLargestComponentOrder G : ℝ) ≤ C * (n : ℝ) ^ (2 / 3 : ℝ)) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- For fixed $\\lambda>1$, every constant above\n$(\\lambda-1-\\log\\lambda)^{-1}$ gives a logarithmic upper bound with high probability. -/\n@[category research solved, AMS 5 60,\n  formal_proof using lean4 at \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos745.lean\"]\ntheorem erdos_745.variants.supercritical (lam : ℝ) (hlam : 1 < lam) (A : ℝ)\n    (hA : 1 / (lam - 1 - Real.log lam) < A) :\n    Filter.Tendsto (fun n : ℕ ↦ probability lam n (fun G ↦\n      (secondLargestComponentOrder G : ℝ) ≤ A * Real.log (n : ℝ)))\n      Filter.atTop (𝓝 1) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- For each fixed $\\lambda>0$ with $\\lambda\\ne1$, the second-largest component size,\ndivided by $\\log n$, converges in probability to $(\\lambda-1-\\log\\lambda)^{-1}$. -/\n@[category research solved, AMS 5 60,\n  formal_proof using lean4 at \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos745.lean\"]\ntheorem erdos_745.variants.noncritical_asymptotic\n    (lam : ℝ) (hlam : 0 < lam) (hne : lam ≠ 1) :\n    ∀ ε : ℝ, 0 < ε → Filter.Tendsto (fun n : ℕ ↦ probability lam n (fun G ↦\n      |(secondLargestComponentOrder G : ℝ) / Real.log (n : ℝ) -\n        1 / (lam - 1 - Real.log lam)| < ε)) Filter.atTop (𝓝 1) := by\n  sorry\n\nend Erdos745\n",
  "statement_hash": "69d44a1e6396478347d230987995bad8c27322ca6629f6624434be5b1523094f",
  "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."
}