The Cayley–Hamilton theorem
Statement
Let \(R\) be a commutative ring with identity, let \(n \ge 1\), and let \(A \in M_n(R)\) be a square \(n \times n\) matrix over \(R\). Define the characteristic polynomial of \(A\) by \( p_A(t) = \det(tI_n - A) \in R[t] \); it is monic of degree \(n\), say \( p_A(t) = t^n + c_{n-1}t^{n-1} + \cdots + c_1 t + c_0 \). Then the matrix obtained by substituting \(A\) for \(t\) coefficientwise — that is, \( p_A(A) := A^n + c_{n-1}A^{n-1} + \cdots + c_1 A + c_0 I_n \), where the constant term acts as \(c_0 I_n\) — is the zero matrix: \[ p_A(A) = 0 \quad \text{in } M_n(R). \]
Why it matters
Cayley–Hamilton is the fundamental finiteness statement of linear algebra: it guarantees that every square matrix satisfies a monic polynomial of degree \(n\) whose coefficients you can actually compute. Consequently every power \(A^m\), every inverse \(A^{-1}\) (when it exists), and every convergent matrix function \(f(A)\) collapses into the \(n\)-dimensional span of \(I, A, \dots, A^{n-1}\). It is the reason the minimal polynomial has degree at most \(n\), the engine behind the rational and Jordan canonical forms via the \(F[t]\)-module structure on \(F^n\), and the bound behind Krylov methods and reachability criteria in numerical analysis and control theory.
Beyond fields, the theorem holds verbatim over any commutative ring, and in that generality (the “determinant trick”) it underlies Nakayama’s lemma and the theory of integral ring extensions — two pillars of commutative algebra. A theorem about matrices thus becomes a theorem about finitely generated modules.
Hypotheses
Proof
The proof works over an arbitrary commutative ring \(R\). The one illegal move — substituting \(t = A\) into an identity of polynomials with coefficients that need not commute with \(A\) — is avoided by comparing coefficients and telescoping. Throughout, \(I = I_n\).
Result
Reading. Every square matrix is a root of its own characteristic polynomial. Concretely: \(A^n\) is always the explicit combination \(-c_{n-1}A^{n-1} - \cdots - c_1 A - c_0 I\) of lower powers, so the algebra \(R[A]\) generated by \(A\) is spanned by \(I, A, \dots, A^{n-1}\) — knowing \(n\) scalars (the coefficients of \(p_A\)) tames all infinitely many powers of \(A\).
Scope. Valid for every \(n \times n\) matrix over every commutative ring with identity — equivalently for every endomorphism of a finitely generated free module, hence for every linear operator on a finite-dimensional vector space over any field. It extends (via the determinant trick, see Problems) to endomorphisms of arbitrary finitely generated modules. It fails for operators on infinite-dimensional spaces and is meaningless over noncommutative base rings.
Corollaries & converses
- Minimal polynomial bound. Over a field \(F\), the minimal polynomial satisfies \(m_A \mid p_A\), so \(\deg m_A \le n\). (The annihilating polynomials of \(A\) form an ideal of \(F[t]\), generated by \(m_A\); Cayley–Hamilton says \(p_A\) lies in this ideal.)
- Power collapse. \(A^m \in \operatorname{span}_R\{I, A, \dots, A^{n-1}\}\) for every \(m \ge 0\): reduce \(t^m\) modulo \(p_A\) by monic division, which is valid over any commutative ring.
- Inverse as a polynomial. \(c_0 = p_A(0) = \det(-A) = (-1)^n \det A\). If \(\det A\) is a unit of \(R\), then rearranging \(p_A(A) = 0\) gives \[ A^{-1} = -c_0^{-1}\left( A^{n-1} + c_{n-1}A^{n-2} + \cdots + c_1 I \right), \] so \(A^{-1} \in R[A]\), of degree \(\le n-1\) in \(A\).
- Nilpotency index. If \(A^k = 0\) for some \(k\), then already \(A^n = 0\) (Worked Example 2).
- Converse fails. “\(p(A) = 0\) for a monic \(p\) of degree \(n\)” does not force \(p = p_A\): the polynomial \((t-1)(t-2)\) annihilates \(I_2\) (indeed \((I-I)(I-2I) = 0\)), yet \(p_{I_2}(t) = (t-1)^2\). The correct statement in the converse direction is that the annihilating polynomials are exactly the multiples of \(m_A\).
- Sharper fact (not a corollary). Over a field, \(m_A\) and \(p_A\) have the same irreducible factors (equivalently \(p_A \mid m_A^{\,n}\)); this needs an eigenvalue/invariant-factor argument beyond Cayley–Hamilton itself.
Fails without
- Commutativity dropped. Over the quaternions \(\mathbb{H}\), let \(A = \operatorname{diag}(i, j)\) and take the natural candidate \(p(t) = t^2 - (i+j)t + ij\) built from the “diagonal roots”. Then \[ p(A) = A^2 - (i+j)A + ijI = \operatorname{diag}\bigl( -1 - (i^2 + ji) + ij,\; -1 - (ij + j^2) + ij \bigr) = \operatorname{diag}(2k, 0) \ne 0, \] using \(ij = k = -ji\). Worse, over a noncommutative ring \(\det\) itself is ill-defined (\(ad - bc\) vs \(ad - cb\) already disagree for \(2 \times 2\)), so no consistent characteristic polynomial exists.
- Finite dimension dropped. The right shift \(S(x_1, x_2, x_3, \dots) = (0, x_1, x_2, \dots)\) on the sequence space \(F^{\mathbb{N}}\) satisfies no nonzero polynomial: if \(p(t) = \sum_{k=0}^{d} c_k t^k\) then \(p(S)e_1 = \sum_{k=0}^{d} c_k e_{k+1}\), and linear independence of the \(e_{k+1}\) forces every \(c_k = 0\). No monic annihilating polynomial of any degree exists.
- Squareness dropped. For \(A \in M_{2 \times 3}(\mathbb{R})\) the matrix \(tI - A\) does not exist, and there is no rectangular substitute: \(A^2\) is not even defined, so no polynomial identity in \(A\) can be formulated.
Common errors
- The one-line pseudo-proof. “\(p_A(A) = \det(A I - A) = \det 0 = 0\).” This confuses substituting \(A\) into the polynomial \(p_A \in R[t]\) (output: a matrix) with substituting \(A\) for the scalar \(t\) inside the determinant (output: a scalar). The two operations do not commute with \(\det\); the argument proves nothing.
- Illegal substitution \(t = A\) in Step 5. Evaluation \(q(t) \mapsto q(A)\) is a ring homomorphism \(R[t] \to M_n(R)\), but on \(M_n(R)[t]\) it respects products only when the coefficients involved commute with \(A\). Setting \(t = A\) directly in \(B(t)(tI - A) = p_A(t)I\) without checking that the \(B_i\) commute with \(A\) is a gap, not a proof; the telescoping in Steps 7–8 exists precisely to avoid it.
- Conflating \(p_A\) with \(m_A\). Cayley–Hamilton gives \(m_A \mid p_A\), not equality: \(A = I_2\) has \(p_A = (t-1)^2\) but \(m_A = t - 1\).
- Forgetting the identity on the constant term. Writing \(A^2 - 5A - 2\) instead of \(A^2 - 5A - 2I\): the constant term of \(p_A(A)\) is \(c_0 I_n\), a matrix, not a scalar summand.
- “Diagonalize and check eigenvalues” presented as a general proof. \(p_A(A)v = p_A(\lambda)v = 0\) on eigenvectors only proves the theorem when eigenvectors span, i.e. \(A\) diagonalizable — it says nothing about \(\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}\). Upgrading via density of diagonalizable matrices works over \(\mathbb{C}\) but requires a genuine continuity/Zariski-density argument and fails to be available over \(\mathbb{F}_p\) or general rings without further work.
- Sign-convention slips. With the alternative convention \(\tilde p_A(t) = \det(A - tI) = (-1)^n p_A(t)\), the theorem still holds, but the inverse formula \(A^{-1} = -c_0^{-1}(A^{n-1} + \cdots + c_1 I)\) picks up sign errors if coefficients from the two conventions are mixed.
Discussion
Historically the theorem predates any general proof of it. Hamilton verified it in 1853 for the \(3 \times 3\) rotation-type operators arising from his quaternions; Cayley stated the general result in his 1858 Memoir on the theory of matrices, checked it for \(n = 2\) and \(n = 3\), and famously declared that he had “not thought it necessary” to verify larger cases. The first genuine general proof is due to Frobenius (1878), as part of the work that founded the structure theory of matrices over fields. The clean adjugate-and-telescope proof given above works over an arbitrary commutative ring and is essentially the modern textbook standard.
The structural way to read the theorem: a matrix \(A \in M_n(F)\) makes \(F^n\) into a module over the polynomial ring \(F[t]\), with \(t\) acting as \(A\). Cayley–Hamilton says this module is torsion — annihilated by the specific polynomial \(p_A\). This is the entry point to the classification of finitely generated modules over the PID \(F[t]\), hence to invariant factors, the rational canonical form, and (over algebraically closed fields) the Jordan form. From that classification one recovers Cayley–Hamilton again, but as a corollary of much finer information: \(p_A\) is the product of the invariant factors, of which \(m_A\) is the largest.
A second reading explains why the commutative-ring generality is not a luxury. The same adjugate argument, applied to a matrix of ring elements rather than scalars, proves the determinant trick: if \(M\) is an \(R\)-module generated by \(n\) elements and \(\varphi : M \to M\) is \(R\)-linear with \(\varphi(M) \subseteq IM\) for an ideal \(I\), then \(\varphi\) satisfies a monic equation \(\varphi^n + a_{n-1}\varphi^{n-1} + \cdots + a_0 = 0\) with \(a_k \in I^{\,n-k}\) (Problem 5). Specializing \(\varphi = \mathrm{id}\) yields Nakayama’s lemma; specializing to multiplication by a ring element yields the fundamental criterion for integral dependence in algebraic number theory. Cayley–Hamilton is thus the common ancestor of a surprising share of commutative algebra.
There is also a “proof by permanence of identities” worth knowing. Each entry of \(p_A(A)\) is a fixed polynomial with integer coefficients in the \(n^2\) entries of \(A\). It therefore suffices to prove that these \(n^2\) polynomials vanish identically on the universal matrix \(X = (x_{ij})\) over \(\mathbb{Z}[x_{11}, \dots, x_{nn}]\); equivalently, since this ring embeds in \(\mathbb{C}\) after choosing algebraically independent complex numbers, it suffices to prove \(p_A(A) = 0\) for all complex matrices. Over \(\mathbb{C}\), matrices with \(n\) distinct eigenvalues are diagonalizable, satisfy the theorem by the eigenvector computation, and are dense (their complement is the vanishing locus of the discriminant of \(p_A\), a proper Zariski-closed set); since \(A \mapsto p_A(A)\) is continuous, the identity extends to all of \(M_n(\mathbb{C})\), hence to all commutative rings. This argument is rigorous once the density and specialization steps are justified, and it illustrates a technique — prove a polynomial identity generically, deduce it universally — that recurs throughout algebraic geometry. Common misconceptions. The theorem does not say \(\det(A - A) = 0\); it does not say \(p_A\) is the smallest annihilating polynomial (that is \(m_A\)); and it does not say \(p_A(B) = 0\) for matrices \(B \ne A\) — e.g. \(A = 0_{2\times 2}\) has \(p_A(t) = t^2\), yet \(p_A(I) = I \ne 0\). The polynomial is tailored to its own matrix.
Worked examples
Example 1 (powers and inverse of a \(2 \times 2\) matrix). Let \(A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\) over \(\mathbb{R}\). Compute \(A^{-1}\) and \(A^4\) using only Cayley–Hamilton.
Reading. One \(2 \times 2\) determinant computation (the characteristic polynomial) replaced two matrix multiplications and one inversion.
Scope. The same scheme computes any \(A^m\) in \(\mathcal{O}(\log m)\) reductions modulo \(p_A\), for any square matrix over any field.
Example 2 (theoretical use: the nilpotency index is at most \(n\)). Let \(F\) be a field and \(A \in M_n(F)\) with \(A^k = 0\) for some \(k \ge 1\). Show that already \(A^n = 0\).
Reading. To test whether an \(n \times n\) matrix is nilpotent you never need to look beyond its \(n\)-th power; the size of the matrix caps its nilpotency index.
Scope. Any field (indeed the statement holds over any commutative ring, with the same proof routed through \(p_A \mid\)-arguments replaced by the direct relation \(p_A(A) = 0\) and \(p_A(t) = t^n\) for nilpotent \(A\) over a field). The bound \(n\) is sharp: the \(n \times n\) Jordan block with eigenvalue \(0\) satisfies \(A^{n-1} \ne 0 = A^n\).
Problems
- Let \(A = \begin{pmatrix} 0 & 1 \\ -2 & 3 \end{pmatrix}\) over \(\mathbb{R}\). Compute \(p_A\), verify Cayley–Hamilton by direct matrix arithmetic, and express \(A^3\) in the form \(\alpha A + \beta I\).
Solution
\( p_A(t) = \det(tI - A) = t(t-3) - (-1)(2) = t^2 - 3t + 2 \). Direct check: \( A^2 = \begin{pmatrix} -2 & 3 \\ -6 & 7 \end{pmatrix} \), and \( 3A - 2I = \begin{pmatrix} -2 & 3 \\ -6 & 7 \end{pmatrix} \), so \(A^2 - 3A + 2I = 0\) as claimed. For the cube: \(A^2 = 3A - 2I\), hence \[ A^3 = A \cdot A^2 = 3A^2 - 2A = 3(3A - 2I) - 2A = 7A - 6I = \begin{pmatrix} -6 & 7 \\ -14 & 15 \end{pmatrix}. \] (Check: multiplying \(A^2 A\) directly gives the same matrix.)
- Use Cayley–Hamilton to compute \(A^{100}\) for \(A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}\).
Solution
\( p_A(t) = (t-1)^2 \). Divide with remainder in \(\mathbb{R}[t]\): \( t^{100} = q(t)(t-1)^2 + at + b \). Evaluating at \(t = 1\): \(a + b = 1\). Differentiating and evaluating at \(t = 1\): \(100 = a\) (the terms containing \((t-1)\) vanish). So \(a = 100\), \(b = -99\), and since \(p_A(A) = 0\), \[ A^{100} = q(A)\,p_A(A) + 100A - 99I = 100A - 99I = \begin{pmatrix} 1 & 100 \\ 0 & 1 \end{pmatrix}. \] Equivalently: \(N = A - I\) satisfies \(N^2 = p_A(A) = 0\), so \(A^{100} = (I + N)^{100} = I + 100N\) by the binomial theorem (all higher terms die).
- Let \(A \in M_n(F)\) be invertible, \(F\) a field. Prove that \(A^{-1} = q(A)\) for some polynomial \(q\) of degree \(\le n - 1\), and give \(q\) explicitly in terms of the coefficients of \(p_A(t) = t^n + c_{n-1}t^{n-1} + \cdots + c_0\).
Solution
The constant term is \( c_0 = p_A(0) = \det(0 \cdot I - A) = \det(-A) = (-1)^n \det A \ne 0 \) since \(A\) is invertible. Cayley–Hamilton gives \[ A^n + c_{n-1}A^{n-1} + \cdots + c_1 A = -c_0 I, \] so factoring \(A\) (all terms on the left contain a factor of \(A\), and powers of \(A\) commute): \[ A \left( A^{n-1} + c_{n-1}A^{n-2} + \cdots + c_1 I \right) = -c_0 I. \] Hence \( A^{-1} = q(A) \) with \[ q(t) = -\frac{1}{c_0}\left( t^{n-1} + c_{n-1}t^{n-2} + \cdots + c_2 t + c_1 \right), \qquad \deg q \le n - 1. \] The same matrix works as a left inverse by the symmetric factorization, so it is the two-sided inverse. Note the conclusion \(A^{-1} \in F[A]\): the inverse always lies in the commutative subalgebra generated by \(A\).
- For \(A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}\) over a commutative ring \(R\): (i) prove Cayley–Hamilton for \(n = 2\) by direct computation; (ii) deduce the trace identity \( \operatorname{tr}(A^2) = (\operatorname{tr} A)^2 - 2\det A \).
Solution
(i) \( p_A(t) = \det\begin{pmatrix} t - a & -b \\ -c & t - d \end{pmatrix} = (t-a)(t-d) - bc = t^2 - (a+d)t + (ad - bc) \). Compute \[ A^2 = \begin{pmatrix} a^2 + bc & b(a+d) \\ c(a+d) & d^2 + bc \end{pmatrix}, \qquad (a+d)A = \begin{pmatrix} a^2 + ad & b(a+d) \\ c(a+d) & ad + d^2 \end{pmatrix}. \] Then \( A^2 - (a+d)A + (ad - bc)I \) has \((1,1)\) entry \( a^2 + bc - a^2 - ad + ad - bc = 0 \), \((2,2)\) entry \( d^2 + bc - ad - d^2 + ad - bc = 0 \), and off-diagonal entries \( b(a+d) - b(a+d) = 0 \), \( c(a+d) - c(a+d) = 0 \). So \( A^2 = (\operatorname{tr} A)A - (\det A)I \).
(ii) Take the trace of that identity, using linearity of trace and \(\operatorname{tr} I_2 = 2\): \[ \operatorname{tr}(A^2) = (\operatorname{tr} A)\operatorname{tr}(A) - 2\det A = (\operatorname{tr} A)^2 - 2\det A. \] (Consistency check with symmetric functions: if the eigenvalues are \(\lambda, \mu\), this says \(\lambda^2 + \mu^2 = (\lambda + \mu)^2 - 2\lambda\mu\).)
- (Determinant trick / module-theoretic Cayley–Hamilton.) Let \(R\) be a commutative ring, \(I \subseteq R\) an ideal, \(M\) an \(R\)-module generated by \(n\) elements, and \(\varphi : M \to M\) an \(R\)-linear map with \(\varphi(M) \subseteq IM\). Prove there exist \(a_0, \dots, a_{n-1} \in R\) with \(a_k \in I^{\,n-k}\) such that
\[ \varphi^{\,n} + a_{n-1}\varphi^{\,n-1} + \cdots + a_1 \varphi + a_0\,\mathrm{id}_M = 0 \quad \text{as an endomorphism of } M. \]
Solution
Let \(m_1, \dots, m_n\) generate \(M\). Since \(\varphi(m_r) \in IM\), write \[ \varphi(m_r) = \sum_{s=1}^{n} a_{rs} m_s, \qquad a_{rs} \in I. \] Let \(S = R[\varphi] \subseteq \operatorname{End}_R(M)\) be the subring generated by the scalar actions \(r \cdot \mathrm{id}\) and \(\varphi\); it is commutative, because \(\varphi\) is \(R\)-linear (so it commutes with every scalar action) and commutes with its own powers. \(M\) is an \(S\)-module. Form the \(n \times n\) matrix over \(S\) \[ \Delta = \bigl( \delta_{rs}\varphi - a_{rs}\,\mathrm{id} \bigr)_{r,s}. \] By construction, \(\Delta\) applied to the column \((m_1, \dots, m_n)^{\top}\) gives zero: row \(r\) reads \(\varphi(m_r) - \sum_s a_{rs} m_s = 0\). Multiply on the left by \(\operatorname{adj}(\Delta)\), using the adjugate identity \(\operatorname{adj}(\Delta)\Delta = \det(\Delta) I_n\) over the commutative ring \(S\): \[ \det(\Delta)\, m_s = 0 \quad \text{for every } s = 1, \dots, n. \] Since the \(m_s\) generate \(M\) and \(\det(\Delta) \in S\) is \(R\)-linear, \(\det(\Delta)\) annihilates all of \(M\), i.e. \(\det(\Delta) = 0\) in \(\operatorname{End}_R(M)\). Finally expand \(\det(\Delta)\) by the Leibniz formula: it is a sum over permutations of products of \(n\) entries \(\delta_{rs}\varphi - a_{rs}\); collecting by the number of \(\varphi\)-factors chosen gives \[ \det(\Delta) = \varphi^{\,n} + a_{n-1}\varphi^{\,n-1} + \cdots + a_0, \] where the coefficient \(a_k\) of \(\varphi^{\,k}\) is a sum of products of exactly \(n - k\) of the elements \(a_{rs} \in I\) (with signs), hence \(a_k \in I^{\,n-k}\). This is the required monic equation. Remarks: taking \(M = R^n\) free, \(I = R\), \(\varphi = A\) recovers Cayley–Hamilton itself; taking \(\varphi = \mathrm{id}\) and \(I\) contained in the Jacobson radical yields Nakayama’s lemma from \( (1 + a_{n-1} + \cdots + a_0)\,\mathrm{id}_M = 0 \) with the bracket a unit; taking \(R \subseteq R'\), \(x \in R'\), \(M = R[x]\) finitely generated and \(\varphi\) = multiplication by \(x\) shows \(x\) is integral over \(R\).