TITLE: Exists polynomial satisfying following?
QUESTION [7 upvotes]: Let $s, u \in M_m(\mathbb{k})$ be a pair of commuting matrices such that $s$ is a diagonal matrix and $u$ is a strictly triangular matrix (with zeros on the diagonal). Put $a = s + u$. Does there exist a polynomial $f(x) = c_1x + \cdots + c_dx^d \in \mathbb{k}[x]$, without constant term and such that one has $s = f(a)$ (a matrix equality), where $f(a) := c_1a + \cdots + c_da^d$?

REPLY [2 votes]: If $\mathbb k$ is a field and the degree $d$ of the polynomial is not pre specified, the answer to your question is affirmative.
Let us first consider the special case where $s$ is a scalar multiple of the identity matrix, say, $s=\lambda I$. In this case you are essentially asking if there exists a polynomial $f$ such that $f(0)=0$ and $f(a)=\lambda I$ when $a=u+\lambda I$.
If $\lambda=0$, we can simply take $f=0$. If $\lambda\ne0$, then $a$ is invertible. Therefore, by Cayley-Hamilton theorem, $a^{-1}=g(a)$ for some polynomial $g$. Let $f(x)=\lambda xg(x)$, we see that $f(0)=0$ and $f(a)=\lambda I$.
Now, consider the general case. Since $s$ and $u$ commute, by permutation we may assume that $s$ is a direct sum of sub-blocks of scalar matrices and $u$ is a block diagonal matrix such that its block structure conforms with $s$ and each sub-block is strictly upper triangular. In other words, we may assume that $s=\bigoplus_{j=1}^k \lambda_jI_{n_j}$ for some distinct $\lambda_j$s and that $u=\bigoplus_{j=1}^k u_j$, where each $u_j$ is a strictly upper triangular matrix of the same size as $I_{n_j}$.
For each $j$, let $a_j=u_j+\lambda_jI_{n_j}$ and let $f_j$ be a polynomial such that $f_j(0)=0$ and $f_j(a_j)=\lambda_j I_{n_j}$. We can now construct $f$ in the spirit of Lagrange interpolation. For any fixed $j$, define
$$
p_j(x)=\prod_{\stackrel{i=1}{i\ne j}}^k (x-\lambda_i)^{n_i}
.$$
It follows that $p_j$ annihilates every $a_i$ when $i\ne j$, and $p_j(a_j)$ is invertible. Therefore the matrix inverse of $p_j(a_j)$ is equal to $q_j(a_j)$ for some polynomial $q_j$. Now, if we define $f$ as
$$
f(x) = \sum_{j=1}^k p_j(x)q_j(x)f_j(x),
$$
we get $f(0)=0$ and $f(a_j)=\lambda_j I_{n_j}$ for each $j$. Consequently, $f(u+s)=s$.