{
  "id": "363",
  "ident": "NS.00363",
  "slug": "erdos-1009",
  "title": "Erdős Problem 1009",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Is it true that, for every $c>0$, there exists $f(c)$ such that every graph on $n$ vertices with\nat least $\\lfloor n^2/4\\rfloor+k$ edges, where $k<c n$, contains at least $k-f(c)$ many edge\ndisjoint triangles?\n\nErdős [Er71] proved this for $c<1/2$ using a theorem of Erdős and Gallai, which says that every\ngraph on $n$ vertices with at least $(n-1)^2/4+2$ many edges, with chromatic number $3$, must\ncontain a triangle. In fact, Erdős proved this is true with $f(c)=0$ for $c<1/2$. At first Erdős\nthought $f(c)=0$ for larger values of $c$ but this is false: an example of Sauer proves that\n$f(2)\\geq 1$.\n\nThis is true, and was proved by Győri [Gy88] who proved that this is true with $f(c)\\ll c^2$,\nand also that $f(c)=0$ if $c<2$ for odd $n$ or $c<3/2$ for even $n$.\n\nA family of edge disjoint triangles is a finite set of $3$-cliques of $G$ any two of which share\nat most one vertex.",
  "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": "Erdos1009.erdos_1009",
  "statement_lean": "theorem erdos_1009 : ∀ c : ℝ, 0 < c → ∃ f : ℕ, ∀ (n k : ℕ) (G : SimpleGraph (Fin n)),\n    n ^ 2 / 4 + k ≤ G.edgeSet.ncard → (k : ℝ) < c * n →\n      ∃ T : Finset (Finset (Fin n)), (∀ t ∈ T, G.IsNClique 3 t) ∧\n        (T : Set (Finset (Fin n))).Pairwise (fun s t => (s ∩ t).card ≤ 1) ∧ k ≤ T.card + f",
  "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 1009\n\n*References:*\n- [erdosproblems.com/1009](https://www.erdosproblems.com/1009)\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- [Gy88] Győri, E., *On the number of edge-disjoint triangles in graphs of given size*. (1988),\n  267--276.\n-/\n\n@[expose] public section\n\nnamespace Erdos1009\n\nset_option linter.style.formal_proof_palomar false in\n/--\nIs it true that, for every $c>0$, there exists $f(c)$ such that every graph on $n$ vertices with\nat least $\\lfloor n^2/4\\rfloor+k$ edges, where $k<c n$, contains at least $k-f(c)$ many edge\ndisjoint triangles?\n\nErdős [Er71] proved this for $c<1/2$ using a theorem of Erdős and Gallai, which says that every\ngraph on $n$ vertices with at least $(n-1)^2/4+2$ many edges, with chromatic number $3$, must\ncontain a triangle. In fact, Erdős proved this is true with $f(c)=0$ for $c<1/2$. At first Erdős\nthought $f(c)=0$ for larger values of $c$ but this is false: an example of Sauer proves that\n$f(2)\\geq 1$.\n\nThis is true, and was proved by Győri [Gy88] who proved that this is true with $f(c)\\ll c^2$,\nand also that $f(c)=0$ if $c<2$ for odd $n$ or $c<3/2$ for even $n$.\n\nA family of edge disjoint triangles is a finite set of $3$-cliques of $G$ any two of which share\nat most one vertex.\n-/\n@[category research solved, question, AMS 5, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos1009.lean#L2347\"]\ntheorem erdos_1009 : ∀ c : ℝ, 0 < c → ∃ f : ℕ, ∀ (n k : ℕ) (G : SimpleGraph (Fin n)),\n    n ^ 2 / 4 + k ≤ G.edgeSet.ncard → (k : ℝ) < c * n →\n      ∃ T : Finset (Finset (Fin n)), (∀ t ∈ T, G.IsNClique 3 t) ∧\n        (T : Set (Finset (Fin n))).Pairwise (fun s t => (s ∩ t).card ≤ 1) ∧ k ≤ T.card + f := by\n  sorry\n\n/--\nSauer gave an example of a graph on $n$ vertices with $\\lfloor n^2/4\\rfloor+2n-6$ many edges\nwhich contains only $2n-7$ many edge disjoint triangles: if $n=2r+4$ then $G$ is the complete\ntripartite graph on $[r]\\times [r]\\times [4]$, with a $K_4$ on the $[4]$ vertices also.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_1009.variants.sauer : ∀ r : ℕ, 1 ≤ r → ∃ G : SimpleGraph (Fin (2 * r + 4)),\n    G.edgeSet.ncard = (2 * r + 4) ^ 2 / 4 + 2 * (2 * r + 4) - 6 ∧\n      ∀ T : Finset (Finset (Fin (2 * r + 4))), (∀ t ∈ T, G.IsNClique 3 t) →\n        (T : Set (Finset (Fin (2 * r + 4)))).Pairwise (fun s t => (s ∩ t).card ≤ 1) →\n          T.card ≤ 2 * (2 * r + 4) - 7 := by\n  sorry\n\nend Erdos1009\n",
  "statement_hash": "89e4bbe29ffd84946644de62531fdb2306991bbacb7e4fdef095c9dd7850f039",
  "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."
}