High-Dimensional Probability

Nine modules, one per chapter: tail bounds, concentration of sums, random vectors and matrices, Johnson–Lindenstrauss, quadratic forms, Gaussian width, VC dimension and sparse recovery. Run a simulation, move a slider, place points, work through an example one step at a time, then check yourself with concept questions and practice problems.

Follows the chapter order of R. Vershynin, High-Dimensional Probability: An Introduction with Applications in Data Science, 2nd ed. (Cambridge University Press; pre-publication version of November 2025). Chapters 1–9 are covered, one module each; the short opening "Appetizer" is not. Chapter and exercise numbers refer to that edition; the questions and examples here are written for this page.

InteractiveVershynin, Ch. 1: A Quick Refresher on Analysis and Probability

Tail bounds from moments

Almost every estimate in high-dimensional probability starts from a few blunt tools: Jensen, Markov, Chebyshev and the union bound. They are crude, but in a way you can control. Here you can see how much each one gives away, and why the next chapter wants exponential moments.

The idea

LpL^p norms. For a random variable XX and p≥1p\ge1, ‖X‖Lp=(𝔼|X|p)1/p\|X\|_{L^p}=(\mathbb E|X|^p)^{1/p}, and ‖X‖L∞\|X\|_{L^\infty} is the essential supremum of |X||X|. These norms increase with pp.
Jensen. If φ\varphi is convex, then φ(𝔼X)≤𝔼φ(X)\varphi(\mathbb E X)\le\mathbb E\,\varphi(X).
Markov and its relatives. If X≥0X\ge0 and t>0t>0, then ℙ(X≥t)≤𝔼X/t\mathbb P(X\ge t)\le \mathbb E X/t. Applying this to |X|p|X|^p or to (X−𝔼X)2(X-\mathbb E X)^2 gives
ℙ(|X|≥t)≤𝔼|X|ptp,ℙ(|X−𝔼X|≥t)≤Var⁡Xt2  (Chebyshev).\mathbb P(|X|\ge t)\le\frac{\mathbb E|X|^p}{t^p}, \qquad \mathbb P\big(|X-\mathbb E X|\ge t\big)\le\frac{\operatorname{Var}X}{t^2}\ \ \text{(Chebyshev)}.
Union bound. ℙ(A1∪⋯∪AN)≤∑iℙ(Ai)\mathbb P(A_1\cup\dots\cup A_N)\le\sum_i\mathbb P(A_i). It needs no independence, and it costs a factor NN, which is cheap whenever each ℙ(Ai)\mathbb P(A_i) is exponentially small.
Limit theorems. For i.i.d. XiX_i with mean μ\mu and variance σ2\sigma^2, the sample mean X‾N→μ\bar X_N\to\mu (law of large numbers) and N(X‾N−μ)/σ→N(0,1)\sqrt N(\bar X_N-\mu)/\sigma\to N(0,1) in distribution (central limit theorem).
Asymptotic is not a bound. The CLT says nothing about a fixed NN. Its error at finite NN (Berry–Esseen) is of order 1/N1/\sqrt N, which is far larger than the tiny tail probabilities we usually care about.

Explore

true tail Markov Chebyshev pp-th moment bound
Distribution of X

Worked example

You average NN i.i.d. measurements with unknown mean μ\mu and variance σ2=1\sigma^2=1. How large must NN be for |X‾N−μ|<0.1|\bar X_N-\mu|<0.1 with probability at least 0.990.99? And what if you run 1000 such experiments and want all of them to succeed at once?

  1. What does Chebyshev guarantee for one experiment?

    Var⁡X‾N=1/N\operatorname{Var}\bar X_N=1/N, so ℙ(|X‾N−μ|≥0.1)≤1/(0.01N)\mathbb P(|\bar X_N-\mu|\ge0.1)\le 1/(0.01N). This is at most 0.010.01 once N≥10000N\ge 10\,000.

  2. What does the CLT suggest instead?

    Treat N(X‾N−μ)\sqrt N(\bar X_N-\mu) as standard normal. A two-sided normal tail of 0.010.01 needs z≈2.576z\approx2.576, so 0.1N≥2.5760.1\sqrt N\ge 2.576, i.e. N≥664N\ge 664. That is 15 times fewer, but it is a heuristic, not a guarantee.

  3. Now 1000 experiments must all succeed with total failure probability 0.010.01. Use the union bound. What failure probability can each experiment have, and what NN does each method ask for?

    Each may fail with probability 10−510^{-5}. Chebyshev needs 1/(0.01N)≤10−51/(0.01N)\le10^{-5}, so N≥107N\ge10^7: a thousand times more. The normal heuristic needs z≈4.417z\approx4.417, so N≥(44.17)2≈1952N\ge(44.17)^2\approx1952: only three times more.

  4. Can you trust the 1952?

    Not from the CLT alone. The normal approximation to the distribution function has error of order 1/N≈0.021/\sqrt N\approx0.02 here, two thousand times bigger than the 10−510^{-5} we are estimating. Chebyshev is rigorous but only polynomial in 1/δ1/\delta. What we want is a rigorous bound with Gaussian-like decay at every finite NN. That is the next module.

Check your understanding

All you know about XX is that X≥0X\ge0 and 𝔼X=1\mathbb E X=1. What is the best upper bound on ℙ(X≥10)\mathbb P(X\ge10) that holds for every such XX?

  1. 1/101/10
  2. 1/1001/100A 1/t21/t^2 bound needs a second moment, and you don't know 𝔼X2\mathbb E X^2. It could be huge.
  3. e−10e^{-10}Exponential decay needs exponential moments. A nonnegative variable with mean 1 can have a heavy tail.
  4. There is no bound without more information.Markov's inequality uses exactly these two facts.
Markov gives 1/101/10, and nothing better is possible: X=10X=10 with probability 1/101/10 and X=0X=0 otherwise has mean 1 and ℙ(X≥10)=1/10\mathbb P(X\ge10)=1/10.

Which inequality holds for every random variable (with the expectations finite)?

  1. 𝔼|X|≤(𝔼X2)1/2\mathbb E|X|\le(\mathbb E X^2)^{1/2}
  2. 𝔼eX≤e𝔼X\mathbb E\,e^X\le e^{\mathbb E X}exe^x is convex, so Jensen goes the other way.
  3. 𝔼log⁡X≥log⁡𝔼X\mathbb E\log X\ge\log\mathbb E X for X>0X>0log⁡\log is concave, so Jensen gives ≤\le.
  4. 𝔼X≥𝔼X\mathbb E\sqrt{X}\ge\sqrt{\mathbb E X} for X≥0X\ge0x\sqrt{x} is concave; try X∈{0,4}X\in\{0,4\} with equal probability.
Apply Jensen to the convex function x↦x2x\mapsto x^2 and the variable |X||X|: (𝔼|X|)2≤𝔼X2(\mathbb E|X|)^2\le\mathbb E X^2. It is the case p=1≤q=2p=1\le q=2 of the monotonicity of LpL^p norms.

You have 10610^6 events, each of probability at most e−t2/2e^{-t^2/2}. Roughly how large must tt be for the union bound to give ℙ(any event)≤0.01\mathbb P(\text{any event})\le0.01?

  1. t≈6.1t\approx6.1
  2. t≈2.6t\approx2.6That makes a single event unlikely. With a million of them you need each to have probability 10−810^{-8}.
  3. t≈1000t\approx1000The number of events enters only through a logarithm, not through tt itself.
  4. The union bound is useless for a million events.It loses a factor 10610^6, but a Gaussian tail absorbs that easily.
Need 106e−t2/2≤10−210^6e^{-t^2/2}\le10^{-2}, i.e. t2≥2ln⁡108≈36.8t^2\ge2\ln10^8\approx36.8, so t≈6.07t\approx6.07. With Gaussian tails, a union bound over NN events costs only a factor 2ln⁡N\sqrt{2\ln N} in the threshold. This is used again and again in the later chapters.

Practice

Markov is sharp at every thresholdExtremal examples

Fix 0<a≤t0<a\le t. Find a nonnegative XX with 𝔼X=a\mathbb E X=a and ℙ(X≥t)=a/t\mathbb P(X\ge t)=a/t. Then show that if equality holds in Markov's inequality, XX must take only the values 00 and tt.

Hint

Write X≥t⋅𝟏{X≥t}X\ge t\cdot\mathbf 1\{X\ge t\} and ask when this is an equality.

Solution

Take X=tX=t with probability a/ta/t and X=0X=0 otherwise. In general X≥t𝟏{X≥t}X\ge t\,\mathbf 1\{X\ge t\} pointwise, so 𝔼X≥tℙ(X≥t)\mathbb E X\ge t\,\mathbb P(X\ge t). Equality forces X=t𝟏{X≥t}X=t\,\mathbf 1\{X\ge t\} almost surely, so X∈{0,t}X\in\{0,t\}.

When is the union bound nearly exact?Independent rare events

Let A1,…,ANA_1,\dots,A_N be independent with ℙ(Ai)=δ\mathbb P(A_i)=\delta. Show that Nδ(1−Nδ2)≤ℙ(⋃Ai)≤NδN\delta\big(1-\tfrac{N\delta}{2}\big)\le\mathbb P(\bigcup A_i)\le N\delta. What does this say when Nδ=0.01N\delta=0.01?

Hint

ℙ(⋃Ai)=1−(1−δ)N\mathbb P(\bigcup A_i)=1-(1-\delta)^N. Use 1−x≤e−x1-x\le e^{-x} and e−y≤1−y+y2/2e^{-y}\le1-y+y^2/2 for y≥0y\ge0.

Solution

The upper bound is the union bound. For the lower, (1−δ)N≤e−Nδ≤1−Nδ+(Nδ)2/2(1-\delta)^N\le e^{-N\delta}\le1-N\delta+(N\delta)^2/2, so 1−(1−δ)N≥Nδ−(Nδ)2/21-(1-\delta)^N\ge N\delta-(N\delta)^2/2. With Nδ=0.01N\delta=0.01, the union bound is off by at most half a percent of its value. It is wasteful only when the events overlap heavily.

More practice: Vershynin, Exercises 1.11 and 1.16.

SimulationVershynin, Ch. 2: Concentration of Sums of Independent Random Variables

Concentration of sums

A sum of nn independent terms with values in [0,1][0,1] exceeds its mean by ss with probability at most e−2s2/ne^{-2s^2/n}, for every nn, not just in the limit. Hoeffding, Chernoff and Bernstein are three versions of this, and the differences between them matter exactly when some terms are rare.

The idea

Hoeffding. If ε1,…,εN\varepsilon_1,\dots,\varepsilon_N are independent random signs and a∈ℝNa\in\R^N, then ℙ(∑aiεi≥t)≤exp⁡(−t2/2‖a‖22)\mathbb P\big(\sum a_i\varepsilon_i\ge t\big)\le\exp\!\big(-t^2/2\|a\|_2^2\big). If instead Xi∈[mi,Mi]X_i\in[m_i,M_i] are independent,
ℙ(∑i=1N(Xi−𝔼Xi)≥t)≤exp⁡(−2t2∑i(Mi−mi)2).\mathbb P\Big(\sum_{i=1}^N(X_i-\mathbb E X_i)\ge t\Big)\le\exp\Big(-\frac{2t^2}{\sum_i(M_i-m_i)^2}\Big).
Chernoff. If XiX_i are independent Bernoulli(pi)(p_i), S=∑XiS=\sum X_i and μ=𝔼S\mu=\mathbb E S, then for t>μt>\mu,  ℙ(S≥t)≤e−μ(eμ/t)t\ \mathbb P(S\ge t)\le e^{-\mu}(e\mu/t)^t. For small μ\mu this behaves like a Poisson tail and is far smaller than Hoeffding's bound.

All of these come from one move: apply Markov to eλSe^{\lambda S}, factor 𝔼eλS\mathbb E e^{\lambda S} using independence, and optimise over λ\lambda.

Subgaussian. ‖X‖ψ2=inf⁡{K>0:𝔼exp⁡(X2/K2)≤2}\|X\|_{\psi_2}=\inf\{K>0:\mathbb E\exp(X^2/K^2)\le2\}. Finite ψ2\psi_2 norm is equivalent, up to absolute constants, to tails ℙ(|X|≥t)≤2e−t2/K2\mathbb P(|X|\ge t)\le2e^{-t^2/K^2}, to moments ‖X‖Lp≲Kp\|X\|_{L^p}\lesssim K\sqrt p, and (for mean zero) to 𝔼eλX≤eCK2λ2\mathbb E e^{\lambda X}\le e^{CK^2\lambda^2}.
General Hoeffding. For independent mean-zero subgaussian XiX_i,  ℙ(|∑Xi|≥t)≤2exp⁡(−ct2/∑‖Xi‖ψ22)\ \mathbb P\big(|\sum X_i|\ge t\big)\le2\exp\big(-ct^2/\sum\|X_i\|_{\psi_2}^2\big).
Bernstein. For independent mean-zero subexponential XiX_i (‖X‖ψ1=inf⁡{K:𝔼e|X|/K≤2}\|X\|_{\psi_1}=\inf\{K:\mathbb E e^{|X|/K}\le2\} finite), with K=max⁡‖Xi‖ψ1K=\max\|X_i\|_{\psi_1},
ℙ(|∑i=1NXi|≥t)≤2exp⁡(−cmin⁡(t2∑i‖Xi‖ψ12, tK)):\mathbb P\Big(\Big|\sum_{i=1}^N X_i\Big|\ge t\Big)\le2\exp\Big(-c\min\Big(\frac{t^2}{\sum_i\|X_i\|_{\psi_1}^2},\ \frac tK\Big)\Big):

a Gaussian tail for moderate tt, an exponential one far out.

Explore

exact ℙ(S≥k)\mathbb P(S\ge k), S∼Bin(n,p)S\sim\mathrm{Bin}(n,p) simulated Chebyshev Hoeffding Chernoff

Worked example

An A/B test estimates a click rate pp by the fraction p^\hat p of NN independent users who click. We want |p^−p|<0.01|\hat p-p|<0.01 with probability at least 0.9990.999. How many users are needed?

  1. Use Chebyshev, knowing only p(1−p)≤1/4p(1-p)\le1/4.

    ℙ(|p^−p|≥0.01)≤p(1−p)N⋅10−4≤14N⋅10−4\mathbb P(|\hat p-p|\ge0.01)\le\dfrac{p(1-p)}{N\cdot 10^{-4}}\le\dfrac{1}{4N\cdot10^{-4}}. Setting this to 10−310^{-3} gives N≥2500000N\ge2\,500\,000.

  2. Use Hoeffding (each click indicator lies in [0,1][0,1]).

    Two-sided: ℙ(|p^−p|≥ε)≤2e−2Nε2\mathbb P(|\hat p-p|\ge\varepsilon)\le2e^{-2N\varepsilon^2}. We need 2e−2N⋅10−4≤10−32e^{-2N\cdot10^{-4}}\le10^{-3}, i.e. N≥ln⁡(2000)/(2⋅10−4)≈38005N\ge\ln(2000)/(2\cdot10^{-4})\approx38\,005. Sixty-five times fewer users.

  3. Suppose you also know p≤0.02p\le0.02. Bernstein's inequality for variables with |Xi−p|≤1|X_i-p|\le1 reads ℙ(|∑(Xi−p)|≥t)≤2exp⁡(−t2/2Nσ2+t/3)\mathbb P(|\sum(X_i-p)|\ge t)\le2\exp\big(-\tfrac{t^2/2}{N\sigma^2+t/3}\big). What NN does it give?

    Here σ2=p(1−p)≤0.02⋅0.98=0.0196\sigma^2=p(1-p)\le0.02\cdot0.98=0.0196 and t=Nεt=N\varepsilon, so the exponent is Nε2/(2(σ2+ε/3))N\varepsilon^2/\big(2(\sigma^2+\varepsilon/3)\big). We need it to be at least ln⁡2000≈7.60\ln2000\approx7.60:

    N ≥ 2(0.0196+0.00333)⋅7.6010−4 ≈ 3487.N\ \ge\ \frac{2\,(0.0196+0.00333)\cdot7.60}{10^{-4}}\ \approx\ 3487.

    Another factor of 11. Hoeffding pays for the worst-case variance 1/41/4; Bernstein pays only for the actual variance.

  4. How does each answer scale with the failure probability δ\delta?

    Chebyshev needs N∝1/δN\propto1/\delta; Hoeffding and Bernstein need N∝log⁡(1/δ)N\propto\log(1/\delta). Asking for δ=10−6\delta=10^{-6} instead of 10−310^{-3} multiplies the Chebyshev answer by 1000, but the Hoeffding answer by less than 2.

Check your understanding

Which of these random variables is not subgaussian?

  1. A random variable with |X|≤5|X|\le 5 almost surelyBounded variables are subgaussian: 𝔼eX2/K2≤e25/K2\mathbb E e^{X^2/K^2}\le e^{25/K^2}, which is at most 2 for large KK.
  2. N(0,σ2)N(0,\sigma^2)The Gaussian is the model subgaussian variable, with ‖X‖ψ2\|X\|_{\psi_2} a constant times σ\sigma.
  3. An exponential random variable
  4. A sum of 100 independent random signsThat sum is bounded by 100, and better, it has ψ2\psi_2 norm of order 100\sqrt{100}.
ℙ(X≥t)=e−t\mathbb P(X\ge t)=e^{-t} decays only exponentially, so 𝔼eX2/K2=∞\mathbb E e^{X^2/K^2}=\infty for every KK. The exponential is the model subexponential variable, which is where Bernstein's inequality takes over.

S∼Bin(104,10−4)S\sim\mathrm{Bin}(10^4,10^{-4}), so 𝔼S=1\mathbb E S=1. Hoeffding bounds ℙ(S≥10)\mathbb P(S\ge10) by about 0.980.98; Chernoff by about 8×10−78\times10^{-7}. Why is Hoeffding so weak here?

  1. It only uses that each term lies in [0,1][0,1], not that each term is almost always 0.
  2. Hoeffding needs identically distributed terms.It doesn't, and these terms are identically distributed anyway.
  3. Hoeffding needs symmetric terms.The version for bounded variables needs only independence and the ranges.
  4. Hoeffding only holds for large nn.It holds for every nn. It is a true bound here, just a useless one.
Hoeffding's exponent 2t2/n2t^2/n is what you'd get if every term had the largest variance a [0,1][0,1] variable can have, namely 1/41/4. Here the variance is 10−410^{-4}. Chernoff (or Bernstein) sees the true variance. Try p=0.005p=0.005 in the explorer.

Let Xi=gi2−1X_i=g_i^2-1 with gig_i i.i.d. standard normal, so the XiX_i are mean-zero subexponential. For which deviations tt does Bernstein give a Gaussian-type bound e−ct2/Ne^{-ct^2/N} for ℙ(|∑i≤NXi|≥t)\mathbb P(|\sum_{i\le N}X_i|\ge t)?

  1. For t≲Nt\lesssim N
  2. For t≳Nt\gtrsim NCompare t2/Nt^2/N with tt: which is smaller when tt is large?
  3. For all ttThen ∑Xi\sum X_i would be subgaussian, but ℙ(X1≥t)\mathbb P(X_1\ge t) alone already decays like e−t/2e^{-t/2}.
  4. Only for t≲Nt\lesssim\sqrt NN\sqrt N is the typical size of the sum, but the Gaussian regime extends much further.
The minimum of t2/Nt^2/N and tt is t2/Nt^2/N exactly when t≤Nt\le N. So the sum looks Gaussian (scale N\sqrt N) well into its tail, and only beyond t≈Nt\approx N does the exponential tail of a single term take over.

Practice

Two subgaussian normsComputing ψ₂ from the definition

(a) Show that if |X|≤M|X|\le M, then ‖X‖ψ2≤M/ln⁡2\|X\|_{\psi_2}\le M/\sqrt{\ln2}, with equality for X=±MX=\pm M with equal probability. (b) Compute ‖g‖ψ2\|g\|_{\psi_2} for g∼N(0,1)g\sim N(0,1).

Hint

For (b), 𝔼esg2=(1−2s)−1/2\mathbb E e^{sg^2}=(1-2s)^{-1/2} for s<1/2s<1/2.

Solution

(a) 𝔼eX2/K2≤eM2/K2≤2\mathbb E e^{X^2/K^2}\le e^{M^2/K^2}\le2 once K2≥M2/ln⁡2K^2\ge M^2/\ln2; for X=±MX=\pm M the first inequality is an equality, so this KK is the smallest. (b) Set (1−2/K2)−1/2=2(1-2/K^2)^{-1/2}=2: then 1−2/K2=1/41-2/K^2=1/4, K2=8/3K^2=8/3, ‖g‖ψ2=8/3≈1.633\|g\|_{\psi_2}=\sqrt{8/3}\approx1.633.

From MGFs to a tail boundThe exponential moment method

Suppose X1,…,XNX_1,\dots,X_N are independent and 𝔼eλXi≤eλ2σi2/2\mathbb E e^{\lambda X_i}\le e^{\lambda^2\sigma_i^2/2} for all λ∈ℝ\lambda\in\R. Prove ℙ(∑Xi≥t)≤exp⁡(−t2/2∑σi2)\mathbb P(\sum X_i\ge t)\le\exp\big(-t^2/2\sum\sigma_i^2\big) for t≥0t\ge0.

Solution

For λ>0\lambda>0, Markov and independence give ℙ(S≥t)≤e−λt∏𝔼eλXi≤exp⁡(−λt+λ2V/2)\mathbb P(S\ge t)\le e^{-\lambda t}\prod\mathbb E e^{\lambda X_i}\le\exp(-\lambda t+\lambda^2V/2) with V=∑σi2V=\sum\sigma_i^2. The exponent is smallest at λ=t/V\lambda=t/V, where it equals −t2/2V-t^2/2V. Random signs satisfy the hypothesis with σi=|ai|\sigma_i=|a_i|, because cosh⁡x≤ex2/2\cosh x\le e^{x^2/2}; this recovers Hoeffding.

More practice: Vershynin, Exercises 2.13 and 2.25.

SimulationVershynin, Ch. 3: Random Vectors in High Dimensions

Random vectors in high dimensions

A standard Gaussian vector in ℝn\R^n has length n±O(1)\sqrt n\pm O(1), and two independent ones are almost perpendicular. Both facts are concentration of a sum, and together they make high-dimensional space behave very differently from the plane.

The idea

Concentration of the norm. If X=(X1,…,Xn)X=(X_1,\dots,X_n) has independent coordinates with 𝔼Xi2=1\mathbb E X_i^2=1 and ‖Xi‖ψ2≤K\|X_i\|_{\psi_2}\le K, then ‖‖X‖2−n‖ψ2≤CK2\big\|\,\|X\|_2-\sqrt n\,\big\|_{\psi_2}\le CK^2. The length is n\sqrt n up to a fluctuation that does not grow with nn.
Isotropic. A random vector is isotropic if 𝔼XX𝖳=In\mathbb E XX^{\mathsf T}=I_n, i.e. 𝔼⟨X,x⟩2=‖x‖22\mathbb E\langle X,x\rangle^2=\|x\|_2^2 for every xx. Then 𝔼‖X‖22=n\mathbb E\|X\|_2^2=n, and for an independent isotropic YY, 𝔼⟨X,Y⟩2=n\mathbb E\langle X,Y\rangle^2=n.

So cos⁡∠(X,Y)≈⟨X,Y⟩/n\cos\angle(X,Y)\approx\langle X,Y\rangle/n is typically of size 1/n1/\sqrt n: independent random directions are nearly orthogonal. Examples of isotropic distributions: N(0,In)N(0,I_n), the uniform distribution on the sphere of radius n\sqrt n, random sign vectors, and the coordinate distribution nei\sqrt n\,e_i with ii uniform.

Covariance and PCA. Σ=𝔼(X−μ)(X−μ)𝖳\Sigma=\mathbb E(X-\mu)(X-\mu)^{\mathsf T}. The top eigenvector of Σ\Sigma is the direction uu that maximises Var⁡⟨X,u⟩\operatorname{Var}\langle X,u\rangle; the next ones maximise it orthogonally to the previous.
Grothendieck and max-cut. Relaxing ±1\pm1 labels to unit vectors turns hard quadratic optimisation into a semidefinite program. Grothendieck's inequality says the relaxation loses only a constant factor. For max-cut, rounding the SDP vectors with a random hyperplane (Goemans–Williamson) gives, in expectation, at least 0.8780.878 times the SDP value, hence at least 0.8780.878 times the maximum cut.

Explore

Coordinates
Left plot shows
Lengths of 1000 random vectors with independent unit-variance coordinates. normal approximation
Angles between 500 independent pairs. normal with sd 57.3°/√n

Worked example

Run Goemans–Williamson by hand on the 5-cycle C5C_5 (vertices 0,…,40,\dots,4, edges {k,k+1}\{k,k+1\} mod 5). The SDP is: maximise ∑{i,j}∈E12(1−⟨ui,uj⟩)\sum_{\{i,j\}\in E}\tfrac12(1-\langle u_i,u_j\rangle) over unit vectors uiu_i.

  1. What is the maximum cut of C5C_5?

    4. A cut of all 5 edges would 2-colour an odd cycle, which is impossible; alternating labels around the cycle cut 4 edges.

  2. Try planar vectors uk=(cos⁡4πk5,sin⁡4πk5)u_k=(\cos\tfrac{4\pi k}5,\sin\tfrac{4\pi k}5). What SDP value do they give?

    Neighbours are at angle 4π/54\pi/5, so each edge contributes 12(1−cos⁡4π5)=12(1+cos⁡π5)≈0.9045\tfrac12(1-\cos\tfrac{4\pi}5)=\tfrac12(1+\cos\tfrac\pi5)\approx0.9045, and the total is 52(1+cos⁡π5)≈4.523\tfrac52(1+\cos\tfrac\pi5)\approx4.523. The relaxation beats every actual cut.

  3. Show no unit vectors do better. (Write the objective with the graph Laplacian LL and the Gram matrix G=(⟨ui,uj⟩)G=(\langle u_i,u_j\rangle).)

    ∑E12(1−⟨ui,uj⟩)=14∑E‖ui−uj‖2=14tr⁡(LG)≤14λmax⁡(L)tr⁡G=n4λmax⁡(L)\sum_{E}\tfrac12(1-\langle u_i,u_j\rangle)=\tfrac14\sum_E\|u_i-u_j\|^2=\tfrac14\operatorname{tr}(LG)\le\tfrac14\lambda_{\max}(L)\operatorname{tr}G=\tfrac n4\lambda_{\max}(L), since G⪰0G\succeq0 with unit diagonal. For C5C_5, λmax⁡(L)=2−2cos⁡4π5\lambda_{\max}(L)=2-2\cos\tfrac{4\pi}5, so the bound is 54(2+2cos⁡π5)≈4.523\tfrac54\big(2+2\cos\tfrac\pi5\big)\approx4.523. The planar vectors are optimal.

  4. Round with a random hyperplane through the origin: vertex ii goes to the side given by the sign of ⟨g,ui⟩\langle g,u_i\rangle. What is the expected cut, and how does it compare with the guarantee?

    An edge is cut when the hyperplane separates its two vectors, which happens with probability (angle)/π=4/5/\pi=4/5. So the expected cut is 5⋅45=45\cdot\tfrac45=4: the rounding finds a maximum cut on average. The ratio to the SDP value is 4/4.523≈0.8844/4.523\approx0.884, just above the 0.8780.878 guarantee; C5C_5 is close to the worst case.

Check your understanding

X∼N(0,In)X\sim N(0,I_n) with n=104n=10^4. Which description of ‖X‖2\|X\|_2 is right?

  1. About 100100, give or take about 11
  2. About 100100, give or take about 1010‖X‖2\|X\|^2 fluctuates by about 2n≈141\sqrt{2n}\approx141 around 10410^4, but taking a square root divides that by 2n=2002\sqrt n=200.
  3. About 10410^4, give or take about 100100That describes ‖X‖22\|X\|_2^2, not ‖X‖2\|X\|_2.
  4. Anywhere between 00 and 200200 with comparable probabilityThe density of XX peaks at the origin, but the volume near the origin is tiny. Look at the left histogram.
‖X‖=n+(‖X‖2−n)≈n+‖X‖2−n2n\|X\|=\sqrt{n+(\|X\|^2-n)}\approx\sqrt n+\frac{\|X\|^2-n}{2\sqrt n}, and ‖X‖2−n\|X\|^2-n has standard deviation 2n\sqrt{2n}. So the fluctuation is about 2n/(2n)=1/2\sqrt{2n}/(2\sqrt n)=1/\sqrt2, whatever nn is.

u,vu,v are independent and uniform on the unit sphere Sn−1S^{n-1}. What is the typical size of ⟨u,v⟩\langle u,v\rangle?

  1. Of order 1/n1/\sqrt n
  2. Of order 1/n1/nThat is the size of 𝔼⟨u,v⟩2\mathbb E\langle u,v\rangle^2, not of |⟨u,v⟩||\langle u,v\rangle|.
  3. Of order 1In the plane, yes. In high dimension, almost all of the sphere is near the "equator" orthogonal to uu.
  4. Exactly 0Orthogonality is approximate; ⟨u,v⟩\langle u,v\rangle has a continuous distribution.
Condition on uu; by rotation invariance ⟨u,v⟩\langle u,v\rangle has the law of one coordinate of vv, and 𝔼v12=1/n\mathbb E v_1^2=1/n. In the explorer this is the shrinking spread of the angle histogram around 90°.

In ℝn\R^n you want unit vectors that are pairwise almost orthogonal: |⟨ui,uj⟩|≤0.1|\langle u_i,u_j\rangle|\le0.1 for i≠ji\ne j. How many can you have?

  1. Exponentially many in nn
  2. At most nnThat is the limit for exactly orthogonal vectors. A little slack changes everything.
  3. At most n2n^2Count with random vectors and the union bound: the failure probability per pair is exponentially small.
  4. At most 10n10nTry the union bound on NN random vectors: for which NN does it still work?
For random unit vectors, ℙ(|⟨ui,uj⟩|>0.1)≤2e−cn\mathbb P(|\langle u_i,u_j\rangle|>0.1)\le2e^{-cn}. A union bound over N2N^2 pairs succeeds as long as N2e−cn<1N^2e^{-cn}<1, so N=ecn/2N=e^{cn/2} vectors work. This is one reason high-dimensional data can hold so many "independent" directions.

Practice

Volume lives near the surfaceThe uniform distribution on a ball

XX is uniform in the unit ball of ℝn\R^n. Show ℙ(‖X‖2≤1−ε)≤e−εn\mathbb P(\|X\|_2\le1-\varepsilon)\le e^{-\varepsilon n}. For n=1000n=1000, how thin is the outer shell that holds 99% of the volume?

Solution

By scaling, ℙ(‖X‖≤r)=rn\mathbb P(\|X\|\le r)=r^n, so ℙ(‖X‖≤1−ε)=(1−ε)n≤e−εn\mathbb P(\|X\|\le1-\varepsilon)=(1-\varepsilon)^n\le e^{-\varepsilon n}. For 99% in the shell, solve (1−ε)1000=0.01(1-\varepsilon)^{1000}=0.01: ε=1−0.011/1000≈0.0046\varepsilon=1-0.01^{1/1000}\approx0.0046.

Norm concentration with only two momentsA Chebyshev version

For X∼N(0,In)X\sim N(0,I_n), use Var⁡‖X‖2=2n\operatorname{Var}\|X\|^2=2n and the inequality |a−b|≤|a2−b2|/b|a-b|\le|a^2-b^2|/b (for a≥0a\ge0, b>0b>0) to show ℙ(|‖X‖2−n|≥t)≤2/t2\mathbb P\big(|\|X\|_2-\sqrt n|\ge t\big)\le2/t^2. What does the theorem above add?

Solution

|‖X‖−n|≤|‖X‖2−n|/n|\|X\|-\sqrt n|\le|\|X\|^2-n|/\sqrt n, so ℙ(|‖X‖−n|≥t)≤ℙ(|‖X‖2−n|≥tn)≤2n/(t2n)=2/t2\mathbb P(|\|X\|-\sqrt n|\ge t)\le\mathbb P(|\|X\|^2-n|\ge t\sqrt n)\le 2n/(t^2n)=2/t^2. This already shows fluctuations are O(1)O(1). The theorem upgrades the 1/t21/t^2 tail to a subgaussian 2e−ct22e^{-ct^2}, which is what union bounds over many vectors need.

More practice: Vershynin, Exercises 3.12 and 3.41.

SimulationVershynin, Ch. 4: Random Matrices

Singular values of random matrices

A tall m×nm\times n random matrix stretches every direction by almost the same factor m\sqrt m: its singular values all lie in [m−Cn, m+Cn][\sqrt m-C\sqrt n,\ \sqrt m+C\sqrt n]. The proof combines one-direction concentration with a union bound over an ε\varepsilon-net of the sphere.

The idea

Singular values. s1(A)≥⋯≥sn(A)≥0s_1(A)\ge\dots\ge s_n(A)\ge0 are the square roots of the eigenvalues of A𝖳AA^{\mathsf T}A.  s1=‖A‖=maxx∈Sn−1⁡‖Ax‖2\ s_1=\|A\|=\max_{x\in S^{n-1}}\|Ax\|_2 and, for m≥nm\ge n, sn=minx∈Sn−1⁡‖Ax‖2s_n=\min_{x\in S^{n-1}}\|Ax\|_2. All singular values lie in [a,b][a,b] exactly when a‖x‖≤‖Ax‖≤b‖x‖a\|x\|\le\|Ax\|\le b\|x\| for every xx.
Nets and covering numbers. 𝒩⊆K\mathcal N\subseteq K is an ε\varepsilon-net of KK if every point of KK is within ε\varepsilon of 𝒩\mathcal N. The smallest size is the covering number N(K,ε)N(K,\varepsilon). By a volume argument, N(Sn−1,ε)≤(1+2/ε)nN(S^{n-1},\varepsilon)\le(1+2/\varepsilon)^n.
Two-sided bound. If AA is m×nm\times n with independent, mean-zero, isotropic, subgaussian rows, ‖Ai‖ψ2≤K\|A_i\|_{\psi_2}\le K, then for every t≥0t\ge0, with probability at least 1−2e−t21-2e^{-t^2},
m−CK2(n+t) ≤ sn(A) ≤ s1(A) ≤ m+CK2(n+t).\sqrt m-CK^2(\sqrt n+t)\ \le\ s_n(A)\ \le\ s_1(A)\ \le\ \sqrt m+CK^2(\sqrt n+t).

For Gaussian entries the constant is sharp: 𝔼s1≤m+n\mathbb E s_1\le\sqrt m+\sqrt n and 𝔼sn≥m−n\mathbb E s_n\ge\sqrt m-\sqrt n (proved in Chapter 7). Equivalently, ‖1mA𝖳A−In‖≲n/m+n/m\|\tfrac1mA^{\mathsf T}A-I_n\|\lesssim\sqrt{n/m}+n/m.

Covariance estimation. For mm i.i.d. subgaussian samples in ℝn\R^n with covariance Σ\Sigma, the sample covariance satisfies 𝔼‖Σm−Σ‖≲(n/m+n/m)‖Σ‖\mathbb E\|\Sigma_m-\Sigma\|\lesssim\big(\sqrt{n/m}+n/m\big)\|\Sigma\|. So m≈n/ε2m\approx n/\varepsilon^2 samples give relative error ε\varepsilon: linear in the dimension.

Explore

Singular values of m×nm\times n matrices with i.i.d. N(0,1)N(0,1) entries, divided by m\sqrt m. [m−n, m+n]/m[\sqrt m-\sqrt n,\ \sqrt m+\sqrt n]/\sqrt m Marchenko–Pastur limit latest draw

Worked example

Bound the number of points needed for an ε\varepsilon-net of the sphere Sn−1S^{n-1}, and see why that number decides how many rows a random matrix needs.

  1. Take a maximal ε\varepsilon-separated subset 𝒩\mathcal N of Sn−1S^{n-1} (pairwise distances >ε>\varepsilon, and no point can be added). Why is it an ε\varepsilon-net?

    If some x∈Sn−1x\in S^{n-1} were at distance >ε>\varepsilon from all of 𝒩\mathcal N, we could add it and stay separated, contradicting maximality.

  2. Bound |𝒩||\mathcal N| by comparing volumes.

    Balls of radius ε/2\varepsilon/2 around the points of 𝒩\mathcal N are disjoint and all lie in the ball of radius 1+ε/21+\varepsilon/2. Comparing volumes,

    |𝒩|(ε2)n≤(1+ε2)n⟹|𝒩|≤(1+2ε)n.|\mathcal N|\Big(\frac\varepsilon2\Big)^n\le\Big(1+\frac\varepsilon2\Big)^n \quad\Longrightarrow\quad |\mathcal N|\le\Big(1+\frac2\varepsilon\Big)^n.

    For ε=1/2\varepsilon=1/2, at most 5n5^n points.

  3. For a fixed unit xx, ‖Ax‖2=∑i⟨Ai,x⟩2\|Ax\|^2=\sum_i\langle A_i,x\rangle^2 is a sum of mm independent terms with mean 1. What does Bernstein give?

    Each ⟨Ai,x⟩2−1\langle A_i,x\rangle^2-1 is mean-zero subexponential with norm ≲K2\lesssim K^2. Bernstein gives ℙ(|1m‖Ax‖2−1|≥12)≤2e−cm\mathbb P\big(|\tfrac1m\|Ax\|^2-1|\ge\tfrac12\big)\le2e^{-cm}, with cc depending only on KK.

  4. Union bound over a 12\tfrac12-net. When does it work?

    The probability that some net point fails is at most 2⋅5ne−cm2\cdot5^ne^{-cm}, which is small once m≥Cnm\ge Cn. Then ‖Ax‖≈m\|Ax\|\approx\sqrt m on the whole net, and an approximation argument (any xx is within 12\tfrac12 of a net point) extends the bounds to the whole sphere. The net has exponentially many points, but exponential concentration pays for them. That is why the number of rows needs to be only proportional to nn.

Check your understanding

AA is a 1000×101000\times10 matrix with i.i.d. N(0,1)N(0,1) entries. Where do you expect its singular values?

  1. Roughly in [28.5, 34.8][28.5,\ 34.8]
  2. Roughly in [0, 31.6][0,\ 31.6]The matrix is very tall, so it is far from singular: s10s_{10} is close to m\sqrt m, not to 0.
  3. Roughly in [990, 1010][990,\ 1010]Those would be eigenvalues of A𝖳AA^{\mathsf T}A if they concentrated to within ±10\pm10; singular values are their square roots.
  4. All within ±0.1\pm0.1 of 31.631.6The spread is of order n≈3.2\sqrt n\approx3.2, not o(1)o(1).
1000≈31.62\sqrt{1000}\approx31.62 and 10≈3.16\sqrt{10}\approx3.16, so [m−n,m+n]≈[28.5,34.8][\sqrt m-\sqrt n,\sqrt m+\sqrt n]\approx[28.5,34.8]. Set m=400m=400, n=4n=4 in the explorer for a similar ratio.

For a square n×nn\times n Gaussian matrix, m−n=0\sqrt m-\sqrt n=0. What is true of its smallest singular value?

  1. It is typically of order 1/n1/\sqrt n: much smaller than the rest, but not zero.
  2. It is typically of order n\sqrt n, like the others.Take n=mn=m in the explorer and look at the left end of the histogram.
  3. It is 0 with positive probability.The set of singular matrices has measure zero, so a Gaussian matrix is invertible almost surely.
The bound sn≥m−Cns_n\ge\sqrt m-C\sqrt n becomes trivial when m=nm=n. Finer arguments show sn(A)≈1/ns_n(A)\approx1/\sqrt n, while s1≈2ns_1\approx2\sqrt n, so the condition number is of order nn.

To show ‖A‖≤Cm\|A\|\le C\sqrt m by a union bound over a 12\tfrac12-net of Sn−1S^{n-1}, roughly how small must ℙ(‖Ax‖>C′m)\mathbb P(\|Ax\|>C'\sqrt m) be for a single fixed xx?

  1. Much smaller than 5−n5^{-n}
  2. Smaller than 1/n1/nThe net has about 5n5^n points, not nn.
  3. Smaller than 1/21/2That controls one direction. The norm is a maximum over all directions at once.
  4. It doesn't matter, the net handles it.The net only makes the set of directions finite. The union bound still costs its size.
The union bound multiplies the single-direction failure probability by |𝒩|≤5n|\mathcal N|\le5^n. Exponential tails e−cme^{-cm} beat this once m≳nm\gtrsim n. Polynomial (Chebyshev) tails would not.

Practice

All 2×2 sign matricesAn exact computation

Let AA be a 2×22\times2 matrix with independent ±1\pm1 entries. Find the distribution of ‖A‖\|A\| and s2(A)s_2(A), and compute 𝔼‖A‖\mathbb E\|A\| and 𝔼s2(A)\mathbb E s_2(A). Compare with m±n\sqrt m\pm\sqrt n.

Hint

The second row is either ±\pm the first row, or orthogonal to it.

Solution

With probability 1/21/2 the rows are ±\pm each other: AA has rank 1, ‖A‖=2\|A\|=2, s2=0s_2=0. Otherwise the rows are orthogonal of length 2\sqrt2, so A/2A/\sqrt2 is orthogonal and s1=s2=2s_1=s_2=\sqrt2. Hence 𝔼‖A‖=(2+2)/2≈1.71\mathbb E\|A\|=(2+\sqrt2)/2\approx1.71 and 𝔼s2=2/2≈0.71\mathbb E s_2=\sqrt2/2\approx0.71, inside [2−2,2+2]=[0,2.83][\sqrt2-\sqrt2,\sqrt2+\sqrt2]=[0,2.83]. For tiny matrices the bounds are true but say little.

Approximate isometriesFrom AᵀA to singular values

Show that if ‖1mA𝖳A−In‖≤δ\big\|\tfrac1mA^{\mathsf T}A-I_n\big\|\le\delta with δ<1\delta<1, then every singular value of AA lies in [m(1−δ), m(1+δ)][\sqrt{m(1-\delta)},\ \sqrt{m(1+\delta)}], and hence in [m(1−δ),m(1+δ)][\sqrt m(1-\delta),\sqrt m(1+\delta)].

Solution

1mA𝖳A−I\tfrac1mA^{\mathsf T}A-I is symmetric with eigenvalues si2/m−1s_i^2/m-1, and its norm is the largest of their absolute values. So |si2/m−1|≤δ|s_i^2/m-1|\le\delta, i.e. si2∈[m(1−δ),m(1+δ)]s_i^2\in[m(1-\delta),m(1+\delta)]. Finally 1−δ≥1−δ\sqrt{1-\delta}\ge1-\delta and 1+δ≤1+δ\sqrt{1+\delta}\le1+\delta.

More practice: Vershynin, Exercises 4.35 and 4.47.

SimulationVershynin, Ch. 5: Concentration Without Independence

Lipschitz concentration and Johnson–Lindenstrauss

Any Lipschitz function of a high-dimensional Gaussian (or of a uniform point on the sphere) is nearly constant, whether or not it is a sum. One consequence: NN points in any dimension can be projected to about log⁡N/ε2\log N/\varepsilon^2 dimensions with every pairwise distance preserved up to 1±ε1\pm\varepsilon.

The idea

Gaussian concentration. If X∼N(0,In)X\sim N(0,I_n) and f:ℝn→ℝf:\R^n\to\R is LL-Lipschitz, then for all t≥0t\ge0
ℙ(|f(X)−𝔼f(X)|≥t)≤2e−t2/2L2.\mathbb P\big(|f(X)-\mathbb E f(X)|\ge t\big)\le2e^{-t^2/2L^2}.
On the sphere. If XX is uniform on nSn−1\sqrt n\,S^{n-1} and ff is LL-Lipschitz, then ‖f(X)−𝔼f(X)‖ψ2≤CL\|f(X)-\mathbb E f(X)\|_{\psi_2}\le CL. The coordinates of XX are not independent; the concentration comes from the geometry of the sphere (isoperimetry).
Johnson–Lindenstrauss. Let x1,…,xN∈ℝnx_1,\dots,x_N\in\R^n and ε∈(0,1)\varepsilon\in(0,1). If k≥Cε−2log⁡Nk\ge C\varepsilon^{-2}\log N and PP is a k×nk\times n matrix with i.i.d. N(0,1/k)N(0,1/k) entries (or a suitably scaled random projection), then with high probability
(1−ε)‖xi−xj‖2≤‖Pxi−Pxj‖2≤(1+ε)‖xi−xj‖2for all i,j.(1-\varepsilon)\|x_i-x_j\|_2\le\|Px_i-Px_j\|_2\le(1+\varepsilon)\|x_i-x_j\|_2\quad\text{for all }i,j.

The target dimension depends on NN and ε\varepsilon but not on nn, and PP is chosen without looking at the data. The proof: for one fixed vector uu, ‖Pu‖/‖u‖\|Pu\|/\|u\| concentrates at 1 with subgaussian tails in kε\sqrt k\,\varepsilon; then union-bound over the (N2)\binom N2 differences.

Matrix Bernstein. For independent mean-zero symmetric n×nn\times n random matrices XiX_i with ‖Xi‖≤K\|X_i\|\le K and σ2=‖∑𝔼Xi2‖\sigma^2=\|\sum\mathbb E X_i^2\|,
ℙ(‖∑iXi‖≥t)≤2nexp⁡(−t2/2σ2+Kt/3).\mathbb P\Big(\Big\|\sum_i X_i\Big\|\ge t\Big)\le2n\exp\Big(-\frac{t^2/2}{\sigma^2+Kt/3}\Big).

The dimension enters only as the factor nn in front, i.e. as a log⁡n\log n in the deviation. It handles covariance estimation for general (not subgaussian) distributions.

Explore

Data in ℝ³⁰⁰
How each pairwise distance changes. [1−ε,1+ε][1-\varepsilon,1+\varepsilon], ε\varepsilon = worst pair
worst distortion for this projection, every kk rough guide 2ln⁡N/k\sqrt{2\ln N/k}

Worked example

Let g∼N(0,In)g\sim N(0,I_n) and M=maxi≤n⁡giM=\max_{i\le n}g_i. How large is MM, and how much does it fluctuate?

  1. Bound 𝔼M\mathbb E M. (Hint: eλ𝔼M≤𝔼eλMe^{\lambda\mathbb E M}\le\mathbb E e^{\lambda M}.)

    By Jensen, eλ𝔼M≤𝔼eλM≤∑i𝔼eλgi=neλ2/2e^{\lambda\mathbb E M}\le\mathbb E e^{\lambda M}\le\sum_i\mathbb E e^{\lambda g_i}=ne^{\lambda^2/2}. So 𝔼M≤ln⁡nλ+λ2\mathbb E M\le\frac{\ln n}\lambda+\frac\lambda2, and λ=2ln⁡n\lambda=\sqrt{2\ln n} gives 𝔼M≤2ln⁡n\mathbb E M\le\sqrt{2\ln n}. For n=106n=10^6 that is about 5.26.

  2. Show that f(x)=maxi⁡xif(x)=\max_ix_i is 1-Lipschitz for the Euclidean norm.

    If the max of xx is at ii, then f(x)−f(y)≤xi−yi≤‖x−y‖∞≤‖x−y‖2f(x)-f(y)\le x_i-y_i\le\|x-y\|_\infty\le\|x-y\|_2. Swap the roles of xx and yy for the other direction.

  3. What does Gaussian concentration give?

    ℙ(|M−𝔼M|≥t)≤2e−t2/2\mathbb P(|M-\mathbb E M|\ge t)\le2e^{-t^2/2} for every nn. The maximum of a million Gaussians grows like 2ln⁡n\sqrt{2\ln n}, but it fluctuates by O(1)O(1) regardless of nn. (Its true fluctuations are even smaller, but the theorem needs no work to give O(1)O(1).) Independence was never used in step 3; only the Lipschitz property was.

  4. The same reasoning applies to f(x)=‖Px−Py‖f(x)=\|Px-Py\| as a function of the Gaussian entries of PP. Compute its Lipschitz constant and explain why JL needs k≳log⁡N/ε2k\gtrsim\log N/\varepsilon^2.

    With u=x−yu=x-y a unit vector and P=G/kP=G/\sqrt k, ‖Pu‖=‖Gu‖/k\|Pu\|=\|Gu\|/\sqrt k, and G↦‖Gu‖G\mapsto\|Gu\| is 1-Lipschitz in the Frobenius norm of GG. So ‖Pu‖\|Pu\| deviates from its mean (which is close to 1) by more than ε\varepsilon with probability ≤2e−kε2/2\le2e^{-k\varepsilon^2/2}, roughly. For all (N2)\binom N2 pairs to succeed we need N2e−kε2/2≪1N^2e^{-k\varepsilon^2/2}\ll1, i.e. k≳4ln⁡N/ε2k\gtrsim4\ln N/\varepsilon^2.

Check your understanding

In the Johnson–Lindenstrauss lemma, what does the target dimension kk depend on?

  1. Only on the number of points NN and the accuracy ε\varepsilon
  2. On the ambient dimension nnThe proof handles one difference vector at a time, and the law of ‖Pu‖/‖u‖\|Pu\|/\|u\| is the same in every dimension.
  3. On how the points are arrangedThe projection is chosen without looking at the data. Switch data sets in the explorer.
  4. Only on ε\varepsilonMore points mean more pairs that could fail; the union bound charges log⁡N\log N.
k≈Cε−2log⁡Nk\approx C\varepsilon^{-2}\log N. A million points can be embedded in a few thousand dimensions with 10% distortion, whether they started in ℝ104\R^{10^4} or ℝ109\R^{10^9}.

X∼N(0,In)X\sim N(0,I_n) and ff is 1-Lipschitz. Which statement is guaranteed for every nn?

  1. f(X)f(X) stays within O(1)O(1) of 𝔼f(X)\mathbb E f(X) with high probability.
  2. f(X)f(X) is approximately Gaussian.Concentration controls the size of fluctuations, not their shape. Think of f(x)=|x1|f(x)=|x_1|.
  3. 𝔼f(X)\mathbb E f(X) is bounded independently of nn.f(x)=‖x‖2f(x)=\|x\|_2 is 1-Lipschitz and 𝔼‖X‖≈n\mathbb E\|X\|\approx\sqrt n.
  4. Var⁡f(X)=1\operatorname{Var} f(X)=1.The variance is at most of order 1 (in fact at most 1), but it can be much smaller, e.g. 0 for a constant ff.
The tail bound 2e−t2/22e^{-t^2/2} does not depend on nn at all, while 𝔼f(X)\mathbb E f(X) can grow with nn. So in relative terms, functions like ‖X‖\|X\| become nearly deterministic.

Fix the target dimension kk and add more and more points. How does the worst distortion over all pairs typically grow with NN?

  1. Like log⁡N\sqrt{\log N}
  2. It stays the same.Each new pair is another chance for an unlucky ratio.
  3. Like N\sqrt NThat would follow from Chebyshev-type tails. The per-pair tail is Gaussian.
  4. Like N2N^2The number of pairs grows like N2N^2, but the distortion only like the square root of its logarithm.
The worst of M≈N2/2M\approx N^2/2 roughly Gaussian deviations of size 1/2k1/\sqrt{2k} is about 2ln⁡M/2k≈2ln⁡N/k\sqrt{2\ln M}/\sqrt{2k}\approx\sqrt{2\ln N/k}. Slide NN in the explorer: going from 10 to 150 points (fifteen times as many) raises the curve by less than half.

Practice

Sizing a projectionUnion bound arithmetic

Suppose that for each fixed difference vector, a random projection to kk dimensions distorts its length by more than ε\varepsilon with probability at most 2e−kε2/82e^{-k\varepsilon^2/8}. How large should kk be so that N=104N=10^4 points keep all pairwise distances within 20%, with failure probability at most 1%?

Solution

There are fewer than N2/2N^2/2 pairs, so the failure probability is below N2e−kε2/8N^2e^{-k\varepsilon^2/8}. Require N2e−kε2/8≤0.01N^2e^{-k\varepsilon^2/8}\le0.01: k≥8ln⁡(100N2)/ε2=8ln⁡(1010)/0.04≈4605k\ge8\ln(100N^2)/\varepsilon^2=8\ln(10^{10})/0.04\approx4605. The original dimension never entered.

The norm of a Gaussian imageLipschitz constant of x ↦ ‖Ax‖

Let AA be a fixed m×nm\times n matrix and g∼N(0,In)g\sim N(0,I_n). Show that ‖Ag‖2\|Ag\|_2 fluctuates around its mean by O(‖A‖)O(\|A\|), while 𝔼‖Ag‖2≤‖A‖F\mathbb E\|Ag\|_2\le\|A\|_F. When is the fluctuation small compared with the mean?

Hint

|‖Ax‖−‖Ay‖|≤‖A(x−y)‖|\|Ax\|-\|Ay\||\le\|A(x-y)\|. For the mean, use Jensen and 𝔼‖Ag‖2=‖A‖F2\mathbb E\|Ag\|^2=\|A\|_F^2.

Solution

x↦‖Ax‖x\mapsto\|Ax\| is ‖A‖\|A\|-Lipschitz, so ℙ(|‖Ag‖−𝔼‖Ag‖|≥t)≤2e−t2/2‖A‖2\mathbb P(|\|Ag\|-\mathbb E\|Ag\||\ge t)\le2e^{-t^2/2\|A\|^2}. Also (𝔼‖Ag‖)2≤𝔼‖Ag‖2=‖A‖F2(\mathbb E\|Ag\|)^2\le\mathbb E\|Ag\|^2=\|A\|_F^2, and since the variance is O(‖A‖2)O(\|A\|^2), 𝔼‖Ag‖≥‖A‖F−C‖A‖\mathbb E\|Ag\|\ge\|A\|_F-C\|A\|. The fluctuation is small relative to the mean when ‖A‖F/‖A‖\|A\|_F/\|A\| is large, i.e. when the stable rank ‖A‖F2/‖A‖2\|A\|_F^2/\|A\|^2 is large.

More practice: Vershynin, Exercises 5.9 and 5.14.

SimulationVershynin, Ch. 6: Quadratic Forms, Symmetrization and Contraction

Quadratic forms and symmetrization

A quadratic form X𝖳AXX^{\mathsf T}AX of independent variables is a sum of dependent terms aijXiXja_{ij}X_iX_j. It still concentrates: its tail is Gaussian at scale ‖A‖F\|A\|_F and exponential at scale ‖A‖\|A\|, and the ratio of the two decides which one you see.

The idea

Decoupling. Let AA have zero diagonal, XX have independent mean-zero coordinates, and X′X' be an independent copy of XX. For every convex FF,
𝔼F(∑i≠jaijXiXj)≤𝔼F(4∑i,jaijXiXj′).\mathbb E\,F\Big(\sum_{i\ne j}a_{ij}X_iX_j\Big)\le\mathbb E\,F\Big(4\sum_{i,j}a_{ij}X_iX'_j\Big).

The right side is linear in XX once X′X' is fixed, so tools for sums apply.

Hanson–Wright. If XX has independent mean-zero coordinates with ‖Xi‖ψ2≤K\|X_i\|_{\psi_2}\le K, then for every n×nn\times n matrix AA and t≥0t\ge0,
ℙ(|X𝖳AX−𝔼X𝖳AX|≥t)≤2exp⁡(−cmin⁡(t2K4‖A‖F2, tK2‖A‖)).\mathbb P\big(|X^{\mathsf T}AX-\mathbb E X^{\mathsf T}AX|\ge t\big)\le2\exp\Big(-c\min\Big(\frac{t^2}{K^4\|A\|_F^2},\ \frac{t}{K^2\|A\|}\Big)\Big).
Symmetrization. For independent mean-zero random vectors XiX_i in a normed space and independent random signs εi\varepsilon_i,
12𝔼‖∑εiXi‖≤𝔼‖∑Xi‖≤2𝔼‖∑εiXi‖.\tfrac12\,\mathbb E\Big\|\sum\varepsilon_iX_i\Big\|\le\mathbb E\Big\|\sum X_i\Big\|\le2\,\mathbb E\Big\|\sum\varepsilon_iX_i\Big\|.
Contraction. For fixed vectors xix_i and real aia_i,  𝔼‖∑aiεixi‖≤‖a‖∞𝔼‖∑εixi‖\ \mathbb E\|\sum a_i\varepsilon_ix_i\|\le\|a\|_\infty\,\mathbb E\|\sum\varepsilon_ix_i\|. Together, these let you replace arbitrary summands by sign-weighted ones and then strip off bounded coefficients. One application in the chapter: completing a low-rank matrix from a few random entries.

Explore

20,000 draws of X𝖳AXX^{\mathsf T}AX, X∼N(0,I200)X\sim N(0,I_{200}), standardised. N(0,1)N(0,1)
exact tail simulated Laurent–Massart bound Gaussian guess

Worked example

Let X∼N(0,I2)X\sim N(0,I_2) and A=(2110)A=\begin{pmatrix}2&1\\1&0\end{pmatrix}, so X𝖳AX=2X12+2X1X2X^{\mathsf T}AX=2X_1^2+2X_1X_2. Find its mean and variance, and the two scales in Hanson–Wright.

  1. Compute 𝔼X𝖳AX\mathbb E X^{\mathsf T}AX for any isotropic XX.

    𝔼X𝖳AX=𝔼tr⁡(AXX𝖳)=tr⁡(A𝔼XX𝖳)=tr⁡A=2\mathbb E X^{\mathsf T}AX=\mathbb E\operatorname{tr}(AXX^{\mathsf T})=\operatorname{tr}(A\,\mathbb E XX^{\mathsf T})=\operatorname{tr}A=2.

  2. For Gaussian XX and symmetric AA, show Var⁡X𝖳AX=2‖A‖F2\operatorname{Var}X^{\mathsf T}AX=2\|A\|_F^2.

    Write A=UΛU𝖳A=U\Lambda U^{\mathsf T}. Then Z=U𝖳X∼N(0,I)Z=U^{\mathsf T}X\sim N(0,I) by rotation invariance, and X𝖳AX=∑λiZi2X^{\mathsf T}AX=\sum\lambda_iZ_i^2, a sum of independent terms with Var⁡(λiZi2)=2λi2\operatorname{Var}(\lambda_iZ_i^2)=2\lambda_i^2. So the variance is 2∑λi2=2‖A‖F22\sum\lambda_i^2=2\|A\|_F^2.

  3. Apply it to this AA, and check directly.

    The eigenvalues are 1±21\pm\sqrt2, so ‖A‖F2=(1+2)2+(1−2)2=6\|A\|_F^2=(1+\sqrt2)^2+(1-\sqrt2)^2=6 (also 4+1+1+04+1+1+0), and the variance is 12. Directly: Var⁡(2X12)=8\operatorname{Var}(2X_1^2)=8, Var⁡(2X1X2)=4\operatorname{Var}(2X_1X_2)=4, and Cov⁡(X12,X1X2)=𝔼X13𝔼X2=0\operatorname{Cov}(X_1^2,X_1X_2)=\mathbb E X_1^3\,\mathbb E X_2=0. Total 12.

  4. What are ‖A‖F\|A\|_F and ‖A‖\|A\|, and where does the tail switch from Gaussian to exponential?

    ‖A‖F=6≈2.45\|A\|_F=\sqrt6\approx2.45 and ‖A‖=1+2≈2.41\|A\|=1+\sqrt2\approx2.41. The two terms in the minimum cross at t≈‖A‖F2/‖A‖≈2.49t\approx\|A\|_F^2/\|A\|\approx2.49, less than one standard deviation (12≈3.46\sqrt{12}\approx3.46). So this form has essentially no Gaussian regime: it is dominated by the single large eigenvalue, like λ1Z12\lambda_1Z_1^2. In the explorer this is stable rank r≈1r\approx1.

Check your understanding

XX has independent ±1\pm1 coordinates and A=InA=I_n. Then X𝖳AX=nX^{\mathsf T}AX=n always, but Hanson–Wright allows fluctuations of order ‖A‖F=n\|A\|_F=\sqrt n. Is something wrong?

  1. No: Hanson–Wright is an upper bound, and here the diagonal terms Xi2=1X_i^2=1 don't fluctuate at all.
  2. Yes: Hanson–Wright requires Gaussian coordinates.It holds for any independent mean-zero subgaussian coordinates, signs included.
  3. Yes: the fluctuation must be exactly of order ‖A‖F\|A\|_F.The theorem bounds the tail from above. Nothing forces the form to fluctuate that much.
For Gaussian XX, ‖X‖2\|X\|^2 does fluctuate by 2n\sqrt{2n}, so the bound is sharp in general. For signs the diagonal part is deterministic and only off-diagonal entries contribute: the variance is 2∑i≠jaij22\sum_{i\ne j}a_{ij}^2 (for symmetric AA).

X∼N(0,In)X\sim N(0,I_n) with nn large. For which AA is X𝖳AXX^{\mathsf T}AX, after standardising, closest to a normal distribution?

  1. A=InA=I_n
  2. A=uu𝖳A=uu^{\mathsf T} with ‖u‖=1\|u\|=1Then X𝖳AX=⟨u,X⟩2X^{\mathsf T}AX=\langle u,X\rangle^2 is a single χ12\chi^2_1: stable rank 1, the most skewed case.
  3. A=diag⁡(n,1,1,…,1)A=\operatorname{diag}(n,1,1,\dots,1)One eigenvalue dominates: ‖A‖F2≈n2=‖A‖2\|A\|_F^2\approx n^2=\|A\|^2, so the stable rank is about 1.
The shape is governed by the stable rank ‖A‖F2/‖A‖2\|A\|_F^2/\|A\|^2. For InI_n it is nn, so X𝖳AX=χn2X^{\mathsf T}AX=\chi^2_n is a sum of many comparable independent terms and the CLT kicks in. Slide rr in the explorer.

The symmetrization inequality 𝔼‖∑Xi‖≤2𝔼‖∑εiXi‖\mathbb E\|\sum X_i\|\le2\,\mathbb E\|\sum\varepsilon_iX_i\| requires the XiX_i to be:

  1. Independent with mean zero
  2. SymmetricIf they were symmetric, ∑Xi\sum X_i and ∑εiXi\sum\varepsilon_iX_i would have the same law. Symmetrization is how you avoid assuming that.
  3. BoundedOnly integrability is needed.
  4. Identically distributedThe proof treats each XiX_i separately; no common distribution is needed.
Mean zero is essential: for Xi≡1X_i\equiv1 in ℝ\R, 𝔼|∑Xi|=N\mathbb E|\sum X_i|=N while 𝔼|∑εi|≈2N/π\mathbb E|\sum\varepsilon_i|\approx\sqrt{2N/\pi}. The proof subtracts an independent copy, which is harmless only when 𝔼Xi=0\mathbb E X_i=0.

Practice

Estimating a trace with random signsHutchinson's estimator

You can only access a symmetric matrix AA through products x↦Axx\mapsto Ax. Show that for XX with independent ±1\pm1 entries, 𝔼X𝖳AX=tr⁡A\mathbb E X^{\mathsf T}AX=\operatorname{tr}A and Var⁡X𝖳AX=2∑i≠jaij2\operatorname{Var}X^{\mathsf T}AX=2\sum_{i\ne j}a_{ij}^2. Why are signs better than Gaussians here?

Solution

X𝖳AX=∑iaii+2∑i<jaijXiXjX^{\mathsf T}AX=\sum_ia_{ii}+2\sum_{i<j}a_{ij}X_iX_j. The products XiXjX_iX_j, i<ji<j, have mean 0, variance 1 and are pairwise uncorrelated, so the variance is 4∑i<jaij2=2∑i≠jaij24\sum_{i<j}a_{ij}^2=2\sum_{i\ne j}a_{ij}^2. With Gaussian XX it is 2‖A‖F22\|A\|_F^2, which also counts the diagonal. For a nearly diagonal AA, signs are far more accurate.

Symmetrization on the lineThe basic argument

Prove 𝔼|∑Xi|≤2𝔼|∑εiXi|\mathbb E|\sum X_i|\le2\,\mathbb E|\sum\varepsilon_iX_i| for independent mean-zero real XiX_i.

Hint

Let X′X' be an independent copy. Write ∑Xi=∑(Xi−𝔼Xi′)\sum X_i=\sum(X_i-\mathbb E X'_i) and use Jensen conditionally on XX.

Solution

𝔼|∑Xi|=𝔼|∑(Xi−𝔼′Xi′)|≤𝔼|∑(Xi−Xi′)|\mathbb E|\sum X_i|=\mathbb E|\sum(X_i-\mathbb E'X'_i)|\le\mathbb E|\sum(X_i-X'_i)| by Jensen. Each Xi−Xi′X_i-X'_i is symmetric, and they are independent, so (Xi−Xi′)i(X_i-X'_i)_i has the same law as (εi(Xi−Xi′))i(\varepsilon_i(X_i-X'_i))_i. Then the triangle inequality gives 𝔼|∑εi(Xi−Xi′)|≤2𝔼|∑εiXi|\mathbb E|\sum\varepsilon_i(X_i-X'_i)|\le2\,\mathbb E|\sum\varepsilon_iX_i|.

More practice: Vershynin, Exercises 6.7 and 6.20.

SimulationVershynin, Ch. 7: Random Processes

Gaussian processes and Gaussian width

How big is a set in ℝn\R^n? Its Gaussian width, the expected maximum of a random linear function over it, is the answer that matters for random projections and for recovery problems. Some sets that look large, like the ℓ1\ell_1 ball, turn out to be tiny.

The idea

Canonical Gaussian process. For T⊆ℝnT\subseteq\R^n and g∼N(0,In)g\sim N(0,I_n), Xt=⟨g,t⟩X_t=\langle g,t\rangle. Its increments are (𝔼(Xt−Xs)2)1/2=‖t−s‖2\big(\mathbb E(X_t-X_s)^2\big)^{1/2}=\|t-s\|_2, so the geometry of TT is the geometry of the process.
Gaussian width. w(T)=𝔼supt∈T⁡⟨g,t⟩w(T)=\mathbb E\sup_{t\in T}\langle g,t\rangle. It is translation invariant, unchanged by taking the convex hull, and w(T)2w(T)^2 behaves like an effective dimension: for a unit ball of a kk-dimensional subspace, w≈kw\approx\sqrt k.
Sudakov–Fernique. If (Xt)(X_t) and (Yt)(Y_t) are mean-zero Gaussian processes with 𝔼(Xt−Xs)2≤𝔼(Yt−Ys)2\mathbb E(X_t-X_s)^2\le\mathbb E(Y_t-Y_s)^2 for all t,st,s, then 𝔼sup⁡Xt≤𝔼sup⁡Yt\mathbb E\sup X_t\le\mathbb E\sup Y_t. Smaller increments mean a smaller supremum. This comparison gives 𝔼‖G‖≤m+n\mathbb E\|G\|\le\sqrt m+\sqrt n for an m×nm\times n Gaussian matrix, and Gordon's min–max version gives 𝔼sn(G)≥m−n\mathbb E s_n(G)\ge\sqrt m-\sqrt n.
Sudakov's minoration. 𝔼supt∈T⁡Xt≥cεlog⁡N(T,ε)\mathbb E\sup_{t\in T}X_t\ge c\,\varepsilon\sqrt{\log N(T,\varepsilon)} for every ε>0\varepsilon>0: a set with many well-separated points has a large supremum.
Random projections of sets. If PP is the orthogonal projection onto a random kk-dimensional subspace of ℝn\R^n, then with high probability diam⁡(PT)≲w(T)/n+k/ndiam⁡(T)\operatorname{diam}(PT)\lesssim w(T)/\sqrt n+\sqrt{k/n}\,\operatorname{diam}(T). The first term wins when k≲w(T)2/diam⁡(T)2k\lesssim w(T)^2/\operatorname{diam}(T)^2: below its effective dimension, a set shrinks to a size set by its width, not by kk.

Explore

Set T (inside the unit ball)
ball ≈n\approx\sqrt n cube =2n/π=\sqrt{2n/\pi} 5-sparse unit vectors ℓ1\ell_1 ball ≈2ln⁡n\approx\sqrt{2\ln n}
Distribution of supt∈T⁡⟨g,t⟩\sup_{t\in T}\langle g,t\rangle at the chosen dimension; the dashed line is its mean, w(T)w(T).

Worked example

Compute, or bound, the Gaussian width of the cross-polytope B1n={t:∑|ti|≤1}B_1^n=\{t:\sum|t_i|\le1\}, and compare it with the Euclidean ball.

  1. Express supt∈B1n⁡⟨g,t⟩\sup_{t\in B_1^n}\langle g,t\rangle in terms of gg.

    A linear function on a polytope is maximised at a vertex, and the vertices are ±ei\pm e_i. So the sup is maxi⁡|gi|=‖g‖∞\max_i|g_i|=\|g\|_\infty, and w(B1n)=𝔼‖g‖∞w(B_1^n)=\mathbb E\|g\|_\infty.

  2. Bound 𝔼maxi⁡|gi|\mathbb E\max_i|g_i| using the moment generating function.

    The maximum is over the 2n2n variables ±gi\pm g_i. For λ>0\lambda>0, Jensen gives eλ𝔼max⁡≤∑𝔼e±λgi=2neλ2/2e^{\lambda\mathbb E\max}\le\sum\mathbb E e^{\pm\lambda g_i}=2ne^{\lambda^2/2}, so 𝔼max⁡≤ln⁡2nλ+λ2\mathbb E\max\le\frac{\ln2n}\lambda+\frac\lambda2. With λ=2ln⁡2n\lambda=\sqrt{2\ln 2n}: w(B1n)≤2ln⁡(2n)w(B_1^n)\le\sqrt{2\ln(2n)}.

  3. Put in n=1000n=1000. How good is the bound?

    The bound is 2ln⁡2000≈3.90\sqrt{2\ln2000}\approx3.90. The exact value (an integral of the normal distribution function, which the explorer computes) is about 3.44. For comparison, w(B21000)=𝔼‖g‖2≈31.6w(B_2^{1000})=\mathbb E\|g\|_2\approx31.6.

  4. What does this mean for a random projection of B1nB_1^n?

    Its effective dimension is w2≈2ln⁡n≈14w^2\approx2\ln n\approx14 for n=1000n=1000. A random projection to kk dimensions with kk well above 14 shrinks it to diameter about k/n\sqrt{k/n} times the original, and for smaller kk to about w/n≈0.11w/\sqrt n\approx0.11. The ball, by contrast, has effective dimension nn. This gap is what makes sparse recovery possible in Chapter 9.

Check your understanding

T⊆ℝnT\subseteq\R^n and AA is an n×nn\times n matrix with ‖A‖≤1\|A\|\le1. How do w(AT)w(AT) and w(T)w(T) compare?

  1. w(AT)≤w(T)w(AT)\le w(T)
  2. w(AT)≥w(T)w(AT)\ge w(T)A contraction can only shrink the increments ‖At−As‖\|At-As\|.
  3. They are equal.Take A=0A=0: then w(AT)=0w(AT)=0.
  4. No general relation.Compare the increments of the two processes and use Sudakov–Fernique.
⟨g,At⟩\langle g,At\rangle is a Gaussian process with increments ‖A(t−s)‖≤‖t−s‖\|A(t-s)\|\le\|t-s\|, smaller than those of ⟨g,t⟩\langle g,t\rangle. Sudakov–Fernique gives 𝔼supt⁡⟨g,At⟩≤𝔼supt⁡⟨g,t⟩\mathbb E\sup_t\langle g,At\rangle\le\mathbb E\sup_t\langle g,t\rangle.

How does the Gaussian width of TT compare with that of its convex hull?

  1. They are equal.
  2. w(conv⁡T)w(\operatorname{conv}T) can be much larger.For a fixed gg, a linear function's sup over the convex hull is attained at a point of TT.
  3. w(conv⁡T)w(\operatorname{conv}T) is larger by a factor log⁡|T|\sqrt{\log|T|} for finite TT.That factor appears when you compare a finite set's width with its diameter, not with its hull.
supconv⁡T⁡⟨g,⋅⟩=supT⁡⟨g,⋅⟩\sup_{\operatorname{conv}T}\langle g,\cdot\rangle=\sup_T\langle g,\cdot\rangle for every gg. That is why the 2n vertices ±ei\pm e_i and the whole ℓ1\ell_1 ball have the same width.

TT is the unit Euclidean ball of a kk-dimensional subspace sitting in ℝn\R^n, k≪nk\ll n. What is w(T)w(T) approximately?

  1. k\sqrt k
  2. n\sqrt nOnly the component of gg inside the subspace matters.
  3. 1That is the radius. The width also counts how many directions the set extends in.
  4. kkThe width is the expected length of a kk-dimensional Gaussian vector, not its squared length.
supt∈T⁡⟨g,t⟩=‖PEg‖2\sup_{t\in T}\langle g,t\rangle=\|P_Eg\|_2, the length of the projection of gg onto the subspace EE, which is a standard Gaussian in ℝk\R^k. Its expected length is about k\sqrt k, so w(T)2≈kw(T)^2\approx k: the effective dimension equals the true dimension.

Practice

Width of the cubeAn exact computation

Compute w([−1,1]n)w([-1,1]^n) exactly and compare it with the width of the Euclidean ball of the same diameter 2n2\sqrt n.

Solution

supt∈[−1,1]n⁡⟨g,t⟩=∑|gi|\sup_{t\in[-1,1]^n}\langle g,t\rangle=\sum|g_i|, so w=n𝔼|g1|=n2/π≈0.80nw=n\,\mathbb E|g_1|=n\sqrt{2/\pi}\approx0.80\,n. The ball of radius n\sqrt n has width n𝔼‖g‖≈n\sqrt n\,\mathbb E\|g\|\approx n. So the cube is almost as wide as its circumscribed ball: its corners stick out in nearly every direction.

Linear images and widthUsing Sudakov–Fernique

Show w(AT)≤‖A‖w(T)w(AT)\le\|A\|\,w(T) for any m×nm\times n matrix AA and bounded T⊆ℝnT\subseteq\R^n. Deduce that if T⊆ℝnT\subseteq\R^n lies in the unit ball then w(T)≤nw(T)\le\sqrt n.

Solution

Compare Yt=⟨h,At⟩Y_t=\langle h,At\rangle (h∼N(0,Im)h\sim N(0,I_m)) with Xt=‖A‖⟨g,t⟩X_t=\|A\|\langle g,t\rangle: 𝔼(Yt−Ys)2=‖A(t−s)‖2≤‖A‖2‖t−s‖2=𝔼(Xt−Xs)2\mathbb E(Y_t-Y_s)^2=\|A(t-s)\|^2\le\|A\|^2\|t-s\|^2=\mathbb E(X_t-X_s)^2, so Sudakov–Fernique gives the claim. For the second part, w(T)≤w(B2n)=𝔼‖g‖2≤(𝔼‖g‖22)1/2=nw(T)\le w(B_2^n)=\mathbb E\|g\|_2\le(\mathbb E\|g\|_2^2)^{1/2}=\sqrt n.

More practice: Vershynin, Exercises 7.17 and 7.22.

Draw it yourselfVershynin, Ch. 8: Chaining

Chaining and VC dimension

To bound the supremum of a process, chaining runs a union bound at every scale and adds up the costs. For classes of sets the relevant size is combinatorial: how many points the class can label in every possible way. Place points below and try to beat the VC dimension.

The idea

Dudley's inequality. If (Xt)t∈T(X_t)_{t\in T} is mean-zero with subgaussian increments, ‖Xt−Xs‖ψ2≤Kd(t,s)\|X_t-X_s\|_{\psi_2}\le K\,d(t,s), then
𝔼supt∈T⁡Xt≤CK∫0∞log⁡N(T,d,ε)dε.\mathbb E\sup_{t\in T}X_t\le CK\int_0^\infty\sqrt{\log N(T,d,\varepsilon)}\,d\varepsilon.

Chaining: approximate each tt by points πk(t)\pi_k(t) of a 2−k2^{-k}-net, write Xt−Xt0=∑k(Xπk(t)−Xπk−1(t))X_t-X_{t_0}=\sum_k(X_{\pi_k(t)}-X_{\pi_{k-1}(t)}), and union-bound each level separately. A link at level kk has length about 2−k2^{-k}, and there are about N(T,2−k)2N(T,2^{-k})^2 of them; summing 2−klog⁡N(T,2−k)2^{-k}\sqrt{\log N(T,2^{-k})} over kk gives the integral.

VC dimension. A class ℱ\mathcal F of subsets shatters a finite set Λ\Lambda if every subset of Λ\Lambda equals F∩ΛF\cap\Lambda for some F∈ℱF\in\mathcal F. The VC dimension is the largest size of a shattered set.
Sauer–Shelah. If vc⁡(ℱ)=d\operatorname{vc}(\mathcal F)=d, then on any kk points ℱ\mathcal F cuts out at most ∑i=0d(ki)≤(ek/d)d\sum_{i=0}^d\binom ki\le(ek/d)^d subsets: polynomially many, instead of 2k2^k.
Uniform law of large numbers. For a class of Boolean functions of VC dimension dd and i.i.d. samples X1,…,XNX_1,\dots,X_N,
𝔼supf∈ℱ⁡|1N∑i=1Nf(Xi)−𝔼f(X)|≤CdN.\mathbb E\sup_{f\in\mathcal F}\Big|\frac1N\sum_{i=1}^Nf(X_i)-\mathbb E f(X)\Big|\le C\sqrt{\frac dN}.

The proof symmetrizes, bounds covering numbers of ℱ\mathcal F in terms of dd, and applies Dudley. In learning theory this says empirical risk minimisation over such a class has excess risk of order d/N\sqrt{d/N}.

Explore

Click to add a point (up to 6), drag to move it. Filled points are labelled "in". a set from the class that cuts out exactly the filled points
Class of sets
Start from
All labellings (click one; red ones are impossible)

Worked example

Find the VC dimension of the class of closed intervals [a,b]⊆ℝ[a,b]\subseteq\R, and count exactly how many subsets it cuts out of kk points.

  1. Show that two points x1<x2x_1<x_2 are shattered.

    ⌀\varnothing: an interval far away. {x1}\{x_1\}, {x2}\{x_2\}: tiny intervals around each. {x1,x2}\{x_1,x_2\}: [x1,x2][x_1,x_2]. All four subsets are cut out.

  2. Why can no three points x1<x2<x3x_1<x_2<x_3 be shattered?

    An interval containing x1x_1 and x3x_3 contains everything between them, including x2x_2. So {x1,x3}\{x_1,x_3\} is never cut out. Hence vc⁡=2\operatorname{vc}=2.

  3. How many subsets of kk points on the line do intervals cut out?

    Exactly the empty set and the runs of consecutive points: 1+(k+12)=1+k+(k2)1+\binom{k+1}2=1+k+\binom k2. (A run is determined by its first and last point, possibly equal.)

  4. Compare with the Sauer–Shelah bound for d=2d=2.

    ∑i=02(ki)=1+k+(k2)\sum_{i=0}^2\binom ki=1+k+\binom k2: exactly equal. So the lemma cannot be improved in general. For k=10k=10, intervals realise 56 of the 1024 subsets.

Check your understanding

What is the VC dimension of half-planes in ℝ2\R^2?

  1. 2Three points in a triangle are shattered: check it in the explorer.
  2. 3
  3. 4Try four points. In convex position, the two diagonals can't be separated; otherwise one point is inside the triangle of the others.
  4. InfiniteHalf-planes are described by 3 parameters, and indeed no 4 points can be shattered.
Any three non-collinear points are shattered. For four points, either they are in convex position, and the labelling "opposite corners in" fails, or one lies in the triangle of the other three, and "the three outer points in, the inner one out" fails, since half-planes are convex.

A class has VC dimension 3. At most how many different subsets can it cut out of 10 points?

  1. 176
  2. 1024That is every subset, which would mean 10 points are shattered.
  3. 120That is (103)\binom{10}3 alone. Add the subsets of size 0, 1 and 2 in the Sauer–Shelah sum.
  4. 103=100010^3=1000The (ek/d)d(ek/d)^d style bound is of this order, but the exact Sauer–Shelah sum is much smaller here.
(100)+(101)+(102)+(103)=1+10+45+120=176\binom{10}0+\binom{10}1+\binom{10}2+\binom{10}3=1+10+45+120=176. Half-planes on 10 points in general position realise even fewer.

Empirical risk minimisation over a class of VC dimension dd, from NN samples. With no further assumptions, how does the guaranteed excess risk scale?

  1. d/N\sqrt{d/N}
  2. d/Nd/NThat faster rate needs extra assumptions (for example, a target in the class with no noise).
  3. log⁡N/N\sqrt{\log N/N}, independent of ddThe complexity of the class must enter: with infinite VC dimension, no rate is possible.
  4. 2d/N2^d/NSauer–Shelah replaces the exponential count by a polynomial, so only dd appears, not 2d2^d.
The excess risk is controlled by the uniform deviation supf⁡|1N∑f(Xi)−𝔼f|\sup_f|\frac1N\sum f(X_i)-\mathbb E f|, which is ≲d/N\lesssim\sqrt{d/N} by the uniform law of large numbers. To halve the error you need four times the data.

Practice

Discs centred at the originA one-parameter class

Find the VC dimension of the class {{x∈ℝ2:‖x‖≤r}:r≥0}\{\{x\in\R^2:\|x\|\le r\}: r\ge0\}.

Solution

One point x≠0x\ne0 is shattered (take r<‖x‖r<\|x\| or r≥‖x‖r\ge\|x\|). For two points with ‖x1‖≤‖x2‖\|x_1\|\le\|x_2\|, any disc containing x2x_2 contains x1x_1, so {x2}\{x_2\} is never cut out. The VC dimension is 1. Notice the class is a nested chain of sets; any such chain has VC dimension at most 1.

Finite classesA simple bound

Show that a finite class ℱ\mathcal F has vc⁡(ℱ)≤log2⁡|ℱ|\operatorname{vc}(\mathcal F)\le\log_2|\mathcal F|. Give a class with |ℱ|=2d|\mathcal F|=2^d and VC dimension exactly dd.

Solution

Shattering kk points needs 2k2^k different sets, so 2k≤|ℱ|2^k\le|\mathcal F|. For equality, take a dd-point set Λ\Lambda and let ℱ\mathcal F be all its subsets.

More practice: Vershynin, Exercises 8.12 and 8.14.

SimulationVershynin, Ch. 9: Deviations of Random Matrices on Sets

Random matrices on sets and sparse recovery

A random m×nm\times n matrix with m<nm<n has a big kernel, so it cannot be injective. But it behaves like a scaled isometry on any set of small Gaussian width, and that is enough to recover an ss-sparse vector exactly from about slog⁡(n/s)s\log(n/s) random measurements.

The idea

Matrix deviation inequality. Let AA be m×nm\times n with independent, mean-zero, isotropic, subgaussian rows, ‖Ai‖ψ2≤K\|A_i\|_{\psi_2}\le K. For every bounded T⊆ℝnT\subseteq\R^n,
𝔼supx∈T⁡|‖Ax‖2−m‖x‖2|≤CK2γ(T),γ(T)=𝔼supx∈T⁡|⟨g,x⟩|.\mathbb E\sup_{x\in T}\Big|\,\|Ax\|_2-\sqrt m\,\|x\|_2\Big|\le CK^2\gamma(T),\qquad \gamma(T)=\mathbb E\sup_{x\in T}|\langle g,x\rangle|.

Taking TT to be the sphere gives the singular value bounds of Chapter 4; taking normalised differences of NN points gives Johnson–Lindenstrauss.

M*M^* bound and escape. ker⁡A\ker A is a random subspace of codimension mm. It meets TT in a set of diameter 𝔼diam⁡(T∩ker⁡A)≤CK2w(T)/m\mathbb E\operatorname{diam}(T\cap\ker A)\le CK^2w(T)/\sqrt m. And if T⊆Sn−1T\subseteq S^{n-1} and m≥CK4w(T)2m\ge CK^4w(T)^2, then T∩ker⁡A=⌀T\cap\ker A=\varnothing with high probability: the kernel escapes through the mesh.
Exact sparse recovery. Let x0x_0 have at most ss nonzero entries and y=Ax0y=Ax_0. If m≥CK4slog⁡nm\ge CK^4s\log n, then with high probability x0x_0 is the unique solution of
min⁡‖x‖1subject toAx=y.\min\|x\|_1\quad\text{subject to}\quad Ax=y.

Why: x0+hx_0+h is a competing solution exactly when h∈ker⁡Ah\in\ker A and ‖x0+h‖1≤‖x0‖1\|x_0+h\|_1\le\|x_0\|_1, i.e. hh lies in the descent cone DD of the ℓ1\ell_1 norm at x0x_0. The cone D∩Sn−1D\cap S^{n-1} has w2≲slog⁡(n/s)w^2\lesssim s\log(n/s), so by the escape theorem the kernel misses it.

Explore

n=40n=40 unknowns, AA Gaussian. hidden x0x_0 ℓ1\ell_1 solution minimum ℓ2\ell_2-norm solution
Success rate of ℓ1\ell_1 recovery; click a cell to try it. success failure m=δ(s)m=\delta(s)

Worked example

The smallest case: n=2n=2, one measurement y=a1x1+a2x2y=a_1x_1+a_2x_2, and the 1-sparse vector x0=(1,0)x_0=(1,0). When does ℓ1\ell_1 minimisation find x0x_0?

  1. Take a=(2,1)a=(2,1), so y=2y=2. Find the minimum ℓ2\ell_2-norm solution.

    It is the point of the line 2x1+x2=22x_1+x_2=2 closest to the origin, x=ay/‖a‖2=(0.8,0.4)x=a\,y/\|a\|^2=(0.8,0.4). Not sparse, and not x0x_0.

  2. Now minimise |x1|+|x2||x_1|+|x_2| on the same line.

    On the line x2=2−2x1x_2=2-2x_1, so minimise |x1|+|2−2x1||x_1|+|2-2x_1|. This is piecewise linear with value 2 at x1=0x_1=0 and 1 at x1=1x_1=1, and grows outside [0,1][0,1]. The minimum is at x=(1,0)=x0x=(1,0)=x_0: recovered. Geometrically, the smallest ℓ1\ell_1 diamond that touches the line touches it at a corner.

  3. Repeat with a=(1,2)a=(1,2), so y=1y=1.

    On x1+2x2=1x_1+2x_2=1, minimise |x1|+|(1−x1)/2||x_1|+|(1-x_1)/2|: value 1 at x1=1x_1=1 but 1/21/2 at x1=0x_1=0. The minimiser is (0,12)(0,\tfrac12): sparse, but the wrong vector.

  4. Explain both outcomes with the kernel and the descent cone D={h:‖x0+h‖1≤‖x0‖1}D=\{h:\|x_0+h\|_1\le\|x_0\|_1\}.

    Near x0=(1,0)x_0=(1,0), ‖x0+h‖1=1+h1+|h2|\|x_0+h\|_1=1+h_1+|h_2|, so D={h:h1≤−|h2|}D=\{h:h_1\le-|h_2|\}, a cone of half-angle 45° around −e1-e_1. For a=(2,1)a=(2,1) the kernel is spanned by (1,−2)(1,-2), which is steeper than 45° and misses D∖{0}D\setminus\{0\}: success. For a=(1,2)a=(1,2) it is spanned by (2,−1)(2,-1), and −(2,−1)∈D-(2,-1)\in D: failure. In high dimension the descent cone is a small fraction of directions, and the escape theorem says a random kernel misses it once m≳w(D∩Sn−1)2m\gtrsim w(D\cap S^{n-1})^2.

Check your understanding

EE is a random subspace of ℝn\R^n of codimension mm. By the M*M^* bound, the Euclidean diameter of B1n∩EB_1^n\cap E is at most about:

  1. log⁡n/m\sqrt{\log n/m}
  2. 1B1nB_1^n has points of length 1 (the vertices), but a random subspace avoids those directions.
  3. n/m\sqrt{n/m}That is what the bound gives for the Euclidean ball, whose width is about n\sqrt n. Use w(B1n)w(B_1^n) instead.
  4. 0EE is a subspace of dimension n−m≥1n-m\ge1, so B1n∩EB_1^n\cap E contains nonzero points.
diam⁡≲w(B1n)/m≈2ln⁡n/m\operatorname{diam}\lesssim w(B_1^n)/\sqrt m\approx\sqrt{2\ln n}/\sqrt m (meaningful once this is below 2, the diameter of B1nB_1^n). Points of a random subspace have small ℓ2\ell_2 norm relative to their ℓ1\ell_1 norm, i.e. they are spread out, never sparse. That is the reason ℓ1\ell_1 minimisation picks out sparse vectors.

How many Gaussian measurements suffice for ℓ1\ell_1 minimisation to recover a given ss-sparse x0∈ℝnx_0\in\R^n with high probability?

  1. On the order of slog⁡ns\log n
  2. On the order of nnnn measurements would let you invert AA, sparse or not. Sparsity is what saves you.
  3. Exactly ssEven knowing the support you need ss; not knowing it costs a logarithmic factor for ℓ1\ell_1.
  4. On the order of s2s^2Some deterministic constructions need that many; random matrices do much better.
The squared width of the descent cone is ≲slog⁡(n/s)\lesssim s\log(n/s), and the escape theorem needs mm of that order. In the phase diagram the dashed boundary grows roughly linearly in ss, with a slope set by the logarithm.

In the matrix deviation inequality, take T=Sn−1T=S^{n-1}, for which γ(T)≈n\gamma(T)\approx\sqrt n. What does it say?

  1. All singular values of AA lie in m±Cn\sqrt m\pm C\sqrt n, on average.
  2. ‖Ax‖2=m\|Ax\|_2=\sqrt m for every unit vector xx.The inequality allows a deviation of order γ(T)\gamma(T), not zero.
  3. AA is invertible.If m<nm<n, AA has a kernel, and the bound m−Cn\sqrt m-C\sqrt n becomes negative, so it says nothing about sns_n.
  4. ‖A‖≤Cn\|A\|\le C\sqrt n.The scale m\sqrt m of ‖Ax‖\|Ax\| must appear; only the deviation is of order n\sqrt n.
supx∈Sn−1⁡|‖Ax‖−m|≲n\sup_{x\in S^{n-1}}|\|Ax\|-\sqrt m|\lesssim\sqrt n is the two-sided bound of Chapter 4. Other sets TT give other theorems: that is the point of stating it for every TT.

Practice

ℓ₁ minimisation is a linear programWhat the explorer solves

Show that min⁡‖x‖1\min\|x\|_1 subject to Ax=yAx=y has the same optimal value as the linear program min⁡∑i(ui+vi)\min\sum_i(u_i+v_i) subject to A(u−v)=yA(u-v)=y, u,v≥0u,v\ge0, and that at any optimum uivi=0u_iv_i=0 for each ii (so x=u−vx=u-v is optimal for the original problem).

Solution

Given feasible xx, u=max⁡(x,0)u=\max(x,0), v=max⁡(−x,0)v=\max(-x,0) is feasible with ∑(ui+vi)=‖x‖1\sum(u_i+v_i)=\|x\|_1. Conversely, feasible (u,v)(u,v) gives a feasible x=u−vx=u-v with ‖x‖1≤∑(ui+vi)\|x\|_1\le\sum(u_i+v_i). So the optimal values agree. If ui,vi>0u_i,v_i>0 at an optimum, lowering both by min⁡(ui,vi)\min(u_i,v_i) keeps u−vu-v and feasibility but lowers the objective, a contradiction.

Too few measurementsA lower bound for any method

Show that if m<2sm<2s, no method at all can recover every ss-sparse x∈ℝnx\in\R^n (with n≥2sn\ge2s) from AxAx.

Hint

Look for two different ss-sparse vectors with the same image.

Solution

Any 2s2s columns of AA are 2s2s vectors in ℝm\R^m with m<2sm<2s, so they are linearly dependent: there is h≠0h\ne0 supported on those 2s2s coordinates with Ah=0Ah=0. Split h=u−vh=u-v with u,vu,v each supported on ss of the coordinates. Then u≠vu\ne v are both ss-sparse and Au=AvAu=Av. So m≥2sm\ge2s is necessary, and the log⁡\log factor in the theorem is the price of a computationally easy method.

More practice: Vershynin, Exercises 9.30 and 9.32.