Show that $E^2=E=E^T$. 
Let $E$ be an $n\times n$ matrix.
  Let $U=\{Ex:x\in \Bbb R^n\}$.
If $\text{proj}_U v=Ev$ $ \forall v\in \Bbb R^n$ show that $E^2=E=E^T$.

I know that if $U$  has a basis $u_1,u_2,\ldots ,u_n$ then 
$\text{proj}_U v=\sum_{i=1}^n\langle v,u_i\rangle u_i$
But how to show from here that $E^2=E=E^T$
Can someone kindly help. 
 A: Let $\{u_1, \ldots, u_k\}$ be an orthonormal basis for $U$. For each $u_i$, define the projection onto $\operatorname{span}(u_i)$:
$$P_i(x) = \operatorname{proj}_{u_i}(x) = \langle x, u_i \rangle u_i.$$
Note that, for any $i, j$, we have
$$(P_j P_i)(x) = \langle P_i(x), u_j \langle u_j = \langle \langle x, u_i \rangle u_i, u_j \rangle u_j = \langle x, u_i\rangle \langle u_i, u_j \rangle u_j.$$
When $i = j$, we have $\langle u_i, u_j \rangle = 1$, hence $P_i^2(x) = P_i(x)$. When $i \neq j$, we have $\langle u_i, u_j \rangle = 0$, so $(P_j P_i)(x) = 0$.
Further, each $P_i$ is self-adjoint (i.e. its corresponding standard matrix is symmetric, in the real case), as
$$\langle P_i(x), y \rangle = \langle \langle x, u_i \rangle u_i , y \rangle =  \langle x, u_i \rangle \langle u_i , y \rangle = \langle x, \langle y, u_i \rangle u_i \rangle = \langle x, P_i(x)\rangle.$$
Note that the projection $P$ onto $U$ is simply the sum of these projections. We have,
$$P^* = (P_1 + \ldots + P_n)^* = P_1^* + \ldots + P_n^* = P_1 + \ldots + P_n = P,$$
so $P$ is self-adjoint (and hence $E$, the standard matrix of $P$, is symmetric). Further,
\begin{align*}
P^2 &= \left(\sum_{i=1}^n P_i\right)^2 \\
&= \sum_{i=1}^n \sum_{j = 1}^n P_iP_j \\
&= \sum_{i=1}^n P_i^2 &\text{as $P_iP_j = 0$ unless $i = j$} \\
&= \sum_{i=1}^n P_i \\
&= P.
\end{align*}
