Let $K\subset\mathbb{R}^n$ be a non-empty convex set. Let $\pi_K$ be the projection onto $K$, that is, $$\pi_K(x)=\mathrm{argmin}_{k\in\mathbb{R}^n}\{\|x-k\|_2:k\in K\}.$$ Let $\|\cdot\|_2$ denote the Euclidean $2$-norm. I want to show that for all $x,y\in\mathbb{R}^n$, we have $$\|\pi_K(x)-\pi_K(y)\|_2\le \|x-y\|_2.$$
An article I am reading claims this is trivial, but I'm not sure how to proceed. It seems intuitively true if $K$ is a projection onto a subspace, say onto $K=\mathrm{span}(e_1,\dots,e_k)$ for some $k<n$ (since in the last few coordinates, nothing is contributing to the $2$-norm).
Note that since $K$ is convex from definition of the projection you have for all $k \in K$ and $\lambda \in (0 ,1)$ that $$ \| x - \pi_{K} (x) \|^2 \leq \|x -(\lambda k +(1- \lambda) \pi_{K} (x)) \|^2 = \| x - \pi_{K} (x) - \lambda (k - \pi_{K} (x)) \|^2$$ By opening up the above norm-squared and letting $\lambda \to 0$, you can conclude that $$ \langle x - \pi_{K} (x) \; , \; k - \pi_{K} (x) \rangle \leq 0 \quad \quad \forall k\in K $$ similarly $$ \langle y - \pi_{K} (y) \; , \; k - \pi_{K} (y) \rangle \leq 0 \quad \quad \forall k\in K $$
Now by settting $k = \pi_{K} (y)$ in first inequality and then $k = \pi_{K} (x)$ in the second inequality, afteradding later inequality we have $$ \langle x-y + (\pi_{K}(y) - \pi_{K} (x) ) \; , \; \pi_{K}(y) - \pi_{K} (x) \rangle \leq 0 $$ Thus $$ \| \pi_{K}(y) - \pi_{K} (x)\|^2 \leq \langle x-y \; , \; \pi_{K}(y) - \pi_{K} (x) \rangle \leq \; \| y -x \| \; \| \pi_{K}(y) - \pi_{K} (x)\| $$ This gives you the desired inequality.