{
  "id": "2688",
  "ident": "NS.02688",
  "slug": "erdos-642",
  "title": "Erdős Problem 642",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $f(n)$ be the maximal number of edges in a graph on $n$ vertices such that all cycles have more\nvertices than chords. Is it true that $f(n)\\ll n$?\n\nA problem of Hamburger and Szegedy. A chord is an edge between two vertices of the cycle which are\nnot consecutive in the cycle.",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos642.erdos_642",
  "statement_lean": "theorem erdos_642 :\n    (fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ))",
  "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 642\n\n*References:*\n- [erdosproblems.com/642](https://www.erdosproblems.com/642)\n- [CES96] Chen, Guantao and Erdős, Paul and Staton, William, *Proof of a conjecture of Bollobás\n  on nested cycles*. J. Combin. Theory Ser. B (1996), 38--43.\n- [DMMS24] Draganić, Nemanja and Methuku, Abhishek and Munhá Correia, David and Sudakov,\n  Benny, *Cycles with many chords*. Random Structures Algorithms (2024), 3--16.\n- [Er97d] Erdős, Paul, *Some recent problems and results in graph theory*. Discrete Math.\n  (1997), 81-85.\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos642\n\n/-- Every cycle of the graph `G` has more vertices than chords.\n\nA cycle is a closed walk `c` with `c.IsCycle`. It has `c.length` vertices. A chord of `c` is an\nedge of `G` between two vertices of `c` that is not an edge of `c`\n(`SimpleGraph.Walk.IsChord`). -/\ndef CyclesHaveMoreVerticesThanChords {V : Type*} (G : SimpleGraph V) : Prop :=\n  ∀ (v : V) (c : G.Walk v v), c.IsCycle → {e : Sym2 V | c.IsChord e}.ncard < c.length\n\nopen scoped Classical in\n/-- The maximal number $f(n)$ of edges of a graph on `n` vertices in which every cycle has more\nvertices than chords. There are finitely many graphs on `Fin n`, so the supremum is a maximum. -/\nnoncomputable def maxEdges (n : ℕ) : ℕ :=\n  (Finset.univ.filter fun G : SimpleGraph (Fin n) => CyclesHaveMoreVerticesThanChords G).sup\n    fun G => G.edgeSet.ncard\n\n/--\nLet $f(n)$ be the maximal number of edges in a graph on $n$ vertices such that all cycles have more\nvertices than chords. Is it true that $f(n)\\ll n$?\n\nA problem of Hamburger and Szegedy. A chord is an edge between two vertices of the cycle which are\nnot consecutive in the cycle.\n-/\n@[category research open, question, AMS 5]\ntheorem erdos_642 :\n    (fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ)) := by\n  sorry\n\n/-- Chen, Erdős, and Staton [CES96] proved $f(n) \\ll n^{3/2}$. -/\n@[category research solved, AMS 5]\ntheorem erdos_642.variants.upper_bound_n_pow_three_halves :\n    (fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ) ^ (3 / 2 : ℝ)) := by\n  sorry\n\n/--\nDraganić, Methuku, Munhá Correia, and Sudakov [DMMS24] have improved this to\n$$f(n) \\ll n(\\log n)^8.$$\n-/\n@[category research solved, AMS 5]\ntheorem erdos_642.variants.upper_bound_n_log_pow_eight :\n    (fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ) * Real.log n ^ 8) := by\n  sorry\n\n/-- A graph without cycles satisfies the condition, since there is no cycle to check. -/\n@[category test, AMS 5]\ntheorem cyclesHaveMoreVerticesThanChords_of_isAcyclic {V : Type*} {G : SimpleGraph V}\n    (hG : G.IsAcyclic) : CyclesHaveMoreVerticesThanChords G :=\n  fun _ c hc => absurd hc (hG c)\n\nopen scoped Classical in\n/-- Every graph on `n` vertices in which every cycle has more vertices than chords has at most\n`maxEdges n` edges. -/\n@[category API, AMS 5]\ntheorem le_maxEdges {n : ℕ} (G : SimpleGraph (Fin n))\n    (hG : CyclesHaveMoreVerticesThanChords G) : G.edgeSet.ncard ≤ maxEdges n := by\n  unfold maxEdges\n  exact Finset.le_sup (f := fun H : SimpleGraph (Fin n) => H.edgeSet.ncard)\n    (Finset.mem_filter.2 ⟨Finset.mem_univ G, hG⟩)\n\n/-- The maximum defining $f(n)$ is attained by an admissible graph. -/\n@[category API, AMS 5]\ntheorem exists_maxEdges (n : ℕ) :\n    ∃ G : SimpleGraph (Fin n), CyclesHaveMoreVerticesThanChords G ∧\n      G.edgeSet.ncard = maxEdges n := by\n  classical\n  have hne : (Finset.univ.filter fun G : SimpleGraph (Fin n) =>\n      CyclesHaveMoreVerticesThanChords G).Nonempty := by\n    refine ⟨⊥, Finset.mem_filter.2 ⟨Finset.mem_univ _, ?_⟩⟩\n    exact cyclesHaveMoreVerticesThanChords_of_isAcyclic SimpleGraph.isAcyclic_bot\n  obtain ⟨G, hG, hmax⟩ := Finset.exists_mem_eq_sup _ hne (fun G => G.edgeSet.ncard)\n  exact ⟨G, (Finset.mem_filter.1 hG).2, hmax.symm⟩\n\n/-- The elementary bound $f(n)\\leq\\binom n2$. -/\n@[category API, AMS 5]\ntheorem maxEdges_le_choose_two (n : ℕ) : maxEdges n ≤ n.choose 2 := by\n  classical\n  obtain ⟨G, _, hG⟩ := exists_maxEdges n\n  rw [← hG]\n  simpa only [SimpleGraph.edgeFinset, Set.ncard_eq_toFinset_card', Fintype.card_fin] using\n    G.card_edgeFinset_le_card_choose_two\n\n/-- There are no edges on an empty vertex set. -/\n@[category test, AMS 5]\ntheorem maxEdges_zero : maxEdges 0 = 0 := by\n  have := maxEdges_le_choose_two 0\n  simpa using this\n\n/-- The asymptotic question is equivalent to a uniform linear edge bound for every admissible\nfinite graph, including the empty graph. -/\n@[category API, AMS 5]\ntheorem isBigO_iff_uniform_edge_bound :\n    ((fun n : ℕ => (maxEdges n : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ))) ↔\n      ∃ C : ℝ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)),\n        CyclesHaveMoreVerticesThanChords G → (G.edgeSet.ncard : ℝ) ≤ C * n := by\n  have hzero : ∀ n : ℕ, (n : ℝ) = 0 → (maxEdges n : ℝ) = 0 := by\n    intro n hn\n    have : n = 0 := by exact_mod_cast hn\n    simp [this, maxEdges_zero]\n  rw [Asymptotics.isBigO_nat_atTop_iff hzero]\n  simp only [Real.norm_natCast]\n  constructor\n  · rintro ⟨C, hC⟩\n    refine ⟨C, fun n G hG => ?_⟩\n    exact (Nat.cast_le.2 (le_maxEdges G hG)).trans (hC n)\n  · rintro ⟨C, hC⟩\n    refine ⟨C, fun n => ?_⟩\n    obtain ⟨G, hG, hmax⟩ := exists_maxEdges n\n    simpa [hmax] using hC n G hG\n\nend Erdos642\n",
  "statement_hash": "7e567c390a1d548c5e7a39ee9abe50351ccc342531b1fba4dd1eeef5def41e20",
  "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."
}