This question is a more precise version of [this question.](https://mathoverflow.net/questions/446033/eigenvalues-two-fold-degenerate)


Let's assume we have the matrix


$$\left(
\begin{array}{ccccc}
 0 & a & 0 & 0 & 0 \\
 f & 0 & b & 0 & 0 \\
 0 & e & 0 & c & 0 \\
 0 & 0 & d & 0 & r \\
 0 & 0 & 0 & g & 0 \\
\end{array}
\right)$$


If we square it, we get the matrix


$$\left(
\begin{array}{ccccc}
 a f & 0 & a b & 0 & 0 \\
 0 & a f+b e & 0 & b c & 0 \\
 e f & 0 & b e+c d & 0 & c r \\
 0 & d e & 0 & c d+g r & 0 \\
 0 & 0 & d g & 0 & g r \\
\end{array}
\right)$$


We see that this matrix decomposes into two submatrices


$$C\_1:=\left(\begin{array}{cccc}
 a f & a b & 0 \\
 e f & b e+c d & c r \\
 0 & d g & g r \\
\end{array}\right)$$
and
$$C\_2:=\left(\begin{array}{cc}
 a f+b e & b c \\
 d e & c d+g r \\
\end{array}\right)$$
Now, one can check explicitly that the two submatrices are isospectral apart from one eigenvalue zero. I wonder if there is an abstract argument why this is so?


It would for instance follow if we can write the matrices as $C\_1 = AB$ and $C\_2= BA$, but I don't see how such a decomposition could work. In particular, this does not seem to be restricted to 5x5 matrices but holds for arbitrary matrices of the above form.



Matrices with same eigenvalues
To answer say a previous question, call such tridiagonal matrix $T$; the matrices $T$ and $-T$ (of dimension $n$) are unitarily congruent (they have the same spectra), that is there is an 'alternating' $\pm 1$ diagonal matrix $U$ such that $U^\*TU=-T$.  

As you noticed when you square $T$ and rearrange it by a permutation $P$ the diagonal blocks have the same eigenvalues. This is true as: for $P\_i$ the permutation matrix exchanging $2i+1\leftrightarrow i+1$, set $P=\prod\_{i=1}^{\lfloor \frac{n-1}{2}\rfloor}P\_i=P\_{\lfloor \frac{n-1}{2}\rfloor}\cdots P\_1$; we get $PTP^\*=\begin{pmatrix}0\_{\lceil\frac{n}{2}\rceil}&A\\B&0\_{\lfloor \frac{n}{2}\rfloor}\end{pmatrix}.$ The square block $0\_m$ is a submatrix with all zeros of dimension $m$. Squaring the last identity gives your matrix $\begin{pmatrix}AB=C\_1&0\\0&BA=C\_2\end{pmatrix}.$


