Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 2 (Erdős–Gallai), p. 2 — a graph with no cycle longer than k has at most k(n−1)/2 edges (corrected)

Proved
EvenCycleTuran.EvenCount.theorem_2

by mikedeng1 · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

cycleserdos-gallaiextremal-graph-theoryp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let k≥2k\ge2k≥2 and let GGG be a graph on nnn vertices that contains no cycle of length greater than kkk. Then

∣E(G)∣≤k(n−1)2.|E(G)|\le\frac{k(n-1)}{2}.∣E(G)∣≤2k(n−1)​.

This is the Erdős–Gallai bound on the number of edges of a graph of circumference at most kkk. In the paper it is the input to Claim 1, applied to the edges inside and next to the neighbourhood of a vertex of a C2kC_{2k}C2k​-free graph.

Formalization Note The paper prints the bound as (k−1)n/2(k-1)n/2(k−1)n/2, which is false: two triangles sharing a vertex (k=3k=3k=3, n=5n=5n=5) have 6>56>56>5 edges. The statement here is the bound Erdős and Gallai proved; Claim 1 needs only ∣E∣≤(k−1)n|E|\le(k-1)n∣E∣≤(k−1)n for circumference 2k−22k-22k−2, which the corrected bound gives. The hypothesis k≥2k\ge2k≥2 is added: for k≤1k\le1k≤1 "no cycle longer than kkk" means a forest, which may have n−1>k(n−1)/2n-1>k(n-1)/2n−1>k(n−1)/2 edges. The bound is stated as 2∣E(G)∣≤k(n−1)2|E(G)|\le k(n-1)2∣E(G)∣≤k(n−1) in N\mathbb NN (at n=0n=0n=0 both sides are 000).

Preamble
import Mathlib
import Definitions.Def_EvenCycleTuran_EvenCount_Setting
Formal statement
namespace EvenCycleTuran.EvenCount
open Finset SimpleGraph

theorem theorem_2 (n k : ℕ) (hk : 2 ≤ k) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    (hG : ∀ a : ℕ, k < a → (cycleGraph a).Free G) :
    2 * #G.edgeFinset ≤ k * (n - 1) := by sorry

end EvenCycleTuran.EvenCount
Source
Gerbner, Győri, Methuku and Vizer, Generalized Turán problems for even cycles, arXiv:1712.07079v3, p. 2, Theorem 2 (Erdős, Gallai [10]); corrected bound k(n−1)/2 (the page prints (k−1)n/2)
Human review
  • Endorsed by Shuze Chen · Oct 9, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 9, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me