# The spectral theorem for Hermitian matrices

A spectral theorem is a theorem about the diagonalization of a matrix or linear operator. A matrix is diagonalizable if it can be written in the form $MDM_{−1}$ where $D$ is a diagonal matrix. In this article, I will explain what a Hermitian matrix is, derive some properties, and use them to prove a spectral theorem for Hermitian matrices.

In the rest of the article, I will use the usual inner product on the complex vector space $C_{n}$:

$⟨u,v⟩=u_{⊤}v=k=1∑n u_{k}v_{k} $and the corresponding norm:

$∣∣z∣∣=⟨z,z⟩ =k=1∑n z_{k}z_{k} $We will often use that the inner product is linear in its first argument, and conjugate linear in its second:

$⟨λu,v⟩=λ⟨u,v⟩$ $⟨u,λv⟩=λ⟨u,v⟩$Here, $z$ denotes the *complex conjugate*, which is defined by $x+iy =x−iy$ for real $x,y∈R$. These are straightforward generalizations of the normal Euclidian inner product and norm on real vector spaces. In particular, this inner product equals the ‘normal’ inner product for real vectors.

## Hermitian operators

Now, we are ready to define Hermitian operators:

**Definition**: *A Hermitian or self-adjoint operator $A$ on a space $X$ with an inner product $⟨⋅,⋅⟩:X×X→R$ is an operator for which*

*for all $x,y∈X$*

By this definition, symmetric matrices with real elements are Hermitian. However, for matrices with complex elements, the condition is slightly different due to the complex conjugation in the second argument of the inner product.

The *conjugate transpose* $A_{∗}$ of a complex matrix $A$ is defined by $A_{∗}=A_{⊤}$.

**Theorem**: *A matrix $A$ with complex elements is Hermitian if and only if*

**Proof**: We have $⟨Ax,y⟩=x_{⊤}A_{⊤}y $ and $⟨x,Ay⟩=x_{⊤}Ay $, so $⟨Ax,y⟩=⟨x,Ay⟩⟺x_{⊤}A_{⊤}y =x_{⊤}Ay $. This equality can only hold for all $x,y∈X$ if $A_{⊤}=A$. Taking transposes from both sides, we see that this holds if and only if $A=A_{∗}$. $□$

I want to emphasize that Hermicity can be seen as a generalization of symmetry: We have $A=A$ if $A$ is a matrix with real elements, so every symmetric matrix with real elements is Hermitian.

## The spectral theorem for Hermitian matrices

Hermitian matrices have some pleasing properties, which can be used to prove a spectral theorem.

**Lemma**: *The eigenvectors of a Hermitian matrix $A∈C_{n×n}$ have real eigenvalues.*

**Proof**: Let $v$ be an eigenvector with eigenvalue $λ$. Then $λ⟨v,v⟩=⟨λv,v⟩=⟨Av,v⟩=⟨v,Av⟩=⟨v,λv⟩=λ⟨v,v⟩$. It follows that $λ=λ$, so $λ$ must be real. $□$

Recall that two vectors $x$ and $y$ are **orthogonal** if their inner product is zero, that is, $⟨x,y⟩=0$, that a set of vectors $V$ is orthogonal if every pair $v_{1},v_{2}$ with $v_{1}=v_{2}$ is orthogonal, and that it is orthonormal if it is orthogonal and every vector $v∈V$ has unit norm, that is, $∣∣v∣∣=1$.

We will need some lemmas to prove the main result later on. The first is a simple result that states that vectors orthogonal to eigenvectors stay orthogonal when multiplied by $A$.

**Lemma**: *If $x$ is orthogonal to an eigenvector $v$ of a Hermitian matrix $A$, then $Ax$ is orthogonal to $v$ as well.*

**Proof**: Suppose that $λ$ is the eigenvalue associated to $v$. Then $⟨Ax,v⟩=⟨x,Av⟩=⟨x,λv⟩=λ⟨x,v⟩=0$. So $⟨Ax,v⟩=0$, which means that $Ax$ and $v$ are orthogonal. $□$

The second lemma is about the behavior of matrices with orthogonal rows.

**Lemma**: *Let $U∈C_{m×n}$ be a matrix with $m≤n$ orthonormal rows $u_{1},u_{2},...,u_{m}$, and $S$ be the space spanned by these vectors. Then*

- $UU_{∗}=I_{m}$
- $U_{∗}Uv=v$ for all $v∈S$

**Proof**: Interpret the vectors $u_{1},u_{2},...,u_{m}$ as column vectors. Then the element at $i,j$ of $UU_{∗}$ is $u_{i}u_{j} =⟨u_{i},u_{j}⟩$. By the orthonormality of $u_{1},u_{2},...,u_{n}$ it follows that this expression is $1$ when $i=j$ (that is, the element is on the diagonal), and $0$ otherwise. So $UU_{∗}$ equals $I_{m}$, the identity matrix of size $m×m$.

For the second result, assume that $v∈S$. Then $v$ is a linear combination of the rows in $U$, or, equivalently, a linear combination of the columns of $U_{∗}$. So we can write $v=U_{∗}w$ for some $w∈C_{m}$. Then, using the first part of the lemma, we have:

$U_{∗}Uv=U_{∗}UU_{∗}w=U_{∗}I_{m}w=U_{∗}w=v$$□$

With these results we are finally ready to prove the existence of an orthogonal basis of eigenvectors.

**Theorem**: *A Hermitian matrix $A∈C_{n×n}$ has $n$ orthogonal eigenvectors.*

**Proof**: We use induction on the number of eigenvalues of $A∈C_{n×n}$. The characteristic equation $det(A−λI)=0$ is a complex polynomial equation of order $n$, and has a solution in $λ$. That implies that for this $λ$, $A−λ$ is singular, so there exists a $v$ such that $(A−λI)v=0$. This implies that $Av=λv$, so we have a set of one eigenvector $v$, which is orthogonal. This proves the base case.

For the induction step, assume the existence of $n−m$ (with $m<n$) orthogonal eigenvectors $v_{1},v_{2},...,v_{n−m}$. We then need to prove the existence of another eigenvector $v$, which is orthogonal to $v_{1},v_{2},...,v_{n−m}$. Let $u_{1},u_{2},...,u_{m}$ be an orthonormal basis of the space that is orthogonal to all the eigenvectors $v_{1},v_{2},...,v_{n−m}$, and $U$ be the matrix with $u_{1},u_{2},...,u_{m}$ as its rows. Now, $UAU_{∗}$ is Hermitian, so as we just proved for the base case, it must have at least one eigenvector $w$ with eigenvalue $λ$. So we have

$UAU_{∗}w=λw$Multiplying both sides by $U_{∗}$ on the left gives $U_{∗}UAv=λU_{∗}w$. Now define $v:=U_{∗}w$ and substitute to get

$U_{∗}UAv=λv$Now, since $v=U_{∗}w$ is a linear combination of the columns of $U_{∗}$, it is orthogonal to all the eigenvectors $v_{1},v_{2},...,v_{n−m}$. So, by the first lemma, $Av$ is also orthogonal to all these eigenvalues. This means that $Av$ is a linear combination of $u_{1},u_{2},...,u_{m}$ as well. By the second lemma, it follows that $U_{∗}UAv=Av$. So we are left with

$Av=λv$So $v$ is an eigenvector of $A$. Moreover, since $v=U_{∗}w$, $v$ is a linear combination of $u_{1},u_{2},...,u_{m}$, so it is orthogonal to the eigenvectors $v_{1},v_{2},...,v_{n−m}$. So this completes the induction step. $□$

Of course, it is now easy to make this basis orthonormal by scaling the vectors in the basis.

**Corollary**: *A Hermitian matrix $A$ has a basis of orthonormal eigenvectors.*

**Proof**: By the preceding theorem, there exists a basis of $n$ orthogonal eigenvectors of $A$. Denote this basis with $x_{1},x_{2},..,x_{n}$, and define $y_{k}=∣∣x_{k}∣∣x_{k} $. Now, $⟨y_{i},y_{j}⟩=∣∣x_{i}∣∣∣∣x_{j}∣∣⟨x_{i},x_{j}⟩ $, which is $0$ when $i=j$ and $1$ when $i=j$. So this basis is orthonormal.

**Definition**: *A unitary matrix $U$ is a matrix for which* $U_{−1}=U_{∗}$.

**Theorem (Spectral theorem for Hermitian matrices)**: *A Hermitian matrix $A∈C_{n×n}$ can be written as*

*where $U$ is a unitary matrix, and $Λ$ is a diagonal matrix with nonnegative elements.*

**Proof**: Let $u_{1},u_{2},...,u_{n}$ be an orthonormal basis of eigenvector, and $λ_{1},λ_{2},...,λ_{n}$ be the corresponding eigenvalues. Now, take $U$ to be the matrix with $u_{k}$ as the $k$th column, and $Λ$ to be the matrix with $λ_{k}$ as the $k$th element on the diagonal.

To prove that $U$ is unitary, consider the element at position $i,j$ of the matrix $UU_{∗}$. It is given by $⟨u_{i},u_{j}⟩$, which is $1$ when $i=j$ and $0$ otherwise. So the elements on the diagonal of $UU_{∗}$ are one and the others zero, which means that $UU_{∗}=I$. Furthermore, we have $U_{∗}U=(UU_{∗})_{∗}=I$. So $U_{−1}=U_{∗}$, and $U$ is unitary.

To prove that $A=UΛU_{∗}$, consider the effect of left multiplying an eigenvector by this expression:

$UΛU_{∗}v_{k}=UΛe_{k}=Uλ_{k}e_{k}=λ_{k}v_{k}=Av_{k}$Since $v_{1},v_{2},...,v_{n}$ is a basis of $C_{n}$, every vector $x∈C_{n}$ can be written as a linear combination of the vectors $v_{1},v_{2},...,v_{n}$. So we have $UΛU_{∗}x=Ax$ for every $x∈C_{n}$. It follows that $A=UΛU_{∗}$. $□$

With this, we finally proved the spectral theorem for Hermitian matrices. While the theorem itself is certainly interesting enough to prove, the proof has other benefits as well. First, there is a spectral theorem for unitary matrices as well, and the proof is analogous to this proof. Secondly, the spectral theorem for Hermitian matrices can be used to easily prove the existence of the singular value decomposition.