Post · 6 min read· pp. 652–655

What is the Cayley–Hamilton Theorem?

The Cayley–Hamilton Theorem says that a square matrix AA satisfies its characteristic equation, that is p(A)=0p(A) = 0 where p(t)=det⁡(tI−A)p(t) = \det(tI-A) is the characteristic polynomial. This statement is not simply the substitution “p(A)=det⁡(A−A)=0p(A) = \det(A - A) = 0”, which is not valid since tt must remain a scalar inside the det⁡\det term. Rather, for an n×nn\times n AA, the characteristic polynomial has the form

p(t)=tn+an−1tn−1+⋯+a1t+a0\notag p(t) = t^n + a_{n-1}t^{n-1} + \cdots + a_1 t + a_0

and the Cayley–Hamilton theorem says that

p(A)=An+an−1An−1+⋯+a1A+a0I=0.\notag p(A) = A^n + a_{n-1}A^{n-1} + \cdots + a_1 A + a_0 I = 0.

Various proofs of the theorem are available, of which we give two. The first is the most natural for anyone familiar with the Jordan canonical form. The second is more elementary but less obvious.

First proof.

Consider a 4×44\times 4 Jordan block with eigenvalue λ\lambda:

J=[λ100λ10λ1λ].\notag J = \begin{bmatrix} \lambda & 1 & 0 & 0 \\ & \lambda & 1 & 0\\ & & \lambda & 1\\ & & & \lambda \end{bmatrix}.

We have

J−λI=[0100010010],(J−λI)2=[0010001000],(J−λI)3=[0001000000],\notag J - \lambda I = \begin{bmatrix} 0 & 1 & 0 & 0 \\ & 0 & 1 & 0\\ & & 0 & 1\\ & & & 0 \end{bmatrix}, \quad (J - \lambda I)^2 = \begin{bmatrix} 0 & 0 & 1 & 0 \\ & 0 & 0 & 1 \\ & & 0 & 0 \\ & & & 0 \end{bmatrix}, \quad (J - \lambda I)^3 = \begin{bmatrix} 0 & 0 & 0 & 1 \\ & 0 & 0 & 0 \\ & & 0 & 0 \\ & & & 0 \end{bmatrix},

and then (J−λI)4=0(J - \lambda I)^4 = 0. In general, for an n×nn \times n Jordan block JJ with eigenvalue λ\lambda, (J−λI)k(J - \lambda I)^k is zero apart from a kkth superdiagonal of ones for k≤n−1k\le n-1, and (J−λI)n=0(J - \lambda I)^n = 0.

Let AA have the Jordan canonical form A=ZJZ−1A = Z JZ^{-1}, where J=diag(J1,…,Jk)J = \mathrm{diag}(J_1, \dots, J_k) and each JiJ_i is an mi×mim_i\times m_i Jordan block with eigenvalue λi\lambda_i. The characteristic polynomial of AA can be factorized as p(t)=(t−λ1)m1(t−λ2)m2…(t−λk)mkp(t) = (t-\lambda_1)^{m_1}(t-\lambda_2)^{m_2}\dots(t-\lambda_k)^{m_k}. Note that Ai=ZJiZ−1A^i = Z J^i Z^{-1} for all ii, and hence q(A)=Zq(J)Z−1q(A) = Z q(J) Z^{-1} for any polynomial qq. Then

Z−1p(A)Z=p(J)=diag(p(J1),p(J2),…,p(Jk)),\notag Z^{-1}p(A)Z = p(J) = \mathrm{diag}\bigl( p(J_1), p(J_2), \dots, p(J_k) \bigr),

and p(Ji)p(J_i) is zero because it contains a factor (Ji−λiI)mi(J_i - \lambda_i I\bigr)^{m_i} and this factor is zero, as noted above. Hence Z−1p(A)Z=0Z^{-1}p(A)Z = 0 and therefore p(A)=0p(A) = 0.

Second Proof

Recall that the adjugate adj(B)\mathrm{adj}(B) of an n×nn\times n matrix BB is the transposed matrix of cofactors, where a cofactor is a signed sum of products of n−1n-1 entries of BB, and that Badj(B)=det⁡(B)IB\mathrm{adj}(B) = \det(B)I. With B=tI−AB = tI - A, each entry of adj(B)\mathrm{adj}(B) is a polynomial of degree n−1n-1 in tt, so B−1=adj(B)/det⁡(B)B^{-1} = \mathrm{adj}(B)/\det(B) can be written

(tI−A)−1=adj(tI−A)det⁡(tI−A)=tn−1Cn−1+⋯+tC1+C0p(t),\notag (tI - A)^{-1} = \displaystyle\frac{\mathrm{adj}(tI - A)}{\det(tI - A)} = \displaystyle\frac{t^{n-1}C_{n-1} + \cdots + tC_1 + C_0}{p(t)},

for some matrices Cn−1C_{n-1}, …\dots, C0C_0 not depending on tt. Rearranging, we obtain

(tI−A)(tn−1Cn−1+⋯+tC1+C0)=p(t)I,\notag (tI - A) \bigl(t^{n-1}C_{n-1} + \cdots + tC_1 + C_0 \bigr) = p(t)I,

and equating coefficients of tnt^n, …, t0t^0 gives

Cn−1=I,Cn−2−ACn−1=an−1I,⋮C0−AC1=a1I,−AC0=a0I.\notag \begin{aligned} C_{n-1} &= I,\\ C_{n-2} - A C_{n-1} &= a_{n-1}I,\\ & \vdots\\ C_0 - A C_1 &= a_1 I,\\ - A C_0 &= a_0I. \end{aligned}

Premultiplying the first equation by AnA^n, the second by An−1A^{n-1}, and so on, and adding, gives

0=An+an−1An−1+⋯+a1A+a0I=p(A),\notag 0 = A^n + a_{n-1}A^{n-1} + \cdots + a_1 A + a_0 I = p(A),

as required. This proof is by Buchheim (1884).

Applications and Generalizations

A common use of the Cayley–Hamilton theorem is to show that A−1A^{-1} is expressible as a linear combination of II, AA, …, An−1A^{n-1}. Indeed for a nonsingular AA, p(A)=0p(A) = 0 implies that

A−1=−1a0(An−1+an−1An−2+⋯+a1I),\notag A^{-1} = -\displaystyle\frac{1}{a_0} \bigl( A^{n-1} + a_{n-1}A^{n-2} + \cdots + a_1 I \bigr),

since a0=det⁡(A)≠0a_0 = \det(A) \ne 0.

Similarly, AkA^k for any k≥nk \ge n can be expressed as a linear combination of II, AA, …, An−1A^{n-1}. An interesting implication is that any matrix power series is actually a polynomial in the matrix. Thus the matrix exponential eA=I+A+A2/2!+⋯\mathrm{e}^A = I + A + A^2/2! + \cdots can be written eA=cn−1An−1+⋯+C1A+c0I\mathrm{e}^A = c_{n-1} A^{n-1} + \cdots + C_1A + c_0I for some scalars cn−1c_{n-1}, …, c0c_0. However, the cic_i depend on AA, which reduces the usefulness of the polynomial representation. A rare example of an explicit expression of this form is Rodrigues’s formula for the exponential of a skew-symmetric matrix A∈R3×3A \in \mathbb{R}^{3\times 3}:

eA=I+sin⁡θθA+1−cos⁡θθ2A2,\notag \mathrm{e}^A = I + \displaystyle\frac{\sin\theta}{\theta} A + \displaystyle\frac{1-\cos\theta}{\theta^2} A^2,

where θ=∥A∥F2/2\theta = \sqrt{\|A\|_F^2/2}.

Cayley used the Cayley–Hamilton theorem to find square roots of a 2×22\times 2 matrix. If X2=AX^2 = A then applying the theorem to XX gives X2−trace(X)X+det⁡(X)I=0X^2 - \mathrm{trace}(X)X + \det(X)I = 0, or

A−trace(X)X+det⁡(X)I=0,(∗)\notag \qquad\qquad\qquad\qquad A - \mathrm{trace}(X)X + \det(X)I = 0, \qquad\qquad\qquad\qquad (*)

which gives

X=A+det⁡(X)Itrace(X).X = \displaystyle\frac{A + \det(X)I}{\mathrm{trace}(X)}.

Now det⁡(X)=det⁡(A)\det(X) = \sqrt{\det(A)} and taking the trace in (∗)(*) gives an equation for trace(X)\mathrm{trace}(X), leading to

X=A+det⁡(A) Itrace(A)+2det⁡(A).\notag X = \displaystyle\frac{ A + \sqrt{\det(A)} \,I} {\sqrt{\mathrm{trace}(A) + 2 \sqrt{\det(A)}}}.

With appropriate choices of signs for the square roots this formula gives all four square roots of AA when AA has distinct eigenvalues, but otherwise the formula can break down.

Expressions obtained from the Cayley–Hamilton theorem are of little practical use for general matrices, because algorithms that compute the coefficients aia_i of the characteristic polynomial are typically numerically unstable.

The Cayley–Hamilton theorem has been generalized in various directions. The theorem can be interpreted as saying that the powers AiA^i for all nonnegative ii generate a vector space of dimension at most nn. Gerstenhaber (1961) proved that if AA and BB are two commuting n×nn\times n matrices then the matrices AiBjA^iB^j, for all nonnegative ii and jj, generate a vector space of dimension at most nn. It is conjectured that this result extends to three matrices.

Historical Note

The Cayley–Hamilton theorem appears in the 1858 memoir in which Cayley introduced matrix algebra. Cayley gave a proof for n=2n = 2 and stated that he had verified the result for n=3n = 3, adding “I have not thought it necessary to undertake the labour of a formal proof of the theorem in the general case of a matrix of any degree.” Hamilton had proved the result for quaternions in 1853. Cayley actually discovered a more general version of the Cayley–Hamilton theorem, which appears in an 1857 letter to Sylvester but not in any of his published work: if the square matrices AA and BB commute and f(x,y)=det⁡(xA−yB)f(x,y) = \det(x A - y B) then f(B,A)=0f(B,A) = 0.

References

This article is part of the “What Is” series, available from https://nhigham.com/category/what-is and in PDF form from the GitHub repository https://github.com/higham/what-is.