45.07.03 · mathematical-statistics / 07-statistical-learning-theory

VC Dimension, the Growth Function, and the Sauer-Shelah Lemma

shipped3 tiersLean: none

Anchor (Master): Shalev-Shwartz & Ben-David 2014 Understanding Machine Learning (Cambridge) ch. 6 (the growth function, the Sauer-Shelah lemma, the polynomial-vs-exponential dichotomy, the setup of the fundamental theorem); Vapnik & Chervonenkis 1971 Theory Probab. Appl. 16 (the original capacity bound); Sauer 1972 J. Combin. Theory A 13 and Shelah 1972 Pacific J. Math. 41 (the lemma); Bollobás 1986 Combinatorics (Cambridge) ch. 17 (the shifting / down-compression proof)

Intuition Beginner

A class of rules is dangerous when it can memorise. The clean way to measure that danger is to ask: how many example points can the rules tag in every possible yes/no pattern? If your rules can paint two points in all four ways — both yes, both no, first yes second no, first no second yes — then two points cannot trip them up; whatever the truth turns out to be, some rule already matches it. If they can do this for three points, the rules are richer still. The largest number of points the rules can pattern in every way is the single number that captures the capacity of the whole class.

This number is the VC dimension. It is small for plain rule families and infinite for families rich enough to fit anything. A family of straight cutoffs on a line — "say yes above the cutoff" — can pattern one point in both ways but cannot pattern two points in the order yes-then-no, so its number is one. The lesson is that a low number means the rules cannot memorise much, which is exactly what makes them safe to trust on new data.

The payoff is a sharp split. Count the distinct labelings a class can produce on a sample of points. If the VC dimension is some finite , that count grows only like a polynomial in — slow. If the dimension is infinite, the count is the full -to-the- — every pattern, always. There is no middle ground, and the slow polynomial growth is the whole reason finite-dimension classes can learn while all-powerful ones cannot.

Visual Beginner

Picture two points on a page and a family of straight cutoffs you can slide and flip. Can you realise all four labelings of the two points? For cutoffs on a line you can get three of them but never the pattern where the left point is yes and the right point is no, so a line of cutoffs shatters one point, not two. Now picture a rectangle you may stretch and place freely: it can capture any four points in every in-or-out pattern, but five points defeat it. The largest fully-patternable set is the VC dimension.

 thresholds on a line          axis-aligned rectangles in the plane
   . shatter 1 point             :: shatter 4 points (every in/out pattern)
   .  . cannot do (yes,no)       five points: some pattern is unreachable
   VC dimension = 1              VC dimension = 4
Rule family Largest set it can pattern every way VC dimension
thresholds on a line one point 1
intervals on a line two points 2
axis-aligned rectangles in the plane four points 4
every possible rule any size, forever infinite

The picture teaches the rule of thumb: a small dimension means the family runs out of patterns quickly, so it cannot fit just anything.

Worked example Beginner

Take the family of intervals on the number line: each rule picks a left end and a right end and says yes inside, no outside. We find its VC dimension by hand.

Step 1. Can it pattern two points? Place points at and . The pattern no-no comes from an interval that misses both, say . The pattern yes-yes comes from . The pattern yes-no comes from , catching but not . The pattern no-yes comes from . All four patterns appear, so two points are shattered.

Step 2. Can it pattern three points? Place points at , , and ask for the pattern yes-no-yes: catch and but skip . An interval is one unbroken stretch, so any interval containing both and must also contain everything between them, including . The pattern yes-no-yes is impossible.

Step 3. Read off the dimension. Two points can be patterned every way; three points cannot. So the VC dimension of intervals is exactly .

Step 4. Count labelings on a sample. On points an interval is pinned down by which point it first catches and which it last catches, giving at most about distinct labelings — a polynomial of degree , matching the dimension.

What this tells us: the VC dimension is found by pushing the point count up until some pattern becomes unreachable, and that same dimension is the exponent governing how the labeling count grows.

Check your understanding Beginner

Formal definition Intermediate+

The setting is that of 45.07.02: a domain , a binary label set , and a hypothesis class of functions . The combinatorial complexity of is measured through how it behaves on finite point sets.

Definition (restriction / trace). For a finite set , the restriction of to is the set of label vectors it induces,

Distinct hypotheses agreeing on all of collapse to one vector, so always.

Definition (shattering). A finite set with is shattered by if realises all of its labelings, , equivalently .

Definition (VC dimension). The Vapnik-Chervonenkis dimension of is

with when arbitrarily large sets are shattered. To prove one exhibits one shattered set of size and shows no set of size is shattered [Shalev-Shwartz Ben-David 2014].

Definition (growth function / shatter coefficient). The growth function is the largest number of labelings realises on any -point set,

By definition , with equality for .

Catalogue of VC dimensions Intermediate+

  • Thresholds on : . One point is shattered; two points cannot realise since the rule is monotone.
  • Intervals : . Two points are shattered; three points cannot realise since an interval is connected.
  • Axis-aligned rectangles in : . Four extremal points are shattered; among any five points one lies in the bounding box of the others and cannot be excluded while they are included.
  • Halfspaces in : , proved in the Key theorem.
  • Finite classes: , since shattering points needs distinct restrictions, hence .

Counterexamples to common slips Intermediate+

  • "VC dimension counts the parameters of the class." Usually parameters and VC dimension agree (halfspaces: parameters, dimension), but not always. The one-parameter sine family has infinite VC dimension. Parameter count is a heuristic, not the definition.
  • "To show I must shatter every -set." Only some -set need be shattered. To show , however, no -set may be shattered — the asymmetry between the existential lower bound and the universal upper bound is where computations go wrong.
  • "A small growth function means a small class." The growth function is small (polynomial) exactly when the VC dimension is finite, regardless of cardinality: an infinite class of finite VC dimension has polynomial growth, while a finite class of size may shatter up to points.

Key theorem with proof Intermediate+

The signature result is the Sauer-Shelah lemma: finite VC dimension forces the growth function to be polynomial rather than exponential. The proof is a self-contained combinatorial induction — independently due to Sauer, Shelah and Perles, and Vapnik and Chervonenkis around 1971-1972 — that bounds the number of distinct labelings by counting subsets of bounded size.

Theorem (Sauer-Shelah). Let be a hypothesis class with . Then for every ,

and for this is at most . [Shalev-Shwartz Ben-David 2014]

Proof. Fix an -point set ; it suffices to bound , since is the maximum of this over . Identify each label vector with the subset of it marks , so becomes a family of subsets of . A set is shattered by if every subset of arises as for some ; because , a set shattered by is shattered by , so shatters no set of size .

The claim is the sharper statement that for any family ,

Granting this, since shatters no set larger than , the shattered sets all have size , so , the count of subsets of of size at most .

Prove the claim by induction on . For the family is or and the empty set is the only candidate; both sides agree. For the step, fix an element and split by whether a set contains . Define two families on :

Here collects the sets avoiding , viewed inside , and collects those -traces whose -free version is also present in . Every is counted once on the right: a set avoiding lands in ; a set contributes to exactly when its partner is in , and otherwise it is the unique set restricting to and is counted within 's tally of distinct -traces. A direct count gives , where is now read as a family of subsets of .

Apply the inductive hypothesis to each. Any shattered by is shattered by (it avoids , and traces on within are traces of ), so the shattered sets of are shattered sets of . For : if is shattered by , then is shattered by . Indeed every subset of is for some , which means both and lie in ; so every subset of — whether or not it contains — is realised as an intersection with . Thus each set shattered by yields, by adjoining , a distinct set shattered by , none of which is counted among the shattered sets of (those omit ). Therefore

completing the induction and the claim.

For the closed form, assume and use , where the first inequality uses and the last uses with .

Bridge. The Sauer-Shelah lemma is the foundational reason an infinite class can still learn: it converts the abstract finiteness of the VC dimension into the concrete polynomial bound that the growth-function uniform-convergence estimate of 45.07.02 demands, since is sublinear precisely when . This is exactly the replacement of the union-bound factor by an effective, sample-dependent count, and the bridge is the lemma's degree- polynomial standing in for the cardinality. It builds toward the fundamental theorem of statistical learning in 45.07.04, where finite VC dimension, the uniform-convergence property, and agnostic-PAC learnability are shown equivalent, the central insight being that the entire learnability question reduces to whether this growth count is polynomial or exponential. The same bound appears again in the empirical-process route to the VC-Donsker theorem, where Sauer-Shelah controls the metric entropy of a VC class; putting these together, the combinatorics proved here generalises the finite-class union bound into the master complexity measure of the subject.

Exercises Intermediate+

Advanced results Master

The Sauer-Shelah bound is the hinge between three developments: the sharper trace-counting form that proves the lemma, the polynomial-versus-exponential dichotomy that the lemma forces on every class, and the passage from this combinatorics into the uniform-convergence machinery that closes the subject.

Theorem 1 (Pajor / sharp trace form). For any family ,

where is shattered by if . The Sauer-Shelah lemma is the corollary obtained by capping the size of shattered sets at : the right side is then at most [Bollobás 1986]. This trace form is strictly stronger than the cardinality statement, since it bounds by the actual count of shattered subsets rather than by the worst-case maximum, and it is the version the down-shifting proof establishes directly.

Theorem 2 (down-shifting / compression proof). For define the operator on a family by

and . Then (the map is injective on ), and the family of sets shattered by is contained in that shattered by . Iterating over all produces a family that is a down-set (closed under taking subsets) with the same cardinality and no larger shattered-set family. For a down-set, the shattered sets are exactly its own members, so equals the number of sets it shatters, and the trace bound is immediate [Bollobás 1986]. The compression argument is the cleanest route to the lemma and the one closest to a Lean formalisation, since each step is a finite cardinality-preserving rewrite.

Theorem 3 (the polynomial-exponential dichotomy). For any class , the growth function satisfies exactly one of:

There is no intermediate growth rate: a growth function is either identically exponential or eventually polynomial, with the polynomial degree equal to the VC dimension. The dichotomy is a structural consequence of Sauer-Shelah — finiteness of caps the degree, while infinite VC dimension means every -set is shattered, so identically [Shalev-Shwartz Ben-David 2014]. This is the combinatorial reason learnability is a zero-one phenomenon rather than a matter of degree.

Theorem 4 (from Sauer-Shelah to uniform convergence). Substituting the polynomial growth bound into the symmetrised tail estimate of 45.07.02, for loss and a class of VC dimension ,

whose right side vanishes as for every fixed precisely because is sublinear. Hence finite VC dimension implies the uniform-convergence property, and the sample complexity is [Mohri Rostamizadeh Talwalkar 2018]. This is the implication that lets the entire learnability theory of 45.07.02 apply verbatim to infinite classes, with in the role the cardinality played for finite classes.

Synthesis. The foundational reason an infinite class can learn is the single combinatorial fact that finite VC dimension forces polynomial growth, and every result here is a reading of that fact through a different lens. This is exactly the trace-counting bound , which the down-shifting compression proves directly and which generalises the crude count by replacing the worst case with the actual shattered family. The polynomial-exponential dichotomy is dual to the No-Free-Lunch picture of 45.07.02: infinite VC dimension means every -set is shattered, so the class realises all labelings and the averaging adversary defeats every learner, while finite VC dimension caps the labeling count and revives uniform convergence — putting these together, learnability is a zero-one property governed by one integer. The central insight is that the cardinality of the finite-class union bound is the wrong complexity measure and must be replaced by the growth function, whose logarithm Sauer-Shelah pins at ; the bridge upward at every level is the same substitution, and it is what makes the fundamental theorem of statistical learning in 45.07.04 possible — uniform convergence, agnostic learnability, and finite VC dimension all coincide because the growth function mediates between the analytic concentration and the combinatorial count.

Full proof set Master

Proposition 1 (shattering and the growth function). For every class and every , if and only if some -point set is shattered; consequently (with the convention , and if the set is unbounded).

Proof. If some -set is shattered then , so the maximum ; combined with the universal bound this gives equality. Conversely if then the maximising -set has , and since this forces , i.e. is shattered. The VC dimension, the largest size of a shattered set, is therefore the largest with .

Proposition 2 (Sauer-Shelah, trace form). For any finite ground set with and any , .

Proof. Induct on . For , ; if then is shattered (its only subset equals ) and both sides are , and if both sides are . For the step pick , , and set and , both viewed in . The trace map sends onto the -traces; a -trace has either one preimage (only , or only , lies in ) contributing to , or two preimages ( and both in ) contributing to and to . Hence . By induction and . Each shattered by is shattered by and omits . Each shattered by gives shattered by : a subset is for some with , so and both arise. The two families of shattered sets — those omitting from , those containing from — are disjoint and both consist of sets shattered by , so their counts add to at most .

Proposition 3 (Sauer-Shelah, cardinality form and closed form). If then for all , and for .

Proof. Fix an -set and let . A set shattered by is shattered by , hence has size . By Proposition 2, . Maximising over gives the growth-function bound. For the closed form with , multiply termwise by :

where the binomial theorem evaluates the sum and uses .

Proposition 4 (VC dimension of halfspaces is ). The class of halfspaces on has VC dimension exactly .

Proof. Lower bound: the points are shattered. For a target put , , ; then has the sign of , and has the sign of , realising the labeling. Upper bound: take any points in . By Radon's theorem they split into disjoint sets whose convex hulls intersect at a point with summing to . The labeling assigning to and to is unrealisable: a halfspace containing contains the convex combination , and a complementary halfspace excluding excludes , contradiction. So no -set is shattered and .

Proposition 5 (finite VC dimension implies sublinear log-growth). If then , and consequently .

Proof. By Proposition 3, for , , so . Dividing by , as since . The case gives , for which the bound is immediate.

Connections Master

This unit completes the infinite-class program opened in 45.07.02: there the growth function and the VC dimension are introduced as the quantities that replace the cardinality in the union bound, and the Sauer-Shelah lemma proved here supplies the missing combinatorial fact — that finite VC dimension forces — which makes the symmetrised uniform-convergence estimate vanish. The bias-complexity and No-Free-Lunch results of that unit are the analytic and adversarial faces of the dichotomy proved here.

The destination is the fundamental theorem of statistical learning in 45.07.04: the polynomial growth bound is exactly the input that closes the equivalence of finite VC dimension, the uniform-convergence property, agnostic-PAC learnability, and ERM-learnability for binary classification. This unit is the combinatorial half of that theorem; the No-Free-Lunch lower bound of 45.07.02 supplies the converse, that infinite VC dimension defeats every learner.

The same VC-dimension and growth-function machinery powers the empirical-process theory of 45.05.03: a VC class of functions with square-integrable envelope is -Donsker for every , because Sauer-Shelah controls the uniform metric entropy by a power of , whose square-rooted logarithm integrates near zero. The Glivenko-Cantelli unit [45.07.02 prerequisite chain] already proves the set-system form of Sauer-Shelah as a tool for distribution-free uniform laws of large numbers; this unit develops the hypothesis-class form and its consequences as a first-class object.

The proof technique is the probabilistic-method and counting toolkit of 40.07.01: shattering is a statement about the trace of a set system, the down-shifting operator is a compression argument of the kind that pervades extremal set theory, and the closed-form bound is the standard binomial-tail estimate. The lemma is one of the rare results that is simultaneously a cornerstone of learning theory and a clean theorem of finite combinatorics, rediscovered independently from both directions.

Historical & philosophical context Master

The capacity measure now called VC dimension was introduced by Vladimir Vapnik and Alexey Chervonenkis in their 1971 paper on the uniform convergence of relative frequencies, where the growth function (which they called the index or entropy of a system of events) and its polynomial bound appear as the engine of the first distribution-free generalization guarantee [Vapnik Chervonenkis 1971]. Their motivation was statistical: to determine when empirical frequencies converge to probabilities uniformly over an infinite family of events, the cardinality of the family being the wrong measure.

The combinatorial lemma at the centre of this unit was proved independently and almost simultaneously around 1972 by Norbert Sauer and by Saharon Shelah (the latter attributing the result also to Micha Perles), and is implicit in the 1971 Vapnik-Chervonenkis bound; it is for this reason often called the Sauer-Shelah-Perles lemma or the Vapnik-Chervonenkis-Sauer-Shelah lemma [Bollobás 1986]. Shelah's interest came from model theory, where the same dichotomy underlies the notion of a stable or NIP (non-independence-property) theory; Sauer's was purely combinatorial. The down-shifting proof given in the Full proof set is the form developed in the extremal-set-theory tradition and recorded by Bollobás. The textbook synthesis with PAC learning, organizing the lemma around shattering and the growth function as the route to the fundamental theorem, is due to Shalev-Shwartz and Ben-David (2014) and Mohri, Rostamizadeh and Talwalkar (2018).

Bibliography Master

@article{vapnikchervonenkis1971,
  author  = {Vapnik, Vladimir N. and Chervonenkis, Alexey Ya.},
  title   = {On the uniform convergence of relative frequencies of events to their probabilities},
  journal = {Theory of Probability and Its Applications},
  volume  = {16},
  number  = {2},
  pages   = {264--280},
  year    = {1971}
}

@article{sauer1972,
  author  = {Sauer, Norbert},
  title   = {On the density of families of sets},
  journal = {Journal of Combinatorial Theory, Series A},
  volume  = {13},
  number  = {1},
  pages   = {145--147},
  year    = {1972}
}

@article{shelah1972,
  author  = {Shelah, Saharon},
  title   = {A combinatorial problem; stability and order for models and theories in infinitary languages},
  journal = {Pacific Journal of Mathematics},
  volume  = {41},
  number  = {1},
  pages   = {247--261},
  year    = {1972}
}

@book{shalevshwartzbendavid2014,
  author    = {Shalev-Shwartz, Shai and Ben-David, Shai},
  title     = {Understanding Machine Learning: From Theory to Algorithms},
  publisher = {Cambridge University Press},
  year      = {2014}
}

@book{mohri2018,
  author    = {Mohri, Mehryar and Rostamizadeh, Afshin and Talwalkar, Ameet},
  title     = {Foundations of Machine Learning},
  edition   = {2},
  publisher = {MIT Press},
  year      = {2018}
}

@book{bollobas1986,
  author    = {Bollob\'{a}s, B\'{e}la},
  title     = {Combinatorics: Set Systems, Hypergraphs, Families of Vectors and Combinatorial Probability},
  publisher = {Cambridge University Press},
  year      = {1986}
}

@book{vapnik1998,
  author    = {Vapnik, Vladimir N.},
  title     = {Statistical Learning Theory},
  publisher = {Wiley-Interscience},
  year      = {1998}
}