Solution (source code)

= Solution

The map $\theta:\mathbb C[x]\to V$, $p\mapsto p(\phi)a_1$, is surjective because $1,x,\ldots,x^{n-1}$ map to the given <basis>. Its kernel is generated by the <minimal polynomial> and the quotient has dimension $n$, so $\deg m_\phi=n$. The relation for $\phi(a_n)$ gives
$$
\boxed{m_\phi(x)=x^n-\sum_{k=0}^{n-1}c_{k+1}x^k.}
$$