Solution (source code)

= Solution

The <VC dimension> is
$$
\boxed{\operatorname{VC}(H)=\sup\{|S|:S\subseteq X\text{ is finite and is shattered by }H\}.}
$$
It is infinite if arbitrarily large finite <sets> are shattered. A <hypothesis class> has <VC dimension> zero when it shatters no one-point <set>; for a nonempty <hypothesis class>, the empty <set> is always shattered.