Turán's theorem (the "Book" weighting proof) #
This file formalizes the weighting/optimization proof of Turán's theorem from
Proofs from THE BOOK. Starting from any vertex weight distribution on a
p-clique-free simple graph, the weight is concentrated onto a clique and then
equalized; the resulting bound on the total edge weight yields the classical
upper bound (1/2)(1 - 1/(p-1)) n² on the number of edges.
All declarations live in the Turan3 namespace.
Structure FunToMax : Represents weight distribution on the vertex set, all weights sum up to 1.
- w : α → NNReal
The weight assigned to each vertex.
The weights sum to one over all vertices.
Instances For
computes the total edge weight of the graph with respect to the weight function W
by summing vp W.w e over all edges
Equations
- W.fw = ∑ e ∈ G.edgeFinset, Turan3.vp W.w e
Instances For
Section 1: Concentrating weights on a clique #
Starting from any weight function W, we “improve” it without decreasing fw
until its support is a clique.
We have an better performing wegith distribution
Betterwith • zeros preserved • support size = m • Better.fw ≥ W.fwmfinds the minimal support size (forBetter) we can achieve without decreasing the total edge weightBetter.fw ≥ W.fw.We define the operation
Improvewhich moves all weight from one vertexlooseto anothergain(non adjacent). •Improve_total_weight_nondec: shoes the total valuefwis equal or greater •ImproveReducesSupportSize: support size strictly decreases underImproveBy minimality of
m,Better_forms_cliqueshows by contradiction that the final support forms a clique.
States that for any weight function W : FunToMax G, there exists a natural number m and a new
weight
function (better) such that:
- The support of the new weight function is included in that of
W(vertices with weight 0 remain 0 underbetter), - The number of vertices with positive weight is exactly
m(support size), and - The total edge weight of the new weight function is equal or greater than that of
W.
computes the smallest possible "m" satisfying the properties under exists_better_distribution for
a weight function W
Instances For
Guarantees that for a distribution W, an "improved" one (better) exists where :
- vertices with weight 0 remain 0,
- Support size (vertices with positive weight) is equal to
m(smallest possible "m" satisfyingexists_better_distributionfor a weight function `W) - Has non decreasing total weight (
fw) than the original distribution.
Returns an improved weight function under the conditions of exists_better_distribution_min_support
- vertices with weight 0 remain 0,
- Support size (vertices with positive weight) is equal to
m(minimal size) - Has non decreasing total weight (
fw) than the original distribution..
Equations
- Turan3.Better G W = Classical.choose ⋯
Instances For
Ensures that vertices with weght 0 remain 0 under Better
Ensures that the total edge weight computed by Better is equal or larger as that of W.
Constructs a new weight function by redistributing weight from one vertex (loose) to another (gain) (distinct vertices). The new function zeros out the weight at loose and adds it to gain (thus preserving the total weight).
Equations
Instances For
Helper lemma: Given that an edge e is part of gain's incidence set, this lemma proves that gain is in e.
Helper lemma : Calculates the value (vp) of an edge e, where gain is one of the vertices in e, as
the product of gain and the other vertex v, in e.
Helper lemma : Shows that the sum of values of the edges incident to gain is equal to the product of the weight of gain and the sum of the other vertices incident to gain.
Helper lemma : Shows that the sum of values of the edges incident to loose is equal to the product of the weight of loose and the sum of the other vertices incident to loose.
Helper lemma : States that the incidence set of any vertex is a subset of the entire edge set.
Helper lemma: shows that the weight function created by Improve W loose gain h_neq is equal to its
"lambda-if function"
Helper lemma: Shows that the weight at the vertex “loose” is 0 after Improve.
Helper lemma: Shows that the incidence sets of gain and loose are disjoint (Assuming they are not adjacent).
Using the same definition affectedEdges, translates the partition into an equality of Sums.
Shows that the toal edge weight is equal to
- The sum over the edges incident to gain
- The sum over the edges incident to loose
- The sum over the remaining edges (the ones in
G\affectedEdges)
Shows that after Improve the total edge value over the edges incident to gain increases exactly
by the weight of loose multiplied by the sum of the ("other") vertex weights incident to gain.
Shows that after Improve, the sum of edge
values over the incidence set of loose is zero.
Shows that the edges not incident to gain or loose (not in affectedEdges)
have the same weightw under the Improve operation
Assumption h mirrors the assumption s_1 ≤ s_2 in the informal proof.
This lemma shows that the total edge weight does not decrease under Improve, using the previous
lemmas:
Improve_partition_sum_split: splits the edge set into the sum of : edges incident to gain, edges incident to loose, the remaining edgesImprove_unchanged_edge_sum: shows all edges not incident to "loose" or "gain" remain unchanged.Improve_gain_contribution_increase: shows that gain’s contribution increases by the weight of loose times the other values incident to "gain"Improve_loose_contribution_zero: shows that loose’s new contribution is zero
Shows that if a vertex has weight 0 , then the weight remains 0 under the Improved function.
Using Improve_support_remains_zero, shows that the support under Improve is strictly smaller
than
that of the original weight function W
Proves that the support of Better is a clique. If two support vertices (gain,loose)
were non‑adjacent, shows wlog that loose has at least as large a neighbor‐sum as gain, then
applies Improve to move all the weight from loose to gain. By
Improve_total_weight_nondec:fwdoes not decrease, andImprove_support_strictly_reduced: the support strictly shrinks,
this contradicts the minimality of Better’s support size m.
Therefore no such non‑adjacent pair exists.
Section 2:
We aim to show that any non‑uniform weight distribution on a clique can be further improved by a small transfer:
Constructs a new weight function by moving a small amount of weight ε < W(loose) - W(gain) from
vertex loose to vertex gain
assuming W.w gain < W.w loose. It preservers the total weight improving the weight function
Equations
Instances For
Helper lemma: deduces that if gain and loose have different weights then gain and loose arent the same vertex
Shows that after applying Enhance, vertices that had weight 0, remain with the same weight 0
(Support is preserved).
Complement of Enhance_support_zero: shows that a vertex has positive weight in W if and only if it has positive weight in the Enhanced function (Support is preserved).
Proves that after applying Enhance the support still forms a clique
Helper definition: Defines that an edge (element of the structur Sym2 α) is "Supported" if both of its vertices have positive weight (according to a weight function W)
Instances For
Helper lemma: Shows that if an edge e is in support and x is part of e, then the weight of the other vertice in e is positive.
Helper lemma: Proves that if all vertices in an edge e have positives weights, then e is in the support.
Decidability of inSupport, used to filter edge finsets by it.
Equations
definition: Defines the subset of a vertex's incident set, that consists of supported edges
Equations
- Turan3.supIncidenceFinset G W v = Finset.filter (Turan3.inSupport G W) (G.incidenceFinset v)
Instances For
definition: Defines the subset of the whole edge set, where the edges are supported
Equations
- Turan3.supEdgeFinset G W = Finset.filter (Turan3.inSupport G W) G.edgeFinset
Instances For
Helper lemma: Explicitly characterizes the definition of supIncidenceFinset:
- edges are incident to the vertex
- edges are supported
Helper lemma: Explicitly caracterizes the definition of supEdgeFinset :
- edges are in the edge set of the graph
- edges are supported
Helper lemma: Shows that any edge part of an supported incident set of a vertex, is also part of whole incident set of v.
Helper lemma : extracts from the fact that an element a belongs to the set difference s \ t that a is indeed in s.
Shows that for a weight function W (and distinct loose and gain), the supported incidence sets of gain and loose (without the edge (gain,loose) are disjoint)
Using disjoint_supported_incidence defines the disjoint union of the supported incidence sets of
gain (without edge (gain,loose))
and that of loose (without edge (gain, loose)).
Equations
Instances For
shows that the set incidenceLooseGain is disjoint from the singleton s(loose, gain)
Extends incidenceLooseGain by taking its disjoint union with s(loose,gain) (using
disjoint_inci_singleton)
Equations
- Turan3.inciLooseGainFull G W loose gain h_neq = (Turan3.incidenceLooseGain G W loose gain h_neq).disjUnion {s(loose, gain)} ⋯
Instances For
Shows that if vertices in the support gain and loose are adjacent, then the supported edge set can
be
decomposed as a disjoint union of inciLooseGainFull and its complement
Helper lemma: Shows that the total edge value obtained by summing vp W.w e over the whole edge set is the same as the sum taken only over the supported edges, (those in supEdgeFinset).
Shows that the sum over the supported incidence set of gain (without s(loose,gain)) after
Enhance transformation, equals the original sum plus ε times the sum over the gain-attached
incident set
Helper: provides a bound: for any edge in the supported incidence set of loose (without
s(loose,gain)), the
product of ε and the weight of the "other" vertex is bounded by the edge's value
Shows that the sum over the supported incidence set of loose (without s(loose,gain)) after Enhance
transformation, equals
the original sum minus ε times the sum over the attached incident set of loose.
Provides a bijection between the supported incidence edges at loose (without s(loose, gain))
and the supported incidence edges at gain (without s(loose, gain)).
Equations
- Turan3.theBij G W loose gain h_lt ε epos elt hc h_supp e h = ⟨s(gain, Sym2.Mem.other ⋯), ⋯⟩
Instances For
For every element e in the incidence set of loose (excluding s(loose, gain)),
theBij maps e into the attached part of the incidence finset of gain.
Injetcitivy of theBij
Surjectivity of theBij
Shows that theBij preserves the "other" weight: for any edge from the supported incidence set of
loose, the weight
at the "other" vertex equals that in its image uneder the bijection
Uses theBij to show that the total sum of the weights, on the "other" vertices in the supported
incidence
set, is preserved when switching fom loose to gain
Shows that, for the edges in the graph's support outside the set
inciLooseGainFull, the total sum of edge values remains unchanged under Enhance.
Proves that after Enhance, the value of the edge connecting loose and gain
is strictly increased in comparisson to that under the original weight function.
States that the subset of supported edges in the Graph, remains the same subset under Enhance.
Combining previous lemmas, shows that the total edge weight increases or remains the same under
Enhance.
Notes:
sum_over_support: Assures that the total whole edge value of the Graph is the same as the total edge value of the edges in the supportEnhance_support_edges_same: assures the supported subset of edges is the same underEnhancesupported_edge_partition: Partitions the total edge contribution of the clique (and whole Graph) into:inciLooseGainFull(edged incident to loose, edges incident to gain and {gain,loose})inciLooseGainFull's complement
Now we show the change for each:
with
Enhance_sum_complement_unchangedwe show that edges in the support but not ininciLooseGainFullremain with unchanged weightswith
Enhance_gain_sum,Enhance_loose_sumthe lemma quantifies the gain from edges incident to gain and the loss from edges incident to loose, then withEnhance_sum_loose_gain_equal, since the support is a clique and there is a bijection between edged inci. to loose to edges incid. to gain, we show that the change is 0.with
Enhance_edge_gainloose_increasewe show that the only change comes from the edgegain-looseTherefore concluding thatEnhanceforms an strictly greater weight distribution
Section 3 : Equalizing weights on the clique
Given any weight function W whose support is a clique here we:
define
prove inequalities relating these to the average weight
1 / |support|:avg ≤ max,min ≤ avg,- strictly showing
min < max ↔ avg < maxandmin < avg
set
theEps := maxWeight − (1/|support|) > 0(whenmin < max), and define another improved weight functionEnhancedthat moves this definedεfromargmaxtoargmin.show
Enhancedpreserves total weight, support, and clique structure AND strictly increases the number of vertices with weight exactly1/|support|Shows
UniformBetterhas constant support
Helper lemma Shows that the support of a weight distribution is nonempty
There exists an improved weight function with: weights that were 0 remain 0 (support included) support forms a clique an has exactly m vertices with 1/m weight each, and that the total edge weight does not decrease.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Using existsUniformClique, computes the largest number m for which there exists a weight
function (with support contained in that of W)
whose support forms a clique, has improved total edge weight, and has exactly m vertices
with weight 1/k (support size).
Equations
- Turan3.maxUniformSupport G W = Nat.findGreatest (Turan3.existsUniformClique G W) {i : α | W.w i > 0}.card
Instances For
Provides the specification for the Nat.findGreates in maxUniformSupport. Shows that for any
weight function whose support forms a clique
There is an improved weight function (with the specified support and uniform weights) with non
decreaseing total edge weight value
having exactly m vertices with 1/m support size
UniformBetter gives a new weight function (via exists_best_uniform) with the same support, clique structure, and improved edge weight. In later lemmas (UniformBetter_constant_support), we prove that this distribution is in fact uniform on the support.
Equations
- Turan3.UniformBetter G W hW = Classical.choose ⋯
Instances For
zeros preserved : Ensures if a vertex is zero in W if and only if it is zero in UniformBetter W
States that the number of vertices with weight 1/m (m being support size) in UniformBetter W is
exactly m
States that the total edge weight of UniformBetter is equal or greater than that of W
Confirms that the support of UniformBetter forms a clique in the Graph
Assures the support of a weight function is non empty
Defines the maximun weight value among vertices
Equations
- Turan3.FunToMax.maxWeight G W = (Finset.image W.w {i : α | W.w i > 0}).max' ⋯
Instances For
Chooses a vertex attaining the maximun weight (later used as the loose vertex)
Equations
Instances For
Proves that the chosen argmax vertex lies in the support (has positive weight)
Confirms that the weigth of the chosen argmax vertex equals the maximun weight.
Defines the min. weight among vertices with positive weight
Equations
- Turan3.FunToMax.minWeight G W = (Finset.image W.w {i : α | W.w i > 0}).min' ⋯
Instances For
Chooses a vertex attaining the min weight (later used as the gain vertex)
Equations
Instances For
Proves that the chosen argmin vertex lies in the support.
Confirms that the weight of the chosen argmin vertex equals the min. weight.
Shows that every vertex's weight is at most the maximun weight
Using the lemma above, assures that minimum weight is at most the maximum weight
Proves that the sum of weights on the support is exactly 1
Shows that if the minimun weight is strictily less that the maximum weight, then the sum of weights over the support is strictly less than the support size times the maximun weight
Shows that if the minimun weight is strictily less that the maximum weight, then the sum over the support is strictly greater than the support size times the minimum weight
Shows that if the minimun weight is strictily less that the maximum weight, then the maximum weight is strictly greater than (1/|support|)
Shows that if the minimun weight is strictily less than the maximum weight, then the minimum weight is strictly less than (1/|support|)
sanity check : Show that if the min. and max. weight are equal, then every vertex in the support hast weight 1/|support|.
Defines ε (theEps) as the difference between maximum weight and the average weight 1/|support|
Equations
- Turan3.theEps G W = Turan3.FunToMax.maxWeight G W - 1 / ↑{i : α | W.w i > 0}.card
Instances For
Shows that ε is positive if the min. and max. weight are distinct
Shows that ε is less than the difference between the weights between argmax argmin vertices
Helper lemma: confirms if the weight at the argmin is less than that in argmax vertex, then the minimum weight is strictly less than the maximum weight
Defines Enhanced weight function : transfering weight from the argmax vertex loose to the argmin
vertex gain, using the previous in Section 2 defined function Enhance by the amount
defined the_.
Equations
- Turan3.Enhanced G W h_con = Turan3.Enhance G W (Turan3.FunToMax.argmax G W) (Turan3.FunToMax.argmin G W) h_con (Turan3.theEps G W) ⋯ ⋯
Instances For
Shows that under Enhanced every vertex that originally had weight 1/|support|, remains with the
same weight
Proves that under the Enhanced weight function, the weight of the argmax vertex becomes 1/|support|
Shows that the number of vertices with weight equal to 1/|support| increases after Enhanced
Helper lemma: Relates the support of the UniformBetter weight distribution to that of the original
weight function W. That
is having W, whose support forms a clique, UniformBetter support also forms a clique
Helper lemma: Shows that if two vertices in the support of W are distinct then they are adjacent (since they are in a clique). Proves that the support forms a clique
Shows that under the UniformBetter distribution, every vertex in the support has an equal weight
of 1/|support|.
Shows that after UniformBetter every supported edge has value equal to
the square of the uniform weight.
Computes the number of edges in a k clique
Defines the uniform vertex weight function that asisngs all vertices the same weight 1 /|V|
Equations
- Turan3.UnivFun G = { w := fun (x : α) => 1 / ↑Finset.univ.card, h_w := ⋯ }
Instances For
Computes the total edge weight of the un weight function. Shows that the total edge weight is equal to the number of edges times the square of the uniform vertex weight.
Turán's theorem on a nonempty vertex set: for p ≥ 2 and G a p-clique-free graph, the desired upper bound on the number of edges holds.
The final theorem. Let p ≥ 2, and G be a p-Clique free Graph then we find the desired upper bound on the number of edges. The empty graph is covered: both sides vanish.