Sufficient condition for compact embedding between Banach spaces

Let $(X,\|\cdot\|_X)$ and $(Y, \|\cdot\|_Y)$ be two Banach spaces and $X\subset Y$. Then $X$ is compactly embedded in $Y$, if the unit ball $B_X(0,1)$ in $X$ is a relatively compact subset in $Y$.

For example, the space of Lipschitz functions on $[0,1]$ is compactly embedded in $L^\infty[0,1]$.

Stateement. Assume that for every $\epsilon>0$, there exist finitely many linear functionals $\lambda_1,\cdots,\lambda_n\in X^\ast$ such that $\|x\|_Y\le \epsilon\|x\|_X+\max_{1\le i\le n} |\lambda_i(x)|$ for all $x\in X$. Then $X$ is compactly embedded in $Y$.

Question. Do you know how to prove this statement? I have seen this statement several times. But I don't know how to prove.

Thanks!

Edit: Pick a sequence $x_i\in B_X(0,1)$. We need to show that there exists a Cauchy subsequence with respect to $\|\cdot\|_Y$. Let $x^0_i=x_i$ and we find $\{x^k_i\}\subset \{x^{k-1}_i\}$ inductively.

Let $\epsilon=1/k$, $\lambda_1,\cdots,\lambda_n$ be given by the assumption, and a subsequence $\{x^k_i\}\subset \{x^{k-1}_i\}$ such that $\lambda_j(x^k_i)$ converges as $i\to \infty$ (for all $j$). In particular, there exists $I_k\ge1$ such that $\|x^k_i-x^k_j\|_Y\le 2\epsilon\cdot 2=4/k$ for all $i,j\ge I_k$. Then consider the diagonal subsequence $x^k_k$, which is a Cauchy sequence.

It suffices to prove that $B_X(0,1)$ is totally bounded in $Y$; that is, for every $\epsilon>0$ it admits a finite $\epsilon$-net (in the norm of $Y$). Pick linear functionals $\lambda_1,\dots,\lambda_n\in X^*$ such that $$\|x\|_Y\le \frac{\epsilon}{3}\|x\|_X+\max_{1\le i\le n} |\lambda_i(x)|\qquad \forall\ x\in X$$ The image of $B_X(0,1)$ under the map $Tx = (\lambda_1(x),\dots,\lambda_n(x) )\in \ell_\infty^n$ is a bounded subset of $\ell_\infty^n$, hence totally bounded. (The notation $\ell_\infty^n$ means $n$-dimensional vector space with $\ell_\infty$ norm.) Pick an $\epsilon/3$-net $\{y_j\}$ in $TB_X(0,1)$, then for each $j$ pick $x_j\in B_X(0,1)$ such that $Tx_j=y_j$.
The set $\{x_j\}$ is the desired $\epsilon$-net in $B_X(0,1)$. Indeed, for each $x\in B_X(0,1)$ we can find $x_j$ such that $\|Tx-Tx_j\|_\infty <\epsilon/3$, hence $$\|x-x_j\|_Y \le \frac{\epsilon}{3}\|x-x_j\|_X+\|Tx-Tx_j\|_\infty <\frac{2\epsilon}{3}+\frac{\epsilon}{3} =\epsilon$$