---
title: '18.156 notes 13: proof of the balog-szemeredi-gowers theorem'
description: In this lecture we'll prove the BSG theorem that we used in the proof of the BKT theorem.
date: '2025-04-03'
tags:
  - course
  - mit
  - ocw
  - lecture-notes
cssclasses:
  - course-notes
license: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/
latex:
  source: static_resources/mit18_156_s25_lec_full.tex
  lines:
    - 2543
    - 2716
  section: 13
  unit: 13
  pdf: mit18_156_s25_lec_full_pdf
  pages:
    - 74
    - 77
created: '2025-04-03'
modified: '2025-04-03'
published: '2025-04-03'
pageLayout: default
slug: courses/18-156-projection-theory-spring-2025/notes/13
permalink: https://aarnphm.xyz/courses/18-156-projection-theory-spring-2025/notes/13.md
generator:
  quartz: v4.6.0
  hostedProvider: Cloudflare
  baseUrl: aarnphm.xyz
full: https://aarnphm.xyz/llms-full.txt
---
In this lecture we’ll prove the BSG theorem that we used in the proof of the BKT theorem. Here’s the statement again:

> \[!theorem|latex\] Theorem 13.1. Balog–Szemerédi–Gowers
>
> Let $A$ and $B$ be subsets of an abelian group and suppose $X \subset A \times B$. If $|A|, |B| \leq N$, $|X| \geq K^{-1} N^2$, and $|\pi_1(X)| \leq KN$, then there are $A' \subset A$ and $B' \subset B$ such that $|A' + B'| \leq K^{O(1)} N$ and $|X'| \geq K^{-O(1)} N^2$, where $X' = X \cap (A' \times B')$.
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^theorem-13-1

Here $\pi_1(X) = \{ a + b \ : \ (a, b) \in X \}$.

> \[!example|latex\] Example 13.2
>
> As subsets of $\mathbb{Z}$, let $A = B$ be the union of $[N]$ and some garbage. Let $X$ be the union of any subset of $[N] \times [N]$ and a little garbage. Then $\pi_1(X)$ is small ($\lesssim N$), while $|A + B| \gtrsim N^2$ is large. We can take $A' = B' = [N]$.
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^example-13-2

The theorem was originally proved by Balog and Szemerédi, but in the bounds $K^{O(1)}$ was instead $F(k)$ and $K^{-O(1)}$ was $\frac{1}{F(K)}$, and $F(K)$ was some function with crazy growth. The bounds in the version stated above are due to Gowers.

We will proceed by thinking of $X \subset A \times B$ as a bipartite graph with $A$ on the left, $B$ on the right, and an element $(a, b) \in X$ representing an edge from $a$ to $b$. Let

$$
P_K(a, b) = \# \{ \text{paths of length } K \text{ in the graph } X \text{ from } a \text{ to } b \}.
$$

> \[!lemma|latex\] Lemma 13.3.
>
> If $A' \subset A$ and $B' \subset B$, and for any $a \in A'$, $b \in B'$, $P_3(a, b) \geq P$, then
>
> $$
> |A' + B'| \leq \frac{\pi_1(X)^3}{P}.
> $$
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^lemma-13-3

> \[!proof|latex\]+ Proof of lemma 13.3.
>
> A path of length $3$ from $a$ to $b$ goes from $a$ to some $b_1 \in B$, then to some $a_1 \in A$, then to $b$. So $(a, b_1), (a_1, b_1), (a_1, b) \in X$ and hence
>
> $$
> \underbrace{a + b_1}_{z_1}, \underbrace{a_1 + b_1}_{z_2}, \underbrace{a_1 + b}_{z_2} \in \pi_1(X).
> $$
>
> We can write $a + b = z_1 - z_2 + z_3$. Therefore
>
> $$
> \# \{ (z_1, z_2, z_3) \in \pi_1(X)^3 \ : \ a + b = z_1 - z_2 + z_3 \} \geq P_3(a, b) \geq P.
> $$
>
> Summing over $A' + B'$ we get
>
> $$
> |A' + B'| \cdot P \leq |\pi_1(X)|^3.
> $$

^proof-13-3

From now on, everything we prove will be a statement about bipartite graphs, i.e. we don’t need the addition law for anything that follows.

> \[!lemma|latex\] Lemma 13.4. Key Lemma
>
> If $X \subseteq A \times B$ and $|X| \geq K^{-1} |A| |B|$, then there are $A' \subset A$ and $B' \subset B$ such that $|X'| \geq K^{-O(1)} |A||B|$ where $X' = X \cap (A' \times B')$ and for any $a \in A'$, $b \in B'$,
>
> $$
> P_3(a, b) \geq K^{-O(1)} |A||B|.
> $$
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^lemma-13-4

The BSG theorem is proved by combining Lemma [[courses/18-156-projection-theory-spring-2025/notes/13#^lemma-13-3|13.3]] and the Key Lemma.

## 13.1 simple bounds about $P_K(a, b)$

In this section, we have

$$
\begin{align*}
\# \text{ edges } & = |X| = \geq K^{-1} |A||B|, \\
P_\ell & := \# \text{paths of length $\ell$ starting in $A$}, \\
P_1 & = |X| \geq K^{-1} |A||B|.
\end{align*}
$$

> \[!definition|latex\] Definition 13.5.
>
> For $a \in A$, the **neighborhood** of $a$ is the set $N(a)$ of points that share an edge with $a$.
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^definition-13-5

We can average over $|A|$ to get

$$
\operatorname{Avg}_{a \in A} P_1(a, \cdot) = \frac{|P_1|}{|A|} \geq K^{-1} |B|.
$$

To get an estimate for the average of $P_2$, we use Cauchy-Schwarz to get

$$
\begin{align*}
P_2 & = \sum_b |N(b)|^2 \\
& \geq \frac{\left( \sum_b |N(b)| \right)^2}{|B|} \\
& \geq \frac{(K^{-1}|A||B|)^2}{|B|} \\
& = K^{-2} |A|^2 |B|.
\end{align*}
$$

Averaging this get us

$$
\operatorname{Avg}_{a_1, a_2} P_2(a_1, a_2) \geq K^{-2} |B|.
$$

_As an exercise_, use similar methods to prove $|P_3| \geq K^{-3} |A|^2 |B|^2$ and

$$
\operatorname{Avg}_{a, b} P_3(a, b) \geq K^{-3} |A| |B|.
$$

The Key Lemma says that $P_3(a, b)$ is at least a small fraction of the average for _all_ $a \in A'$, $b \in B'$.

> \[!lemma|latex\] Lemma 13.6. Length 2
>
> If $X \subset A \times B$, $|X| \geq K^{-1} |A||B|$, $\epsilon > 0$, then there is a subset $A' \subset A$ such that $|A'| \geq \frac{1}{2} K^{-1} |A|$ and $P_2(a_1, a_2) \geq \epsilon K^{-2} |B|$ for $(1 - 2\epsilon) |A'|^2$ choices of $(a_1, a_2) \in (A')^2$.
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^lemma-13-6

Note that we cannot always take $A' = A$, because there are graphs $X$ where only $\frac{1}{K} |A|$ vertices in $A$ have an edge and there are also graphs with multiple connected components. What we will do is let $A' = N(b)$ for some $b \in B$.

> \[!definition|latex\] Definition 13.7.
>
> A pair $(a_1, a_2)$ is **$\epsilon$-bad** if $P_2(a_1, a_2) < \epsilon K^{-2} |B|$. Let
>
> $$
> BP_\epsilon(b) = \# \{ (a_1, a_2) \in N(b)^2 \ : \ (a_1, a_2) \text{ is $\epsilon$-bad} \}.
> $$
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^definition-13-7

> \[!lemma|latex\] Lemma 13.8. P1
>
> $$
> \mathbb{E}_b |BP_\epsilon(b)| \leq \epsilon K^{-2} |A|^2.
> $$
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^lemma-13-8

> \[!lemma|latex\] Lemma 13.9. P2
>
> $$
> \mathbb{E}_b |N(b)|^2 \geq K^{-2} |A|^2.
> $$
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^lemma-13-9

This says there’s only about an $\epsilon$-fraction of bad pairs.

> \[!proof|latex\]+ Proof of P2 of lemma 13.9.
>
> By Cauchy-Schwarz,
>
> $$
> \begin{align*}
> \sum_b |N(b)|^2 & \geq \frac{\left( \sum_b |N(b)| \right)^2}{|B|} \\
> & \geq \frac{(K^{-1} |A||B|)^2}{|B|} \\
> & = K^{-2} |A|^2 |B|.
> \end{align*}
> $$
>
> Divide by $|B|$.

^proof-13-9

> \[!proof|latex\]+ Proof of P1 of lemma 13.9.
>
> $$
> \begin{align*}
> \sum_b |BP_\epsilon(b)| & = \# \{ \text{$a_1, a_2, b$ such that $(a_1, b), (a_2, b) \in X$ and $P(a_1, a_2) \leq \epsilon K^{-2} |B|$} \} \\
> & \leq |A|^2 \epsilon K^{-2} |B|.
> \end{align*}
> $$
>
> Divide by $|B|$.

^proof-13-9-b

> \[!proof|latex\]+ Proof of Length 2 of lemma 13.9.
>
> Let $A' = N(b)$. Then by the previous two lemmas,
>
> $$
> \mathbb{E} \left( |N(b)|^2 - \frac{1}{2\epsilon} |BP_\epsilon(b)| \right) \geq \frac{1}{2} K^{-2} |A|^2.
> $$
>
> So we can pick $b$ to satisfy
>
> $$
> |N(b)|^2 - \frac{1}{2\epsilon} |BP_\epsilon(b)| \geq \frac{1}{2} K^{-2} |A|^2
> $$
>
> and let $A' = N(b)$. Then $|BP_\epsilon(b)| \leq 2\epsilon |N(b)|^2$.

^proof-13-9-c

By discarding some $a_1$‘s, we can upgrade this.

> \[!lemma|latex\] Lemma 13.10. 2
>
> If $X \subset A \times B$, $|X| \geq K^{-1} |A||B|$, and $\epsilon > 0$, then there exists $A_2 \subset A$ such that $|A_2| \geq \frac{1}{4} K^{-1} |A|$ and for every $a \in A_2$, there are at most $10\epsilon |A_2|$ choices for $a_2$ such that $(a, a_2)$ is $\epsilon$-bad.
>
> <ref slug="courses/18-156-projection-theory-spring-2025/resources/mit18_156_s25_lec13_pdf/#page=4">

^lemma-13-10

We won’t prove this, but the idea is to let

$$
A_2 = A' \setminus \{ a \in A' \ : \ \text{$(a, a_2)$ is $\epsilon$-bad for many $a_2 \in A'$} \}.
$$

The second part of the conclusion can be written as $A = B(a) \cup G(a)$, where $|B(a)| \leq 10\epsilon |A_2|$ and for any $a_2 \in G(a)$, $P_2(a, a_2) \geq \epsilon K^{-2} |B|$.

> \[!proof|latex\]+ Proof of Key Lemma of lemma 13.10.
>
> First, let
>
> $$
> A_1 = \{ a \in A \ : \ |N(a)| \geq \frac{1}{10} K^{-1} |A| \}.
> $$
>
> Let
>
> $$
> X(A', B') := \{ (a, b) \in (A' \times B') \cap X \} = (A' \times B') \cap X.
> $$
>
> Choose $A' \subset A$ be the $A_2$ of Lemma 2. Let
>
> $$
> B' = \{ b \in B \ : \ |N(b) \cap A'| > 20\epsilon |A'| \}
> $$
>
> so
>
> $$
> |B(a)| \leq 10\epsilon |A'|.
> $$
>
> For any $a \in A'$, $b \in B'$, we have
>
> $$
> \begin{align*}
> P_3(a, b) & \geq \epsilon K^{-2} |B| (|N(b) \cap G(a)|) \\
> & \geq \epsilon K^{-2} |B| (|N(b) \cap A'| - |B(a)|) \\
> & \gtrsim \epsilon^2 K^{-3} |A||B|
> \end{align*}
> $$
>
> using $|A'| \gtrsim K^{-1}|A|$. Now we just need to check $|X(A', B')| \geq K^{-O(1)}|X|$. Since $|A'| \gtrsim K^{-1} |A|$, $A' \subset A$, $N(a) \geq \frac{1}{10} K^{-1} |B|$ for $a \in A'$, and $|X(A', B)| \gtrsim K^{-2} |A||B|$, so
>
> $$
> \begin{align*}
> |X(A', B \setminus B')| & \leq 20\epsilon |A'||B| \\
> & \leq 20\epsilon |A||B|.
> \end{align*}
> $$
>
> Let $\epsilon = \frac{1}{10^6} K^{-2}$, so $|X(A', B \setminus B')| \ll |X(A', B)|$. Hence
>
> $$
> |X(A', B')| \sim |X(A', B)| \geq K^{-O(1)} |A||B|.
> $$

^proof-13-10

