The areas / V30. Combinatorics
Mathlib.Combinatorics.SimpleGraph.Extremal.Turan
41 declarations and 3 deprecated aliases. Mathlib docs · Source
Turán's theorem
In this file we prove Turán's theorem, the first important result of extremal graph theory,
which states that the r + 1-cliquefree graph on n vertices with the most edges is the complete
r-partite graph with part sizes as equal as possible (turanGraph n r).
The forward direction of the proof performs "Zykov symmetrisation", which first shows constructively that non-adjacency is an equivalence relation in a maximal graph, so it must be complete multipartite with the parts being the equivalence classes. Then basic manipulations show that the graph is isomorphic to the Turán graph for the given parameters.
For the reverse direction we first show that a Turán-maximal graph exists, then transfer
the property through turanGraph n r using the isomorphism provided by the forward direction.
Main declarations
SimpleGraph.IsTuranMaximal:G.IsTuranMaximal rmeans thatGhas the most number of edges for its number of vertices while still beingr + 1-cliquefree.SimpleGraph.turanGraph n r: The canonicalr + 1-cliquefree Turán graph onnvertices.SimpleGraph.IsTuranMaximal.finpartition: The result of Zykov symmetrisation, a finpartition of the vertices such that two vertices are in the same part iff they are non-adjacent.SimpleGraph.IsTuranMaximal.nonempty_iso_turanGraph: The forward direction, an isomorphism betweenGsatisfyingG.IsTuranMaximal randturanGraph n r.isTuranMaximal_of_iso: the reverse direction,G.IsTuranMaximal rgiven the isomorphism.isTuranMaximal_iff_nonempty_iso_turanGraph: Turán's theorem in full.
References
- https://en.wikipedia.org/wiki/Turán%27s_theorem
Number of edges in the Turán graph
theorem SimpleGraph.IsTuranMaximal.congr_simp E1 #
∀ {V : Type u_1} [inst : Fintype V] (G G_1 : SimpleGraph V),
G = G_1 →
∀ {inst_1 : DecidableRel G.Adj} [inst_2 : DecidableRel G_1.Adj] (r r_1 : ℕ),
r = r_1 → G.IsTuranMaximal r = G_1.IsTuranMaximal r_1
theorem SimpleGraph.IsTuranMaximal.finpartition.congr_simp E1 #
∀ {V : Type u_1} [inst : Fintype V] {G G_1 : SimpleGraph V} (e_G : G = G_1) {inst_1 : DecidableRel G.Adj}
[inst_2 : DecidableRel G_1.Adj] {r r_1 : ℕ} (e_r : r = r_1) (h : G.IsTuranMaximal r) [inst_3 : DecidableEq V],
h.finpartition = ⋯.finpartition
theorem SimpleGraph.IsExtremal.congr_simp E1 #
∀ {V : Type u_1} [inst : Fintype V] (G G_1 : SimpleGraph V),
G = G_1 →
∀ {inst_1 : DecidableRel G.Adj} [inst_2 : DecidableRel G_1.Adj] (p p_1 : SimpleGraph V → Prop),
p = p_1 → G.IsExtremal p = G_1.IsExtremal p_1
def SimpleGraph.IsTuranMaximal E3 #
{V : Type u_1} → [Fintype V] → (G : SimpleGraph V) → [DecidableRel G.Adj] → ℕ → Prop
An r + 1-cliquefree graph is r-Turán-maximal if any other r + 1-cliquefree graph on
the same vertex set has the same or fewer number of edges.
def SimpleGraph.turanGraph E1 #
(n : ℕ) → ℕ → SimpleGraph (Fin n)
The canonical r + 1-cliquefree Turán graph on n vertices.
theorem SimpleGraph.turanGraph_adj E1 #
∀ {n r : ℕ} {v w : Fin n}, (SimpleGraph.turanGraph n r).Adj v w ↔ ↑v % r ≠ ↑w % r
instance SimpleGraph.instDecidableRelFinAdjTuranGraph E0 #
{n r : ℕ} → DecidableRel (SimpleGraph.turanGraph n r).Adj
theorem SimpleGraph.turanGraph_zero E0 #
∀ {n : ℕ}, SimpleGraph.turanGraph n 0 = ⊤
theorem SimpleGraph.turanGraph_one E0 #
∀ {n : ℕ}, SimpleGraph.turanGraph n 1 = ⊥
theorem SimpleGraph.turanGraph_eq_top E0 #
∀ {n r : ℕ}, SimpleGraph.turanGraph n r = ⊤ ↔ r = 0 ∨ n ≤ r
theorem SimpleGraph.turanGraph_cliqueFree E1 #
∀ {n r : ℕ}, 0 < r → (SimpleGraph.turanGraph n r).CliqueFree (r + 1)
theorem SimpleGraph.not_cliqueFree_of_isTuranMaximal E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ},
r ≤ Fintype.card V → G.IsTuranMaximal r → ¬G.CliqueFree r
An r + 1-cliquefree Turán-maximal graph is not r-cliquefree
if it can accommodate such a clique.
theorem SimpleGraph.exists_isTuranMaximal E1 #
∀ {V : Type u_1} [inst : Fintype V] {r : ℕ}, 0 < r → ∃ H x, H.IsTuranMaximal r
theorem SimpleGraph.IsTuranMaximal.degree_eq_of_not_adj E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ} {s t : V},
G.IsTuranMaximal r → ¬G.Adj s t → G.degree s = G.degree t
In a Turán-maximal graph, non-adjacent vertices have the same degree.
theorem SimpleGraph.IsTuranMaximal.not_adj_trans E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ} {s t u : V},
G.IsTuranMaximal r → ¬G.Adj t s → ¬G.Adj s u → ¬G.Adj t u
In a Turán-maximal graph, non-adjacency is transitive.
theorem SimpleGraph.IsTuranMaximal.equivalence_not_adj E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ},
G.IsTuranMaximal r → Equivalence fun x1 x2 ↦ ¬G.Adj x1 x2
In a Turán-maximal graph, non-adjacency is an equivalence relation.
def SimpleGraph.IsTuranMaximal.setoid E1 #
{V : Type u_1} →
[inst : Fintype V] → {G : SimpleGraph V} → [inst_1 : DecidableRel G.Adj] → {r : ℕ} → G.IsTuranMaximal r → Setoid V
The non-adjacency setoid over the vertices of a Turán-maximal graph
induced by equivalence_not_adj.
instance SimpleGraph.IsTuranMaximal.instDecidableRelR E0 #
{V : Type u_1} →
[inst : Fintype V] →
{G : SimpleGraph V} → [inst_1 : DecidableRel G.Adj] → {r : ℕ} → (h : G.IsTuranMaximal r) → DecidableRel ⇑h.setoid
def SimpleGraph.IsTuranMaximal.finpartition E3 #
{V : Type u_1} →
[inst : Fintype V] →
{G : SimpleGraph V} →
[inst_1 : DecidableRel G.Adj] → {r : ℕ} → G.IsTuranMaximal r → [inst_2 : DecidableEq V] → Finpartition Finset.univ
The finpartition derived from h.setoid.
theorem SimpleGraph.IsTuranMaximal.not_adj_iff_part_eq E0 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ} {s t : V}
(h : G.IsTuranMaximal r) [inst_2 : DecidableEq V], ¬G.Adj s t ↔ h.finpartition.part s = h.finpartition.part t
theorem SimpleGraph.IsTuranMaximal.degree_eq_card_sub_part_card E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ} {s : V}
(h : G.IsTuranMaximal r) [inst_2 : DecidableEq V], G.degree s = Fintype.card V - (h.finpartition.part s).card
theorem SimpleGraph.IsTuranMaximal.isEquipartition E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ} (h : G.IsTuranMaximal r)
[inst_2 : DecidableEq V], h.finpartition.IsEquipartition
The parts of a Turán-maximal graph form an equipartition.
theorem SimpleGraph.IsTuranMaximal.card_parts_le E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ} (h : G.IsTuranMaximal r)
[inst_2 : DecidableEq V], h.finpartition.parts.card ≤ r
theorem SimpleGraph.IsTuranMaximal.card_parts E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ} (h : G.IsTuranMaximal r)
[inst_2 : DecidableEq V], h.finpartition.parts.card = min (Fintype.card V) r
There are min n r parts in a graph on n vertices satisfying G.IsTuranMaximal r.
min handles the n < r case, when G is complete but still r + 1-cliquefree
for having insufficiently many vertices.
theorem SimpleGraph.IsTuranMaximal.nonempty_iso_turanGraph E3 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ},
G.IsTuranMaximal r → Nonempty (G ≃g SimpleGraph.turanGraph (Fintype.card V) r)
Turán's theorem, forward direction.
Any r + 1-cliquefree Turán-maximal graph on n vertices is isomorphic to turanGraph n r.
theorem SimpleGraph.isTuranMaximal_of_iso E3 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {n r : ℕ}
(f : G ≃g SimpleGraph.turanGraph n r), 0 < r → G.IsTuranMaximal r
Turán's theorem, reverse direction.
Any graph isomorphic to turanGraph n r is itself Turán-maximal if 0 < r.
theorem SimpleGraph.IsTuranMaximal.iso E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ} {W : Type u_2}
[inst_2 : Fintype W] {H : SimpleGraph W} [inst_3 : DecidableRel H.Adj],
G.IsTuranMaximal r → ∀ (f : G ≃g H), 0 < r → H.IsTuranMaximal r
Turán-maximality with 0 < r transfers across graph isomorphisms.
theorem SimpleGraph.isTuranMaximal_turanGraph E1 #
∀ {n r : ℕ}, 0 < r → (SimpleGraph.turanGraph n r).IsTuranMaximal r
For 0 < r, turanGraph n r is Turán-maximal.
theorem SimpleGraph.isTuranMaximal_iff_nonempty_iso_turanGraph E3 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ},
0 < r → (G.IsTuranMaximal r ↔ Nonempty (G ≃g SimpleGraph.turanGraph (Fintype.card V) r))
Turán's theorem. turanGraph n r is, up to isomorphism, the unique
r + 1-cliquefree Turán-maximal graph on n vertices.
theorem SimpleGraph.isExtremal_top_free_iff_isTuranMaximal E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {α : Type u_2}
[inst_2 : Fintype α] [Nontrivial α], G.IsExtremal ⊤.Free ↔ G.IsTuranMaximal (Fintype.card α - 1)
theorem SimpleGraph.isExtremal_top_free_turanGraph E1 #
∀ {n : ℕ} {α : Type u_2} [inst : Fintype α] [Nontrivial α],
(SimpleGraph.turanGraph n (Fintype.card α - 1)).IsExtremal ⊤.Free
theorem SimpleGraph.extremalNumber_top E1 #
∀ {n : ℕ} {α : Type u_2} [inst : Fintype α] [Nontrivial α],
SimpleGraph.extremalNumber n ⊤ = (SimpleGraph.turanGraph n (Fintype.card α - 1)).edgeFinset.card
The extremal numbers of ⊤ are equal to the number of edges in turanGraph.
theorem SimpleGraph.card_edgeFinset_eq_extremalNumber_top_iff_nonempty_iso_turanGraph E2 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {α : Type u_2}
[inst_2 : Fintype α] [Nontrivial α],
⊤.Free G ∧ G.edgeFinset.card = SimpleGraph.extremalNumber (Fintype.card V) ⊤ ↔
Nonempty (G ≃g SimpleGraph.turanGraph (Fintype.card V) (Fintype.card α - 1))
The turanGraph is, up to isomorphism, the unique extremal graph forbidding ⊤.
This is Turán's theorem restated in terms of the extremal numbers of ⊤.
See SimpleGraph.isTuranMaximal_iff_nonempty_iso_turanGraph.
abbrev SimpleGraph.turanNumber E1 #
ℕ → ℕ → ℕ
The number of edges in turanGraph n r.
theorem SimpleGraph.turanNumber_add E1 #
∀ {n r : ℕ}, SimpleGraph.turanNumber (n + r) r = SimpleGraph.turanNumber n r + n * (r - 1) + r.choose 2
theorem SimpleGraph.turanNumber_eq E0 #
∀ {n r : ℕ}, SimpleGraph.turanNumber n r = (n ^ 2 - (n % r) ^ 2) * (r - 1) / (2 * r) + (n % r).choose 2
The exact formula for the number of edges in turanGraph n r.
theorem SimpleGraph.turanNumber_two E1 #
∀ {n : ℕ}, SimpleGraph.turanNumber n 2 = n ^ 2 / 4
theorem SimpleGraph.turanNumber_three E1 #
∀ {n : ℕ}, SimpleGraph.turanNumber n 3 = n ^ 2 / 3
theorem SimpleGraph.mul_turanNumber_le E1 #
∀ {n r : ℕ}, 2 * r * SimpleGraph.turanNumber n r ≤ (r - 1) * n ^ 2
A looser, but simpler than turanNumber_eq, bound on turanNumber n r.
theorem SimpleGraph.CliqueFree.card_edgeFinset_le E1 #
∀ {V : Type u_1} [inst : Fintype V] {G : SimpleGraph V} [inst_1 : DecidableRel G.Adj] {r : ℕ},
G.CliqueFree (r + 1) → G.edgeFinset.card ≤ SimpleGraph.turanNumber (Fintype.card V) r
theorem SimpleGraph.strictMonoOn_turanNumber E1 #
∀ {n : ℕ}, StrictMonoOn (SimpleGraph.turanNumber n) (Set.Icc 1 n)
Deprecated aliases
| Name | New name | Since |
|---|---|---|
SimpleGraph.card_edgeFinset_turanGraph | SimpleGraph.turanNumber_eq | 2026-07-25 |
SimpleGraph.card_edgeFinset_turanGraph_add | SimpleGraph.turanNumber_add | 2026-07-25 |
SimpleGraph.mul_card_edgeFinset_turanGraph_le | SimpleGraph.mul_turanNumber_le | 2026-07-25 |