While trying to prove the Cayley-Hamilton theorem, I came up with the following proof:
If $A$ is a diagonalizable matrix, so $A=SDS^{-1}$ with $D$ diagonal, then, letting $$P(\lambda)=\det(A-\lambda I)=\sum_{i=0}^n c_i\lambda^i,$$
$$``P(A)" = \sum_{i=0}^n c_i A^i = S\left(\sum_{i=0}^n c_i D^i \right)S^{-1},$$
which is clearly the zero matrix as, if $D$ contains $\lambda_1,\cdots,\lambda_n$ on its diagonal, $D^i$ contains $\lambda_1^i,\cdots,\lambda_n^i$, and each of the eigenvalues satisfy the characteristic polynomial. So, the Cayley-Hamilton theorem is true for diagonalizable matrices. Specifically, it is true for all matrices with $n$ distinct eigenvalues, or equivalently all matrices whose characteristic polynomials have no repeated roots.
However, the coefficients of the characteristic polynomial are polynomials in the elements $a_1,\cdots,a_{n^2}$ of the matrix $A$. Also, there is a polynomial expression of the coefficients of a polynomial that is $0$ iff the polynomial has a repeated root (the resultant). So, there exists some polynomial $Q$ such that either the matrix $A$ satisfies its characteristic polynomial or
$$Q(a_1,\cdots,a_{n^2}) = 0.$$
However, a matrix inputted into its characteristic polynomial is itself a matrix whose elements are polynomial functions $R_1,\cdots,R_{n^2}$ of the elements of the matrix. Thus, for each $1\leq i\leq n^2$ and any values $a_1,\cdots,a_{n^2}$, we have either that
$$Q(a_1,\cdots,a_{n^2}) = 0\ \mathrm{or}\ R_i(a_1,\cdots,a_{n^2}) = 0.$$
Thus, for all $(a_1,\cdots,a_{n^2}) \in \mathbb{R}^{n^2}$, and each $1\leq i\leq n^2$, we have
$$Q(a_1,\cdots,a_{n^2})\cdot R_i(a_1,\cdots,a_{n^2}) = 0.$$
However, a polynomial (here $QR_i$) that equals zero everywhere must be the zero polynomial, and if a product of two polynomials is the zero polynomial, one of the two must be the zero polynomial.
It's clearly not $Q$, since there exist matrices with distinct eigenvalues. So, each $R_i$ must be identically $0$, and the Cayley-Hamilton theorem is proven.
However, this only works in infinite fields. In finite fields, the two statements:
If a polynomial is $0$ everywhere, it is the zero polynomial.
If two polynomials multiply to make the zero polynomial, one of them must be the zero polynomial.
are not both true (I'm sure the first one isn't; I'm not sure about the second). Is there a way to rigorize the notion that "It's an algebraic statement that's true in, say, $\mathbb{R}$, so it must be true in any field," or is there some other way to extend this proof to finite fields? Or does this proof just only work (or make sense) in infinite fields?