Szemerédi regularity lemma

In extremal graph theory, Szemerédi’s regularity lemma states that a graph can be partitioned into a bounded number of parts so that the edges between parts are regular. The lemma shows that certain properties of random graphs can be applied to dense graphs like counting the copies of a given subgraph within graphs. Endre Szemerédi proved the lemma over bipartite graphs for his theorem on arithmetic progressions in 1975 and for general graphs in 1978. Variants of the lemma use different notions of regularity and apply to other mathematical objects like hypergraphs.

Statement
To state Szemerédi's regularity lemma formally, we must formalize what the edge distribution between parts behaving 'almost randomly' really means. By 'almost random', we're referring to a notion called $ε$-regularity. To understand what this means, we first state some definitions. In what follows $G$ is a graph with vertex set $V$.

Definition 1. Let $X, Y$ be disjoint subsets of $V$. The edge density of the pair $(X, Y)$ is defined as:


 * $$d(X,Y) := \frac{\left| E(X,Y) \right|}{|X||Y|}$$

where $E(X, Y)$ denotes the set of edges having one end vertex in $X$ and one in $Y$. We call a pair of parts $ε$-regular if, whenever you take a large subset of each part, their edge density isn't too far off the edge density of the pair of parts. Formally,

Definition 2. For $ε > 0$, a pair of vertex sets $X$ and $Y$ is called $ε$-regular, if for all subsets $A ⊆ X$, $B ⊆ Y$ satisfying $|A| ≥ ε|X|$, $|B| ≥ ε|Y|$, we have


 * $$\left| d(X,Y) - d(A,B) \right| \le \varepsilon.$$

The natural way to define an $ε$-regular partition should be one where each pair of parts is $ε$-regular. However, some graphs, such as the half graphs, require many pairs of partitions (but a small fraction of all pairs) to be irregular. So we shall define $ε$-regular partitions to be one where most pairs of parts are $ε$-regular.

Definition 3. A partition of $$V$$ into $$k$$ sets $$\mathcal{P}=\{V_1,\ldots,V_k\}$$ is called an $$\varepsilon$$-regular partition if
 * $$\sum_{(V_i,V_j)\text{ not }\varepsilon\text{-regular}} |V_i||V_j|\leq\varepsilon|V(G)|^2$$

Now we can state the lemma:

"Szemerédi's Regularity Lemma. For every $ε > 0$ and positive integer $m$ there exists an integer $M$ such that if $G$ is a graph with at least $M$ vertices, there exists an integer $k$ in the range $m &le; k &le; M$ and an $ε$-regular partition of the vertex set of $G$ into $k$ sets."

The bound $M$ for the number of parts in the partition of the graph given by the proofs of Szemeredi's regularity lemma is very large, given by a $O(ε^{−5})$-level iterated exponential of $m$. At one time it was hoped that the true bound was much smaller, which would have had several useful applications. However found examples of graphs for  which $M$ does indeed grow very fast and is at least as large as a $ε^{−1/16}$-level iterated exponential of $m$.

Proof
We shall find an ε-regular partition for a given graph following an algorithm:


 * 1) Start with a partition
 * 2) While the partition isn't ε-regular:
 * 3) *Find the subsets which witness ε-irregularity for each irregular pair.
 * 4) Refine the partition using all the witnessing subsets.

We apply a technique called the energy increment argument to show that this process stops after a bounded number of steps. To do this, we define a measure which must increase by a certain amount in each step, but it's bounded above and thus cannot increase indefinitely. This measure is called 'energy' as it's an $$L^2$$ quantity.

Definition 4. Let $U, W$ be subsets of $V$. Set $$ |V| = n $$. The energy of the pair $(U, W)$ is defined as:


 * $$q(U,W) := \frac{|U||W|}{n^2}d(U,W)^2$$

For partitions $$\mathcal{P}_U=\{U_1,\ldots,U_k\} $$ of $U$ and $$ \mathcal{P}_W = \{W_1,\ldots,W_l\} $$ of $W$, we define the energy to be the sum of the energies between each pair of parts:


 * $$q(\mathcal{P}_U,\mathcal{P}_W) := \sum_{i=1}^k\sum_{j=1}^lq(U_i,W_j) $$

Finally, for a partition $$\mathcal{P}=\{V_1,\ldots,V_k\}$$ of $V$, define the energy of $$\mathcal{P}$$ to be $$q(\mathcal{P},\mathcal{P})$$. Specifically,


 * $$q(\mathcal{P})=\sum_{i=1}^k\sum_{j=1}^kq(V_i,V_j)=\sum_{i=1}^k\sum_{j=1}^k\frac{|V_i||V_j|}{n^2}d(V_i,V_j)^2$$

Note that energy is between 0 and 1 because edge density is bounded above by 1:


 * $$q(\mathcal{P})=\sum_{i=1}^k\sum_{j=1}^k\frac{|V_i||V_j|}{n^2}d(V_i,V_j)^2\leq\sum_{i=1}^k\sum_{j=1}^k\frac{|V_i||V_j|}{n^2}=1$$

Now, we start by proving that energy does not decrease upon refinement.

Lemma 1. (Energy is nondecreasing under partitioning) For any partitions $$\mathcal{P}_U$$ and $$\mathcal{P}_W$$ of vertex sets $$U$$ and $$W$$, $$q(\mathcal{P}_U,\mathcal{P}_W)\geq q(U,W)$$. Proof: Let $$\mathcal{P}_U=\{U_1,\ldots,U_k\}$$ and $$\mathcal{P}_W=\{W_1,\ldots,W_l\}$$. Choose vertices $$x$$ uniformly from $$U$$ and $$y$$ uniformly from $$W$$, with $$x$$ in part $$U_i$$ and $$y$$ in part $$W_j$$. Then define the random variable $$Z=d(U_i,W_j)$$. Let us look at properties of $$Z$$. The expectation is


 * $$\mathbb{E}[Z]=\sum_{i=1}^k\sum_{j=1}^l\frac{|U_i|}{|U|}\frac{|W_j|}{|W|}d(U_i,W_j)=\frac{e(U,W)}{|U||W|}=d(U,W)$$

The second moment is


 * $$\mathbb{E}[Z^2]=\sum_{i=1}^k\sum_{j=1}^l\frac{|U_i|}{|U|}\frac{|W_j|}{|W|}d(U_i,W_j)^2=\frac{n^2}{|U||W|}q(\mathcal{P}_U,\mathcal{P}_W)$$

By convexity, $$\mathbb{E}[Z^2]\geq\mathbb{E}[Z]^2$$. Rearranging, we get that $$q(\mathcal{P}_U,\mathcal{P}_W) \ge q(U,W)$$ for all $$U,W$$.$$\square$$

If each part of $$\mathcal{P}$$ is further partitioned, the new partition is called a refinement of $$\mathcal{P}$$. Now, if $$\mathcal{P}=\{V_1,\ldots,V_m\}$$, applying Lemma 1 to each pair $$(V_i,V_j)$$ proves that for every refinement $$\mathcal{P'}$$ of $$\mathcal{P}$$, $$q(\mathcal{P'}) \ge q(\mathcal{P})$$. Thus the refinement step in the algorithm doesn't lose any energy.

Lemma 2. (Energy boost lemma) If $$(U,W)$$ is not $$\varepsilon$$-regular as witnessed by $$U_1\subset U,W_1\subset W$$, then,


 * $$q\left(\{U_1,U\backslash U_1\},\{W_1,W\backslash W_1\}\right)>q(U,W)+\varepsilon^4\frac{|U||W|}{n^2}$$

Proof: Define $$Z$$ as above. Then,


 * $$Var(Z) = \mathbb{E}[Z^2]-\mathbb{E}[Z]^2 = \frac{n^2}{|U||W|}\left(q\left(\{U_1,U\backslash U_1\},\{W_1,W\backslash W_1\}\right)-q(U,W)\right)$$

But observe that $$|Z-\mathbb{E}[Z]|=|d(U_1,W_1)-d(U,W)|$$ with probability $$\frac{|U_1|}{|U|}\frac{|W_1|}{|W|}$$(corresponding to $$x\in U_1$$ and $$y\in W_1$$), so


 * $$Var(Z) = \mathbb{E}[(Z-\mathbb{E}[Z])^2] \geq \frac{|U_1|}{|U|}\frac{|W_1|}{|W|}(d(U_1,W_1)-d(U,W))^2 > \varepsilon\cdot\varepsilon\cdot\varepsilon^2$$ $$\square$$

Now we can prove the energy increment argument, which shows that energy increases substantially in each iteration of the algorithm.

Lemma 3 (Energy increment lemma) If a partition $$\mathcal{P}=\{V_1,\ldots,V_k\}$$ of $$V(G)$$ is not $$\varepsilon$$-regular, then there exists a refinement $$\mathcal{Q}$$ of $$\mathcal{P}$$ where every $$V_i$$ is partitioned into at most $$2^k$$ parts such that


 * $$q(\mathcal{Q})\geq q(\mathcal{P})+\varepsilon^5.$$

Proof: For all $$(i,j)$$ such that $$(V_i,V_j)$$ is not $$\varepsilon$$-regular, find $$A^{i,j}\subset V_i$$ and $$A^{j,i}\subset V_j$$ that witness irregularity (do this simultaneously for all irregular pairs). Let $$\mathcal{Q}$$ be a common refinement of $$\mathcal{P}$$ by $$A^{i,j}$$'s. Each $$V_i$$ is partitioned into at most $$2^k$$ parts as desired. Then,


 * $$q(\mathcal{Q}) = \sum_{(i,j)\in[k]^2} q(\mathcal{Q}_{V_i},\mathcal{Q}_{V_j}) = \sum_{(V_i,V_j)\text{ }\varepsilon\text{-regular}}q(\mathcal{Q}_{V_i},\mathcal{Q}_{V_j})+\sum_{(V_i,V_j)\text{ not }\varepsilon\text{-regular}}q(\mathcal{Q}_{V_i},\mathcal{Q}_{V_j})$$

Where $$\mathcal{Q}_{V_i}$$ is the partition of $$V_i$$ given by $$\mathcal{Q}$$. By Lemma 1, the above quantity is at least


 * $$\sum_{(V_i,V_j)\text{ }\varepsilon\text{-regular}}q(V_i,V_j)+\sum_{(V_i,V_j)\text{ not }\varepsilon\text{-regular}}q(\{A^{i,j},V_i\backslash A^{i,j}\},\{A^{j,i},V_j\backslash A^{j,i}\})$$

Since $$V_i$$ is cut by $$A^{i,j}$$ when creating $$\mathcal{Q}$$, so $$\mathcal{Q}_{V_i}$$ is a refinement of $$\{A^{i,j},V_i\backslash A^{i,j}\}$$. By lemma 2, the above sum is at least


 * $$	\sum_{(i,j)\in[k]^2}q(V_i,V_j)+\sum_{(V_i,V_j)\text{ not }\varepsilon\text{-regular}}\varepsilon^4\frac{|V_i||V_j|}{n^2}$$

But the second sum is at least $$\varepsilon^5$$ since $$\mathcal{P}$$ is not $$\varepsilon$$-regular, so we deduce the desired inequality. $$\square$$

Now, starting from any partition, we can keep applying Lemma 3 as long as the resulting partition isn't $$\varepsilon$$-regular. But in each step energy increases by $$\varepsilon^5$$, and it's bounded above by 1. Then this process can be repeated at most $$\varepsilon^{-5}$$ times, before it terminates and we must have an $$\varepsilon$$-regular partition.

Graph counting lemma
If we have enough information about the regularity of a graph, we can count the number of copies of a specific subgraph within the graph up to small error.

Graph Counting Lemma. Let $$H$$ be a graph with $$V(H)=[k]$$, and let $$\varepsilon>0$$. Let $$G$$ be an $$n$$-vertex graph with vertex sets $$V_1,\dots,V_k\subseteq V(G)$$ such that $$(V_i,V_j)$$ is $$\varepsilon$$-regular whenever $$\{i,j\}\in E(H)$$. Then, the number of labeled copies of $$H$$ in $$G$$ is within $$e(H)\varepsilon|V_1|\cdots|V_k|$$ of


 * $$\left(\prod_{\{i,j\}\in E(H)}d(V_i,V_j)\right)\left(\prod_{i=1}^k|V_i|\right).$$

This can be combined with Szemerédi's regularity lemma to prove the Graph removal lemma. The graph removal lemma can be used to prove Roth's Theorem on Arithmetic Progressions, and a generalization of it, the hypergraph removal lemma, can be used to prove Szemerédi's theorem.

The graph removal lemma generalizes to induced subgraphs, by considering edge edits instead of only edge deletions. This was proved by Alon, Fischer, Krivelevich, and Szegedy in 2000. However, this required a stronger variation of the regularity lemma.

Szemerédi's regularity lemma does not provide meaningful results in sparse graphs. Since sparse graphs have subconstant edge densities, $$\varepsilon$$-regularity is trivially satisfied. Even though the result seems purely theoretical, some attempts have been made to use the regularity method as compression technique for large graphs.

Frieze-Kannan regularity
A different notion of regularity was introduced by Frieze and Kannan, known as the weak regularity lemma. This lemma defines a weaker notion of regularity than that of Szemerédi which uses better bounds and can be used in efficient algorithms.

Given a graph $$G=(V,E)$$, a partition of its vertices $$\mathcal{P} = \{ V_1, \ldots, V_k\}$$ is said to be Frieze-Kannan $$\epsilon$$-regular if for any pair of sets $$S,T \subseteq V$$:



\left| e(S,T) - \sum_{i,j=1}^k d(V_i, V_j) |S\cap V_i| |T\cap V_j|\right| \leq \epsilon |V|^2 $$

The weak regularity lemma for graphs states that every graph has a weak $$\epsilon$$-regular partition into at most $$4^{\epsilon^{-2}}$$ parts.

This notion can be extended to graphons by defining a stepping operator. Given a graphon $$W$$ and a partition $$\mathcal{P}$$ of $$[0,1]$$, we can define $$W_{\mathcal{P}}$$ as a step-graphon with steps given by $$\mathcal{P}$$ and values given by averaging $$W$$ over each step.

A partition $$\mathcal{P}$$ is weak $$\epsilon$$-regular if:

\| W - W_{\mathcal{P}} \|_{\square} \leq \epsilon $$ The weak regularity lemma for graphons states that every graphon has a weak $$\epsilon$$-regular partition into at most $$4^{\epsilon^{-2}}$$ parts. As with Szemerédi's regularity lemma, the weak regularity also induces a counting lemma.

Algorithmic applications
One of the initial motivations for the development of the weak regularity lemma was the search for an efficient algorithm for estimating the maximum cut in a dense graph. It has been shown that approximating the max-cut problem beyond 16/17 is NP-hard, however an algorithmic version of the weak regularity lemma gives an efficient algorithm for approximating the max-cut for dense graphs within an $$\epsilon n^2$$ additive error. These ideas have been further developed into efficient sampling algorithms for estimating max-cut in dense graphs.

The smaller bounds of the weak regularity lemma allow for efficient algorithms to find an $$\epsilon$$-regular partition. Graph regularity has further been used in various area of theoretical computer science, such as matrix multiplication and communication complexity.

Strong regularity lemma
The strong regularity lemma is a stronger variation of the regularity lemma proven by Alon, Fischer, Krivelevich, and Szegedy in 2000. Intuitively, it provides information between non-regular pairs and could be applied to prove the induced graph removal lemma.

Statement
For any infinite sequence of constants $$\epsilon_0\ge \epsilon_1 \ge ...>0$$, there exists an integer $$M$$ such that for any graph $$G$$, we can obtain two (equitable) partitions $$\mathcal{P}$$ and $$\mathcal{Q}$$ such that the following properties are satisfied:


 * $$\mathcal{Q}$$ refines $$\mathcal{P}$$, that is every part of $$\mathcal{P}$$ is the union of some collection of parts in $$\mathcal{Q}$$.
 * $$\mathcal{P}$$ is $$\epsilon_0$$-regular and $$\mathcal{Q}$$ is $$\epsilon_{|\mathcal{P}|}$$-regular.
 * $$q(\mathcal{Q})<q(\mathcal{P})+\epsilon_0$$
 * $$|\mathcal{Q}|\le M$$

Proof
We apply the regularity lemma repeatedly to prove the stronger version. A rough outline:


 * Start with $$\mathcal P_0$$ be an $$\epsilon_0$$ regular partition


 * Repeatedly find its refinement $$\mathcal Q$$ that is $$\epsilon_{|\mathcal P|}$$ regular. If the energy increment of $$\mathcal Q \le \epsilon_0$$, we simply return $$(\mathcal P, \mathcal Q)$$. Otherwise, we replace $$\mathcal P$$ with $$\mathcal Q$$ and continue.

We start with $$\mathcal P_0$$ be an $$\epsilon_0$$ regular partition of $$G$$ with $$\le M(\epsilon_0)$$ parts. Here $$M(t)$$ corresponds to the bound of parts in regularity lemma when $$\epsilon=t $$.

Now for $$i=0, 1, \cdots$$, we set $$\mathcal{P_{i+1}}$$ to be an $$\epsilon_{|P_i|}$$regular refinement of $$\mathcal{P_i}$$ with $$\le M(\epsilon_{|P_i|})|\mathcal P_i|$$ parts. By the energy increment argument, $$q(\mathcal P_{i+1}) \ge q(\mathcal P_{i})$$. Since the energy is bounded in $$[0, 1]$$, there must be some $$i \le 1/\epsilon_0+1$$ such that $$q(\mathcal P_{i+1})- q(\mathcal P_{i}) < \epsilon_0$$. We return $$(\mathcal P_i, \mathcal P_{i+1})$$ as $$(\mathcal P, \mathcal Q)$$.

By our choice of $$\mathcal P_{i+1},$$ the regular and refinement conditions hold. The energy condition holds trivially. Now we argue for the number of parts. We use induction to show that $$\forall i$$, there exists $$M_i$$ such that $$|\mathcal P_i| \le M_i$$. By setting $$M_0=M(\epsilon_0)$$, we have $$|\mathcal P_0|\le M_0$$. Note that when $$|P_i|\le M_i$$, $$|P_{i+1}| \le M(\epsilon_{|P_i|})|\mathcal P_i| \le M(\epsilon_{|M_i|}) M_i$$, so we could set $$M_{i+1}=M(\epsilon_{|M_i|}) M_i$$ and the statement is true for $$i+1$$. By setting $$M=\max_{i\le 1/\epsilon_0+2} M_i$$, we have $$|P|, |Q| \le M.$$

Remarks on equitable
A partition is equitable if the sizes of any two sets differ by at most $$1 $$. By equitizing in each round of iteration, the proof of regularity lemma could be accustomed to prove the equitable version of regularity lemma. And by replacing the regularity lemma with its equitable version, the proof above could prove the equitable version of strong regularity lemma where $$\mathcal{P}$$ and $$\mathcal{Q}$$ are equitable partitions.

Statement
For any infinite sequence of constants $$\epsilon_0\ge \epsilon_1 \ge ...>0$$, there exists $$\delta>0$$ such that there exists a partition $$\mathcal{P}={V_1,...,V_k}$$ and subsets $$ W_i \subset V_i$$ for each $$i$$ where the following properties are satisfied:


 * $$|W_i|>\delta n$$
 * $$(W_i,W_j)$$ is $$\epsilon_{|\mathcal{P}|}$$-regular for each pair $$1\le i\le j\le k$$
 * $$|d(W_i,W_j)-d(V_i,V_j)|\le \epsilon_0$$ for all but $$\epsilon_0 |\mathcal{P}|^2$$ pairs $$1\le i\le j\le k$$

Motivation
The corollary explores deeper the small energy increment. It gives us a partition together with subsets with large sizes from each part, which are pairwise regular. In addition, the density between the corresponding subset pairs differs "not much" from the density between the corresponding parts.

Proof of corollary
We'll only prove the weaker result where the second condition only requires $$(W_i,W_j)$$ to be $$\epsilon_{|\mathcal{P}|}$$-regular for $$1\le i< j\le k$$. The full version can be proved by picking more subsets from each part that are mostly pairwise regular and combine them together.

Let $$r=\epsilon_0^3/20$$. We apply the strong regularity lemma to find equitable $$\mathcal P$$ that is a $$r$$ regular partition and equitable $$\mathcal Q$$ that is a $$r/|P|^4$$ regular refinement of $$\mathcal P$$, such that $$q(\mathcal Q)-q(\mathcal P) \le r$$ and $$|\mathcal Q|\le M$$.

Now assume that $$P=\{V_1, \cdots, V_k\}$$, we randomly pick a vertex $$v_i$$ from each $$V_i$$ and let $$W_i$$ to be the set that contains $$v_i$$ in $$\mathcal Q$$. We argue that the subsets $$W_i$$ satisfy all the conditions with probability $$> 0$$.

By setting $$\delta = \frac{1}{2M}$$ the first condition is trivially true since $$\mathcal Q$$ is an equitable partition. Since at most $$\frac{r}{|P|^4}\binom{n}{2}\le \epsilon_0\frac{|V_i||V_j|}{3|P|^2}$$ vertex pairs live between irregular pairs in $$\mathcal Q$$, the probability that the pair $$W_i$$ and $$W_j$$ is irregular $$\le \frac{1}{3|P|^2}$$, by union bound, the probability that at least one pair $$W_i$$, $$W_i$$ is irregular $$\le 1/3$$. Note that

$$\begin{align}r&\ge q(\mathcal Q)-q(\mathcal P)\\&=\sum_{i, j}\frac{|V_i||V_j|}{n^2}\mathbb E|d(W_i, W_j)-d(V_i, V_j)|^2\\ &\ge \sum_{i, j}\frac{1}{4|P|^2}\mathbb E|d(W_i, W_j)-d(V_i, V_j)|^2\\&=\frac{1}{4|P|^2}\mathbb E\sum_{i,j} |d(W_i, W_j)-d(V_i, V_j)|^2 \end{align}$$

So by Markov's inequality $$P(\sum_{i,j} |d(W_i, W_j)-d(V_i, V_j)|^2\ge 8|P|^2r)\le 1/2$$, so with probability $$\ge 1/2$$, at most $$\epsilon_0 |P|^2$$ pairs could have $$d(W_i, W_j)-d(V_i, V_j) \ge \epsilon_0$$. By union bound, the probability that all conditions hold $$\ge 1-1/2-1/3 >0$$.

History and extensions
first introduced a weaker version of this lemma, restricted to bipartite graphs, in order to prove Szemerédi's theorem, and in he proved the full lemma. Extensions of the regularity method to hypergraphs were obtained by Rödl and his collaborators  and Gowers.

János Komlós, Gábor Sárközy and Endre Szemerédi later (in 1997) proved in the blow-up lemma that the regular pairs in Szemerédi regularity lemma behave like complete bipartite graphs under the correct conditions. The lemma allowed for deeper exploration into the nature of embeddings of large sparse graphs into dense graphs.

The first constructive version was provided by Alon, Duke, Lefmann, Rödl and Yuster. Subsequently, Frieze and Kannan gave a different version and extended it to hypergraphs. They later produced a different construction due to Alan Frieze and Ravi Kannan that uses singular values of matrices. One can find more efficient non-deterministic algorithms, as formally detailed in Terence Tao's blog and implicitly mentioned in various papers.

An inequality of Terence Tao extends the Szemerédi regularity lemma, by revisiting it from the perspective of probability theory and information theory instead of graph theory. Terence Tao has also provided a proof of the lemma based on spectral theory, using the adjacency matrices of graphs.

It is not possible to prove a variant of the regularity lemma in which all pairs of partition sets are regular. Some graphs, such as the half graphs, require many pairs of partitions (but a small fraction of all pairs) to be irregular.

It is a common variant in the definition of an $$\varepsilon$$-regular partition to require that the vertex sets all have the same size, while collecting the leftover vertices in an "error"-set $$V_0$$ whose size is at most an $$\varepsilon$$-fraction of the size of the vertex set of $$G$$.

A stronger variation of the regularity lemma was proven by Alon, Fischer, Krivelevich, and Szegedy while proving the induced graph removal lemma. This works with a sequence of $$\varepsilon$$ instead of just one, and shows that there exists a partition with an extremely regular refinement, where the refinement doesn't have too large of an energy increment.

Szemerédi's regularity lemma can be interpreted as saying that the space of all graphs is totally bounded (and hence precompact) in a suitable metric (the cut distance). Limits in this metric can be represented by graphons; another version of the regularity lemma simply states that the space of graphons is compact.