Matrix similarity invariants (source code)

= Matrix similarity invariants
{title2=$\chi_B(t)=\chi_A(t)$}

<Matrix similarity invariants> are quantities unchanged by replacing $A$ with $S^{-1}AS$. Important examples are the <characteristic polynomial>, <trace>, <determinant>, <matrix rank>, and <eigenvalues> with their <algebraic multiplicities>. The <characteristic polynomial> convention here is $\chi_A(t)=\det(tI-A)$, where $I$ is the <identity matrix>.<Linear Algebra Done Right by Sheldon Axler (4th edition)>[§9C, Definition 9.63, printed p. 363; Theorem 9.65, printed p. 364: characteristic polynomial, trace, and determinant]{ref}

The short <determinant> proof works over any <field>: because $tI-B=S^{-1}(tI-A)S$, <multiplicativity of the determinant> gives
$$
\chi_B(t)=\det(S^{-1})\det(tI-A)\det(S)=\chi_A(t).
$$
Thus its roots, the <eigenvalues>, retain their <algebraic multiplicities> in any <field extension> where the <polynomial> splits. Also $\det B=\det A$. The <cyclic property of the trace> gives $\operatorname{tr}(S^{-1}AS)=\operatorname{tr}(ASS^{-1})=\operatorname{tr}A$; equivalently, the <trace> is determined by the <coefficient> of $t^{n-1}$ in the <characteristic polynomial> for an $n$-by-$n$ <matrix>.<Linear Algebra Done Right by Sheldon Axler (4th edition)>[§8D, Theorems 8.49–8.50, printed pp. 326–327: cyclic trace identity and basis independence]{ref}

For the two <matrices> in the opening example,
$$
\chi_A(t)=\chi_B(t)=(t-2)(t-5)=t^2-7t+10,\qquad
\operatorname{tr}A=\operatorname{tr}B=7,\qquad \det A=\det B=10.
$$
Their entries differ, yet these quantities agree. Agreement is a useful necessary test for <matrix similarity>; it is not sufficient in general, as <same eigenvalues do not imply similarity> illustrates.

The relation also preserves repeated application. Adjacent factors $SS^{-1}$ cancel to give
$$
B^k=S^{-1}A^kS\quad(k\geq0).
$$
For the opening example, <matrix powers> therefore have the explicit form
$$
B^k=\begin{pmatrix}2^k&2^k-5^k\\0&5^k\end{pmatrix}.
$$
At $k=2$, this is $\begin{pmatrix}4&-21\\0&25\end{pmatrix}$. Acting on $y=(1,1)^T$ gives $(-17,25)^T$, which reconstructs as $S(-17,25)^T=(8,25)^T=A^2x$. More generally $q(B)=S^{-1}q(A)S$ for every <polynomial> $q$, so the <minimal polynomial> is also unchanged. Multiplication by <invertible matrices> preserves <matrix rank>, giving another invariant without finding <eigenvalues>.