# The singular value decomposition

In this article, I will prove that every matrix has a *singular value decomposition*. The singular value decomposition has numerous applications. It can be used to compute the pseudoinverse of a matrix, to perform principal component analysis, and it can be used to approximate a matrix $M$ by a low-rank approximation $M~$.

**Theorem**: *Any matrix $M∈C_{m×n}$ of rank $r$ has a decomposition*
$M=UΣV_{∗}$

*where $U∈C_{m×r}$ and $V∈C_{n×r}$ are semi-unitary matrices, and $Σ∈R_{r×r}$ is a diagonal matrix with positive elements on the diagonal.*

**Proof**: If $m>n$, we can look at the singular value decomposition $M_{∗}=UΣV_{∗}$ of the conjugate transpose $M_{∗}$ of $M$. Using $M=(M_{∗})_{∗}=(UΣV_{∗})_{∗}=VΣU_{∗}$, we find the singular value decomposition of $M$. So we can assume $m≤n$ without loss of generality.

Now consider the $n×n$ matrix $M_{∗}M$, which is Hermitian. Using the spectral theorem for Hermitian matrices, we have $M_{∗}M=WΛW_{∗}$

where $W$ is a unitary matrix with $n$ orthonormal eigenvectors $v_{1},v_{2},...,v_{n}$ of $M_{∗}M$, and $Λ$ is a diagonal matrix, where the $k$th element $λ_{k}$ on the diagonal is the eigenvalue of $v_{k}$. According to the first lemma, all the $λ_{k}$ are nonnegative.

We can assume that $λ_{1}≥λ_{2}≥...≥λ_{n}$. If this is not the case, we can simply permute the columns of $V$ and $Σ$ so that this condition holds. Since all the eigenvectors are orthogonal, and the rank of $M_{∗}M$ is $r$ by the second lemma, the eigenvalues $λ_{1},λ_{2},...,λ_{r}$ are positive, and $λ_{r+1},λ_{r+2},λ_{n}$ are zero.

Now define $σ_{k}=λ_{k} $

$u_{k}=σ_{k}Av_{k} $

for $k=1,2,...,r$

Let $U∈C_{m×r}$ be the matrix with $u_{1},u_{2},...,u_{r}$, let $V∈C_{n×r}$ be the matrix with $v_{1},v_{2},...,v_{r}$ as columns, and let $Σ∈R_{r×r}$ be the diagonal matrix with $σ_{1},σ_{2},...,σ_{r}$ on the diagonal.

For $1≤k≤r$, we have that $V_{∗}v_{k}=e_{k}$. So $Mv_{k}=UΣV_{∗}v_{k}=Uσ_{k}e_{k}=σ_{k}Ue_{k}=σ_{k}u_{k}=Av_{k}$. On the other hand, if $r<k≤n$, we have $V_{∗}v_{k}=0$, so $UΣV_{∗}v_{k}=0$. It follows that $Mv_{k}=UΣV_{∗}v_{k}$ for $k=1,2,...,n$. Since the vectors $v_{1},v_{2},...,v_{n}$ are orthonormal, they form a basis basis of $C_{n}$. By linearity, it follows that $Mv=UΣVv$ for any $v∈C_{n}$. So we must have $M=UΣV_{∗}$

It remains to show that $Σ$ is a diagonal matrix with positive diagonal elements, and that $U$ and $V$ are semi-unitary. The first fact is obvious since we have defined $Σ$ to have the values $λ_{1} ,λ_{2} ,...λ_{r} $ on the diagonal.

To show that $U$ is semi-unitary we need to show that $U_{∗}U=I$. Consider that the elements $U_{∗}U$ are given by $u_{i}u_{j}=σ_{i}σ_{j}(Av_{i})_{∗}Av_{j} =σ_{i}σ_{j}v_{i}(A_{∗}Av_{j}) =λ_{j}σ_{i}σ_{j}⟨v_{i},v_{j}⟩ $ for $1≤i,j≤r$. This expression reduces to 1 if $i=j$ and to 0 otherwise (by the orthogonality of the vectors $v_{1},v_{2},...,v_{r}$. So $U_{∗}U=I_{r}$, which means that $U$ is semi-unitary.

$V$ is an $n×r$ matrix with orthonormal columns. It follows that $V_{∗}V=I_{r}$, so $V$ is semi-unitary. $□$

**Lemma**: *$M_{∗}M$ has only real, nonnegative eigenvalues.*

**Proof**: Let $v$ be any eigenvector of $M_{∗}M$ and $λ$ be the corresponding eigenvalue, so that $M_{∗}Mv=λv$. We have $∣∣Mv∣∣_{2}=v_{∗}M_{∗}Mv=λv_{∗}v=λ∣∣v∣∣_{2}$. Rearranging for $λ$, we get $λ=∣∣v∣∣_{2}∣∣Mv∣∣_{2} $, which is obviously real and nonnegative. $□$

**Lemma**: *Let $r$ be the rank of a complex matrix $M$. Then $M_{∗}M$ has rank $r$ as well.*

**Proof**: For a matrix $M∈C_{m×n}$ we have $rank(M)=n−dim(null(M))$, so it suffices to show that $Mv=0⟺M_{∗}Mv=0$, since this implies that the null spaces are the same.

From $Mv=0$ it follows that $M_{∗}Mv=M_{∗}0=0$. It is a property of the norm that $∣∣v∣∣_{2}=0$ implies $v=0$. So $M_{∗}Mv=∣∣Mv∣∣_{2}=0$ implies $v=0$. $□$

The theorem proves the existence of a variant of the singular value decomposition that is also known as the compact singular value decomposition. The existence of the 'full' singular value decomposition and other variants follows from the existence of the compact singular value decomposition, since we can just add extra zeroes to the diagonal, and add more orthonormal columns to $U$ and $V$, without changing the product $UΣV_{∗}$.