Sufficient and necessary condition for compact ellipsoids in $l_2$ Another fun problem from functional analysis that I am having issues with. I have fought long enough and would like to offer this to the community.
For a sequence $\mathbb{R}\ni a_i>0$ consider a subset in the Hilbert space $l_2=\left\{(x_n):\sum_{i>0}|x_i|^2<+\infty\right\}$ defined by $$E=\left\{(x_n)\in l_2:\sum_{n>0}\frac{|x_i|^2}{a_i^2}\le1\right\}\subset l_2.$$
Show that $E$ is compact in the native metric of $l_2$ if and only if $(a_n)\in l_2$.
 A: Here is a characterization of compactness in $\ell_2$. 
Actually, it seems that $E$ is compact if and only if $a_n\to 0$.
Assume that $a_n\to 0$ when $n\to \infty$. Then $\frac 1{a_n}\to \infty$; in particular there is $K$ such that for all $n$, $\frac 1{a_n}\gt K$, hence $E$ is bounded. Since 
$$\sum_{n\geqslant N}|x_n|^2=\sum_{n\geqslant N}\frac{|x_n|^2}{a_n^2}a_n^2\leqslant \sup_{n\geqslant N}|a_n|,$$
the third condition is satisfied. One can see that $E$ is closed in the following way: if $x^{(n)}\to x$ and $x^{(n)}\in E$ for all $n$, then for each $M,n$,
$$\sum_{i=1}^M\frac{|x_i^{(n)}|^2}{a_i^2}\leqslant 1.$$
Taking the limit $n\to \infty$, we have the same inequality for $x$, and we conclude $x\in E$. 
Assume that $(a_n,n\geqslant 1)$ doesn't converge to $0$ and $E$ is compact. There is $n_k\uparrow \infty$ and $\delta\gt 0$ such that $a_{n_k}\geqslant \delta$ for each $k$. Define $x^{(k)}:=a_{n_k}e_k$. Then $x^{(k)}\in E$, hence the sequence $(x^{(k)},k\geqslant 1)$ admits a convergent subsequence, say $(y_j:=x^{k_j},j\geqslant 1)$. Since $y_{j+1}-y_j\to 0$, we get a contradiction. 
