Prove that a projection $A^2=A$ is self-adjoint if and only $\ker(A) \perp \operatorname{im}(A)$ 
Let $A$ be a projection such that $A^2=A$ then I want to prove that $A=A^* \Leftrightarrow \ker(A) \perp \operatorname{im}(A)$.

The implication $A=A^*\Rightarrow \ker(A) \perp \operatorname{im}(A)$ is easy, but I have troubles with the converse. Is there anybody who knows how to do this?
 A: Let $P$ be a projection matrix in a vector space $V$.
Let us also assume that the kernel of $P$ is a proper subspace of $V$: $\ker(P)\neq\{0\}$ and $\ker(P)\neq V$, as in these cases the result is trivial.
Any projection (self-adjoint or not) has eigenvalues in $\{0,1\}$.
Moreover, one always has $\mathrm{im}(P)=\ker(P-I)$ (because if $y=Px$ then $Py=y$).
If $P$ is normal/self-adjoint (the two things are equivalent for projections), then its eigenspaces are orthogonal, that is, $\ker(P-I)\perp\ker(P)$.
It follows that, if $P$ is self-adjoint, then $\mathrm{im}(P)\perp\ker(P)$.
For the other implication, let us assume $\mathrm{im}(P)\perp\ker(P)$. Again, this is equivalent to $\ker(P-I)\perp\ker(P)$ because $P$ is a projection. But this means that the eigenspaces of $P$ are orthogonal, which is equivalent to saying that $P$ is normal, and thus self-adjoint.
A: Hint: Take an orthonormal basis $B_1$ of $\ker A$ and an orthonormal basis $B_2$ of $\operatorname{im}A$ and prove that $\langle Av,u\rangle=\langle v,Au\rangle$ for all $v,u\in B=B_1\cup B_2$.
A: For any projection $P=P^2$ on a Hilbert space $\mathcal{H}$, the identity
$$
              x=Px+(I-P)x
$$
gives the decomposition
$$
                   \mathcal{H}=\mathcal{R}(P)\oplus\mathcal{R}(I-P).
$$
This is because any $y\in\mathcal{R}(P)\cap\mathcal{R}(I-P)$ must satisfy
$$
        (I-P)y=0=Py \implies y=0.
$$
This is an orthogonal decomposition iff
$$
             \langle Px,(I-P)y\rangle=0,\;\; x,y\in\mathcal{H},
$$
which is equivalent to $P^*(I-P)=0$ or $P^*=P^*P$, which is also equivalent to
$$
        P=(P^*)^* = (P^*P)^* = P^*P.
$$
And that implies $P=P^*$, which is also equivalent to the above.
A: This is true in any inner product space and the forward implication (the “only if” part) does not depend on the condition that $A^2=A$.
Suppose $A^\ast=A$. For any $x\in\ker(A)$ and $y\in\operatorname{im}(A)$, we have $y=Au$ for some vector $u$. Therefore
$
\langle x,y\rangle
=\langle x,Au\rangle
=\langle A^\ast x,u\rangle
=\langle Ax,u\rangle
=\langle 0,u\rangle
=0
$ and $\ker(A)\perp\operatorname{im}(A)$.
Now suppose $A^2=A$. Then $\operatorname{im}(I-A)\subseteq\ker(A)$. If we are also given that $\ker(A)\perp\operatorname{im}(A)$, then
$
\langle A^\ast(I-A)x,y\rangle
=\langle (I-A)x,Ay\rangle
=0
$
for any vectors $x$ and $y$. Hence $A^\ast(I-A)=0$ and $A^\ast=A^\ast A$. Taking Hermitian adjoint on both sides, we also have $A=A^\ast A$. Therefore $A^\ast=A$.
