{
  "id": "3230",
  "ident": "NS.03230",
  "slug": "erdos-794",
  "title": "Erdős Problem 794",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Is it true that every $3$-uniform hypergraph on $3n$ vertices with at least $n^3+1$ edges must\ncontain either a subgraph on $4$ vertices with $3$ edges or a subgraph on $5$ vertices with $7$\nedges?\n\nHarris has provided the following simple counterexample to the problem as stated: the\n$3$-uniform graph on $\\{1,\\ldots,9\\}$ with $28$ edges, formed by taking $27$ edges by choosing\none element each from $\\{1,2,3\\},\\{4,5,6\\},\\{7,8,9\\}$, and then adding the edge $\\{1,2,3\\}$.",
  "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": "Erdos794.erdos_794",
  "statement_lean": "theorem erdos_794 :\n    ¬ ∀ n : ℕ, ∀ H : Finset (Finset (Fin (3 * n))), H.IsUniform 3 →\n      n ^ 3 + 1 ≤ H.card → H.ContainsSubgraph 4 3 ∨ H.ContainsSubgraph 5 7",
  "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 794\n\n*References:*\n- [erdosproblems.com/794](https://www.erdosproblems.com/794)\n- [Er69] Erdős, Paul, *Some applications of graph theory to number theory*. The Many Facets of\n  Graph Theory (Proc. Conf., Western Mich. Univ., Kalamazoo, Mich., 1968) (1969), 77-82.\n- [FrFu84] Frankl, P. and Füredi, Z., *An exact result for $3$-graphs*. Discrete Math. (1984),\n  323-328.\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos794\n\n/-- The `3`-uniform hypergraph on `Fin 9` given by Harris: the `27` triples containing exactly\none vertex from each of the three parts `{0, 1, 2}`, `{3, 4, 5}`, `{6, 7, 8}`, together with the\ntriple `{0, 1, 2}`. A triple is a transversal of the three parts exactly when the three values\nof `v ↦ v / 3` it produces are distinct. -/\ndef harrisHypergraph : Finset (Finset (Fin 9)) :=\n  insert {0, 1, 2}\n    (Finset.filter\n      (fun e : Finset (Fin 9) =>\n        (Finset.image (fun v : Fin 9 => (v : ℕ) / 3) e).card = 3)\n      (Finset.powersetCard 3 Finset.univ))\n\nset_option linter.style.formal_proof_palomar false in\n/--\nIs it true that every $3$-uniform hypergraph on $3n$ vertices with at least $n^3+1$ edges must\ncontain either a subgraph on $4$ vertices with $3$ edges or a subgraph on $5$ vertices with $7$\nedges?\n\nHarris has provided the following simple counterexample to the problem as stated: the\n$3$-uniform graph on $\\{1,\\ldots,9\\}$ with $28$ edges, formed by taking $27$ edges by choosing\none element each from $\\{1,2,3\\},\\{4,5,6\\},\\{7,8,9\\}$, and then adding the edge $\\{1,2,3\\}$.\n-/\n@[category research solved, question, AMS 5, formal_proof using lean4 at \"https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos794.lean\"]\ntheorem erdos_794 :\n    ¬ ∀ n : ℕ, ∀ H : Finset (Finset (Fin (3 * n))), H.IsUniform 3 →\n      n ^ 3 + 1 ≤ H.card → H.ContainsSubgraph 4 3 ∨ H.ContainsSubgraph 5 7 := by\n  sorry\n\n/--\nBalogh has observed that this problem is probably misstated by Erdős - indeed, every graph with\n$5$ vertices spanning $7$ edges contains a graph on $4$ vertices spanning $3$ edges, so the\nsecond condition can be dropped.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_794.variants.balogh {V : Type*} [DecidableEq V] (H : Finset (Finset V))\n    (hH : H.IsUniform 3) (h : H.ContainsSubgraph 5 7) : H.ContainsSubgraph 4 3 := by\n  obtain ⟨S, hS, hk⟩ := h\n  by_contra hcon\n  simp only [Finset.ContainsSubgraph, not_exists, not_and, not_le] at hcon\n  -- Each of the five `4`-subsets of `S` spans at most `2` edges.\n  have hub : ∑ T ∈ S.powersetCard 4, (H.filter (· ⊆ T)).card ≤ 10 := by\n    calc ∑ T ∈ S.powersetCard 4, (H.filter (· ⊆ T)).card ≤ ∑ T ∈ S.powersetCard 4, 2 :=\n          Finset.sum_le_sum fun T hT => by\n            have := hcon T (Finset.mem_powersetCard.1 hT).2\n            omega\n      _ = 10 := by simp [Finset.card_powersetCard, hS]\n  -- Each edge inside `S` lies in two of the `4`-subsets of `S`, so the double count is at\n  -- least `2 * 7`.\n  have hlb : 2 * (H.filter (· ⊆ S)).card ≤ ∑ T ∈ S.powersetCard 4, (H.filter (· ⊆ T)).card := by\n    calc 2 * (H.filter (· ⊆ S)).card = ∑ e ∈ H.filter (· ⊆ S), 2 := by simp [mul_comm]\n      _ ≤ ∑ e ∈ H.filter (· ⊆ S), ((S.powersetCard 4).filter (e ⊆ ·)).card := by\n          refine Finset.sum_le_sum fun e he => ?_\n          obtain ⟨heH, heS⟩ := Finset.mem_filter.1 he\n          have he3 := hH e heH\n          rw [show 4 = e.card + 1 by omega, Finset.card_filter_subset_powersetCard_card_add_one heS]\n          omega\n      _ = ∑ T ∈ S.powersetCard 4, (H.filter (· ⊆ T)).card := by\n          simp only [Finset.card_filter]\n          rw [Finset.sum_comm]\n          refine Finset.sum_congr rfl fun T hT => ?_\n          rw [Finset.sum_filter]\n          refine Finset.sum_congr rfl fun e _ => ?_\n          by_cases heT : e ⊆ T\n          · simp [heT, heT.trans (Finset.mem_powersetCard.1 hT).1]\n          · simp [heT]\n  omega\n\n/--\nHarris has provided the following simple counterexample to the problem as stated: the\n$3$-uniform graph on $\\{1,\\ldots,9\\}$ with $28$ edges, formed by taking $27$ edges by choosing\none element each from $\\{1,2,3\\},\\{4,5,6\\},\\{7,8,9\\}$, and then adding the edge $\\{1,2,3\\}$.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_794.variants.harris :\n    harrisHypergraph.IsUniform 3 ∧ harrisHypergraph.card = 28 ∧\n      ¬ harrisHypergraph.ContainsSubgraph 4 3 ∧ ¬ harrisHypergraph.ContainsSubgraph 5 7 := by\n  unfold Finset.IsUniform Finset.ContainsSubgraph\n  decide +kernel\n\n/--\nThis problem is then now asking how many edges a $3$-uniform hypergraph can have before it\ncontains $K_4$ minus an edge, and whether the critical edge density is $2/9$. In fact there is a\nconstruction of Frankl and Füredi [FrFu84] showing it must be at least $2/7$, which is the\nconjectured truth (although Turán conjectured before [Er69] that the edge density was $1/4$, and\nso likely there is simply a typo in this problem's statement).\n-/\n@[category research solved, AMS 5]\ntheorem erdos_794.variants.frankl_furedi (ε : ℝ) (hε : 0 < ε) :\n    ∀ᶠ n : ℕ in atTop, ∃ H : Finset (Finset (Fin n)), H.IsUniform 3 ∧\n      ¬ H.ContainsSubgraph 4 3 ∧ (2 / 7 - ε) * (n.choose 3 : ℝ) ≤ (H.card : ℝ) := by\n  sorry\n\nend Erdos794\n",
  "statement_hash": "f73646f2317febe74d02a9f4e9add7f8854ee19e68a8977c9e17e03bad20138a",
  "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."
}