# Gershgorin circle theorem

In mathematics, the Gershgorin circle theorem may be used to bound the spectrum of a square matrix. It was first published by the Soviet mathematician Semyon Aronovich Gershgorin in 1931. Gershgorin's name has been transliterated in several different ways, including Geršgorin, Gerschgorin, Gershgorin, Hershhorn, and Hirschhorn.

## Statement and proof

Let $A$ be a complex $n\times n$ matrix, with entries $a_{ij}$. For $i\in \{1,\dots ,n\}$ let $R_{i}$ be the sum of the absolute values of the non-diagonal entries in the $i$-th row:
    $R_{i}=\sum _{j\neq {i}}\left|a_{ij}\right|.$
Let $D(a_{ii},R_{i})\subseteq \mathbb {C}$ be a closed disc centered at $a_{ii}$ with radius $R_{i}$. Such a disc is called a Gershgorin disc.
    Theorem. Every eigenvalue of $A$ lies within at least one of the Gershgorin discs $D(a_{ii},R_{i}).$
Proof. Let $\lambda$ be an eigenvalue of $A$ with corresponding eigenvector $x=(x_{j})$. Find i such that the element of x with the largest absolute value is $x_{i}$. Since $Ax=\lambda x$, in particular we take the ith component of that equation to get:
    $\sum _{j}a_{ij}x_{j}=\lambda x_{i}.$
Taking $a_{ii}$ to the other side:
    $\sum _{j\neq i}a_{ij}x_{j}=(\lambda -a_{ii})x_{i}.$
Therefore, applying the triangle inequality and recalling that ${\frac {\left|x_{j}\right|}{\left|x_{i}\right|}}\leq 1$ based on how we picked i,
    $\left|\lambda -a_{ii}\right|=\left|\sum _{j\neq i}{\frac {a_{ij}x_{j}}{x_{i}}}\right|\leq \sum _{j\neq i}\left|{\frac {a_{ij}x_{j}}{x_{i}}}\right|=\sum _{j\neq i}\left|a_{ij}\right|{\frac {\left|x_{j}\right|}{\left|x_{i}\right|}}\leq \sum _{j\neq i}\left|a_{ij}\right|=R_{i}.$
    Corollary. The eigenvalues of A must also lie within the Gershgorin discs C$_j$ corresponding to the columns of A.
Proof. Apply the Theorem to A$^T$ while recognizing that the eigenvalues of the transpose are the same as those of the original matrix.
Example. For a diagonal matrix, the Gershgorin discs coincide with the spectrum. Conversely, if the Gershgorin discs coincide with the spectrum, the matrix is diagonal.

## Discussion

One way to interpret this theorem is that if the off-diagonal entries of a square matrix over the complex numbers have small norms, the eigenvalues of the matrix cannot be "far from" the diagonal entries of the matrix. Therefore, by reducing the norms of off-diagonal entries one can attempt to approximate the eigenvalues of the matrix. Of course, diagonal entries may change in the process of minimizing off-diagonal entries.
The theorem does not claim that there is one disc for each eigenvalue; if anything, the discs rather correspond to the axes in $\mathbb {C} ^{n}$, and each expresses a bound on precisely those eigenvalues whose eigenspaces are closest to one particular axis. In the matrix
    ${\begin{pmatrix}3&2&2\\1&1&0\\1&0&1\end{pmatrix}}{\begin{pmatrix}a&0&0\\0&b&0\\0&0&c\end{pmatrix}}{\begin{pmatrix}3&2&2\\1&1&0\\1&0&1\end{pmatrix}}^{-1}={\begin{pmatrix}-3a+2b+2c&6a-2b-4c&6a-4b-2c\\b-a&a+(a-b)&2(a-b)\\c-a&2(a-c)&a+(a-c)\end{pmatrix}}$
— which by construction has eigenvalues $a$, $b$, and $c$ with eigenvectors $\left({\begin{smallmatrix}3\\1\\1\end{smallmatrix}}\right)$, $\left({\begin{smallmatrix}2\\1\\0\end{smallmatrix}}\right)$, and $\left({\begin{smallmatrix}2\\0\\1\end{smallmatrix}}\right)$ — it is easy to see that the disc for row 2 covers $a$ and $b$ while the disc for row 3 covers $a$ and $c$. This is however just a happy coincidence; if working through the steps of the proof one finds that it in each eigenvector is the first element that is the largest (every eigenspace is closer to the first axis than to any other axis), so the theorem only promises that the disc for row 1 (whose radius can be twice the sum of the other two radii) covers all three eigenvalues.

## Strengthening of the theorem

If one of the discs is disjoint from the others then it contains exactly one eigenvalue. If however it meets another disc it is possible that it contains no eigenvalue (for example, $A=\left({\begin{smallmatrix}0&1\\4&0\end{smallmatrix}}\right)$ or $A=\left({\begin{smallmatrix}1&-2\\1&-1\end{smallmatrix}}\right)$). In the general case the theorem can be strengthened as follows:
Theorem: If the union of k discs is disjoint from the union of the other n − k discs then the former union contains exactly k and the latter n − k eigenvalues of A, when the eigenvalues are counted with their algebraic multiplicities.
Proof: Let D be the diagonal matrix with entries equal to the diagonal entries of A and let
    $B(t)=(1-t)D+tA.$
We will use the fact that the eigenvalues are continuous in $t$, and show that if any eigenvalue moves from one of the unions to the other, then it must be outside all the discs for some $t$, which is a contradiction.
The statement is true for $D=B(0)$. The diagonal entries of $B(t)$ are equal to that of A, thus the centers of the Gershgorin circles are the same, however their radii are t times that of A. Therefore, the union of the corresponding k discs of $B(t)$ is disjoint from the union of the remaining n-k for all $t\in [0,1]$. The discs are closed, so the distance of the two unions for A is $d>0$. The distance for $B(t)$ is a decreasing function of t, so it is always at least d. Since the eigenvalues of $B(t)$ are a continuous function of t, for any eigenvalue $\lambda (t)$ of $B(t)$ in the union of the k discs its distance $d(t)$ from the union of the other n-k discs is also continuous. Obviously $d(0)\geq d$, and assume $\lambda (1)$ lies in the union of the n-k discs. Then $d(1)=0$, so there exists $0<t_{0}<1$ such that $0<d(t_{0})<d$. But this means $\lambda (t_{0})$ lies outside the Gershgorin discs, which is impossible. Therefore $\lambda (1)$ lies in the union of the k discs, and the theorem is proven.
Remarks: It is necessary to count the eigenvalues with respect to their algebraic multiplicities. Here is a counter-example :
Consider the matrix, ${\begin{bmatrix}5&1&0&0&0\\0&5&1&0&0\\0&0&5&0&0\\0&0&0&1&1\\0&0&0&0&1\end{bmatrix}}$
The union of the first 3 disks does not intersect the last 2, but the matrix has only 2 eigenvectors, e1,e4, and therefore only 2 eigenvalues, demonstrating that theorem is false in its formulation. The demonstration of the shows only that eigenvalues are distinct, however any affirmation about number of them is something that does not fit, and this is a counterexample.
* The continuity of $\lambda (t)$ should be understood in the sense of topology. It is sufficient to show that the roots (as a point in space $\mathbb {C} ^{n}$) is continuous function of its coefficients. Note that the inverse map that maps roots to coefficients is described by Vieta's formulas (note for characteristic polynomials that $a_{n}\equiv 1$), which can be proved an open map. This proves the roots as a whole is a continuous function of its coefficients. Since composition of continuous functions is again continuous, the $\lambda (t)$ as a composition of roots solver and $B(t)$ is also continuous.
* Individual eigenvalue $\lambda (t)$ could merge with other eigenvalue(s) or appeared from a splitting of previous eigenvalue. This may confuse people and questioning the concept of continuous. However, when viewing from the space of eigenvalue set $\mathbb {C} ^{n}$, the trajectory is still a continuous curve although not necessarily smooth everywhere.
Added Remark:
* The proof given above is arguably (in)correct...... There are two types of continuity concerning eigenvalues: (1) each individual eigenvalue is a usual continuous function (such a representation does exist on a real interval but may not exist on a complex domain), (2) eigenvalues are continuous as a whole in the topological sense (a mapping from the matrix space with metric induced by a norm to unordered tuples, i.e., the quotient space of C^n under permutation equivalence with induced metric). Whichever continuity is used in a proof of the Gerschgorin disk theorem, it should be justified that the sum of algebraic multiplicities of eigenvalues remains unchanged on each connected region. A proof using the argument principle of complex analysis requires no eigenvalue continuity of any kind. For a brief discussion and clarification, see.

## Application

The Gershgorin circle theorem is useful in solving matrix equations of the form Ax = b for x where b is a vector and A is a matrix with a large condition number.
In this kind of problem, the error in the final result is usually of the same order of magnitude as the error in the initial data multiplied by the condition number of A. For instance, if b is known to six decimal places and the condition number of A is 1000 then we can only be confident that x is accurate to three decimal places. For very high condition numbers, even very small errors due to rounding can be magnified to such an extent that the result is meaningless.
It would be good to reduce the condition number of A. This can be done by preconditioning: A matrix P such that P ≈ A$^{−1}$ is constructed, and then the equation PAx = Pb is solved for x. Using the exact inverse of A would be nice but finding the inverse of a matrix is something we want to avoid because of the computational expense.
Now, since PA ≈ I where I is the identity matrix, the eigenvalues of PA should all be close to 1. By the Gershgorin circle theorem, every eigenvalue of PA lies within a known area and so we can form a rough estimate of how good our choice of P was.

## Example

Use the Gershgorin circle theorem to estimate the eigenvalues of:
    $A={\begin{bmatrix}10&1&0&1\\0.2&8&0.2&0.2\\1&1&2&1\\-1&-1&-1&-11\\\end{bmatrix}}.$
Starting with row one, we take the element on the diagonal, a$_{ii}$ as the center for the disc. We then take the remaining elements in the row and apply the formula
    $\sum _{j\neq i}|a_{ij}|=R_{i}$
to obtain the following four discs:
    $D(10,2),\;D(8,0.6),\;D(2,3),\;{\text{and}}\;D(-11,3).$
Note that we can improve the accuracy of the last two discs by applying the formula to the corresponding columns of the matrix, obtaining $D(2,1.2)$ and $D(-11,2.2)$.
The eigenvalues are -10.870, 1.906, 10.046, 7.918. Note that this is a (column) diagonally dominant matrix: |a$_{ii}$|>∑$_{j≠i}$|a$_{ji}$|{\textstyle |a_{ii}|>\sum _{j\neq i}|a_{ji}|}. This means that most of the matrix is in the diagonal, which explains why the eigenvalues are so close to the centers of the circles, and the estimates are very good. For a random matrix, we would expect the eigenvalues to be substantially further from the centers of the circles.