Algorithm Search⌘K

Proofs: Faddeev-LeVerrier algorithm

These are the human proofs of Faddeev-LeVerrier algorithm, at full length.

The Faddeev-LeVerrier recurrence returns the characteristic polynomial and M_n full

This proof shows: correctness, termination.

Let RR be a commutative ring in which the integers 1,2,…,n1, 2, \dots, n are invertible, for example a field of characteristic 00 or of characteristic greater than nn, and let AA be an n×nn \times n matrix over RR. Write

χA(x)=det⁡(xI−A)=∑k=0npk xn−k,p0=1,\chi_A(x) = \det(xI - A) = \sum_{k=0}^{n} p_k\, x^{n-k}, \qquad p_0 = 1,

so that pkp_k is the coefficient of xn−kx^{n-k}, the same indexing as the pseudocode. The case of the integers is treated at the end.

Claim. FADDEEV-LEVERRIER(A)(A) stops, returns (p0,…,pn)(p_0, \dots, p_n), and returns a matrix MnM_n with AMn=−pnIA M_n = -p_n I and adj⁡(A)=(−1)n−1Mn\operatorname{adj}(A) = (-1)^{n-1} M_n for n≥1n \ge 1.

Termination. Line L2 runs kk over nn values, and each of lines L3 to L5 is a finite computation.

Lemma 1 (the adjugate of xI−AxI - A). Let B(x)=adj⁡(xI−A)B(x) = \operatorname{adj}(xI - A), a matrix over R[x]R[x]. Define matrices M1,…,MnM_1, \dots, M_n by M1=IM_1 = I and Mk+1=AMk+pkIM_{k+1} = A M_k + p_k I for 1≤k≤n−11 \le k \le n - 1. Then B(x)=∑k=1nMk xn−kB(x) = \sum_{k=1}^{n} M_k\, x^{n-k}, and AMn+pnI=0A M_n + p_n I = 0.

Proof. Each entry of B(x)B(x) is, up to sign, a minor of order n−1n - 1 of xI−AxI - A, so it has degree at most n−1n - 1. Write B(x)=∑k=1nBkxn−kB(x) = \sum_{k=1}^{n} B_k x^{n-k} with Bk∈Rn×nB_k \in R^{n \times n}. By Cramer's rule over the commutative ring R[x]R[x], (xI−A)B(x)=χA(x)I(xI - A)B(x) = \chi_A(x) I. Comparing the coefficients of xn,xn−1,…,x0x^{n}, x^{n-1}, \dots, x^0:

  • xnx^n: B1=p0I=IB_1 = p_0 I = I.
  • xn−kx^{n-k} for 1≤k≤n−11 \le k \le n - 1: Bk+1−ABk=pkIB_{k+1} - A B_k = p_k I.
  • x0x^0: −ABn=pnI-A B_n = p_n I.

So the BkB_k satisfy the same recurrence as the MkM_k with the same start, hence Bk=MkB_k = M_k for all kk, and AMn+pnI=0A M_n + p_n I = 0. □\square

Lemma 2 (derivative of the determinant). χA′(x)=tr⁡B(x)\chi_A'(x) = \operatorname{tr} B(x), where ′' is the formal derivative in R[x]R[x].

Proof. Write χA(x)=∑σsgn⁡(σ)∏i(xI−A)i,σ(i)\chi_A(x) = \sum_\sigma \operatorname{sgn}(\sigma) \prod_{i} (xI - A)_{i, \sigma(i)}. The formal derivative satisfies the product rule, and the derivative of the entry (xI−A)ij(xI - A)_{ij} is 11 if i=ji = j and 00 otherwise. So χA′(x)=∑idet⁡Ni(x)\chi_A'(x) = \sum_{i} \det N_i(x), where Ni(x)N_i(x) is xI−AxI - A with row ii replaced by the unit row eiTe_i^T. Expanding det⁡Ni(x)\det N_i(x) along row ii gives the cofactor of the entry (i,i)(i, i) of xI−AxI - A, which is the diagonal entry B(x)iiB(x)_{ii} of the adjugate. Summing over ii gives tr⁡B(x)\operatorname{tr} B(x). □\square

Lemma 3 (the trace recurrence). For 1≤k≤n1 \le k \le n, k pk=−tr⁡(AMk)k\, p_k = -\operatorname{tr}(A M_k).

Proof. The coefficient of xn−kx^{n-k} in χA′(x)=∑j(n−j)pjxn−j−1\chi_A'(x) = \sum_{j} (n - j) p_j x^{n-j-1} is (n−k+1)pk−1(n - k + 1) p_{k-1}. By Lemmas 1 and 2, it is also tr⁡Mk\operatorname{tr} M_k. So tr⁡Mk=(n−k+1)pk−1\operatorname{tr} M_k = (n - k + 1) p_{k-1} for 1≤k≤n1 \le k \le n, and the same formula with k+1k + 1 gives tr⁡Mk+1=(n−k)pk\operatorname{tr} M_{k+1} = (n - k) p_k for k≤n−1k \le n - 1.

For k≤n−1k \le n - 1, take the trace of Mk+1=AMk+pkIM_{k+1} = A M_k + p_k I: (n−k)pk=tr⁡(AMk)+n pk(n - k) p_k = \operatorname{tr}(A M_k) + n\, p_k, so k pk=−tr⁡(AMk)k\, p_k = -\operatorname{tr}(A M_k). For k=nk = n, take the trace of AMn+pnI=0A M_n + p_n I = 0: tr⁡(AMn)+n pn=0\operatorname{tr}(A M_n) + n\, p_n = 0, which is the same formula. □\square

Invariant. At the start of the iteration of line L2 with index kk, the stored values p0,…,pk−1p_0, \dots, p_{k-1} are the coefficients of χA\chi_A and N=AMk−1N = A M_{k-1}, where we put M0=0M_0 = 0.

Initialization. For k=1k = 1, line L1 set p0=1p_0 = 1 and N=0=AM0N = 0 = A M_0.

Maintenance. Line L3 sets M=N+pk−1I=AMk−1+pk−1IM = N + p_{k-1} I = A M_{k-1} + p_{k-1} I. For k=1k = 1 this is 0+I=M10 + I = M_1, and for k≥2k \ge 2 it is MkM_k by the recurrence of Lemma 1. Line L4 sets N=AMkN = A M_k. Line L5 sets pk=−tr⁡(AMk)/kp_k = -\operatorname{tr}(A M_k)/k, which is the coefficient pkp_k by Lemma 3, since kk is invertible. So the invariant holds for k+1k + 1.

End. After the iteration with k=nk = n, the list holds p0,…,pnp_0, \dots, p_n, and M=MnM = M_n; line L6 returns them. For n=0n = 0 the loop is empty and the result is (1)(1), the characteristic polynomial of the empty matrix. By Lemma 1, AMn=−pnIA M_n = -p_n I. Since B(0)=MnB(0) = M_n and B(0)=adj⁡(−A)=(−1)n−1adj⁡(A)B(0) = \operatorname{adj}(-A) = (-1)^{n-1} \operatorname{adj}(A) (each cofactor is a minor of order n−1n - 1), adj⁡(A)=(−1)n−1Mn\operatorname{adj}(A) = (-1)^{n-1} M_n.

Integers. Let R=ZR = \mathbb{Z}. Run the argument in Q\mathbb{Q}, where 1,…,n1, \dots, n are invertible: the computed pkp_k and MkM_k are the coefficients of χA\chi_A and of adj⁡(xI−A)\operatorname{adj}(xI - A), which have integer entries because they are integer combinations of minors of AA. So every quotient on line L5 is an integer, and the exact integer division of the implementation computes it. ■\blacksquare

Remark. If some k≤nk \le n is not invertible in RR, Lemma 3 still holds but does not determine pkp_k. Over Z/2Z\mathbb{Z}/2\mathbb{Z} with n=2n = 2, the equation 2p2=−tr⁡(AM2)2 p_2 = -\operatorname{tr}(A M_2) reads 0=00 = 0 for every matrix, so the method has no way to find det⁡A\det A.

Back to Faddeev-LeVerrier algorithm