Solution (source code)

= Solution

The perpendicular decomposition in part (a) gives, by the <Pythagorean theorem>,
$$
\|x\|_2^2=\|Px\|_2^2+\|(I-P)x\|_2^2\geq\|Px\|_2^2.
$$
Thus an <orthogonal projection> cannot lengthen a vector and $\boxed{\|P\|_2\leq1}$. Algebraically the cross term vanishes because $P^T(I-P)=P-P^2=0$, giving the same identity directly from the hypotheses. If $P\ne0$, take a nonzero $x$ in its range; then $Px=x$ and $\|P\|_2=1$. For $P=0$ the norm is zero.