History of the characteristic matrix Let $\mathbb{F}$ be a number field, $A$ and $B$ be two $n\times n$-matrix over $\mathbb{F}$. It is known from some textbook that $A$ is similar to $B$ iff there exists $n\times n$ nonsingular matrix $P(\lambda)$ and $Q(\lambda)$ with entries in $\mathbb{F}[\lambda]$ such that
$$\lambda I-A=P(\lambda)(\lambda I-B)Q(\lambda),$$
where $I$ is the identity matrix and $\lambda$ is an indeterminate.
I am wondering who invented this theorem and what is motivation to consider a matrix with polynomial entries?
 A: This observation is sometimes referred to as the "Structure of One Endomorphism".
Let $V$ denote the $n$-dimensional column vector space over a field $\mathbb{F}$.
Given a square $n\times n$ matrix $A$ over $\mathbb{F}$ we consider $V$ as a module over $\mathbb{F}[\lambda]$ by letting $\lambda$ act as $A$ and denote it as $V_A$.
Note that $V_B$ is isomorphic as a module to $V_A$ if and only if there is a choice of $\mathbb{F}$-basis for $V=V_B$ under which the action of $\lambda$ on $V_B$ is given by multiplication by $A$. In other words,

$A$ and $B$ are similar if and only if $V_A$ and $V_B$ are isomorphic as modules over $\mathbb{F}[\lambda]$

One then observes that we have a natural surjection $\mathbb{F}[\lambda]\otimes V\to V_A$ given by $\lambda\otimes v\mapsto Av$ and $1\otimes v\mapsto v$. The kernel of this is generated by expressions of the form $\lambda \otimes v - 1\otimes Av$. In other words, we have an exact sequence
$$
      0 \to
      \mathbb{F}[\lambda]\otimes V
      \stackrel{\lambda I - A}{\longrightarrow}
      \mathbb{F}[\lambda]\otimes V
      \to V_A \to 0
$$ Any change of $\mathbb{F}[\lambda]$-basis for the two free modules in this sequence corresponds to replacing $\lambda I - A$ by $S(\lambda I - A)T$ where $S$ and $T$ are $n\times n$ invertible matrices over $\mathbb{F}[\lambda]$.
The isomorphism of $V_A$ with $V_B$ "lifts" to such an isomorphism by the usual lifting property for free resolutions.
An explicit such isomorphism can be found as a consequence of the Smith Normal Form (SNF) known at least to Henry John Stephen Smith but perhaps to others as well in various forms.
