{
  "id": "2626",
  "ident": "NS.02626",
  "slug": "erdos-619",
  "title": "Erdős Problem 619",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "**Erdős Problem 619** [EGR98, Er99]: For a triangle-free graph $G$ let $h_r(G)$ be the\nsmallest number of edges that need to be added to $G$ so that it has diameter $r$ (while\npreserving the property of being triangle-free). Is it true that there exists a constant\n$c>0$ such that if $G$ is a connected graph on $n$ vertices then $h_4(G)<(1-c)n$?\n\nThe answer is **no**: for every $\\eta>0$ there exist connected triangle-free graphs on\n$n$ vertices with $h_4(G)\\geq(1-\\eta)n$, so no such constant $c$ exists. The original proof\nwas generated by Claude Fable 5; the Lean formalization was sketched by Fable and\nimplemented by GPT 5.5 with Codex (see the linked `formal_proof`).",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos619.erdos_619",
  "statement_lean": "theorem erdos_619 :\n    ¬ ∃ c > (0 : ℝ), ∀ (V : Type) [Fintype V] (G : SimpleGraph V),\n      G.Connected → G.CliqueFree 3 →\n      (minNewEdges 4 G : ℝ) < (1 - c) * Fintype.card V",
  "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 619\n\n*References:*\n- [erdosproblems.com/619](https://www.erdosproblems.com/619)\n- [EGR98] Erdős, Paul and Gyárfás, András and Ruszinkó, Miklós, *How to decrease the\n  diameter of triangle-free graphs*. Combinatorica **18** (1998), 493-501.\n- [Er99] Erdős, Paul, *A selection of problems and results in combinatorics*.\n  Combin. Probab. Comput. **8** (1999), 1-6.\n-/\n\n@[expose] public section\n\nopen SimpleGraph\n\nnamespace Erdos619\n\n/--\nFor a graph $G$, `minNewEdges r G` is the smallest number of edges that need to be added\nto $G$ so that it has diameter at most $r$, while preserving the property of being\ntriangle-free. Erdős, Gyárfás and Ruszinkó denote this quantity by $h_r(G)$ in [EGR98].\n\nAdding edges is formalised as passing to a supergraph `H ≥ G` on the same vertex set, the\nnumber of added edges being the (finite) cardinality of the edge set of `H \\ G`. We use\nthe extended diameter `SimpleGraph.ediam` (valued in `ℕ∞`) so that disconnected\nsupergraphs, which have infinite diameter, do not qualify. If no triangle-free supergraph\nof `G` of diameter at most `r` exists, then `minNewEdges r G = 0` by the `Nat.sInf`\nconvention on the empty set; `erdos_619.variants.add_edges_diam_three` shows this\ndegenerate case does not occur for connected triangle-free `G` when `3 ≤ r`.\n-/\nnoncomputable def minNewEdges {V : Type*} (r : ℕ) (G : SimpleGraph V) : ℕ :=\n  sInf {k | ∃ H : SimpleGraph V,\n    G ≤ H ∧ H.CliqueFree 3 ∧ H.ediam ≤ r ∧ (H \\ G).edgeSet.ncard = k}\n\nset_option linter.style.formal_proof_palomar false in\n/--\n**Erdős Problem 619** [EGR98, Er99]: For a triangle-free graph $G$ let $h_r(G)$ be the\nsmallest number of edges that need to be added to $G$ so that it has diameter $r$ (while\npreserving the property of being triangle-free). Is it true that there exists a constant\n$c>0$ such that if $G$ is a connected graph on $n$ vertices then $h_4(G)<(1-c)n$?\n\nThe answer is **no**: for every $\\eta>0$ there exist connected triangle-free graphs on\n$n$ vertices with $h_4(G)\\geq(1-\\eta)n$, so no such constant $c$ exists. The original proof\nwas generated by Claude Fable 5; the Lean formalization was sketched by Fable and\nimplemented by GPT 5.5 with Codex (see the linked `formal_proof`).\n-/\n@[category research solved, question, AMS 5,\n  formal_proof using formal_conjectures at\n    \"https://github.com/google-deepmind/formal-conjectures/blob/b8c7a76f267c29eaa41d1212c211a920be8b05ea/FormalConjectures/ErdosProblems/619.lean#L6009\",\n  formal_proof using lean4 at\n    \"https://github.com/nick-kuhn/erdos-619/blob/7f65718b8c1019ecc24e6c9a6b04ec4c66a4e26f/Solution.lean#L5869\"]\ntheorem erdos_619 :\n    ¬ ∃ c > (0 : ℝ), ∀ (V : Type) [Fintype V] (G : SimpleGraph V),\n      G.Connected → G.CliqueFree 3 →\n      (minNewEdges 4 G : ℝ) < (1 - c) * Fintype.card V := by\n  sorry\n\n/-\n## Partial results\n-/\n\n/--\nErdős, Gyárfás and Ruszinkó [EGR98]: every connected triangle-free graph on a finite\nvertex set can be extended, by adding edges, to a triangle-free graph of diameter at\nmost $3$. This shows that the infimum defining `minNewEdges r G` ranges over a nonempty\nset for every `3 ≤ r`.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_619.variants.add_edges_diam_three {V : Type*} [Fintype V]\n    (G : SimpleGraph V) (hG : G.Connected) (hG' : G.CliqueFree 3) :\n    ∃ H : SimpleGraph V, G ≤ H ∧ H.CliqueFree 3 ∧ H.ediam ≤ 3 := by\n  sorry\n\n/--\nErdős, Gyárfás and Ruszinkó [EGR98]: $h_3(G) \\leq n$ for every connected triangle-free\ngraph $G$ on $n$ vertices.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_619.variants.h_three_le {V : Type*} [Fintype V]\n    (G : SimpleGraph V) (hG : G.Connected) (hG' : G.CliqueFree 3) :\n    minNewEdges 3 G ≤ Fintype.card V := by\n  sorry\n\n/--\nErdős, Gyárfás and Ruszinkó [EGR98]: $h_5(G) \\leq \\frac{n-1}{2}$ for every connected\ntriangle-free graph $G$ on $n$ vertices.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_619.variants.h_five_le {V : Type*} [Fintype V]\n    (G : SimpleGraph V) (hG : G.Connected) (hG' : G.CliqueFree 3) :\n    (minNewEdges 5 G : ℝ) ≤ (Fintype.card V - 1) / 2 := by\n  sorry\n\n/--\nErdős, Gyárfás and Ruszinkó [EGR98]: there is a constant $c > 0$ such that for every\n$n$ there exist connected triangle-free graphs $G$ on $n$ vertices with\n$h_3(G) \\geq n - c$.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_619.variants.h_three_lower :\n    ∃ c > (0 : ℝ), ∀ n : ℕ, 0 < n →\n      ∃ (V : Type) (_ : Fintype V) (G : SimpleGraph V),\n        Fintype.card V = n ∧ G.Connected ∧ G.CliqueFree 3 ∧\n        (n : ℝ) - c ≤ minNewEdges 3 G := by\n  sorry\n\n/-\n## Sanity checks\n-/\n\n/-- A triangle-free graph that already has diameter at most `r` needs no new edges. -/\n@[category test, AMS 5]\ntheorem erdos_619.test.minNewEdges_eq_zero {V : Type*} {r : ℕ} {G : SimpleGraph V}\n    (hG : G.CliqueFree 3) (hdiam : G.ediam ≤ r) :\n    minNewEdges r G = 0 :=\n  Nat.sInf_eq_zero.mpr <| Or.inl ⟨G, le_rfl, hG, hdiam, by simp⟩\n\n/-- The graph with a single vertex is triangle-free and has diameter `0`, so it needs no\nnew edges to reach diameter at most `4`. -/\n@[category test, AMS 5]\ntheorem erdos_619.test.minNewEdges_singleton :\n    minNewEdges 4 (⊥ : SimpleGraph (Fin 1)) = 0 :=\n  erdos_619.test.minNewEdges_eq_zero (cliqueFree_bot (by norm_num))\n    (by simp [ediam_eq_zero_of_subsingleton])\n\nend Erdos619\n",
  "statement_hash": "eebc7e39f545d43a56f1ec49c5fe5d3e4e8a9871a252f43489ff71c8e8a89820",
  "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."
}