Solution (source code)

= Solution

If $H$ is a finite-dimensional <Hilbert space>, a choice of <orthonormal basis> identifies its closed <unit ball> with a closed bounded ball in a finite-dimensional Euclidean space. The <Heine-Borel theorem> makes it compact in the norm topology.

Conversely, if $H$ is infinite-dimensional, choose a unit vector $e_1$ and inductively choose $e_{n+1}$ orthogonal to the span of $e_1,\ldots,e_n$. The finite span is a proper closed subspace, so its <orthogonal complement> contains a nonzero vector that can be normalized. The resulting <orthonormal sequence> lies in the closed <unit ball> and satisfies
$$
\|e_n-e_m\|^2=\|e_n\|^2+\|e_m\|^2=2\qquad(n\ne m).
$$
It has no norm-convergent subsequence. <Sequential compactness> is equivalent to <compactness> in a metric space, hence the closed ball is not compact. This proves the <norm-compact unit ball criterion>: \b[a Hilbert space has a norm-compact closed unit ball exactly when it is finite-dimensional.]