How to show that this set is compact in $\ell^2$

The set $C$ is the image of the compact set $X = [-1,1]^{\mathbb N}$ (with the product topology) under the map $F: X \to \ell^2$, where $F(x)_j = x_j a_j$. Since the image of a compact Hausdorff space under a continuous map is compact, we just need to show that $F$ is continuous. Note that $\Vert F(x) - F(y)\Vert^2 = \sum_{j=1}^\infty (x_j - y_j)^2 a_j^2$. Given $\varepsilon > 0$, there is $N\in\mathbb{N}$ such that $\sum_{j=N+1}^\infty a_j^2 < \varepsilon/8$. If $x, y \in X$ with $|x_j - y_j|^2 < \varepsilon/(2\|a\|^2)$ for $1 \le j \le N$, we have $\Vert F(x) - F(y)\Vert ^2 < \varepsilon$.


Theorem. Let $p\in[1,+\infty]$ and $M\subset\ell_p$ is bounded subset such that $$ \lim\limits_{N\to\infty}\sup\{\Vert (0,0,\ldots,0,x_N,x_{N+1},\ldots) \Vert_p:x\in M\}=0 $$ then $M$ is totally bounded.

Proof. Take arbitrary $\varepsilon>0$ then there exist $N\in\mathbb{N}$ such that for all $x\in M$ we have $$ \Vert (0,0,\ldots,0,x_N,x_{N+1},\ldots) \Vert_p<\varepsilon/2\tag{1} $$ Since $M$ is bounded, the set $$ M_{reduced}=\{(x_1,x_2,\ldots,x_N,0,0,\ldots):x\in M\} $$ is bounded. But $M_{reduced}$ is a bounded subset of $\mathbb{R}^N$ so we can find finite $\varepsilon/2$-net $N\subset \ell_p$. This is possible because all norms on finite dimensional spaces are equivalent to euclidean norm, and sets bounded in euclidean norm are always totally bounded. We claim that $N$ is a finite $\varepsilon$-net for $M$. Take arbitrary $x\in M$ and consider $x_{reduced}=(x_1,x_2,\ldots,x_N,0,0\ldots,)\in M_{reduced}$. Then there exist $y\in N$ such that $\Vert x_{reduced}-y\Vert_p<\varepsilon/2$. Then using $(1)$ we get $$ \Vert x-y\Vert_p\leq\Vert x-x_{reduced}\Vert_p+\Vert x_{reduced}-y\Vert_p< \Vert (0,0,\ldots,0,x_N,x_{N+1},\ldots) \Vert_p+\varepsilon/2<\varepsilon $$ Since $x\in M$ is arbitrary, then $N$ is an $\varepsilon$-net for $M$. Since $\varepsilon>0$ is arbitrary and by construction $N$ is finite, then $M$ is totally bounded.

Theorem. Let $1\leq p\leq +\infty$ and $a\in \ell_p \cap c_0$, then the set $$ C=\{x\in\ell_p:\;\forall n\in\mathbb{N}\quad|x_n|\leq |a_n|\} $$ is compact.

Proof. We need to show that $C$ is complete and totally bounded

1) Completeness. Since $C$ is a subset of complete space $\ell_p$, it is enough to show that $C$ is closed. Consider continuous linear functionals $f_n:\ell_p\to\mathbb{R}:x\mapsto x_n$. Since $|f_n(x)|=|x_n|\leq\Vert x\Vert_p$ for all $x\in\ell_p$, then $f_n$ is continuous and obviously linear. Hence $f_n^{-1}([-a_n,a_n])$ is a closed set as preimage of closed set. Note that $$ C=\bigcap\limits_{n\in\mathbb{N}}f_n^{-1}([-a_n,a_n]) $$ so $C$ is closed as intersection of closed sets.

2) Total boundedness. From the formula of the norm in $\ell_p$ it follows that for all $x\in C$ we have $\Vert x\Vert_p\leq\Vert a\Vert_p$, so $C$ is bounded. By the same reasonong for all $x\in C$ we have $$ \Vert (0,0,\ldots,0,x_N,x_{N+1},\ldots) \Vert_p\leq \Vert (0,0,\ldots,0,a_N,a_{N+1},\ldots) \Vert_p $$ Hence $$ \lim\limits_{N\to\infty}\sup\left\{\Vert (0,0,\ldots,0,x_N,x_{N+1},\ldots) \Vert_p:x\in C\right\}\leq \lim\limits_{N\to\infty}\Vert (0,0,\ldots,0,a_N,a_{N+1},\ldots) \Vert_p=0 $$ Since $a\in\ell_p\cap c_0$ then the last limit is $0$, so $$ \lim\limits_{N\to\infty}\sup\left\{\Vert (0,0,\ldots,0,x_N,x_{N+1},\ldots) \Vert_p:x\in C\right\}=0 $$ Thus from previous theorem we see that $C$ is totally bounded.


Show that $C$ is complete and totally bounded.

Completeness is straightforward, suppose $x_n \in C$ is Cauchy. Then each component is also Cauchy since $|[x_n]_k - [x_m]_k | \leq \|x_n -x_m\|$, hence each component converges to some $\alpha_k$. Furthermore, it is clear that $|\alpha_k| \leq a_n$, so define $\hat{x}$ by $[\hat{x}]_n = \alpha_n$. Clearly, $\hat{x} \in C$, and we just need to show that $x_n \to \hat{x}$. Let $\epsilon > 0$, and choose $N'$ such that $\sum_{k>N'} a_k^2 < \frac{\epsilon}{2}$. Furthermore, we can choose $N>N'$ such that if $n>N$, then $|[x_n]_k - [\hat{x}]_k|^2< \frac{\epsilon}{2N'}$, for all $k \leq N'$. Then, if $n>N$, we have $\|x_n-\hat{x}\|^2 < \sum_{k\leq N'} |[x_n]_k - [\hat{x}]_k|^2 + \frac{\epsilon}{2} \leq \epsilon$. Hence $x_n \to \hat{x}$.

To show total boundedness, we need to find a finite $\epsilon$-net for all $\epsilon>0$. Choose $N'$ such that $\sum_{k>N'} a_k^2 < \frac{\epsilon^2}{2}$. It is clear that since $A=[-a_1,a_1]\times \cdots \times [-a_{N'},a_{N'}]$ is compact (as a subset of $\mathbb{R}^{N'}$), we can find an $\frac{\epsilon^2}{2}$-net for $A$. Let $E \subset A$ be a $\frac{\epsilon^2}{2}$-net for $A$, then define the set (with slight abuse of notation) $E' = E \times \{0\} \times \{0\} \times \cdots$. The set $E' \subset C$ is finite, and is an $\epsilon$-net for $C$. To see this, choose $x \in C$. Then let $\tilde{x} \in \mathbb{R}^{N'}$ be the first $N'$ components of $x$. Then there exists $\tilde{y} \in E$ such that $\|\tilde{y}-\tilde{x} \| < \frac{\epsilon^2}{2}$. Let $y \in E'$ be the element (again abusing notation slightly) $\tilde{y} \times 0 \times 0 \times \cdots$. Then we have the estimate $\|y-x\|^2 = \sum_{k\leq N'} |[\tilde{y}]_k-[x]_k|^2 + \sum_{k\leq N'} |[x]_k|^2 \leq \frac{\epsilon^2}{2}+ \sum_{k\leq N'} a_n^2 \leq \epsilon^2$.