Graph Theory

The Expander Mixing Lemma: Eigenvalues Force Pseudorandom Edges

A single number — the second-largest eigenvalue of a graph's adjacency matrix — controls the edge count between every pair of vertex subsets simultaneously, forcing a sparse graph to scatter its edges as evenly as a random one. That is the Expander Mixing Lemma: if G is a d-regular graph on n vertices with adjacency eigenvalues d = λ₁ ≥ λ₂ ≥ ⋯ ≥ λₙ and spectral gap parameter λ = max(|λ₂|, |λₙ|), then for all subsets S, T ⊆ V,

|e(S, T) − (d/n)·|S|·|T|| ≤ λ·√(|S|·|T|),

where e(S, T) counts ordered edges from S to T. The term (d/n)·|S|·|T| is exactly the number of edges a random d-regular graph would put between S and T; the eigenvalue λ bounds the deviation. Small λ means near-perfect pseudorandomness.

  • FieldSpectral graph theory / combinatorics
  • First provedAlon & Chung, 1988 (spectral form)
  • Key hypothesisd-regularity; λ = max(|λ₂|, |λₙ|)
  • Statement|e(S,T) − (d/n)|S||T|| ≤ λ√(|S||T|)
  • Proof techniqueSpectral decomposition + Cauchy–Schwarz
  • Generalizes toIrregular graphs, hypergraphs, buildings

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

The precise statement

Let G = (V, E) be a d-regular graph on n = |V| vertices with adjacency matrix A. Because A is real symmetric, the spectral theorem gives real eigenvalues d = λ₁ ≥ λ₂ ≥ ⋯ ≥ λₙ ≥ −d, with the all-ones vector 𝟙 an eigenvector for λ₁ = d. Define the spectral gap parameter

λ := max(|λ₂|, |λₙ|),

the largest absolute eigenvalue other than d. For any two subsets S, T ⊆ V, write e(S, T) = |{(u, v) ∈ S × T : uv ∈ E}| for the number of ordered edges between them (edges inside S ∩ T counted twice). The Expander Mixing Lemma (Alon–Chung, 1988) asserts

| e(S, T) − (d/n)·|S|·|T| | ≤ λ·√(|S|·|T|).

A slightly sharper version replaces the right side by λ·√(|S||T|(1 − |S|/n)(1 − |T|/n)). The quantity (d/n)|S||T| is the expected edge count in the Erdős–Rényi / random-regular model, so the lemma bounds discrepancy from perfect randomness by a single spectral quantity.

The picture: one eigenvalue, all cuts at once

Think of the normalized adjacency operator A/d as a diffusion step: it averages a function over each vertex's neighbors. On the constant direction 𝟙 it acts as the identity (eigenvalue 1); on every direction orthogonal to 𝟙 it shrinks by a factor at most λ/d. So after one step, any 'signal' orthogonal to the uniform distribution decays by λ/d. Edges between S and T are exactly a bilinear form ⟨𝟙_S, A 𝟙_T⟩ evaluated on indicator vectors.

Decompose each indicator into its uniform part (which lives along 𝟙) plus a mean-zero fluctuation. The uniform parts interact through the top eigenvalue d and produce precisely the 'expected' term (d/n)|S||T|. The fluctuations interact through the operator restricted to 𝟙⊥, where its norm is at most λ. The entire deviation from randomness is therefore squeezed into λ times a product of fluctuation norms — and those norms are just √(|S|) and √(|T|) sized quantities. One eigenvalue governs every subset pair simultaneously.

Key idea of the proof: project, then Cauchy–Schwarz

Write the indicator 𝟙_S = (|S|/n)𝟙 + f, where f = 𝟙_S − (|S|/n)𝟙 is orthogonal to 𝟙 (it has mean zero), and similarly 𝟙_T = (|T|/n)𝟙 + g. Then

e(S, T) = 𝟙_S^⊤ A 𝟙_T = (|S||T|/n²)·(𝟙^⊤ A 𝟙) + f^⊤ A g,

since the cross terms vanish: A𝟙 = d𝟙 is along 𝟙, and f, g ⟂ 𝟙. As 𝟙^⊤A𝟙 = d·n, the first term is exactly (d/n)|S||T|. It remains to bound the error f^⊤ A g. Because f, g lie in the invariant subspace 𝟙⊥, the operator norm of A there is λ = max(|λ₂|,|λₙ|), so |f^⊤ A g| ≤ λ‖f‖‖g‖ by the spectral bound plus Cauchy–Schwarz. Finally ‖f‖² = |S|(1 − |S|/n) ≤ |S| and ‖g‖² ≤ |T|, giving |f^⊤A g| ≤ λ√(|S||T|). Keeping the (1 − |S|/n) factors yields the sharp form. The whole argument is orthogonal projection followed by one inequality.

Worked example: the Petersen graph

The Petersen graph is 3-regular on n = 10 vertices with adjacency spectrum 3, 1, 1, 1, 1, 1, −2, −2, −2, −2. Thus λ₂ = 1, λ₁₀ = −2, so λ = max(1, 2) = 2. Take S = T a 5-vertex independent set (Petersen has independence number 4, so let S be a 4-vertex independent set instead, |S| = 4, and e(S, S) = 0). The lemma predicts

|0 − (3/10)·4·4| ≤ 2·√(16), i.e. 4.8 ≤ 8. ✓

Now the sharp form: λ·√(|S||T|(1−|S|/n)(1−|T|/n)) = 2·√(4·4·0.6·0.6) = 2·√(16·0.36) = 2·√5.76 = 2·2.4 = 4.8, so the sharp bound gives exactly 4.8 ≥ 4.8 — tight to the discrepancy. This tightness is characteristic: subsets aligned with the extreme eigenvectors (here the −2 eigenspace) saturate the inequality, which is why √(d−1)-type gaps are extremal for sparse regular graphs.

Why the hypotheses matter — and what breaks

Regularity is essential. The clean split into a uniform part plus 𝟙⊥ needs 𝟙 to be an eigenvector, which requires every row of A to sum to d. Drop it and (d/n)|S||T| is no longer the expectation; the irregular generalization (Chung; Bollobás–Nikiforov) replaces d/n by the ratio 2|E|/n² with an extra additive error, or works with the normalized Laplacian eigenvalues.

The two-sided gap matters. Using λ = max(|λ₂|,|λₙ|), not just |λ₂|, is crucial: a bipartite d-regular graph has λₙ = −d, so λ = d and the bound is vacuous — correctly, since e(A, B) between the two sides is wildly non-random. A large negative eigenvalue signals near-bipartiteness, a genuine obstruction to mixing.

Disconnection. Two disjoint copies of K_{d+1} have λ₂ = d, again λ = d: the lemma correctly refuses to certify mixing across the components. The lemma is a converse-friendly quantitative statement — Bilu–Linial (2006) proved a near-converse: small discrepancy forces λ = O(α·log(d/α)).

Why it matters: what the lemma unlocks

The Expander Mixing Lemma is the workhorse that turns a spectral gap into combinatorial pseudorandomness, and it underlies much of theoretical computer science. It gives instant proofs that expanders are excellent samplers and randomness extractors: a short random walk hits every large set with near-correct frequency, powering probability amplification and derandomization. It yields the expander-based error-correcting codes of Sipser–Spielman and Tanner, whose distance is bounded via edge discrepancy. In extremal combinatorics it proves that expanders contain the 'right' count of small subgraphs, connecting to the Chung–Graham–Wilson theory of quasirandom graphs, where seven equivalent pseudorandomness conditions include this discrepancy bound. It quantifies Markov chain mixing times through λ/d. Combined with the Alon–Boppana lower bound λ ≥ 2√(d−1) − o(1), it certifies that Ramanujan graphs (Lubotzky–Phillips–Sarnak, 1988) are optimally pseudorandom — a bridge from number theory and automorphic forms to concrete network design.

How the spectral gap parameter λ controls edge pseudorandomness for a d-regular graph on n vertices. Smaller λ (relative to d) means edges are distributed more like a random graph.
Graph typeλ = max(|λ₂|,|λₙ|)Discrepancy bound λ√(|S||T|)Interpretation
Complete graph Kₙ (d = n−1)λ = 1√(|S||T|)Perfectly mixed; smallest possible λ
Ramanujan graphλ ≤ 2√(d−1)2√(d−1)·√(|S||T|)Optimal sparse expander (Alon–Boppana tight)
Random d-regular graphλ ≈ 2√(d−1)≈ 2√(d−1)·√(|S||T|)Almost Ramanujan with high probability
Disjoint union of two K_{d+1}λ = dd·√(|S||T|)Bound vacuous; not an expander
Bipartite d-regular graphλₙ = −d, so λ = dd·√(|S||T|)Two-sided gap fails; use |λ₂| variant

Frequently asked questions

Why is λ the second-largest eigenvalue in absolute value, not just λ₂?

Because both extremes of the spectrum obstruct mixing. A large negative eigenvalue λₙ near −d signals near-bipartite structure, which makes edges between the two sides highly non-random. Setting λ = max(|λ₂|, |λₙ|) captures the operator norm of A restricted to 𝟙⊥, which is exactly what bounds the error term f⊤Ag. If you only used |λ₂|, a bipartite graph (λₙ = −d) would falsely appear to mix.

Is the bound tight?

Yes, up to constants, and sometimes exactly. Choosing S and T aligned with the eigenvectors of the extremal eigenvalue saturates the Cauchy–Schwarz step. On the Petersen graph the sharp form is attained to the decimal. More broadly, the Alon–Boppana bound λ ≥ 2√(d−1) − oₙ(1) shows no sparse d-regular family can beat the discrepancy that λ = 2√(d−1) produces, so Ramanujan graphs are essentially optimal.

Does a converse hold — does small discrepancy imply a spectral gap?

Approximately. Bilu and Linial (2006) proved that if |e(S,T) − (d/n)|S||T|| ≤ α√(|S||T|) for all S, T, then λ = O(α · log(d/α)). So discrepancy and spectral gap are equivalent up to a logarithmic factor. The log is genuinely necessary — there exist graphs with small discrepancy but λ larger than α by a logarithmic amount, so the converse is not perfectly clean.

What changes for irregular graphs?

Regularity makes 𝟙 an eigenvector, which is what produces the exact expected term (d/n)|S||T|. Without it you work with the normalized adjacency matrix D^{−1/2}AD^{−1/2} (D the degree matrix) and its eigenvalues, or use the normalized Laplacian. The expected term becomes vol(S)·vol(T)/vol(V) where vol(S) = ∑ degrees, and the bound picks up √(vol(S)vol(T)) with an extra small additive error (Chung; Bollobás–Nikiforov).

How does e(S,T) count edges inside S ∩ T?

As defined, e(S,T) = 𝟙_S⊤ A 𝟙_T counts ordered pairs, so an edge with both endpoints in S ∩ T is counted twice (once each direction). This convention makes e(S,T) a clean bilinear form and keeps the proof one line. If you want unordered edges strictly between disjoint sets, take S, T disjoint or adjust by a factor of two; the discrepancy bound is unaffected up to that bookkeeping.

Why does the all-ones vector give exactly the random-graph term?

Regularity forces A𝟙 = d𝟙, so 𝟙 is the top eigenvector. Projecting 𝟙_S onto 𝟙 gives the average density |S|/n. The product of the two projected components, scaled by the top eigenvalue d, is (|S|/n)(|T|/n)·(d·n) = (d/n)|S||T| — precisely the edge count expected if each of the possible pairs were joined with probability d/n. Everything orthogonal to 𝟙 is 'noise' controlled by λ.