### Section SD Similarity and Diagonalization

This section's topic will perhaps seem out of place at first, but we will make the connection soon with eigenvalues and eigenvectors. This is also our first look at one of the central ideas of Chapter R.

#### Subsection SM Similar Matrices

The notion of matrices being “similar” is a lot like saying two matrices are row-equivalent. Two similar matrices are not equal, but they share many important properties. This section, and later sections in Chapter R will be devoted in part to discovering just what these common properties are.

First, the main definition for this section.

##### Definition SIM Similar Matrices

Suppose $A$ and $B$ are two square matrices of size $n$. Then $A$ and $B$ are *similar* if there exists a nonsingular matrix of size $n$, $S$, such that $A=\similar{B}{S}$.

We will say “$A$ is similar to $B$ via $S$” when we want to emphasize the role of $S$ in the relationship between $A$ and $B$. Also, it does not matter if we say $A$ is similar to $B$, or $B$ is similar to $A$. If one statement is true then so is the other, as can be seen by using $\inverse{S}$ in place of $S$ (see Theorem SER for the careful proof). Finally, we will refer to $\similar{B}{S}$ as a *similarity transformation* when we want to emphasize the way $S$ changes $B$. OK, enough about language, let us build a few examples.

##### Example SMS5 Similar matrices of size 5

Let us do that again.

##### Example SMS3 Similar matrices of size 3

#### Subsection PSM Properties of Similar Matrices

Similar matrices share many properties and it is these theorems that justify the choice of the word “similar.” First we will show that similarity is an *equivalence relation*. Equivalence relations are important in the study of various algebras and can always be regarded as a kind of weak version of equality. Sort of alike, but not quite equal. The notion of two matrices being row-equivalent is an example of an equivalence relation we have been working with since the beginning of the course (see Exercise RREF.T11). Row-equivalent matrices are not equal, but they are a lot alike. For example, row-equivalent matrices have the same rank. Formally, an equivalence relation requires three conditions hold: reflexive, symmetric and transitive. We will illustrate these as we prove that similarity is an equivalence relation.

##### Theorem SER Similarity is an Equivalence Relation

Suppose $A$, $B$ and $C$ are square matrices of size $n$. Then

- $A$ is similar to $A$. (Reflexive)
- If $A$ is similar to $B$, then $B$ is similar to $A$. (Symmetric)
- If $A$ is similar to $B$ and $B$ is similar to $C$, then $A$ is similar to $C$. (Transitive)

Here is another theorem that tells us exactly what sorts of properties similar matrices share.

##### Theorem SMEE Similar Matrices have Equal Eigenvalues

Suppose $A$ and $B$ are similar matrices. Then the characteristic polynomials of $A$ and $B$ are equal, that is, $\charpoly{A}{x}=\charpoly{B}{x}$.

So similar matrices not only have the same *set* of eigenvalues, the algebraic multiplicities of these eigenvalues will also be the same. However, be careful with this theorem. It is tempting to think the converse is true, and argue that if two matrices have the same eigenvalues, then they are similar. Not so, as the following example illustrates.

##### Example EENS Equal eigenvalues, not similar

##### Sage SM Similar Matrices

#### Subsection D Diagonalization

Good things happen when a matrix is similar to a diagonal matrix. For example, the eigenvalues of the matrix are the entries on the diagonal of the diagonal matrix. And it can be a much simpler matter to compute high powers of the matrix. Diagonalizable matrices are also of interest in more abstract settings. Here are the relevant definitions, then our main theorem for this section.

##### Definition DIM Diagonal Matrix

Suppose that $A$ is a square matrix. Then $A$ is a *diagonal matrix* if $\matrixentry{A}{ij}=0$ whenever $i\neq j$.

##### Definition DZM Diagonalizable Matrix

Suppose $A$ is a square matrix. Then $A$ is *diagonalizable* if $A$ is similar to a diagonal matrix.

##### Example DAB Diagonalization of Archetype B

Example SMS3 provides yet another example of a matrix that is subjected to a similarity transformation and the result is a diagonal matrix. Alright, just how would we find the magic matrix $S$ that can be used in a similarity transformation to produce a diagonal matrix? Before you read the statement of the next theorem, you might study the eigenvalues and eigenvectors of Archetype B and compute the eigenvalues and eigenvectors of the matrix in Example SMS3.

##### Theorem DC Diagonalization Characterization

Suppose $A$ is a square matrix of size $n$. Then $A$ is diagonalizable if and only if there exists a linearly independent set $S$ that contains $n$ eigenvectors of $A$.

Notice that the proof of Theorem DC is constructive. To diagonalize a matrix, we need only locate $n$ linearly independent eigenvectors. Then we can construct a nonsingular matrix using the eigenvectors as columns ($R$) so that $\inverse{R}AR$ is a diagonal matrix ($D$). The entries on the diagonal of $D$ will be the eigenvalues of the eigenvectors used to create $R$, *in the same order* as the eigenvectors appear in $R$. We illustrate this by *diagonalizing* some matrices.

##### Example DMS3 Diagonalizing a matrix of size 3

The dimension of an eigenspace can be no larger than the algebraic multiplicity of the eigenvalue by Theorem ME. When every eigenvalue's eigenspace is this large, then we can diagonalize the matrix, and only then. Three examples we have seen so far in this section, Example SMS5, Example DAB and Example DMS3, illustrate the diagonalization of a matrix, with varying degrees of detail about just how the diagonalization is achieved. However, in each case, you can verify that the geometric and algebraic multiplicities are equal for every eigenvalue. This is the substance of the next theorem.

##### Theorem DMFE Diagonalizable Matrices have Full Eigenspaces

Suppose $A$ is a square matrix. Then $A$ is diagonalizable if and only if $\geomult{A}{\lambda}=\algmult{A}{\lambda}$ for every eigenvalue $\lambda$ of $A$.

Example SEE, Example CAEHW, Example ESMS3, Example ESMS4, Example DEMS5, Archetype B, Archetype F, Archetype K and Archetype L are all examples of matrices that are diagonalizable and that illustrate Theorem DMFE. While we have provided many examples of matrices that are diagonalizable, especially among the archetypes, there are many matrices that are not diagonalizable. Here is one now.

##### Example NDMS4 A non-diagonalizable matrix of size 4

Archetype A is the lone archetype with a square matrix that is not diagonalizable, as the algebraic and geometric multiplicities of the eigenvalue $\lambda=0$ differ. Example HMEM5 is another example of a matrix that cannot be diagonalized due to the difference between the geometric and algebraic multiplicities of $\lambda=2$, as is Example CEMS6 which has two complex eigenvalues, each with differing multiplicities. Likewise, Example EMMS4 has an eigenvalue with different algebraic and geometric multiplicities and so cannot be diagonalized.

##### Sage MD Matrix Diagonalization

##### Theorem DED Distinct Eigenvalues implies Diagonalizable

Suppose $A$ is a square matrix of size $n$ with $n$ distinct eigenvalues. Then $A$ is diagonalizable.

##### Example DEHD Distinct eigenvalues, hence diagonalizable

Archetype B is another example of a matrix that has as many distinct eigenvalues as its size, and is hence diagonalizable by Theorem DED.

Powers of a diagonal matrix are easy to compute, and when a matrix is diagonalizable, it is almost as easy. We could state a theorem here perhaps, but we will settle instead for an example that makes the point just as well.

##### Example HPDM High power of a diagonalizable matrix

#### Subsection FS Fibonacci Sequences

##### Example FSCF Fibonacci sequence, closed form

We close this section with a comment about an important upcoming theorem that we prove in Chapter R. A consequence of Theorem OD is that every Hermitian matrix (Definition HM) is diagonalizable (Definition DZM), and the similarity transformation that accomplishes the diagonalization uses a unitary matrix (Definition UM). This means that for every Hermitian matrix of size $n$ there is a basis of $\complex{n}$ that is composed entirely of eigenvectors for the matrix and also forms an orthonormal set (Definition ONS). Notice that for matrices with only real entries, we only need the hypothesis that the matrix is symmetric (Definition SYM) to reach this conclusion (Example ESMS4). Can you imagine a prettier basis for use with a matrix? I cannot.

These results in Section OD explain much of our recurring interest in orthogonality, and make the section a high point in your study of linear algebra. A precise statement of this diagonalization result applies to a slightly broader class of matrices, known as “normal” matrices (Definition NRML), which are matrices that commute with their adjoints. With this expanded category of matrices, the result becomes an equivalence (Proof Technique E). See Theorem OD and Theorem OBNM in Section OD for all the details.