Solution (source code)

= Solution

For real orthonormal column <vectors>, $u^Tu=v^Tv=1$ and $u^Tv=v^Tu=0$. Expand using associativity of <matrix multiplication>:
$$
\begin{aligned}
(uu^T+vv^T)^2
&=u(u^Tu)u^T+u(u^Tv)v^T+v(v^Tu)u^T+v(v^Tv)v^T\\
&=uu^T+vv^T.
\end{aligned}
$$
Hence
$$
\boxed{M=uu^T+vv^T\text{ is idempotent}.}
$$
More precisely, it is the <orthogonal projection> onto the span of $u,v$: it fixes both <vectors> and annihilates every <vector> orthogonal to both.

The transpose convention presumes real <vectors>, or the explicitly stated bilinear identities above. For complex <vectors> orthonormal in the <Hermitian inner product>, the correct <orthogonal projection> is $uu^\dagger+vv^\dagger$. The printed transpose formula need not work in that setting: $u=(i,0)^T$ and $v=(0,1)^T$ are Hermitian-orthonormal, but $uu^T+vv^T=\operatorname{diag}(-1,1)$ has square $I_2$, which is different from itself.