Let $H$ denote a separable Hilbert space with an orthonormal basis $\{e_k\}_k\in \mathbb N$ and consider a linear, bounded operator $A:H \to H$ such that: $Ae_k=\lambda_k e_k$. Show that $T$ is a compact operator provided that $\lambda_k \to 0$ as $k\to \infty$.
Following the argument which can be found here or in other similar posts, I want to define a sequence of operators $A_n$ which will be of finite Rank (thus compact) and then using the fact that $\lambda_k \to 0$, to deduce that $A_n$ converges to $A$ and hence $A$ is also compact.
My question is: How should I define $A_n$?
Unfortunately I can't think anything that fits here. The fact that I have $A$ mapping $e_k$ and not a general $x \in l^2$ confused me a lot.
Any help or hint is much appreciated. Thanks in advance!