Characteristic Polynomials and the Cayley–Hamilton Theorem

We chase down which matrices can actually be diagonalized — starting with characteristic polynomials, hitting complex eigenvalues, and landing on the Cayley–Hamilton theorem.

Picking up right where we left off. The big question we’ve been chasing: “can every matrix be diagonalized?!”

Right now we’re setting up an equation of degree $n$ from a determinant to find the eigenvalues, and… common sense says there could be times when we don’t get $n$ eigenvalues out of it!!

So which matrices get diagonalized, and which ones don’t?

① When we can’t find the eigenvalues

The first case: the degree-$n$ equation in λᵢ has “no solution” (we can’t find the eigenvalues).

For an n × n matrix A, solve det(λI − A) = 0 for λ

Anyway, since we’re hunting for the solutions of det(λI − A) = 0, let me slap a definition on the determinant in that equation: φ_A(t), the characteristic polynomial of $A$. So:

Definition: φ_A(t) = det(tI − A)

That’s the definition. If we call an eigenvalue $\lambda$, then φ_A(λ) = 0, right? And if

Factored form: φ_A(t) = (t − λ₁)···(t − λₙ)

then the eigenvalues are λ₁, …, λₙ!!

Hold on, let me try an example.

Example: B = (1, −1; 2, −1) gives φ_B(t) = t² + 1

That’s what we get. Whoa, there’s no solution…..

Ah… well, “no solution” is a bit of a stretch… There’s no solution in the reals, sure, but if we let ourselves play in the complex numbers, there are solutions, the imaginary roots. So in other words: over the real numbers, this matrix can’t be diagonalized.

And if we extend to the complex numbers,

Over the complex numbers: φ_B(t) = t² + 1 = (t + i)(t − i)

we can find the eigenvalues, λ₁ = i, λ₂ = −i, and the eigenvectors that go with them,

Eigenvectors X₁ = (1 + i, 2) and X₂ = (1 − i, 2)

like so. And if we build the matrix $R$, R = (1 + i, 1 − i; 2, 2), and then diagonalize,

Diagonalized: B′ = R⁻¹BR = (i, 0; 0, −i)

it comes out like this.

Side note!! A polynomial over the complex numbers can always, no exceptions, be factored into first-degree factors. That’s called the Fundamental Theorem of Algebra.

So as you can see, the result can change depending on which field we work over.

Up to now we didn’t really care which field we were doing linear algebra over; we just used the handy real numbers like it went without saying. From here on out, I think we’ll have to keep a close eye on which field we’re playing on.

Anyway, so there’s the case where the eigenvalues don’t exist…..

② The eigenvalues exist, but we can’t find their eigenvectors

Could that even happen?!

For an n × n matrix A: φ_A(t) = det(tI − A) = (t − λ₁)···(t − λₙ), and let’s say λ₁ through λₙ are all different

Then for each λᵢ we have to find the matching Xᵢ, but (λᵢI − A)Xᵢ = 0 — can each one really, really, REALLY get a (nonzero) value that satisfies this equation?!

Answer: Yes, it can!!

Since det(λI − A) = 0, the dimension of the column space of the matrix λᵢI − A — that is, the dimension of the image, dim im (λI − A) — is at most $n-1$, no matter how big it gets. ($\le n-1$)

Why~~? Because the image of the matrix λI − A can’t have dimension $n$. If the image had dimension $n$, that matrix would be invertible, and then it couldn’t satisfy det(λI − A) = 0. Okey-dokey?

So by the Dimension Theorem, the kernel of λᵢI − A must, no exceptions, have dimension at least 1?! And what does a kernel of dimension at least 1 mean? It means there’s at least one nonzero vector that the matrix λᵢI − A sends to 0.

So!! (λᵢI − A)Xᵢ = 0 — each one really, really, REALLY gets a (nonzero) value that satisfies this equation!!

And let’s check this one too, just for fun.

When we stack X₁ ~ Xₙ up neatly into the matrix $R$,

R = (X₁ ··· Xₙ), the eigenvectors side by side as columns

let’s check whether this matrix $R$ really, always comes out invertible.

So let me make an assumption: “Suppose $R$ is not invertible.” $R$ not being invertible means X₁ ~ Xₙ are linearly dependent!! Which means

The relation c₁X₁ + ··· + cₙXₙ = 0

the $c_1$ ~ $c_n$ that satisfy this don’t all have to be 0. Among c₁ ~ cₙ, let me pull out the nonzero cᵢ, $k$ of them (I’ll number them 1 ~ $k$). Then dropping the zeros and writing only what’s left,

Only the nonzero ones: c₁X₁ + ··· + c_kX_k = 0

we get this. Now let me multiply the left side of this equation by the matrix $A$.

Multiplying by A: A(c₁X₁ + ··· + c_kX_k) = 0

Whoa,

Each AXᵢ = λᵢXᵢ, so c₁λ₁X₁ + ··· + c_kλ_kX_k = 0

we can write it like this, since the eigenvalue equation holds for all $k$ vectors. Let me multiply the left of this by $A$ again.

Multiplying by A again: A²(c₁X₁ + ··· + c_kX_k) = c₁λ₁²X₁ + ··· + c_kλ_k²X_k = 0

Keep~~ multiplying.

Up to A to the power k − 1: c₁λ₁^(k−1)X₁ + ··· + c_kλ_k^(k−1)X_k = 0

That way we can make $k$ equations. Now let me gather the $k$ vectors $X_i$ into a matrix, call it $B$, and write it like this.

B = (X₁ ··· X_k), where the entry b_ij is the i-th entry of X_j

That’s what I mean. You get what the rightmost part means, right?!…..?

And if we write the $k$ equations above using this matrix $B$,

B times diag(c₁, …, c_k) times the Vandermonde matrix with rows 1, λ_j, …, λ_j^(k−1) equals 0

we can write it like this, right?? I jotted some extra explanation underneath.

The same product with notes: the diagonal matrix has determinant c₁···c_k, which is not 0, and the Vandermonde determinant is not 0 because λ₁ through λ_k are all different

For the Vandermonde matrix, check the earlier #15: The Adjoint Matrix (Linear Algebra I Studied #15)

So what’s the conclusion? We get $B = 0$. But a matrix built like $B$, out of eigenvectors, can’t be 0 (an eigenvector is never the zero vector), so what kind of result is this~~ This is what we call a contradiction. Meaning the ‘assumption’ itself was wrong.

So the conclusion: if $\lambda_1$ ~ $\lambda_n$ are all different, diagonalization ALWAYS works!!

OK OK OK OK OK, we now know that when λ₁ ~ λₙ are all different, diagonalization always works. Now someone gets nitpicky: “Hey hey hey hey, what if even one pair of them coincides???” you might ask.

③ The characteristic polynomial has repeated roots

(Conclusion: it might be diagonalizable, it might not.)

A = (1, 0; 0, 1) gives φ_A(t) = (t − 1)²

In this case we only find one root, λ₁ = 1. So it’ll fetch just one eigenvector too, right???

Nope!! It might fetch 2.

The eigenvector equation (λ₁I − A)X₁ = 0 becomes (0, 0; 0, 0)X₁ = 0

It works out like this, so we can say “for $X_1$, ANY vector goes!?”, and

X₁ = (1, 0) and X₂ = (0, 1)

we can bring in two linearly independent vectors like this. λ₁ did the work of two all by itself. That is,

R = (1, 0; 0, 1) and R⁻¹ = (1, 0; 0, 1)

so $R^{-1}AR = A' = A = I$. (Well duh, it was already diagonal, so diagonalizing it one more time just spits the same thing back;;;)

But!! The question is whether it ALWAYS goes like that.

Somehow I’ve got a feeling it might not.

B = (1, 0; 1, 1) gives φ_B = (t − 1)²

Same as before?! λ₁ = 1. But this time, the eigenvectors just won’t make two linearly independent vectors…..

Eigenvectors: X₁ = (0, 1), and X₂ fails

Conclusion:

The case φ_A(t) = (t − 1)ⁿ

If the characteristic polynomial comes out with its $n$ roots all piled up like this, there are two cases lol: diagonalizable, or not~

Let me make the situation above more general. Above, we watched all~~ $n$ eigenvalues land on one value; instead of all $n$ coinciding, let’s look at the case where each one repeats its own number of times.

The characteristic polynomial of some matrix $A$:

General form: φ_A(t) = (t − λ₁)^m₁ ··· (t − λ_k)^m_k with m₁ + ··· + m_k = n

You get why the $m_i$’s below add up to $n$, right?! The characteristic polynomial has to be a polynomial of degree $n$ in $t$!! Right?!

Here mᵢ is called the multiplicity!! It just means “how many times is this root repeated~~?”

Then for the matrix to be diagonalizable, each root has to bring along at least as many linearly independent vectors as its own multiplicity. (If some eigenvalue brings fewer than its multiplicity, some other eigenvalue would have to bring more eigenvectors than its own multiplicity. But that can’t happen. An eigenvalue can never, ever bring more than its own multiplicity. I’ll skip the proof; it gets way too long.)

Eigenvalue by eigenvalue: λ₁ has multiplicity m₁, so it brings m₁ different eigenvectors X′₁¹ through X′₁^m₁; likewise for λ₂ with m₂, on down to λ_k with m_k

We have to gather $n$ of these $X$’s and build an invertible $R$!! ⟨That vectors belonging to different eigenvalues are linearly independent, we already proved above.⟩

That’s it! What you need to take away here: λᵢ has to bring along as many linearly independent Xᵢ’s as its own multiplicity.

That’s the conclusion for now, and I’ll stop the conclusions here. To go deeper we’d need the decomposition theorem, and we’re doing that waaaaay~~ later! Don’t worry heh heh heh. I’ll copy-paste this conclusion and bring it along when we do the decomposition theorem!! Yep yep yep.

The Cayley-Hamilton theorem

OK, finally, something we learned in high school… Not technically in the curriculum, but every teacher told us to memorize it anyway: let me wrap up this post by proving the Cayley-Hamilton theorem with the characteristic polynomial.

Take a 2 × 2 matrix A = (a, b; c, d): φ_A(t) = t² − (a + d)t + (ad − bc); plug A itself into this characteristic polynomial and φ_A(A) = A² − (a + d)A + (ad − bc)I, which works out entry by entry to the zero matrix

Holy cow, that’s wild,

The result A² − (a + d)A + (ad − bc)I = 0

this equation gets proven this easily!?

But what’s even more amazing is that this holds for $n \times n$ too. Let me go through $n \times n$ case by case. If $A$ is diagonalizable,

Factored: φ_A(t) = (t − λ₁)···(t − λₙ)

it factors into $n$ linear factors like this, and if we plug in $A$,

Plugging in A: φ_A(A) = (A − λ₁)···(A − λₙ)

How on earth can we say THIS is 0?!

OK OK OK OK, didn’t we say $A$ is diagonalizable?!

Diagonalized: A′ = R⁻¹AR = diag(λ₁, …, λₙ)

That means this is possible,

Powers: A′ⁿ = R⁻¹AⁿR = diag(λ₁ⁿ, …, λₙⁿ)

and this holds too, so

Again φ_A(A) = (A − λ₁)···(A − λₙ)

this equation — let me play with it like this.

Sandwiching: R⁻¹φ_A(A)R = R⁻¹(A − λ₁)RR⁻¹ ··· RR⁻¹(A − λₙ)R

Then we can write it like this.

R⁻¹φ_A(A)R = (A′ − λ₁I)···(A′ − λₙI), a product of diagonal matrices in which every diagonal position gets a zero factor, so the product is 0

So R⁻¹φ_A(A)R = 0, and therefore φ_A(A) = 0

Let’s also look at the general case, where $A$ isn’t diagonalizable. Then we can wrap this up.

It’s a sli~~ghtly different direction, but I’ll use the adjoint matrix. We could write this:

The adjoint identity A · adj A = (det A)I

Now,

Swap A for the matrix tI − A: (tI − A) · adj(tI − A) = (det(tI − A))I

The two sides annotated: adj(tI − A) is a polynomial in t, call it B(t) = B₀ + B₁t + ··· + B_(n−1)t^(n−1), of degree n − 1; det(tI − A) is the characteristic polynomial, written in general form because it might not factor: φ_A(t) = a₀ + a₁t + ··· + aₙtⁿ, of degree n

I wrote it like this!! If the adjoint is hazy, check #15: The Adjoint Matrix (Linear Algebra I Studied #15)

Now let me compare the two sides of that equation, power by power. The notation needs some high-level technique that’s a real pain to type in the equation editor, so I’ll swap in a photo.

Comparing coefficients power by power: constant term −AB₀ = a₀I; degree 1: B₀ − AB₁ = a₁I, times A; degree 2: B₁ − AB₂ = a₂I, times A²; and so on down to degree n − 1, times A^(n−1), and degree n: B_(n−1) = aₙI, times Aⁿ

You see what I was trying to write?! Now let me add up all the left sides and right sides, zwoop!~~

Adding up the rows: the left sides cancel to 0, and the right sides give a₀I + a₁A + ··· + a_(n−1)A^(n−1) + Aⁿ = φ_A(A)

Then we get this.

We’ve shown that φ_A(A) = 0 holds!! This is called the Cayley-Hamilton theorem!!

A little preview of the next post

OK, let me give a little preview of the next post and move on.

Out of the zillions of polynomials in the world, is the characteristic polynomial reaaally the only one that turns into 0 when you plug the matrix $A$ in for the variable?!

Never mind the characteristic polynomial; if we set our minds to it, it kinda feels like we could cook up plenty more?!

Hmm!! So I want to define this: the set of all, all the polynomials that turn into 0 when you plug the matrix $A$ in for the variable, I’ll call it I_A. Let me add just a tiny bit more and define this much:

I_A is a subset of the set of all polynomials over a field F

Remember this notation?? I introduced it almost at the very beginning.

Anyway, naturally, the polynomial φ_A(t) is an element of I_A. But besides the characteristic polynomial, if we look at a few more elements of I_A, we can find them like this. If we have

A = diag(2, 1, 1)

a matrix like this, its characteristic polynomial is

Its characteristic polynomial φ_A(t) = (t − 2)(t − 1)²

and so

So φ_A(A) = (A − 2I)(A − I)² = 0

holds. BUT!!!

But also (A − 2I)(A − I) = 0

doesn’t this hold too?!

(We’ll learn it later, but apparently that one’s called the minimal polynomial, m_A(t).)

So why is this a problem? (From where I’m sitting) it’s a real head-scratcher. The set I_A apparently has this property:

If f(t) and g(t) are in I_A, then f(t) + g(t), cf(t) and f(t)·g(t) are in I_A

Don’t you smell something?!

To understand diagonalization, we ended up exploring something more primitive than diagonalization, ‘blocking’, and we came all this way to do the ‘decomposition theorem’ later on, the one that says “through blocking, we’ll get to diagonalization”.

To really get the decomposition theorem, we need to know the characteristic polynomial better; to understand the characteristic polynomial better, we need to know I_A better; and to understand I_A better, apparently we need to understand ‘polynomials’ better. But to understand polynomials well, we need to know fields better, and to know fields better, apparently we need to know the ‘integers’ better…….

So the next post will be a session laying down the ‘background knowledge’ for the decomposition theorem.


Heads-up. The figures here are the original notes, slips and all. A few things to watch for:

  • In the $2 \times 2$ Cayley–Hamilton picture, the first matrix should be $A^2 = \begin{pmatrix} a^2 + bc & ab + bd \\ ca + dc & cb + d^2 \end{pmatrix}$; with it, $A^2 - (a + d)A + (ad - bc)I$ is the zero matrix, as the picture says.
  • In the coefficient-comparison pictures, the degree $n - 1$ row should end in $a_{n-1}I$, not $a_nI$ (the summed line below uses $a_{n-1}A^{n-1}$ correctly).

Questions or corrections?

Did a step lose you, or does a number look off? Email me or use the contact page. Include the note title and the step or figure you mean.

Feedback goes to me privately by email; it is not posted as a public comment.