# Maths - Cayley-Hamilton Theorem

This theorem says that every square matrix (over a field or a commutative ring) satisfies its own characteristic equation. That is:

 if: p(λ) = det(λ I - A) characteristic polynomial of A then : p(A) = 0

where:

• det = determinant
• A = square matrix
• λ = scalar value
• I = identity matrix
• p() = polynomial

An equivalent statement to Cayley-Hamilton is that the minimal polynomial of a square matrix divides its characteristic polynomial.

#### Examples

I have used a computer algebra programs called Axiom for these examples, how to install Axiom here.

I have put user input in red:

 ```a1 := matrix[[1,0],[0,1]] +1 0+ (1) | | +0 1+ Type: Matrix(Integer) m1 := diagonalMatrix[lambda,lambda]-a1 +lambda - 1 0 + (2) | | + 0 lambda - 1+ Type: Matrix(Polynomial(Integer)) d1 := determinant(m1) 2 (3) lambda - 2lambda + 1 Type: Polynomial(Integer) a1*a1 -2*a1 + diagonalMatrix[1,1] +0 0+ (4) | | +0 0+ Type: Matrix(Integer) a2 := matrix[[a,b],[c,d]] +a b+ (5) | | +c d+ Type: Matrix(Polynomial(Integer)) m2 := diagonalMatrix[lambda,lambda]-a2 +lambda - a - b + (6) | | + - c lambda - d+ Type: Matrix(Polynomial(Integer)) d2 := determinant(m2) 2 (7) lambda + (- d - a)lambda + a d - b c Type: Polynomial(Integer) a2*a2+(-d-a)*a2 + determinant(a2)*diagonalMatrix[1,1] +0 0+ (8) | | +0 0+ Type: Matrix(Polynomial(Integer)) a3 := matrix[[1,0,0],[0,1,0],[0,0,1]] +1 0 0+ | | (9) |0 1 0| | | +0 0 1+ Type: Matrix(Integer) m3 := diagonalMatrix[lambda,lambda,lambda]-a3 +lambda - 1 0 0 + | | (10) | 0 lambda - 1 0 | | | + 0 0 lambda - 1+ Type: Matrix(Polynomial(Integer)) d3 := determinant(m3) 3 2 (11) lambda - 3lambda + 3lambda - 1 Type: Polynomial(Integer) a3*a3*a3 - 3*a3*a3 +3*a3 - diagonalMatrix[1,1,1] +0 0 0+ | | (12) |0 0 0| | | +0 0 0+ Type: Matrix(Integer) a4 := matrix[[a,b,c],[d,e,f],[g,h,i]] +a b c+ | | (13) |d e f| | | +g h i+ Type: Matrix(Polynomial(Integer)) m4 := diagonalMatrix[lambda,lambda,lambda]-a4 +lambda - a - b - c + | | (14) | - d lambda - e - f | | | + - g - h lambda - i+ Type: Matrix(Polynomial(Integer)) d4 := determinant(m4) (15) 3 2 lambda + (- i - e - a)lambda + ((e + a)i - f h - c g + a e - b d)lambda (- a e + b d)i + (a f - c d)h + (- b f + c e)g Type: Polynomial(Integer) a4*a4*a4 + (-i-e-a)*a4*a4 +((e + a)*i - f*h - c*g + a*e - b*d)*a4 + ((- a*e + b*d)*i + (a*f - c*d)*h + (- b*f + c*e)*g)*diagonalMatrix[1,1,1] +0 0 0+ | | (16) |0 0 0| | | +0 0 0+ Type: Matrix(Polynomial(Integer)) (17) -> ```