How to use Cayley-Hamiltonian theorem in proving upper bound on linear space $W$? If $W = span(I,A,A^1,A^2, \dots)$. What is the upper bound on dimension of $W$? All matrices are $n \times n$.
I know that the dim($W$) $\leq n$, by the Cayley-Hamiltonian theorem. However, I don't see how the Cayley-Hamiltonian (C-H) theorem is used to show this. From what I understand, the C-H theorem says once you get the characteristic polynomial equation for matrix $M$, $p(\lambda)$, then $p(M) =$ the zero matrix. I'm not sure how C-H can be used in showing that $dim(W) \leq n$.
Second question:
If $A=$ zero matrix, then would the dimension of $W = 1$ or $2$?
 A: Hint: The Cayley-Hamilton theorem implies that $A^n$ is a linear combination of $I,A,A^2,\ldots,A^{n-1}$.
A: I'm going to assume that
$A = [a_{ij}], \;\; 1 \le i, j \le n, \tag{1}$
where the $a_{ij} \in \Bbb F$, $\Bbb F$ some field; then a moment's reflection reveals that $W$ may be expressed as the space of all polynomials in $A$, that is
$W = \Bbb F[A]. \tag{2}$
Suppose $A \ne 0$;  then characteristic polynomial  of $A$, $p(x)  \ne 0$.   Now for $f(x) \in \Bbb F[x]$, by the Euclidean algotithm applied to $\Bbb F[x]$ we have
$f(x) = p(x)q(x) + r(x), \tag{3}$
for unique $q(x), r(x) \in \Bbb F[x]$ with either $r(x) = 0$ or $\deg r(x) < \deg p(x)$.  Then evaluating (3) at $x = A$,
$f(A) = p(A)q(A) + r(A) = 0 \cdot q(A) + r(A) = r(A), \tag{4}$
since by Cayley-Hamilton $p(A) = 0$.  This shows that every $f(A) \in \Bbb F[A]$ may in fact be expresssed as a ploynomial of degree at most $n - 1$ in $A$; thus $I$, $A$, $A^2$, $\dots$, $ A^{n - 1}$ span $W$, so $\dim W \le n$ over $\Bbb F$.  QED.
Finally, if $A = 0$, $W = \text{span} (I)$, so $\dim W = 1$.
