Are projections with the same kernels the same? This question is related to another question I just asked. 
I thought I figured it out but I got confused again. Given two projections $k^n\rightarrow k^n$, represented by $n\times n$ matrices $A$ and $B$, if they have the same range $H$ which is a subspace $H\subset k^n$ with dimension $r$, and the same kernel, how to prove that they are identical?
Since they are projections, $A^2=A$, $B^2=B$. They have the same kernel, so $A$ is row equivalent to $B$. So $A=PB$ for some invertible matrix $P$. This gives
$$(PB)(PB)=PB\implies BPB=B\implies BA=B \text{  or  } BA=B^2$$
How to get $A=B$ then? Thank you for any help!
 A: As already pointed out in the comments, two projections with the same kernel must not be the same; consider for example $p_1, p_2 \colon k^n \to k^n$ with
$$
 p_1(x,y) = (x,0)
 \quad\text{and}\quad
 p(x,y) = (x,x).
$$
In the case of your earlier question you have the additional property that all projections you consider there have the same image: Then the statement is true.

The most important property of a projection $p \colon k^n \to k^n$ is that $k^n = \ker p \oplus \mathrm{im} \ p$: We have $\ker p \cap \mathrm{im} \ p = \{0\}$, because for every $x \in \ker p \cap \mathrm{im} \ p$ we have some $y \in k^n$ with $x = p(y)$, and thus
$$
 0 = p(x) = p(p(y)) = p^2(y) = p(y) = x.
$$
On the other hand we can write every $x \in k^n$ as $x = x_1 + x_2$ with
$$
 x_1 = p(x) \in \mathrm{im} \ p
 \quad\text{and}\quad
 x_2 = x - p(x) \in \ker p,
$$
so we have $k^n = \ker p + \mathrm{im} \ p$.

Thus we have $k^n = \ker p \oplus \mathrm{im} \ p$. But we know the restrictions $p|_{\ker p} = 0$ and (because $p$ is a projection) $p|_{\mathrm{im} \ p} = \mathrm{id}_{\mathrm{im} \ p}$.
If we have another projection $q$ with $H' := \ker q = \ker p$ and $H := \mathrm{im} \ q = \mathrm{im} \ p$ it follows that the restrictions of $p$ and $q$ on $H$ and $H'$ coincide. Because $k^n = H' \oplus H$ it follows from the linearity of $p$ and $q$ that they already coincide everywhere.

One can also generalize this this by saying that the map
\begin{align*}
 \{p \colon k^n \to k^n \mid \text{$p$ a projection}\}
 &\to
 \{
  (H', H)
 \mid
 \text{$H', H \subseteq k^n$ subspaces, $k^n = H' \oplus H$}
\} \\
 p 
 &\mapsto
(\ker p, \mathrm{im} \ p)
\end{align*}
is a bijection; the statement from your earlier question is then just a special case of this.
A: A projection $P$ is a linear operator satisfying $P^2=P$, so it is annihilated by the polynomial $X^2-X=X(X-1)$. Since that polynomial is split with simple roots $0,1$, a projection is diagonalisable with eigenvalues contained in $\{0,1\}$, which means that the whole space is the direct sum of the eigenspaces $\ker(P)$ for $\lambda=0$ and $\ker(P-I)$ for $\lambda=1$. The latter eigenspace is equal to the image of$~P$ (as $P$ acts invertibly, in fact identically, on it, while it kills the other summand).
That this information determines $P$ is just an instance of the general fact that knowing the eigenvalues and the eigenspaces of a diagonalisable operator determines that operator completely. To see this, just choose a basis of eigenvectors (i.e., vectors in these eigenspaces), and express the operator by a (diagonal) matrix on that basis.
