The triangle removal lemma shows that if a lot of edges must be removed to make a graph triangle-free, then there must have been a lot of triangles in the original graph. While this observation may not sound ground breaking, it is a very useful tool in combinatorics.

## The importance of triangles

Whether or not a graph contains any triangles (3 vertices which are all adjacent to each other) is relevant for a variety of questions in mathematics.

### Intersection graphs

The intersection graph of a family of lines is the graph on the vertex set , where an edge exists between if and only if and intersect. A famous question posed by Erdös in the 1970s is whether the chromatic number of intersections graphs of line segments is bounded by a function of their clique number (the maximum size of a clique in the graph). The answer, *no,* was recently published in this paper.

The authors prove that for every positive integer *k*, there exists an arrangement of a finite number of line segments so that the intersection graph of the line segments is triangle-free and has chromatic number greater than *k*. Think about constructing a graph with large chromatic number. Intuitively, the most reasonable way to force more colors is to have 2 intersecting lines, which are both different colors in a proper coloring, and then another line intersecting both of those. However, this is exactly a triangle. Thus the construction of this arrangement is by no means obvious and is of interest to those who study combinatorial geometry.

Also in the realm of incidence geometry, the triangle removal lemma is explicitly used in this 2008 paper by Solymosi. The author proves that when an arrangement of points and lines defines a lot of incidences (at least as given by the Szemerédi-Trotter theorem), then there exists *k* points, which are not collinear or concurrent, so that any pair of them is incident to a line.

### Networks: phase transitions and independence number

In a network, the existence of triangles may be undesirable depending on the network’s purpose. For example, a random graph on *n* vertices without any cliques is exactly a triangle-free graph. It’s easy to prove using the second moment method that with high probability an Erdös-Rényi random graph on *n* vertices is triangle-free for , where is the probability of an edge between any 2 vertices.

Furthermore, Ajtai, Komlós, and Szemerédi showed that when a graph on vertices is triangle-free with maximum degree at most , it has a large independence number . Thus knowing whether the underlying graph of a network is triangle-free provides confirmation of the existence of a large independent set in the network.

### Arithmetic progressions

This last result is actually a consequence of the theorem proven in this post: the triangle removal lemma. Roth’s lemma states that for which has positive upper density, *A* contains an arithmetic progression of length 3. For reasons beyond my knowledge, as my knowledge of number theory is ε, arithmetic progressions with common differences of 3 or 4 are very important.

The triangle removal lemma shows that if a lot of edges must be removed to make a graph triangle-free, then there must have been a lot of triangles in the original graph.

**The Triangle Removal Lemma** *For every* ε>0* there exists *δ>0* such that for any graph* G* on *n* vertices where at least* εn²* edges must be removed in order to make it triangle-free,* G* contains at least *δn³* **triangles.*

Thus for the reasons listed above, and many more, the triangle removal lemma is a useful tool. Its proof is due to Rusza and Szemerédi.

## Background and definitions

The experienced reader familiar with Szemerédi’s regularity lemma can skip this section. From now on we use standard graph theory notation, but will introduce all non-basic definitions. Assume *G=(V,E)* is a graph with vertex set *V* and edge set *E. *The triangle removal lemma and regularity lemma both rely on the fact that *most graphs look random*.

First, let *A,B⊂V* where *A* and *B* are disjoint. The **density** of the pair *(A,B)* is defined as

Think of density as a measurement in [0,1], which represents the fraction of total possible edges between two disjoint sets that are edges in the graph. To illustrate this, note that all disjoint pairs of vertices in a complete graph have density 1, and most of the pairs of vertices in a sparse graph will have density close to 0.

Furthermore, *(A,B)* is said to be **ε-pseudo-random** if for all pairs *(A’,B’)*, where *A’⊂A* and *B’⊂B*, . In other words, the edge density in a pair of subsets is close to uniform across the pair. The figure below illustrates a graph that obviously satisfies this definition for pseudo-random, , and a graph that is definitely not pseudo-random. A subset pair which is ε-pseudo-random does not have an area where most of its edges lie.

Next, a partition on *V* into sets is said to be **ε-regular** if the following two conditions hold:

- For all , .
- All except
*εk²*pairs of subsets from the partitions , for*i<j*, are ε-pseudo-random

A partition on the vertices is ε-regular if it is as close as possible to an equipartition with *k* parts, and most pairs in this partition have close to uniform edge density between them.

## Formal statement

Equipped with the necessary definitions, it’s time for the lemma and its proof.

**The Triangle Removal Lemma ***For every* ε>0* there exists *δ>0* such that for any graph* G* on *n* vertices where at least* εn²* edges must be removed in order to make it triangle-free,* G* contains at least *δn³* **triangles.*

A common equivalent statement is: for every *ε>0 *there exists *δ>0* such that for any graph *G* on *n *vertices with at most *δn³* triangles, there exists a set of at most *εn²* edges, which when removed results in a triangle-free graph.

## Proof

Let *G* be a graph on *n* vertices, where at least *εn²* edges must be removed in order to make the graph triangle-free. Let be an -regular partition on *V*. Such a partition exists by Szemerédi’s regularity lemma. Edges which satisfy one of 3 conditions, to be enumerated soon, will be removed. Then it’s argued that at most *εn²* edges were removed and there are still at least *δn³* triangles in the graph.

Remove edge *(u,v)* from *G* if:

- where is not an -pseudo-random pair. Remember our definition for ε-regular partitions allowed a few of the pairs to not have its edges uniformly distributed throughout the partition. So all edges between such pairs are removed.
- where . This condition states to remove all edges between pairs in the partition which didn’t have many edges between them to begin with.
- where . Any partitions that are small are removed. Thus obviously any edges with adjacencies in this partition are removed.

At most, pairs from the partition were not -pseudo-random. Denote the set of such pairs by . As the partition is close to an equi-partition, for all , . Thus from condition 1, at most edges are removed. The number of edges in a simple graph on *n* vertices is <*n²*. When edges are removed between pairs of partitions that have low density, specifically density , at most edges are removed.

If a partition has vertices, then it contributes edges. As there are *k* parts, this implies edges are removed when the vertices from those partitions are deleted. In total, the 3 conditions for edge removal deleted only at most *εn² *edges. Thus the graph still contains a triangle.

It remains to show how many triangles are left in the graph after removing edges.

Fix a triangle that remains in the graph, and label the vertices of the triangle *a,b,c*. WLOG suppose that , , . As these three edges were not removed, *(V₁,V₂)*, *(V₂,V₃)*, and *(V₁,V₃)* are -regular pairs with density . Lastly, for *i=1,2,3*.

Next, it’s necessary to show that the number of vertices which have at least adjacencies in both *V₂* and *V₃* is at least . Assume for sake of contradiction that there is a subset *X ⊂ V₁* where and every , has adjacencies in

*V₂*. Then checking the density between

*X*and

*V₂*, , which breaks the assumptions that

*(V₁,V₂)*are -regular pairs. The same applies for

*V₃*, and the number of vertices which have adjacencies in either

*V₂*or

*V₃*is

Thus there are at least vertices in *V₁* with at least adjacent vertices to both *V₂* and *V₃*. For such an , let *W₂,W₃* be subsets of *V₂* and *V₃* respectively which are adjacent to *a*. As*(V₂,V₃)* is regular,

Every edge between *W₂* and *W₃* forms a unique triangle. This was for an arbitrary , so summing over all vertices in V*1*, the number of triangles is at least

## What just happened?

The regularity lemma shed light on the substructure of the graph. This substructure is easier to analyze than the full graph. Even further, the edges which were removed left a graph with triangles that were easy to find and count.