Triangle inequality for infinite number of terms

We can prove that for any $n\in \mathbb{N}$ we have triangle inequality: $$|x_1+x_2+\cdots+x_n|\leqslant |x_1|+|x_2|+\cdots+|x_n|.$$

How to prove it for series i.e. $$\left|\sum \limits_{n=1}^{\infty}a_n\right|\leqslant \sum \limits_{n=1}^{\infty}|a_n|.$$ Can anyone help to me with this?


Let $\sum \limits_{n=1}^{\infty}|a_n|<\infty. $ For any $n\in \mathbb{N}$ we have triangle inequality: $$|a_1+a_2+\cdots+a_n|\leqslant |a_1|+|a_2|+\cdots+|a_n|\leq \sum \limits_{n=1}^{\infty}|a_n| .$$ This implies $\left|\sum \limits_{j=1}^{n}a_j\right|\leqslant \sum \limits_{n=1}^{\infty}|a_n|$ for each $n\in\mathbb{N}.$ Letting $n\to\infty$ in the last inequality and using continuity of modulus function, we get $$\left|\sum \limits_{n=1}^{\infty}a_n\right|\leqslant \sum \limits_{n=1}^{\infty}|a_n|.$$

If $\sum \limits_{n=1}^{\infty}|a_n|=\infty$ then inequality is true.