# Prove that this algorithm always produces a matrix with all but two eigenvalues equal one

I stumbled on an algorithm that generates a rotation matrix $R$ that rotates unit vector $u$ to unit vector $v$, i.e. $v=Ru$. $R$ seems to have two interesting characteristics. First, it doesn't rotate vectors which are outside the vector space of $u$ and $v$. This I think I understand (see the link) but is not proven. Second, all but two eigenvalues of $R$ are equal to one. This second characteristic seems intuitive but I have no idea how to prove it. I assume it's related to the first characteristic.

Of possible interest, I've noticed that $u^Tv=\Re(\lambda_c)$ where $\lambda_c$ is either of the complex eigenvalues. In other words, $\pm \arg(\lambda_c)$ is equal to the angle between $u$ and $v$. Exploiting this, the eigendecomposition of $R$ is $$R=Q\Lambda Q^{-1}$$ where $Q$ is a square matrix of eigenvectors and and $\Lambda$ is a diagonal matrix of eigenvalues. This evidently means that the amount of rotation can be adjusted by only changing the arguments of the complex eigenvalues of $\Lambda$.

For 3-D, setting the complex pair of eigenvalues to $\exp(\pm i\theta)$ generates a rotation matrix $R(\theta)$ that rotates $u$ by $\theta$ radians around a great circle that's defined by $u$ and $v$. Also, it appears that $Q^{-1}=Q^\dagger$ for 3-D only. An analogous effect occurs in higher dimensions where the great circle is in the subspace of $u$ and $v$.

Any help in proving or understanding these observations certainly would be appreciated.

• $Q^{-1}=Q^\dagger$ isn’t true in 3-d, either, unless you happened to choose unit eigenvectors. In higher dimensions, choose an orthonormal set of eigenvectors of $1$ when constructing $Q$ (and, of course, unit eigenvectors for the other two eigenvalues) and the equality holds. – amd May 8 '17 at 1:18
• @amd: Thanks. I'm using MATLAB's $\mathtt{eig}$ function for eigendecomposition which returns a non-orthogonal $Q$ of unit eigenvectors for dimensions >3. I then used their $\mathtt{qr}$ function to make $Q$ orthogonal and, surprisingly, everything works as you said. Is there a better way? – T L Davis May 8 '17 at 16:17
• It shouldn’t be terribly surprising since $R$ is orthogonal. I’m not really familiar with MATLAB, but perhaps applying orth to the matrix of eigenvalues would do the trick. – amd May 8 '17 at 17:04
• Nice find, by the way. I hadn’t seen that particular construction of the rotation before. – amd May 8 '17 at 17:07
• @amd: Thanks. I'm probably too proud of it but it does seem nice. – T L Davis May 8 '17 at 23:44

Let’s assume that the claim that $R$ is the identity on the orthogonal complement of $W=\operatorname{span}\{u,v\}$, i.e., that for $w\in W^\perp$, $Rw=w$, is true. The claim about the eigenvalues of $R$ follows easily from this. It should be obvious that every element of $W^\perp$ is an eigenvector of $R$ with eigenvalue $1$. If $u$ and $v$ are linearly independent, then the dimension of $W^\perp$ is two less than the dimension of the containing space, so we’ve accounted for all but two of the eigenvalues. (If you want to compute the remaining two eigenvalues, recall that complex eigenvalues of a real matrix come in conjugate pairs and that the product of the eigenvalues of a matrix is equal to its determinant.)
As for the first claim, suppose that $w\in W^\perp$, as above. Then $u^Tw=v^Tw=0$, and \begin{align}Sw=f(I,u+v)w&=\left(I-2(u+w){(u+v)^TI\over(u+v)^T(u+v)}\right)w\\&=w-2(u+w){(u+v)^Tw\over(u+v)^T(u+v)} \\&=w.\end{align} Thus, $$Rw=f(S,v)w=\left(S-2v{v^TS\over v^Tv}\right)w=Sw-2v{v^TSw\over v^Tv}=w-2v{v^Tw\over v^Tv}=w.$$
By the way, these constructions that you’ve cited are $n$-dimensional analogues of the proof that a rotation in the plane is a composition of two reflections.