User:Isaac Riley/Sandbox

Proof
Let $\mathbf A$ be a square matrix of order $n$.

Then, by definition of the characteristic equation, $A$ has $n$ eigenvalues, not necessarily distinct. Let $p$ be the number of distinct eigenvalues.

For each distinct eigenvalue $\lambda_k$, let $a_k$ denote the algebraic multiplicity of $\lambda_k$ and let $g_k$ denote the geometric multiplicity of $\lambda_k$.

By the Diagonalization Theorem, $\mathbf A$ is diagonalizable if and only if it has $n$ distinct eigenvectors, i.e. $a_k=g_k$ for all $k$.

If $\mathbf A$ is non-diagonalizable, we can use generalized eigenvectors and the fact that they exist in Jordan chains to augment its $\Sigma_{k=1}^p g_k$ linearly independent eigenvectors and create a basis of size $n$ for $\mathbf A$. This basis will allow us to show that $A$ is similar to a Jordan matrix $J$, that is, that $\mathbf{AP}=\mathbf{PJ}$.