Let (S,R) be a set system, where S is a set and R is a collection of subsets in S.
Definition. Given (S,R), X⊂S is shattered by R if,
∀X′⊂X,∃R′∈R, such that X′=S∩R′.
Definition. The VC dimension of (S,R) is the maximum cardinality of some X⊂S that is shattered by R.
Note: If we view (S,R) as a classification problem, i.e., S is a set of points and R a set of functions, the VC dimension d is the maximum size of a subset X in which R could separate arbitrary set points from the rest.
In some sense, it measures how complex a separation plane R could form.
Definition.
Given a nonnegative integer n and d, we define (≤dn)=∑i=0d(in)
Lemma. If (S,R) has VC dimension d, then ∣R∣≤(≤dn), where ∣S∣=n.
Proof.
Let X⊂S be the set that has size d and is shattered by R.
Define R∣X as {R′∩X∣R′∈R}.
It is obvious that (X,R∣X) has VC dimension d.
Also, the number of subset of X is given by
2d=(≤dd)=∣R∣X∣
Now we will show this lemma by induction.
Label the elements in S−X in arbitrary order as {xd+1,xd+2,...,xn}.
Define Xi = X∪{xd+1,xd+2,...,xd+i} for 0≤i≤n−d, where X0=X. So ∣Xi∣=d+i.
We will show that ∣R∣Xi∣≤(≤dd+i) holds.
Suppose the assumption holds for R∣Xi, now consider R∣Xi+1.
The elements r in R∣Xi can be divided into
D1={r∣r∈R∣Xi+1,r∪xd+1∈R∣Xi+1}.
D2={r∣r∈/R∣Xi+1,r∪xd+1∈R∣Xi+1}.
D2={r∣r∈R∣Xi+1,r∪xd+1∈/R∣Xi+1}.
We can verify that ∣R∣Xi∣=∣D1∣+∣D2∣+∣D3∣, ∣R∣Xi+1∣=2∣D1∣+∣D2∣+∣D3∣.
We show that ∣D1∣≤(≤d−1d+i).
This is because the VC dimension of (Xi,D1) is at most d−1.
Otherwise, suppose Y⊂Xi is shattered by D1 and ∣Y∣=d.
It is apparent Y∪xd+1 is shattered by R∣Xi+1 in Xi+1.
A contradiction.