Solution (source code)

= Solution

Use the convention
$$
P_A(t)=\det(tI-A)=\sum_{r=0}^n a_rt^r
$$
for the <characteristic polynomial>. Choosing $\det(A-tI)$ instead multiplies it by $(-1)^n$ and leaves the requested zero identity unchanged. For each <eigenvector> $v_j$, induction gives $A^rv_j=\lambda_j^rv_j$, including $r=0$. Thus
$$
\left(\sum_{r=0}^n a_rA^r\right)v_j=P_A(\lambda_j)v_j=0,
$$
because $\lambda_jI-A$ has the nonzero <kernel> <vector> $v_j$ and therefore has zero <determinant>. Part (a) supplies a <basis> consisting of these $n$ <eigenvectors>. A <linear map> vanishing on every <basis> <vector> vanishes everywhere. Consequently
$$
\boxed{\sum_{r=0}^n a_rA^r=0.}
$$
This proves the <Cayley-Hamilton theorem> identity directly in the distinct-<eigenvalue> case assumed here.