Subset of $\ell^2$ is precompact Suppose we have a sequence of $a_i$ with some restrictions on it. Which restrictions must be to make set 
$$A= \left\{(x_i) \in \ell_2 \mid \sum\limits_{i\geqslant1} |a_i x_i|^2 \leqslant 1 \right\} $$
precompact in $\ell_2$? I have spent a lot of time on solving that task, but I still have got no idea which restrictions I have to choose
 A: *

*Assume that $(|a_i|)_{i\geqslant 1}$ does not diverge to $+\infty$. Then there exists $M\gt 0$ and $I\subset \mathbb N^*$ infinite such that $|a_i|\leqslant M$ for each $i\in I$. Consider $e^{(i)}\in \ell_2$ the element whose $i$th term is $1$ and all the others are $0$. Then for each $i\in I$, $e^{(i)}/M$ belongs to $A$ and $\lVert e^{(i)}-e^{\left(i'\right)}\rVert_2=\sqrt 2$, hence $A$ cannot be precompact. 

*Assume that $a_{i_k}\to 0$ for some increasing sequence of integers $(i_k)_{k\geqslant 1}$ and $a_{i_k}\neq 0$. Then for each $k$, $u_k=a_{i_k}^{-1}e^{(i_k)}$ belongs to $A$ but $\lVert u_k\rVert=\left|a_{i_k}^{-1}\right|$, hence the 
sequence $(u_k)_{k\geqslant 1}$ cannot be bounded.

*As noted by Peter Franek, the set $A$ is not bound if $a_i=0$ for some $i$. 


In conclusion, necessary conditions are the following: $|a_i|\to +\infty$ and $\inf_{i\geqslant 1}|a_i|\gt 0$.
Assume that $(|a_i|)_{i\geqslant 1}$ diverges to $+\infty$ and that $c:=\inf_{i\geqslant 1}|a_i|\gt 0$. Show that $A$ is bounded and that $$\tag{*}\lim_{n\to \infty}\sup_{x\in A}\sum_{i\geqslant n}|x_i|^2=0.$$
To see this, use the bound $$\sum_{i\geqslant 1}x_i^2\leqslant 
\sum_{i\geqslant 1}a_i^2x_i^2/c^2\leqslant 1/c^2.$$
For (*), fix  $M>0$ and take $n_0$ such that $|a_i|\gt M$ whenever $i\geqslant n_0$. For each $x\in A$, and $n\geqslant n_0$, 
$$\sum_{i\geqslant n}|x_i|^2 \leqslant \frac 1{M^2}\sum_{i\geqslant n}|Mx_i|^2\leqslant \frac 1{M^2}\sum_{i\geqslant n}|a_ix_i|^2\leqslant \frac 1{M^2}.$$
A: This is not a full answer but I would start like this..
If $a_i=0$ for some $i$, then $A$ is clearly unbounded, as the $i$th coordinate of elements in $A$ can be anything. So, $a_i\neq 0$ for all $i$ is one such condition.
Assume that $a_i$ is bounded. Then for all $i$, $a_i<B$ for some $B>0$ and $A$ contains all $x\in\ell^2$ such that $\sum_i |Bx|^2\leq 1$. In other words, it contains all elements $x$ such that $\sum_i |x|^2\leq 1/B^2$, which is a ball in $\ell^2$ and hence is non-compact. You can easily derive that then $A$ cannot be precompact (by showing that it is not totally bounded). So another constraint is that $a_i$ must be unbounded.
Slightly extending the last paragraph, you can easily show that $\lim a_i=\infty$. Otherwise, you could find a constant $B$ for which there are infinitely many indices $i_1,i_2,\ldots $ such that $a_{i_j}<B$ and then $A$ would contain a copy of an $\ell^2$-ball in those indices, which again is noncompact. 
(Edit: Initially I though that these conditions are not sufficient, but as Davide Giraudo showed, apparently they are sufficient.)
A: We can also use an elementary fact about compact operators for the harder direction: Assume $|a_n|\to \infty$ and no $a_n=0.$ We can write $A=T(B),$ where $B$ is the closed unit ball in $l^2$ and $T$ is the bounded linear operator on $l^2$ given by $T((x_n)) = (x_n/a_n).$ Thus it suffices to show $T$ is a compact operator. But this is easy: Define $T_m(x)= P_m\circ T,$ where $P_m$ is projection onto the first $m$ coordinates. Then
$$\|T_m -T\| \le \sup_{n > m} 1/|a_n| \to 0.$$
Thus $T$ is strongly approximable by the finite rank operators $T_m,$ which implies $T$ is a compact operator as desired.
