# Similarity to companion matrix, uniqueness

Let $$A \in \mathcal{M}_{n\times n}(\mathbf{R})$$ and $$b \in \mathbf{R}^n$$ with $$n\geqslant2$$ be given.

Now should $$(A,b)$$ satisfy the Kalman rank condition $$$$\text{rank}[b \,\, Ab \,\, \ldots \,\, A^{n-1}b] = n,$$$$ or equivalently $$$$\text{span}\{b, Ab, \ldots, A^{n-1}b\} = \mathbf{R}^n,$$$$ then it is known that there exists $$P \in \mathrm{GL}_n(\mathbf{R})$$ such that $$$$A = P\mathbf{A}P^{-1} \quad \text{ and } \quad b = Pe_n,$$$$ where $$e_n = [0, \ldots, 1]^T$$ denotes the vector of the canonical basis of $$\mathbf{R}^n$$, whereas $$\mathbf{A}$$ is the companion matrix of $$A$$ (as defined in https://en.wikipedia.org/wiki/Companion_matrix): $$$$\mathbf{A} = \begin{bmatrix} 0 & 1 & 0 &\ldots & 0\\ 0 & 0 & 1 &\ldots & 0 \\ \vdots & & & \ddots &0\\ -a_n &\ldots &\ldots & \ldots & -a_1 \end{bmatrix},$$$$ where $$a_1, \ldots, a_n$$ are the coefficients of the characteristic polynomial of $$A$$: $$$$\chi_A(x) = x^n + a_1 x^{n-1} + \ldots + a_{n-1} x + a_n.$$$$

My question is:

Is the matrix $$P$$ unique?

Yes. Suppose there was another such matrix. Since $$P$$ is invertible, it could be written as $$QP$$ for some $$n \times n$$ matrix $$Q$$. Thus $$A Q P = Q P {\bf A} = Q A P$$, so $$Q$$ commutes with $$A$$, and $$Q P e_n = b$$. But then $$A^k b = A^k Q P e_n = Q A^k P e_n = Q A^k b$$. Since the vectors $$A^k b$$ span $$\mathbb R^n$$, we conclude that $$Q = I$$.