I'm trying to solve an exercise in Brezis' Functional Analysis
Let $E:= \ell^p$ with $p \in [1, \infty]$. Let $(\lambda_n)$ be a bounded sequence in $\mathbb R$. We consider a bounded linear operator $T:E \to E$ defined by $$ Tx := (\lambda_1 x_1, \lambda_2 x_2, \ldots), $$ for $x = (x_1, x_2, \ldots) \in E$. Prove that $T$ is compact iff $\lambda_n \to 0$.
There are possibly subtle mistakes that I could not recognize in below attempt. Could you have a check on it? Thank you so much for your help!
Proof Let $B$ be the closed unit ball of $E$.
First, we prove the direction "$\impliedby$". Because $F$ is complete, it suffices to prove that $T(B)$ is totally bounded. Fix $\varepsilon>0$. There is $m \in \mathbb N$ such that $|\lambda_n| < \varepsilon$ for all $n \ge m$. Then for $x,y \in B$, $$ \begin{align} \sum_{n=m}^\infty |\lambda_n x_n-\lambda_n y_n|^p &=\sum_{n=m}^\infty \lambda^p_n |x_n-y_n|^p \\ &\le \varepsilon^p \sum_{n=m}^\infty |x_n-y_n|^p \\ & \le \varepsilon^p \|x-y\|_p^p \\ &\le \varepsilon^p 2^p (\|x\|^p_p + \|y\|^p_p) \\ &\le 2^{p+1}\varepsilon^p, \end{align} $$ and $$ \sup_{n \ge m} |\lambda_n x_n-\lambda_n y_n| \le \varepsilon \sup_{n \ge m} |x_n- y_n| \le 2 \varepsilon. $$ It remains to prove that $$ C :=\{ (\lambda_1 x_1, \lambda_2 x_2, \ldots, \lambda_{m-1} x_{m-1}, 0, 0, \ldots) : x \in B \} $$ has compact closure. This is indeed true because $C$ is bounded and is contained in a finite-dimensional subspace of $E$.
Second, we prove the direction "$\implies$". We define $x^m \in B$ by $(x^m)_n :=1$ if $n=m$ and $0$ otherwise. Let $y^m := T x^m$ Then $(y^m)_n =\lambda_m$ if $n=m$ and $0$ otherwise. Then $\|y^m\|_p = |\lambda_m|$. We have $T(B)$ has compact closure and thus $\{y^m :m \ge 1\}$ is bounded. The claim then follows.
Update: @Ryszard pointed out in a comment that I incorrectly quoted the exercise and thus my proof for the direction "$\implies$" is incorrect. Could you help me prove this direction?