Nonexpansive map on Hilbert space Let $H$ be a real Hilbert space and $\bar{B_r} = \{x\in H :\Vert x\Vert \leq r\}$ with $r>0$. Define $f:H \rightarrow \bar {B_r}$ by
$
f(x)=\left\{ \begin{array}
xx,& \Vert x \Vert \leq r\\
rx/\Vert x \Vert,& \Vert x \Vert >r
\end{array}\right.
$
I want to prove that f is a nonexpansive map(i.e. $\Vert f(x)-f(y) \Vert \leq \Vert x-y \Vert$).
 A: First we need the following Hilbert space inequality:


Lemma 1: For every nonzero $x, y\in H$, $ \left\| \frac{x}{\|x\|}-\frac{y}{\|y\|} \right\| \leq \frac{\|x-y\|}{\min\{  \|x\|, \|y\|\}}$.
Proof: Without loss of generality we may assume that this minimum is attained at $\|x\|$, so we are trying to show that $\left\|x-\frac{\|x\|}{\|y\|}y\right\| \leq \|x-y\|$. Taking squares in both sides and using the inner product properties we get that this inequality is equivalent to  $$2\langle x, y\rangle \left(1-\tfrac{\|x\|}{\|y\|}\right) \leq \|y\|^2-\|x\|^2, $$
    which is true (just apply the Cauchy–Schwarz inequality on the left hand side of it). 


To return to your question, there are three cases we need to examine, regarding where $x,y$ lie: If $x, y\in B(0,r)$, then the result is obvious. If $\|x\|, \|y\|>r$, then it follows from the previous lemma. If $\|x\|\leq r$ and $\|y\|>r$, then we need to show that $$\left\|\|x\|-\tfrac{ry}{\|y\|}\right\| \leq \|x-y\|.$$
I will leave the details of this case to you, just follow the steps of the proof of Lemma 1. 
A: $f$ is in general not nonexpansive: Let $r=3$, fix $x_0 \in H$ with $||x_0||=3$ and take $x=\frac{1}{2}x_0$ and $y=2x_0$.
