Define the closed unit ball $B \subset \Bbb R^n$ by $B:= \{x \in \Bbb R \mid \|x\| \le 1\}$, where $\| \cdot \|$ denotes the Euclidean norm Define the closed unit ball $B \subset \Bbb R^n$ by: 
$B:= \{x \in \Bbb R \mid \|x\| \le 1\}$, where $\| \cdot \|$ denotes the Euclidean norm on $\Bbb R^n$, i.e. $\| x \| = \sqrt {\langle x, x \rangle}$ for $x \in \Bbb R$.
Prove that:
$$P_B = \begin{cases} \frac1{\|x \|} x ,& \text{if } \|x \| > 1 \\ x, &\text{if } \|x \| \le 1 \end{cases}$$
So in this particular case, $P_B =$ the nearest point of $x$ in $B$, as it is a projection function.
What I have so far is that I think when ||$x$||≤ 1, we need to show/verify that || $x$-$x/||x||$ || ≤ ||$x$-$z$|| for every z ∈ 0. So: $x$-$x/||x||$=$x$(1-1/||$x$||). But I'm really stuck on this still, not sure where to go from here. :/
 A: I am assuming that $P_B(x)$ is the closest point to $x$ in $B$.
If $x=0$ we have $\|P_B(0)-0\| \le \|0-0\| = 0$ hence $P_B(0) = 0$.
Suppose $x \neq 0$. Then any point $z$ can be written as
$z = \lambda{1 \over \|x\|} x + w$, where $w \bot x$. Furthermore,
$\|z\|^2 = \lambda^2 + \|w\|^2$, and so $z \in B$ iff $\lambda^2 + \|w\|^2 \le 1$.
Then consider
$\|x-( \lambda{1 \over \|x\|} x + w) \|^2$, where $\lambda^2 + \|w\|^2 \le 1$.
We have $\|x-( \lambda{1 \over \|x\|} x + w) \|^2 = (\|x\|-\lambda)^2 + \|w\|^2 \ge (\|x\|-\min(1,\|x\| ) )^2$, and the unique minimising $\lambda,w$ are $\lambda = \min(1,\|x\|)$, $w=0$.
Hence $P_B(x) = \min(1,\|x\|) {1 \over \|x\|} x= \min(1,{1 \over \|x\|}) x$.
A: Hint: If $\|x\|>1$, show that, for all $y\in B$, we have
$$\|y-x\|\ge \|x\|-1$$
and that $y = \frac{x}{\|x\|}$ makes the above inequality an equality.
One slight detail you may wish to address is that you assumed there is a unique point which minimizes the distance. You may wish to prove that this is indeed true.
