Szemerédi's regularity lemma
Define uniform density across large subsets, state a precise equitable partition theorem, and understand the bounded-energy refinement mechanism.
On this page
The question for today
What you’ll understand
- Test ε-regularity using the size thresholds for both witness subsets.
- State the regularity lemma with the correct order of quantifiers and an exceptional class.
- Explain why refining an irregular partition increases a bounded quadratic energy.
A large graph need not be random, but it can be organized into a bounded number of parts so that most pairs behave uniformly at a chosen resolution. This is the content of Szemerédi's regularity lemma. Uniformity here concerns densities of all sufficiently large subsets, not a visual impression or independent edges. We consider finite simple undirected graphs and disjoint nonempty vertex sets. The number of parts may be enormous, but its bound depends on the requested accuracy rather than the graph order.
Regularity is a test against every large subrectangle
For disjoint sets A and B, their pair density is the number of crossing edges divided by the product of their sizes. The pair is epsilon-regular if every pair of subsets A-prime and B-prime, each containing at least an epsilon fraction of its parent set, has density within epsilon of the original density. Both the threshold and the allowed error use the same parameter. Tiny exceptional subsets can behave differently without violating this definition.
A pair can have density one half and still fail regularity badly. Divide both sides into equal halves and put in all edges between corresponding halves, with no other crossing edges. The whole density is one half, but a corresponding-half pair has density one. For epsilon less than one half, these large witnesses expose the discrepancy. Thus a single pair-density number loses information that the regularity condition is designed to control. Regularity also does not require every individual vertex to have the average degree.
The partition theorem fixes accuracy before graph size
For every epsilon between zero and one and every positive integer m-zero, there are integers M and n-zero such that every graph with at least n-zero vertices admits a partition into an exceptional class V-zero and k ordinary classes. The ordinary classes have equal size, the exceptional class contains at most epsilon n vertices, and m-zero is at most k, which is at most M. At most epsilon k squared unordered pairs of distinct ordinary classes are irregular. This particular numerical convention counts unordered pairs, so the bound need not be an epsilon fraction of all such pairs.
The key quantifier is that M is chosen independently of the eventual graph order and its individual edges. A partition depending on the particular graph is allowed. There is no promise that its parts are independent sets or that all pairs are regular. To use the theorem for embedding a fixed pattern, one must choose epsilon small compared with the density threshold and the pattern's size before applying it. Choosing a coarse epsilon first and hoping every later counting lemma accepts it reverses the required dependence.
Why refinement cannot keep finding large defects forever
A partition has an energy obtained by averaging the squared densities of its block pairs, weighted by their relative sizes. Refining a block replaces its density by a weighted average of finer densities; convexity says the weighted square average cannot decrease. An irregular pair provides witness subsets with a definite density discrepancy, and splitting along those witnesses produces a definite energy gain. If sufficiently many pairs are irregular, the total gain is bounded below by a positive function of epsilon.
Energy stays between zero and one, so only boundedly many substantial increments are possible. Refining simultaneously for many witnesses can multiply the number of parts dramatically; equalizing the part sizes and managing exceptional vertices require additional bookkeeping. This is the proof mechanism, not a complete proof of the lemma. It explains both the independence from n and why the theoretical partition bound is too large for many direct numerical applications. More efficient weak-regularity variants give different guarantees and should not be substituted without checking the counting task.
Work it through
A visible witness and its energy increment
Let A and B each have four vertices, split into equal halves A₁,A₂ and B₁,B₂. Include exactly all edges between A₁,B₁ and between A₂,B₂. Test ε=1/4 regularity and compare coarse and refined pair energies.
Each complete half-pair contributes four edges, for eight crossing edges among sixteen possible pairs. The coarse density is 1/2, so its squared-density energy is 1/4.
Choose A′=A₁ and B′=B₁. Both contain two vertices, exceeding the required one-vertex threshold, while their density is 1. The discrepancy 1/2 exceeds ε=1/4.
The four refined block densities are 1,0,0,1 with equal weights 1/4. Their weighted squared average is 1/2, an increase of 1/4 over the coarse energy.
The pair is not 1/4-regular. Refining by its witness exposes a positive energy increment, exactly as the proof mechanism requires.
The living notebook
Explore the model
Interactive lab · probability
A random-degree benchmark does not certify regularity
Pause, reset, then set probability p=0.5 and trials n=10. Predict mean five and variance 2.5 for the number of neighbors among ten independently connected candidates. Compare the exact binomial bars. This benchmark allows degree variation even in a random model; it does not test all large subsets or certify ε-regularity of a deterministic pair.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forRegularity concerns uniform subset densities, which cannot be inferred from a mean degree or a single sampled degree distribution.
Pause & reason
Check your understanding
Your turn
Try it yourself
Show that a complete bipartite pair is ε-regular for every 0<ε<1, then explain why a balanced checkerboard pair is not 0.1-regular.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Compute every eligible subpair density in the complete case. In the checkerboard case, use the corresponding halves as witnesses.
Compare with the solution
Every nonempty subpair of a complete bipartite pair has density one, equal to its parent density, so the error is zero. A checkerboard pair has parent density one half, but corresponding halves each have half the vertices and density one. Their sizes exceed the 0.1 thresholds and their density error is 0.5, so the pair fails 0.1-regularity. The average density alone cannot distinguish these behaviors.
Keep the idea
Take it with you
- ε-regularity controls all subset pairs above specified relative-size thresholds.
- The partition bound depends on accuracy and a minimum part count, not on host order.
- Energy increment explains termination, while later counting determines the required parameter hierarchy.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.