Module contents
Lesson 8 of 20Advanced 120 min

The fundamental theorem of PAC learning: upper bounds, lower bounds and rates

Combine Rademacher, Massart and Sauer to obtain a VC bound, discuss sample-complexity lower bounds and the fundamental PAC theorem, and introduce covering numbers, Dudley chaining and fast rates.

After this lesson you can

  • Derive the VC bound R(h) ≤ R̂(h) + O(√(d log(n/d)/n)) by combining previous results.
  • Prove a realizable Ω(d/ε) lower bound and know the agnostic Ω((d + log(1/δ))/ε²) bound.
  • State and justify the equivalences in the fundamental PAC learning theorem.
  • Define covering numbers and use Dudley chaining to remove the log n factor.
  • Explain when fast O(1/n) rates arise under realizability, Bernstein and Tsybakov conditions, and local Rademacher complexity.

Before you start

From growth to generalization

Upper bounds control all distributions under their assumptions; minimax lower bounds exhibit difficult distributions. An easy distribution can behave much better than the worst case. For binary class H\mathcal H of VC dimension dd, n≥d≥1n\ge d\ge1, its loss class L\mathcal L has at most ΠH(n)\Pi_\mathcal H(n) sample vectors, each with norm at most n\sqrt n. Massart and Sauer give

R^S(L)≤2log⁡ΠH(n)n≤2dlog⁡(en/d)n.\widehat{\mathfrak R}_S(\mathcal L)\le\sqrt{\frac{2\log\Pi_\mathcal H(n)}n}\le\sqrt{\frac{2d\log(en/d)}n}.

Substituting into the previous lesson’s empirical bound, with probability at least 1−δ1-\delta, simultaneously for every hh,

R(h)≤R^S(h)+22dlog⁡(en/d)n+3log⁡(2/δ)2n.R(h)\le\widehat R_S(h)+2\sqrt{\frac{2d\log(en/d)}n}+3\sqrt{\frac{\log(2/\delta)}{2n}}.

This VC generalization bound uses the explicit constants of our derivation; other bounds may use different constants. If the right side exceeds 1, replacing it by 1 gives the trivial bound. For n<dn<d use the 2n2^n count or the full binomial sum.

The figure fits a subclass of 64 affine half-spaces by ERM on synthetic data and estimates error on 3000 independent examples. Test excess subtracts known noise, which is Bayes risk. Upper bounds control total error. The lower bound concerns another adversarial distribution and expected risk in the full half-space class, not a point prediction for this experiment. The generator and seeds accompany the widget.

InteractiveBounds versus a particular distribution
  • positive test excess
  • VC bound on error
  • Rademacher bound on error
  • realizable minimax lower bound

Upper bounds are for total error; test excess subtracts known noise and is omitted when ≤ 0. The lower bound corresponds to a different problem.

Dimension p
Noise
Test at n=10000.112
Rademacher bound n=10000.467
VC bound n=10000.598
Change dimension and noise. The upper and worst-case lower bounds have different scopes from measured excess.

Empirical complexity is estimated with 1000 sign vectors. Each normalized supremum lies between −1-1 and 11: Hoeffding adds 2log⁡(100)/1000\sqrt{2\log(100)/1000} as an upper correction with failure 0.01. The generalization bound allocates another 0.04, so combined failure is at most 0.05 for a fixed configuration. The VC bound uses δ=.05\delta=.05. Choosing a configuration after inspecting many requires splitting confidence.

An adversary with rare points

Choose d≥2d\ge2 shattered points and 0<ε≤1/80<\varepsilon\le1/8. One has mass 1−8ε1-8\varepsilon and the other d−1d-1 each have mass q=8ε/(d−1)q=8\varepsilon/(d-1). Assign each point an independent uniform label before sampling. Every assignment is realizable by shattering. Even if the learner is randomized and knows points and masses, an unobserved rare label remains an independent coin with expected error 1/21/2.

The probability of missing a rare point is (1−q)n(1-q)^n. Summing masses, expected error on unseen rare points, averaged over sample, labels and algorithm randomness, is

4ε(1−q)n.4\varepsilon(1-q)^n.

If n<(d−1)/(32ε)n<(d-1)/(32\varepsilon), Bernoulli gives (1−q)n≥1−nq>3/4(1-q)^n\ge1-nq>3/4 and expected error exceeds 3ε3\varepsilon. Let ZZ be error on unseen rare points; 0≤Z≤8ε0\le Z\le8\varepsilon. Since EZ≤ε+7ε P(Z>ε)\mathbb E Z\le\varepsilon+7\varepsilon\,\mathbb P(Z>\varepsilon), failure exceeds 2/72/7. Averaging over labels yields a fixed assignment with at least that failure probability. Thus no algorithm attains confidence above 5/75/7 with so few observations: complexity Ω(d/ε)\Omega(d/\varepsilon) at constant confidence.

InteractiveThe rare-point adversary
Heavy
mass 0.60
unseen
Rare 1
mass 0.05
unseen
Rare 2
mass 0.05
unseen
Rare 3
mass 0.05
unseen
Rare 4
mass 0.05
unseen
Rare 5
mass 0.05
unseen
Rare 6
mass 0.05
unseen
Rare 7
mass 0.05
unseen
Rare 8
mass 0.05
unseen
0 observations
Total rare mass0.40
Rare points seen0/8
Error on unseen rare points0.250
A fixed sequence reveals points and labels. The illustrated rule predicts 0 on unseen points; one run does not represent all samples.

The example uses d=9d=9, ε=.05\varepsilon=.05, total rare mass .4 and eight masses of .05. The mathematical adversary does not change labels after seeing the sample: the probabilistic method finds a fixed difficult choice. The Ω(log⁡(1/δ)/ε)\Omega(\log(1/\delta)/\varepsilon) contribution comes from a rare-event construction and does not follow from the constant-confidence proof alone.

In the agnostic case, nearly balanced labels on shattered points give a lower bound Ω((d+log⁡(1/δ))/ε2)\Omega((d+\log(1/\delta))/\varepsilon^2) in the usual range. Distinguishing a small probability difference requires order 1/ε21/\varepsilon^2 observations. A complete proof uses multiple-testing reduction or Fano and controls constants; PAC lower bounds do not say every distribution is difficult.

The fundamental theorem

For binary classification, with appropriate measurability and ERM selectors, the following are equivalent:

  1. VC⁡(H)<∞\operatorname{VC}(\mathcal H)<\infty.
  2. The 0-1 loss converges uniformly in probability with distribution-independent sample size.
  3. ERM learns in the agnostic PAC sense.
  4. An agnostic PAC learner exists; equivalently, a realizable PAC learner exists.

Finite VC dimension implies uniform convergence by Sauer and Rademacher. Uniform convergence implies ERM excess is at most twice uniform deviation: compare ERM with a nearly optimal competitor. Agnostic learning includes the realizable case. Finally, infinite VC dimension permits as many shattered points as the adversary needs, and the construction above prevents a uniformly sufficient sample. This fundamental PAC theorem is statistical: it does not promise to find ERM in polynomial time.

In standard ranges, agnostic minimax sample complexity has order (d+log⁡(1/δ))/ε2(d+\log(1/\delta))/\varepsilon^2, while realizable optimal order is (d+log⁡(1/δ))/ε(d+\log(1/\delta))/\varepsilon. A classical consistent-ERM upper bound contains an extra log⁡(1/ε)\log(1/\varepsilon); Hanneke constructs an optimal-order learner. It does not follow that every ERM has that bound or that the logarithm is intrinsic.

Covering real-valued functions

For real values, pseudodimension shatters points using individual thresholds and fat-shattering adds a positive margin. On the sample, use the pseudometric

dS(f,g)=(1n∑i(f(zi)−g(zi))2)1/2.d_S(f,g)=\left(\frac1n\sum_i(f(z_i)-g(z_i))^2\right)^{1/2}.

An ε\varepsilon-net has centers covering every function within distance ε\varepsilon. The covering number N(ε,F,dS)N(\varepsilon,\mathcal F,d_S) is the minimum number of centers, here chosen from the class. Distinct functions can have distance zero if they agree on the sample. A greedy net scans a finite family and adds a curve when no prior center covers it. Its size is not necessarily minimal or decreasing with radius for an arbitrary family and order.

InteractiveA greedy net of sigmoids
Functions and centersx: −2 to 2√(log greedy count)0.0050.5
0.10
Functions41
Greedy centers7
Integral over displayed scales0.563
Change the empirical radius. Orange curves are centers; the area integrates greedy entropy over a finite window of scales.

The family contains 41 sigmoids on 51 equally spaced points, not all possible sigmoids. The area approximates ∫.005.5log⁡Nvoraz(u) du\int_{.005}^{.5}\sqrt{\log N_{\mathrm{voraz}}(u)}\,du; it omits other scales and is not a complete Dudley bound. Greedy counting upper-bounds NN, but quadrature requires error control to be a guarantee.

Chaining scales

Dudley chaining approximates a function with centers at decreasing radii and decomposes the sum into increments. Each increment is small; a sub-Gaussian inequality controls the maximum over center pairs and the contributions are added. For bounded functions and suitable diameter DD, one version is

R^S(F)≤inf⁡0<a≤D/2{4a+12n∫aDlog⁡N(u,F,dS) du}.\widehat{\mathfrak R}_S(\mathcal F)\le \inf_{0<a\le D/2}\left\{4a+\frac{12}{\sqrt n}\int_a^D\sqrt{\log N(u,\mathcal F,d_S)}\,du\right\}.

Constants depend on conventions. A binary VC entropy bound log⁡N(u)≤Cdlog⁡(C/u)\log N(u)\le Cd\log(C/u) for 0<u≤10<u\le1 gives a finite integral of order d\sqrt d and complexity O(d/n)O(\sqrt{d/n}), without the log⁡n\sqrt{\log n} from applying Massart to all traces. Concentration adds confidence. Removing that logarithm requires the entropy bound; it does not happen for every real-valued family.

[ ]A net and an entropy integralBrowser
import numpy as np
def greedy_cover(F,eps):
    F=np.asarray(F); centers=[]
    for i,row in enumerate(F):
        if not centers or np.min(np.sqrt(np.mean((F[centers]-row)**2,axis=1)))>eps: centers.append(i)
    return centers
x=np.linspace(-2,2,51); shifts=np.linspace(-1,1,41)
F=1/(1+np.exp(-3*(x[None,:]-shifts[:,None])))
scales=np.linspace(0,1,101); counts=np.array([len(greedy_cover(F,e)) for e in scales])
area=np.trapezoid(np.sqrt(np.log(counts)),scales)
signs=np.random.default_rng(1308).choice([-1,1],size=(3000,len(x)))
mc=([email protected]).max(axis=1).mean()/len(x)
massart=np.sqrt(2*np.log(len(F))/len(x))
print('centros ε=.1:',len(greedy_cover(F,.1)),'integral numérica:',round(area,4))
print('MC:',round(mc,4),'Massart:',round(massart,4),'12 × integral / √n:',round(12*area/np.sqrt(len(x)),4))

Quadrature is illustrative, not a certification of the integral. To verify the net, calculate each row’s distance to its nearest center; counting centers is not enough.

[ ]Half-spaces and bounds on a sampleBrowser
import numpy as np
from math import comb, log, sqrt
rng=np.random.default_rng(1309); n=400; p=3; M=32
W=rng.normal(size=(M,p+1)); X=np.column_stack((rng.normal(size=(n+2000,p)),np.ones(n+2000)))
[email protected]>=0; y=np.logical_xor(pred[:,0],rng.random(len(X))<.1)
loss=(pred[:n]!=y[:n,None]); risks=loss.mean(axis=0); h=np.argmin(risks)
test=np.mean(pred[n:,h]!=y[n:]); signs=rng.choice([-1,1],size=(2000,n))
mc=np.max(signs@loss,axis=1).mean()/n
upper=mc+sqrt(2*log(100)/len(signs))
rad=risks[h]+2*upper+3*sqrt(log(50)/(2*n))
traces=sum(comb(n,i) for i in range(p+2))
vc=risks[h]+2*sqrt(2*log(traces)/n)+3*sqrt(log(40)/(2*n))
print('error train:',round(risks[h],4),'test:',round(test,4))
print('Rademacher estimada:',round(mc,4),'cota corregida:',round(rad,4),'cota VC:',round(vc,4))

ERM is exact only over 32 candidates. The test is an independent estimate; untruncated bounds reveal when they are vacuous. The Monte Carlo correction keeps its failure probability explicit.

When fast rates appear

In the realizable case, a proof using zero empirical error and Bernstein can give order d/nd/n with logarithmic factors depending on the method. In noisy problems, impose a Bernstein condition on excess losses gh=ℓh−ℓh∗g_h=\ell_h-\ell_{h^*}, for example Pgh2≤C(Pgh)βPg_h^2\le C(Pg_h)^\beta, 0≤β≤10\le\beta\le1. Together with localized complexity control and other assumptions, a typical fixed point has bound r=O((d/n)1/(2−β))r=O((d/n)^{1/(2-\beta)}). The 1/n1/n power requires β=1\beta=1; bounded variance alone is insufficient.

Tsybakov’s margin condition controls mass near the Bayes boundary: P(∣2η(X)−1∣≤t)≤CtαP(|2\eta(X)-1|\le t)\le Ct^\alpha. With Bayes in the class and suitable conditions, it relates to β=α/(α+1)\beta=\alpha/(\alpha+1) and yields orders (d/n)(α+1)/(α+2)(d/n)^{(\alpha+1)/(\alpha+2)}, up to constants and possible logarithms. A fast rate describes excess risk, not necessarily absolute error tending to zero with irreducible noise. Local complexity restricts the supremum to functions near the optimum and solves a fixed point; the radius needs justification.

InteractiveFrom n⁻¹ᐟ² toward n⁻¹
  • chosen α reference
  • n⁻¹ᐟ²
  • n⁻¹
0
Exponent (α+1)/(α+2)0.500
Log-log slope−0.500
Normalized reference curves for noise exponents. They are not measurements or guarantees without additional assumptions.

To evaluate a fixed predictor, use concentration and an independent test. For a binary uniform guarantee use VC; Rademacher incorporates sample geometry; coverings and local complexity require checking their assumptions. Review constants, confidence, adaptive selection and risk type.

Exercises

Proof
Prove: Prove a realizable lower bound with one heavy point and d−1 rare points.
0
Total rare mass 8ε, independent labels and n < (d−1)/(32ε).

Step 1 of 2. What expected error does an unseen rare point contribute?

Proof
Prove: Explain why infinite VC dimension prevents realizable PAC learning.
0
For each proposed sample size choose sufficiently many shatterable points.

Step 1 of 2. What does infinite VC dimension provide?

Numeric
Evaluate √(2d ln(en/d)/n) + √(ln(1/δ)/(2n)) for d=10, n=10000 and δ=0.05.
Quiz
Which condition is NOT by itself equivalent to binary PAC learning?
CodeGreedy net and entropy
Implement greedy_cover(F, eps), returning indices of centers chosen in order using empirical L² distance, and dudley_integral(F, scales), the trapezoidal integral of √log of the number of centers at ascending scales. Return an approximation, not a certified guarantee.
def greedy_cover(F, eps):
  pass
def dudley_integral(F, scales):
  pass
Shift+Enter to run

Summary

Key idea
Finite VC dimension characterizes binary PAC learning under usual conditions. The lower bound uses rare points and fixed labels; chaining uses nets at multiple scales; fast rates need additional noise and local-complexity conditions.

Sources: Hanneke on optimal complexity, Bartlett, Bousquet and Mendelson on local complexities, and Vershynin on chaining.