Let $X$ be a Hilbert space and $A\subset X$ a closed subspace. Let $P:X\rightarrow A$ be a mapping for wich $x-P(x)\in A^{\perp}$ holds. Show that
$\|x-P(x)\|=d(x,A)$ $\hspace{2cm}$ $(1)$
where $d(x,A):=\inf(\{\|x-a\|:a\in A\})$
This is part of a bigger proof in my lecture notes, where we show that those two properties are indeed equivalent if $A$ is closed. However this part of the proof is cut short and refers to a proof that states that such a mapping (the projection of $X$ onto $A$) fulfilling $(1)$ indeed exists and is unique.
Sadly, I didn't see how from there I can conclude this statement.
$d(x,A) \leq \|x-Px\|$ because $Px \in A$. For any $a \in A$ we have $\|x-a\|^{2}=\|(x-Px)+(Px-a)\|^{2}=\|x-Px\|^{2}+\|Px-a\|^{2}$ because $x-Px$ is orthogonal to $Px-a$. Hence $\|x-Px\|^{2} \leq \|x-a\|^{2}$ for all $a \in A$. Taking infimum we get $\|x-Px\|^{2} \leq d(x,A)^{2}$.