Characteristic Polynomial

This part of the discussion considers only square matrices, that is, the linear transformation corresponding to matrix AA maps nn vectors to nn vectors.

Since practical problems often require repeated transformations, merely saying that the linear transformation corresponding to matrix AA transforms the identity matrix II into AA is too abstract. The best approach is to look for fixed points, that is, parts of the transformation that remain unchanged.

However, the linear transformation corresponding to matrix AA may have no fixed points at all. We therefore look instead for collinear parts or parts resembling a simple transformation.

Eigenvalues and Eigenvectors

Under the linear transformation corresponding to matrix AA, the directions of some vectors do not change; only their magnitudes are scaled.

Let VV be a vector space over FF, and let TT be a linear transformation on VV. If there exist an element of FF, denoted by λ\lambda, and a nonzero vector in VV, denoted by ξ\xi, such that:

Tξ=λξT\xi=\lambda\xi

then λ\lambda is called an eigenvalue of TT, and ξ\xi is called an eigenvector of TT belonging to the eigenvalue λ\lambda.

Eigenvectors on the same line retain their direction under a linear transformation (compressing them to zero is also regarded as preserving direction). An eigenvector is not unique: every vector collinear with an eigenvector is also an eigenvector, but the zero vector is not an eigenvector by definition, since a vector with a direction is necessarily nonzero. The eigenvalue of an eigenvector is the factor by which it is scaled.

In applications, for eigenvectors with the same eigenvalue, one usually chooses a basis as a representative of the whole set.

Let α1,α2,⋯ ,αn\alpha_1,\alpha_2,\cdots,\alpha_n be a basis of VV, and let the matrix of TT in this basis be AA, that is:

T(α1,α2,⋯ ,αn)=(α1,α2,⋯ ,αn)AT(\alpha_1,\alpha_2,\cdots,\alpha_n)=(\alpha_1,\alpha_2,\cdots,\alpha_n)A

Let λ0\lambda_0 be an eigenvalue of TT, let ξ\xi be an eigenvector of TT belonging to the eigenvalue λ0\lambda_0, and let a nonzero vector XX satisfy:

ξ=(α1,α2,⋯ ,αn)X\xi=(\alpha_1,\alpha_2,\cdots,\alpha_n)X

Then:

Tξ=λ0ξT\xi=\lambda_0\xi T(α1,α2,⋯ ,αn)X=λ0(α1,α2,⋯ ,αn)XT(\alpha_1,\alpha_2,\cdots,\alpha_n)X=\lambda_0(\alpha_1,\alpha_2,\cdots,\alpha_n)X (α1,α2,⋯ ,αn)AX=λ0(α1,α2,⋯ ,αn)X(\alpha_1,\alpha_2,\cdots,\alpha_n)AX=\lambda_0(\alpha_1,\alpha_2,\cdots,\alpha_n)X AX=λ0XAX=\lambda_0X (A−λ0I)X=0(A-\lambda_0I)X=0

Therefore, the corresponding determinant is also 00.

Characteristic Polynomial

Consider an n×nn\times n matrix AA, where n≥0∧n∈Zn\geq 0\land n\in\mathbb{Z}. Let λ\lambda be a parameter. The matrix λI−A\lambda I-A is called the characteristic matrix of AA.

The determinant of the characteristic matrix is called the characteristic polynomial of AA. It is an nn-th degree polynomial whose roots are the eigenvalues of AA, and is denoted by pA(λ)p_A(\lambda):

pA(λ)=det⁡(λIn−A)=∣λ−a11−a12⋯−a1n−a21λ−a22⋯−a2n⋮⋮⋮−an1−an2⋯λ−ann∣p_A(\lambda)=\det(\lambda I_n-A)=\begin{vmatrix} \lambda-a_{11} & -a_{12} & \cdots & -a_{1n} \\ -a_{21} & \lambda-a_{22} & \cdots & -a_{2n} \\ \vdots & \vdots & & \vdots \\ -a_{n1} & -a_{n2} & \cdots & \lambda-a_{nn} \\ \end{vmatrix}

Here InI_n is an n×nn\times n identity matrix. Some sources define it as pA(λ)=det⁡(A−λIn)p_A(\lambda)=\det(A-\lambda I_n), which differs from our definition only by the sign (−1)n(-1)^n. With our definition, pA(λ)p_A(\lambda) is always monic, whereas the other definition is monic only when nn is even. Note that the determinant of a 0×00\times 0 matrix is well-defined as 11.

The nonzero solution vector of (λ0I−A)X=0(\lambda_0 I-A)X=0, denoted by XX, is called an eigenvector of AA belonging to λ0\lambda_0.

The linear transformation TT has eigenvalue λ0\lambda_0 if and only if matrix AA has eigenvalue λ0\lambda_0.

The linear transformation TT has eigenvector ξ\xi if and only if matrix AA has eigenvector XX, where:

ξ=(α1,⋯ ,αn)X\xi=(\alpha_1,\cdots,\alpha_n)X

By the fundamental theorem of algebra, the characteristic polynomial can be factored as:

f(λ)=∣λI−A∣=(λ−λ1)d1⋯(λ−λm)dmf(\lambda)=|\lambda I-A|={(\lambda-\lambda_1)}^{d_1}\cdots{(\lambda-\lambda_m)}^{d_m}

The did_i are called the algebraic multiplicity of the eigenvalue λi\lambda_i. The sum of all algebraic multiplicities is the dimension nn of the space.

Finding All Eigenvalues and Eigenvectors of a Matrix

The process consists of the following steps:

  • Compute the determinant ∣λI−A∣|\lambda I-A|.
  • Find all roots of the polynomial f(λ)=∣λI−A∣f(\lambda)=|\lambda I-A| in the field FF; these are the eigenvalues of AA.
  • For each eigenvalue of AA, denoted by λ\lambda, solve the homogeneous linear system (λI−A)X=0(\lambda I-A)X=0 and find a fundamental solution system X1,⋯ ,XtX_1,\cdots,X_t. Then all eigenvectors of AA belonging to λ\lambda are:
k1X1+k2X2+⋯+ktXtk_1X_1+k_2X_2+\cdots+k_tX_t

The kik_i in this expression are not all zero.

  • The eigenvectors of the linear transformation TT belonging to λ\lambda are:
ξi=(α1,⋯ ,αn)Xi\xi_i=(\alpha_1,\cdots,\alpha_n)X_i

Therefore, all eigenvectors belonging to λ\lambda are:

k1ξ1+k2ξ2+⋯+ktξtk_1\xi_1+k_2\xi_2+\cdots+k_t\xi_t

The kik_i in this expression are not all zero.

Whether eigenvalues and eigenvectors exist depends on the field containing VV.

Similarity Transformation

Introduction

If an n×nn\times n matrix AA is an upper-triangular matrix of the form

A=[a1,1a1,2⋯a1,na2,2⋯a2,n⋱⋮an,n]A= \begin{bmatrix} a_{1,1}&a_{1,2}&\cdots &a_{1,n}\\ &a_{2,2}&\cdots &a_{2,n}\\ &&\ddots &\vdots \\ &&&a_{n,n} \end{bmatrix}

then

pA(x)=det⁡(xIn−A)=[x−a1,1−a1,2⋯−a1,nx−a2,2⋯−a2,n⋱⋮x−an,n]=∏i=1n(x−ai,i)\begin{aligned} p_A(x)&=\det(xI_n-A)\\ &= \begin{bmatrix} x-a_{1,1}&-a_{1,2}&\cdots &-a_{1,n}\\ &x-a_{2,2}&\cdots &-a_{2,n}\\ &&\ddots &\vdots \\ &&&x-a_{n,n} \end{bmatrix} \\ &=\prod_{i=1}^n(x-a_{i,i}) \end{aligned}

The characteristic polynomial of a lower-triangular matrix can be obtained similarly. If AA is neither of these two types, a similarity transformation is needed to put the matrix into a form whose characteristic polynomial is easier to compute.

Definition

For n×nn\times n matrices AA and BB, if there exists an invertible n×nn\times n matrix PP satisfying

B=P−1APB=P^{-1}AP

then matrices AA and BB are similar, and the transformation A↦P−1APA\mapsto P^{-1}AP is called a similarity transformation. The matrices AA and P−1APP^{-1}AP have the same characteristic polynomial.

Consider

det⁡(xIn−P−1AP)=det⁡(xP−1InP−P−1AP)=det⁡(P−1xInP−P−1AP)=det⁡(P−1)⋅det⁡(P)⋅det⁡(xIn−A)=det⁡(xIn−A)=pA(x)\begin{aligned} \det(xI_n-P^{-1}AP)&=\det(xP^{-1}I_nP-P^{-1}AP)\\ &=\det(P^{-1}xI_nP-P^{-1}AP)\\ &=\det(P^{-1})\cdot \det(P)\cdot \det(xI_n-A)\\ &=\det(xI_n-A)\\ &=p_A(x) \end{aligned}

This proves the claim; the case of A↦PAP−1A\mapsto PAP^{-1} is the same. Also, pA(0)=(−1)n⋅det⁡(A)p_A(0)=(-1)^n\cdot \det(A), because pA(0)=det⁡(−1⋅InA)=det⁡(−1⋅In)⋅det⁡(A)p_A(0)=\det(-1\cdot I_nA)=\det(-1\cdot I_n)\cdot \det(A), so det⁡(A)=det⁡(P−1AP)\det(A)=\det(P^{-1}AP).

Theorem: Similar matrices have the same characteristic polynomial and eigenvalues, but the converse is not true.

The theorem shows that the characteristic polynomial of the matrix of a linear transformation is independent of the choice of basis and is determined directly by the linear transformation. It can therefore be called the characteristic polynomial of the linear transformation.

The characteristic polynomial of matrix AA, namely f(λ)=∣λI−A∣f(\lambda)=|\lambda I-A|, is a monic polynomial. By Vieta's formulas, its coefficient of degree n−1n-1 is:

−(λ1+⋯+λn)=−(a11+⋯+ann)=−trA-(\lambda_1+\cdots+\lambda_n)=-(a_{11}+\cdots+a_{nn})=-tr A

Here trAtr A is called the trace of AA and is the sum of the entries on the main diagonal of AA.

By Vieta's formulas, the constant term of the characteristic polynomial is:

(−1)n∣A∣=(−1)n(λ1⋯λn){(-1)}^n|A|={(-1)}^n(\lambda_1\cdots\lambda_n)

Theorem: Similar matrices have the same trace.

Sylvester's Determinant Identity

Theorem: Whether or not matrices AA and BB are square, as long as their product is defined, the trace of ABAB equals the trace of BABA.

One proof is by direct expansion. Another proof uses Sylvester's determinant identity.

Theorem: Let AA be an mm-by-nn matrix and BB an nn-by-mm matrix. Then:

λn∣λIm−AB∣=λm∣λIn−BA∣\lambda^n|\lambda I_m-AB|=\lambda^m|\lambda I_n-BA|

This formula shows that ABAB and BABA have the same nonzero eigenvalues.

Schur's Lemma

Every nn-th order matrix AA is similar to an upper-triangular matrix. In other words, there exists a full-rank matrix PP such that P−1APP^{-1}AP is upper triangular, with all eigenvalues of AA on its main diagonal.

Corollary: Let AA have nn eigenvalues λ1,⋯ ,λn\lambda_1,\cdots,\lambda_n, and let ϕ(x)\phi(x) be any polynomial. Then the matrix polynomial ϕ(A)\phi(A) has the nn eigenvalues:

ϕ(λ1),⋯ ,ϕ(λn)\phi(\lambda_1),\cdots,\phi(\lambda_n)

In particular, the eigenvalues of kAkA are kλ1,⋯ ,kλnk\lambda_1,\cdots,k\lambda_n, and those of AmA^m are λ1m,⋯ ,λnm{\lambda_1}^m,\cdots,{\lambda_n}^m.

Similarity Transformations Using Gaussian Elimination

Gaussian elimination can be performed on an n×nn\times n matrix BB using elementary row operations.

After applying the above operations to a matrix (left-multiplying by elementary matrices), right-multiplying by the inverse elementary matrix gives a similarity transformation. The left multiplication is a row operation, and the right multiplication is correspondingly a column operation.

If a matrix can be transformed into upper- or lower-triangular form by similarity transformations, its characteristic polynomial can be obtained easily. However, applying A↦Tij(k)ATij(−k)A\mapsto T_{ij}(k)AT_{ij}(-k) to an element on the main diagonal may cause the following operation to restore a previously eliminated zero: first apply A↦Tij(k)AA\mapsto T_{ij}(k)A to eliminate the element in row ii, column jj, then right-multiply by Tij(−k)T_{ij}(-k), which adds the AA-column indexed by ii multiplied by −k-k to column jj. Thus the matrix may fail to become upper or lower triangular.

The following section shows that applying transformations to elements on the subdiagonal still produces a matrix whose characteristic polynomial can be computed easily.

Upper Hessenberg Matrix

For n>2n\gt 2, a matrix of the form

H=[α1h12……h1nβ2α2h23…⋮⋱⋱⋱⋮⋱⋱h(n−1)nβnαn]H= \begin{bmatrix} \alpha_{1}&h_{12}&\dots&\dots&h_{1n}\\ \beta_{2}&\alpha_{2}&h_{23}&\dots &\vdots \\ &\ddots &\ddots & \ddots &\vdots \\ & &\ddots &\ddots & h_{(n-1)n}\\ &&& \beta_{n}& \alpha_{n} \end{bmatrix}

is called an upper Hessenberg matrix, where β\beta is the subdiagonal.

We can obtain an upper Hessenberg matrix by using similarity transformations to eliminate all elements below the subdiagonal. The characteristic polynomial of an n×nn\times n upper Hessenberg matrix can then be computed in O(n3)O(n^3) time.

Let HiH_i be the matrix obtained from HH by retaining only its first ii rows and first ii columns, and let pi(x)=det⁡(xIi−Hi)p_i(x)=\det(xI_i-H_i). Then

H0=[],p0(x)=1H_0= \begin{bmatrix} \end{bmatrix},\quad p_0(x)=1 H1=[α1],p1(x)=det⁡(xI1−H1)=x−α1H_1= \begin{bmatrix} \alpha_1 \end{bmatrix},\quad p_1(x)=\det(x I_1-H_1)=x -\alpha_1 H2=[α1h12β2α2],p2(x)=det⁡(xI2−H2)=(x−α2)p1(x)−β2h12p0(x)H_2= \begin{bmatrix} \alpha_1&h_{12}\\ \beta_2&\alpha_2 \end{bmatrix},\quad p_2(x)=\det(xI_2-H_2)=(x-\alpha_2)p_1(x)-\beta_2h_{12}p_0(x)

When computing a determinant, we usually expand along a row or column with as many zeros as possible. The corresponding minor is the matrix obtained by deleting the row and column containing the selected element. Here we expand along the last row:

p3(x)=det⁡(xI3−H3)=∣x−α1−h12−h13−β2x−α2−h23−β3x−α3∣=(x−α3)⋅(−1)3+3p2(x)−β3⋅(−1)3+2∣x−α1−h13−β2−h23∣=(x−α3)p2(x)−β3(h23p1(x)+β2h13p0(x))\begin{aligned} p_3(x)&= \det(xI_3-H_3)\\ &=\begin{vmatrix} x-\alpha_1&-h_{12}&-h_{13}\\ -\beta_2&x-\alpha_2&-h_{23}\\ &-\beta_3&x-\alpha_3 \end{vmatrix}\\ &=(x-\alpha_3)\cdot (-1)^{3+3}p_2(x)-\beta_3\cdot (-1)^{3+2} \begin{vmatrix} x-\alpha_1&-h_{13}\\ -\beta_2&-h_{23} \end{vmatrix}\\ &=(x-\alpha_3)p_2(x)-\beta_3(h_{23}p_1(x)+\beta_2h_{13}p_0(x)) \end{aligned}

Observing the pattern and generalizing, for 2≤i≤n2\leq i\leq n we have

pi(x)=(x−αi)pi−1(x)−∑m=1i−1hi−m,i(∏j=i−m+1iβj)pi−m−1(x)p_i(x)=(x-\alpha_i)p_{i-1}(x)- \sum_{m=1}^{i-1}h_{i-m,i} \left( \prod_{j=i-m+1}^{i}\beta_j \right) p_{i-m-1}(x)

This completes the algorithm, which is generally called the Hessenberg algorithm.

Cayley–Hamilton Theorem

For any nn-th order matrix AA with characteristic polynomial f(λ)=∣λI−A∣f(\lambda)=|\lambda I-A|, we have f(A)=0f(A)=0.

There is a corresponding result for a linear transformation TT: if f(λ)f(\lambda) is the characteristic polynomial of TT, then f(T)f(T) is the zero transformation.

This theorem implies that every matrix AA has a polynomial that annihilates it.

Minimal Polynomial

Let VV be an nn-dimensional vector space. Since the matrix corresponding to a linear transformation has n2n^2 entries, all linear transformations form an n2n^2-dimensional vector space.

For a particular linear transformation TT, the transformations obtained by applying it from 00 through nn times give n2+1n^2+1 linear transformations in total, and their corresponding matrices must be linearly dependent. Therefore, there is a nonzero polynomial ff such that f(T)f(T) is the zero transformation; we say that transformation TT satisfies polynomial ff. Among all polynomials satisfied by TT, one denoted by ff has minimum degree.

The monic polynomial of minimum degree that annihilates matrix AA is called the minimal polynomial of AA, denoted by mA(λ)m_A(\lambda).

By the Euclidean algorithm for polynomials, the minimal polynomial is unique and divides every polynomial that annihilates AA. In particular, the minimal polynomial divides the characteristic polynomial.

Theorem: Ignoring multiplicities, matrix AA's characteristic polynomial f(λ)f(\lambda) and minimal polynomial mA(λ)m_A(\lambda) have the same roots.

Theorem: Eigenvectors of matrix AA belonging to distinct eigenvalues are linearly independent.

Applications

In informatics, we usually consider matrices over (Z/mZ)n×n(\mathbb{Z}/m\mathbb{Z})^{n\times n}, with mm usually prime, so the similarity transformations above are straightforward. When mm is composite, we can use an approach similar to the Euclidean algorithm.

Implementation
#include <cassert>
#include <iostream>
#include <random>
#include <vector>

using Matrix = std::vector<std::vector<int>>;
using i64 = int64_t;

Matrix to_upper_Hessenberg(const Matrix &M, int mod) {
  Matrix H(M);
  int n = H.size();
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if ((H[i][j] %= mod) < 0) H[i][j] += mod;
    }
  }
  for (int i = 0; i < n - 1; ++i) {
    int pivot = i + 1;
    for (; pivot < n; ++pivot) {
      if (H[pivot][i] != 0) break;
    }
    if (pivot == n) continue;
    if (pivot != i + 1) {
      for (int j = i; j < n; ++j) std::swap(H[i + 1][j], H[pivot][j]);
      for (int j = 0; j < n; ++j) std::swap(H[j][i + 1], H[j][pivot]);
    }
    for (int j = i + 2; j < n; ++j) {
      for (;;) {
        if (H[j][i] == 0) break;
        if (H[i + 1][i] == 0) {
          for (int k = i; k < n; ++k) std::swap(H[i + 1][k], H[j][k]);
          for (int k = 0; k < n; ++k) std::swap(H[k][i + 1], H[k][j]);
          break;
        }
        if (H[j][i] >= H[i + 1][i]) {
          int q = H[j][i] / H[i + 1][i], mq = mod - q;
          for (int k = i; k < n; ++k)
            H[j][k] = (H[j][k] + i64(mq) * H[i + 1][k]) % mod;
          for (int k = 0; k < n; ++k)
            H[k][i + 1] = (H[k][i + 1] + i64(q) * H[k][j]) % mod;
        } else {
          int q = H[i + 1][i] / H[j][i], mq = mod - q;
          for (int k = i; k < n; ++k)
            H[i + 1][k] = (H[i + 1][k] + i64(mq) * H[j][k]) % mod;
          for (int k = 0; k < n; ++k)
            H[k][j] = (H[k][j] + i64(q) * H[k][i + 1]) % mod;
        }
      }
    }
  }
  return H;
}

std::vector<int> get_charpoly(const Matrix &M, int mod) {
  Matrix H(to_upper_Hessenberg(M, mod));
  int n = H.size();
  std::vector<std::vector<int>> p(n + 1);
  p[0] = {1 % mod};
  for (int i = 1; i <= n; ++i) {
    const std::vector<int> &pi_1 = p[i - 1];
    std::vector<int> &pi = p[i];
    pi.resize(i + 1, 0);
    int v = mod - H[i - 1][i - 1];
    if (v == mod) v -= mod;
    for (int j = 0; j < i; ++j) {
      pi[j] = (pi[j] + i64(v) * pi_1[j]) % mod;
      if ((pi[j + 1] += pi_1[j]) >= mod) pi[j + 1] -= mod;
    }
    int t = 1;
    for (int j = 1; j < i; ++j) {
      t = i64(t) * H[i - j][i - j - 1] % mod;
      int prod = i64(t) * H[i - j - 1][i - 1] % mod;
      if (prod == 0) continue;
      prod = mod - prod;
      for (int k = 0; k <= i - j - 1; ++k)
        pi[k] = (pi[k] + i64(prod) * p[i - j - 1][k]) % mod;
    }
  }
  return p[n];
}

bool verify(const Matrix &M, const std::vector<int> &charpoly, int mod) {
  if (mod == 1) return true;
  int n = M.size();
  std::vector<int> randvec(n), sum(n, 0);
  std::mt19937 gen(std::random_device{}());
  std::uniform_int_distribution<int> dis(1, mod - 1);
  for (int i = 0; i < n; ++i) randvec[i] = dis(gen);
  for (int i = 0; i <= n; ++i) {
    int v = charpoly[i];
    for (int j = 0; j < n; ++j) sum[j] = (sum[j] + i64(v) * randvec[j]) % mod;
    std::vector<int> prod(n, 0);
    for (int j = 0; j < n; ++j) {
      for (int k = 0; k < n; ++k) {
        prod[j] = (prod[j] + i64(M[j][k]) * randvec[k]) % mod;
      }
    }
    randvec.swap(prod);
  }
  for (int i = 0; i < n; ++i)
    if (sum[i] != 0) return false;
  return true;
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n, mod;
  std::cin >> n >> mod;
  Matrix M(n, std::vector<int>(n));
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) std::cin >> M[i][j];
  std::vector<int> charpoly(get_charpoly(M, mod));
  for (int i = 0; i <= n; ++i) std::cout << charpoly[i] << ' ';
  assert(verify(M, charpoly, mod));
  return 0;
}

The Hessenberg algorithm above is not numerically stable, so matrices over Rn×n\mathbb{R}^{n\times n} need to be preprocessed with another algorithm or handled with a different numerically stable algorithm.

The characteristic polynomial can be connected with constant-coefficient homogeneous linear recurrences. Together with the Cayley–Hamilton theorem and polynomial modular reduction, it can also accelerate algorithms for computing matrix powers over some fields.

The Cayley–Hamilton theorem states

pA(A)=An+c1An−1+⋯+cn−1A+cnI=O\begin{aligned} p_A(A)&=A^n+c_1A^{n-1}+\cdots +c_{n-1}A+c_nI\\ &=O \end{aligned}

Here OO is the n×nn\times n zero matrix, A∈Cn×nA\in\mathbb{C}^{n\times n}, and pA(x)=xn+∑i=1ncixn−i∈C[x]p_A(x)=x^n+\sum_{i=1}^nc_ix^{n-i}\in\mathbb{C}[x] is the characteristic polynomial of AA.

If we need AKA^K for a large KK, we can first compute f(x)=xK mod pA(x)f(x)=x^K\bmod{p_A(x)} and then use f(A)=AKf(A)=A^K.

Clearly, deg⁡(f(x))<n\deg(f(x))\lt n. Let f(x)=∑i=0n−1fixif(x)=\sum_{i=0}^{n-1}f_ix^i and n=kmn=km. Then

fkm−1xkm−1+⋯+f1x+f0=(⋯(fkm−1xk−1+⋯+fk(m−1))xk+fk(m−1)−1xk−1+⋯+fk(m−2))xk+⋯+fk−1xk−1+⋯+f1x+f0\begin{aligned} f_{km-1}x^{km-1}+\cdots +f_1x+f_0&=(\cdots (f_{km-1}x^{k-1}+\cdots +f_{k(m-1)})x^k\\ &+f_{k(m-1)-1}x^{k-1}+\cdots +f_{k(m-2)})x^k\\ &+\cdots\\ &+f_{k-1}x^{k-1}+\cdots +f_1x+f_0 \end{aligned}

Taking k=nk=\sqrt{n}, we see that computing f(A)f(A) requires approximately O(n)O(\sqrt{n}) matrix-matrix multiplications.

References

This content comes from OI Wiki: Characteristic Polynomial. See the original for authors and revision history. AIOJ has adapted the formatting, in-site links, and resource paths.

Content is shared under CC BY-SA 4.0 and SATA license; additional terms are governed by the original notice. Thanks to the OI Wiki authors and contributors; per the SATA terms, please visit the OI Wiki repository and star it to show your support.