Solution (source code)

= Solution

A square <complex matrix> $U$ is a <unitary matrix> when $U^\dagger U=I$, so it preserves the <Euclidean norm>. If $Uv=\mu v$ with $v\ne0$, then $\|v\|=\|Uv\|=|\mu|\|v\|$, giving \b[$|\mu|=1$]. For a <Hermitian matrix> $A=A^\dagger$ and $Ae_j=\lambda_je_j$,
$$
\lambda_j=\frac{e_j^\dagger Ae_j}{e_j^\dagger e_j}\in\mathbb R,
$$
because the numerator equals its complex conjugate. Hence no eigenvalue of $A+iI$ is zero, proving it is invertible.

For $V=(A-iI)(A+iI)^{-1}$, the <Hermitian conjugate> is $V^\dagger=(A-iI)^{-1}(A+iI)$. The factors and their inverses commute, since they are rational functions of $A$. Thus $V^\dagger V=I$. Its action on the same <eigenvectors> is
$$
\boxed{Ve_j=\frac{\lambda_j-i}{\lambda_j+i}e_j.}
$$
These eigenvalues have modulus one. This is the <Cayley transform of a Hermitian matrix> in the convention that avoids the unitary eigenvalue one.

For the inverse direction, $U^\dagger=U^{-1}$ gives
$$
(I-U^{-1})^{-1}=-(I-U)^{-1}U,\qquad I+U^{-1}=U^{-1}(I+U).
$$
Taking the conjugate transpose of $B=i(I+U)(I-U)^{-1}$ therefore yields
$$
B^\dagger=-i(I-U^{-1})^{-1}(I+U^{-1})=i(I-U)^{-1}(I+U)=B.
$$
The last equality uses commutativity of the two factors. This proves that the <inverse Cayley transform of a unitary matrix without eigenvalue one> is Hermitian. Solving for $U$ gives $U=(B-iI)(B+iI)^{-1}$. An orthonormal <eigenbasis> of $B$ therefore diagonalizes $U$, with diagonal entries $(b_j-i)/(b_j+i)$.

The result extends even when a unitary matrix has eigenvalue one: choose $|\alpha|=1$ so that $\alpha U$ does not. There are only finitely many forbidden phases, since the matrix has finitely many <eigenvalues>. Diagonalizing $\alpha U$ also diagonalizes $U$ in the same basis. Thus \b[every unitary matrix is unitarily diagonalizable].