Solution (source code)

= Solution

If $V=V_1\oplus V_2$ were a nontrivial invariant decomposition, each restricted minimal <polynomial> would be a power of $x-\alpha$ of degree at most $\dim V_i<n$. Their least common multiple is the minimal <polynomial> of $\phi$, contradicting its degree $n$.

Since $m_\phi$ has degree $n$, $\phi$ has a <cyclic vector> $b_1$. Put $b_k=\phi^{k-1}b_1$. Then $\phi(b_k)=b_{k+1}$ for $k<n$. In this <basis> the <matrix> is the <companion matrix> with ones immediately below the diagonal and last column
$$
c_{k+1}=(-1)^{n-k+1}\binom nk\alpha^{n-k},\qquad0\le k<n,
$$
obtained by expanding $(x-\alpha)^n$.