I don't understand one step in this proof of the triangle inequality (number 1 below).
I.e. we have the equality $|x+y|^2 =|x|^2+2xy+|y|^2$, but how can we then conclude $|x+y|^2 \leq|x|^2+2|xy|+|y|^2$?
Let $x,y \in \mathbb{R}$ and let $|x|$ be the absolute value of $x$. Then: $$ |x+y|\leq|x|+|y| $$ Proof: \begin{align} |x+y|^2 &= (x+y)^2 \\ &=x^2+2xy+y^2 \\ &= |x|^2+2xy +|y|^2 \\ &\leq |x|^2+2|xy|+|y|^2 \tag{1}\\ &=|x|^2+2|x||y|+|y|^2 \\ &= (|x|+|y|)^2 \end{align}
Thanks!
It's because for every number $a\in\mathbb R$, you have $a\leq |a|.$ In particular, here they set $a=xy$.
Longer explanation:
First of all, if $a\in\mathbb R$, then you have two options:
in total, this means that $a\leq |a|$ is true for any real number $a$.
In particular, this measn that $xy\leq |xy|$ for each value of $x,y\in\mathbb R$.
We also know that if $a\leq b$, then $ac \leq bc$ if $c>0$. In particular, this means that $2xy\leq 2|xy|$.
Now, there is also a rule that if $a\leq b$, then $b+a\leq c+a$ for all $a,b,c\in\mathbb R$. In particular, this means that, because $2xy\leq 2|xy|$, we also know that $$2xy + (|x|^2+|y|^2) \leq 2|xy| + (|x|^2+|y|^2),$$ which is exactly what you need.