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 of VC dimension , , its loss class has at most sample vectors, each with norm at most . Massart and Sauer give
Substituting into the previous lesson’s empirical bound, with probability at least , simultaneously for every ,
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 use the 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.
Empirical complexity is estimated with 1000 sign vectors. Each normalized supremum lies between and : Hoeffding adds 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 . Choosing a configuration after inspecting many requires splitting confidence.
An adversary with rare points
Choose shattered points and . One has mass and the other each have mass . 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 .
The probability of missing a rare point is . Summing masses, expected error on unseen rare points, averaged over sample, labels and algorithm randomness, is
If , Bernoulli gives and expected error exceeds . Let be error on unseen rare points; . Since , failure exceeds . Averaging over labels yields a fixed assignment with at least that failure probability. Thus no algorithm attains confidence above with so few observations: complexity at constant confidence.
The example uses , , 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 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 in the usual range. Distinguishing a small probability difference requires order 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:
- .
- The 0-1 loss converges uniformly in probability with distribution-independent sample size.
- ERM learns in the agnostic PAC sense.
- 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 , while realizable optimal order is . A classical consistent-ERM upper bound contains an extra ; 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
An -net has centers covering every function within distance . The covering number 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.
The family contains 41 sigmoids on 51 equally spaced points, not all possible sigmoids. The area approximates ; it omits other scales and is not a complete Dudley bound. Greedy counting upper-bounds , 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 , one version is
Constants depend on conventions. A binary VC entropy bound for gives a finite integral of order and complexity , without the 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.
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.
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 with logarithmic factors depending on the method. In noisy problems, impose a Bernstein condition on excess losses , for example , . Together with localized complexity control and other assumptions, a typical fixed point has bound . The power requires ; bounded variance alone is insufficient.
Tsybakov’s margin condition controls mass near the Bayes boundary: . With Bayes in the class and suitable conditions, it relates to and yields orders , 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.
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
Step 1 of 2. What expected error does an unseen rare point contribute?
Step 1 of 2. What does infinite VC dimension provide?
def greedy_cover(F, eps):
pass
def dudley_integral(F, scales):
passSummary
Sources: Hanneke on optimal complexity, Bartlett, Bousquet and Mendelson on local complexities, and Vershynin on chaining.