Let $A\in M_n(F)$ and $k=\deg(m_A)$ where $m_A$ is the minimal polynomial of $A$.
Prove that $\mathrm{span}\{ I,A,A^2... \} = \mathrm{span} \{ I,A,A^2,..., A^{k-1}\}$
So we have that $m_A = a_0 + a_1x + ... +x^{k}$ (Notice that the coefficient of $x^{k}$ is $1$)
Since, $m_A$ is the minimal polynomial:
$$m_A(A) = 0 \\a_0I+a_1A + ... + A^{k} = 0$$
What should I do next? I am kinda stuck