TITLE: Cayley-Hamilton theorem on square matrices
QUESTION [10 upvotes]: Can anyone help me by giving the proof of the Cayley-Hamilton theorem? It states that every square matrix $A$ satisfies its own characteristic equation:
$$p_{A}(A) = 0$$
I could prove it when $A$ has distinct eigenvalues, because then it will have $n$ linearly independent eigenvectors, but I couldn't prove the general case.

REPLY [7 votes]: For any diagonal matrix $D$, it is clear that $p_D(D)=0$. Therefore, for any $P \in  GL_n(\mathbb{C})$, $p_{PDP^{-1}}(PDP^{-1})=p_D(PDP^{-1})=Pp_D(D)P^{-1}=0$: Cayley theorem holds for diagonalizable matrices. Moreover:

Lemma: the set of diagonalizable matrices is dense in $M_n(\mathbb{C})$.

Proof: Let $M \in M_n(\mathbb{C})$. For some $P \in GL_n(\mathbb{C})$, $M=PT(\lambda_1,\dots,\lambda_n)P^{-1}$ where $T(\lambda_1,\dots,\lambda_n)$ is an upper triangular matrix with diagonal $(\lambda_1,\dots,\lambda_n)$. Let $\epsilon_{ij}$ such that $\lambda_i+\epsilon_{ij} \neq \lambda_k + \epsilon_{kj}$ for $i \neq k$ and $\epsilon_{ij} \underset{j \to + \infty}{\longrightarrow} 0$. Then $PT(\lambda_1+ \epsilon_{1j},\dots,\lambda_n+ \epsilon_{nj})P^{-1}$ is diagonalizable (all their eigenvalues are distincts) and converges to $M$. $\square$
Now $\det$ is continuous, so if $M \in M_n(\mathbb{C})$ and $(M_n)$ is a sequence of diagonalizable matrices converging to $M$, $p_M(M)=\lim\limits_{n \to + \infty} p_{M_n}(M_n)=0$.