The following result is available:
Let $\left(X,\lVert\cdot\rVert\right)$ be a Banach space and $S$ a subset of $X$. Then $S$ is compact if and only if the following two conditions hold:
- $S$ is closed and bounded;
- for each positive $\varepsilon$, there exists a finite dimensional vector space $F=F(\varepsilon)$ such that for all $x\in S$, we have $d(x,F)=\inf\left\{\left\lVert x-y\right\rVert, y\in F\right\}\lt\varepsilon$.
These conditions are necessary because if $\varepsilon$ is fixed, there is an integer $n$ and $x_1,\dots,x_n \in S$ such that $S\subset\bigcup_{j=1}^nB(x_j,\varepsilon)$ and we take $F$ as the vector subspace generated by the $x_j$'s. Taking $\varepsilon=1$ we get that $S$ is bounded.
The converse is a little bit more tricky. Let $M$ be such that $\lVert x\rVert\lt M$ for each $x\in S$. Fix $\varepsilon\gt 0$. Then $B(0,M+\varepsilon)\cap F(\varepsilon)$ has a compact closure, hence there is an integer $N$ and $y_1,\dots, y_N$ such that $B(0,M+\varepsilon)\cap F(\varepsilon)\subset\bigcup_{j=1}^NB(y_j,\varepsilon)$ and we conclude that
$S\subset \bigcup_{j=1}^NB(y_j,\varepsilon)$.