Solution (source code)

= Solution

A complex square <matrix> $U$ is a <unitary matrix> when $U^\dagger U=I$, equivalently $U^{-1}=U^\dagger$. Here $\dagger$ denotes the <adjoint matrix>, the conjugate transpose. Such a matrix preserves the standard complex <inner product> and its <Euclidean norm>.

A real <symmetric matrix> $A$ is a <Hermitian matrix>, so $A^\dagger=A$. For arbitrary complex $\mathbf x$,
$$
\begin{aligned}
|(A+iI)\mathbf x|^2
&=\mathbf x^\dagger(A-iI)(A+iI)\mathbf x\\
&=\mathbf x^\dagger(A^2+I)\mathbf x\\
&=|A\mathbf x|^2+|\mathbf x|^2.
\end{aligned}
$$
The imaginary cross terms cancel because $A$ is Hermitian. Reversing the signs gives the same identity:
$$
\boxed{|(A-iI)\mathbf x|^2=|(A+iI)\mathbf x|^2
=|A\mathbf x|^2+|\mathbf x|^2.}
$$
In particular, $(A+iI)\mathbf x=0$ implies $|\mathbf x|^2=0$, so $A+iI$ has zero <kernel of a linear map>. It is a square matrix, and the <rank-nullity theorem> therefore makes it invertible. The same argument proves invertibility of $A-iI$.

The proposed matrix
$$
U=(A-iI)(A+iI)^{-1}
$$
is consequently well-defined. For any $\mathbf y$, put $\mathbf x=(A+iI)^{-1}\mathbf y$. The two norm identities show directly that
$$
|U\mathbf y|=|(A-iI)\mathbf x|
=|(A+iI)\mathbf x|=|\mathbf y|.
$$
To verify the <unitary matrix> identity explicitly, take adjoints:
$$
U^\dagger=(A-iI)^{-1}(A+iI).
$$
The two shifts commute, because both are polynomials in $A$. Hence
$$
\begin{aligned}
U^\dagger U
&=(A-iI)^{-1}(A+iI)(A-iI)(A+iI)^{-1}\\
&=(A-iI)^{-1}(A-iI)(A+iI)(A+iI)^{-1}=I.
\end{aligned}
$$
Thus
$$
\boxed{(A-iI)(A+iI)^{-1}\ \text{is unitary}.}
$$
\b[The imaginary shifts are invertible, and their equal norm changes cancel in the quotient.] This is the <Cayley transform of a Hermitian matrix> in the $(A-iI)(A+iI)^{-1}$ convention.