This is a somewhat high-brow way of showing the Cayley-Hamilton theorem, through the power of holomorphic functional calculus.
As I mentioned in this answer, one of the standard ways to define a matrix function is through a Cauchy-like construction:
$$f(\mathbf A) = \frac{1}{2\pi i} \oint_\gamma f(z)\, (z \mathbf I- \mathbf A)^{-1}\,\mathrm dz$$
where the closed contour $\gamma$ encloses the eigenvalues of $\mathbf A$. Here is how to use this definition for a Mathematica demonstration of Cayley-Hamilton.
First, define the matrix and the corresponding characteristic polynomial:
A = {{-1, -4, -2}, {0, 1, 1}, {-6, -12, 2}};
p[λ_] = CharacteristicPolynomial[A, λ];
To construct the integrand, do this:
n = Length[A];
ip = Simplify[p[z] Inverse[z IdentityMatrix[n] - A]];
Now, to evaluate the contour integral, we can use the Cauchy integral theorem (and relatedly, the residue theorem). Let's look at what ip
looks like:
ip
{{-14 + 3 z - z^2, 4 (-8 + z), 2 (1 + z)},
{6, 14 + z - z^2, -1 - z},
{6 (-1 + z), 12 (-1 + z), 1 - z^2}}
Could it be?
And @@ Flatten[Map[PolynomialQ[#, z] &, ip, {2}]]
True
GASP! All the matrix entries are polynomials!
This means that the conditions of the integral theorem are satisfied (polynomials certainly are holomorphic functions!), and the matrix contour integral should evaluate to the zero matrix. If you still want to try things out in Mathematica anyway, we can use the syntax for Integrate[]
that allows piecewise linear paths in the complex plane:
Integrate[ip, {z, 1, I, -1, -I, 1}]/(2 Pi I)
{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}
and we're done.
See also this math.SE question and this paper.
p[lambda] /. lambda^k_. -> MatrixPower[A,k]
. $\endgroup$ – Daniel Lichtblau Apr 4 '15 at 19:42c
, then replace it withc*IdentityMatrix[...]
. $\endgroup$ – Daniel Lichtblau Apr 4 '15 at 22:13