Given the matrix $$\begin{equation*} A_{m,n} = \begin{pmatrix} 0 & 1 & 0 & \cdots & 0 \\ 0 & 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & 1 \\ a_0 & a_1 & \cdots & a_{n-2} & a_{n-1} \end{pmatrix} \end{equation*}$$
and $p(T) := T^n - a_{n-1}T^{n-1} - \cdots - a_0$
If we know that $p(T)$ has exactly $n$ roots $(\lambda_1, \cdots, \lambda_n)$ .
So how would I find a basis change matrix $S$ so that $S^{-1}AS$ is a diagonal matrix?
We proved in a previous question that if a $\lambda$ is a root of $p(T) \implies (1, \lambda, \cdots, \lambda^{n-1}) $ is an eigenvector for the eigenvalue $\lambda$, but I don't know if this helps.
Any help is appreciated.