Solution (source code)

= Solution

Write $P=\mathbf a\mathbf a^T$. Since $\mathbf a$ is a <unit vector>, $P^2=\mathbf a(\mathbf a^T\mathbf a)\mathbf a^T=P$ and $P^T=P$. Thus this <Householder reflection> satisfies
$$
\boxed{A^2=(I-2P)^2=I,\qquad A^T=I-2P^T=A.}
$$
Geometrically, the mirror preserves the component tangent to its plane and reverses the normal component; doing it twice restores the original <vector>.