This is the deepest, most universal, and most widely used theorem in all linear algebra applications. Absolutely any matrix admits this decomposition. Once you calculate it, you have access to almost all of its properties, from its range to its inverse, through its determinant and a complete interpretation of its associated linear transformation.
In a sense, this is why you've been learning linear algebra. In this introductory topic, you'll analyze this decomposition in detail, learn how to calculate it efficiently, and finally take a look at the first sample of its geometric implications. In the next topic, you'll see its power in action.
The best decomposition
For any matrix , there exist orthogonal matrices and (of sizes and , respectively), and a diagonal matrix with non-negative entries, such that:
The fact that the rectangular matrix is meant to be diagonal simply means that its -entry is whenever . This decomposition brings with it a bit of terminology that's worth knowing now.
| Concept | Name | Definition |
|---|---|---|
|
The diagonal entries of |
Singular values of |
The non-negative square roots of the eigenvalues of . |
|
The columns of |
Left singular vectors of |
The eigenvectors of |
|
The columns of |
Right singular vectors of |
The eigenvectors of |
Proof of the singular value decomposition
You can suppose that and work with —otherwise, you only need to use . Well, as you already know, the matrix is positive semidefinite. Thus it has a spectral decomposition with non-negative eigenvalues in the diagonal of .
Thanks to this fact, you can build the matrix by putting its -entry as and as otherwise. Of course, is the principal square root of but with extra zero rows so that it has the same number of rows as . Then and this implies that:
Take a closer look at the last equation. You have just proved that . This is the orthogonal freedom, so there exists an orthogonal matrix such that . Yes, you have built the decomposition.
But you aren't done yet. You have to justify the terminology of the pieces. When the decomposition is ready, it's clear that:
Since this is a diagonalization of , it follows that the columns of are eigenvectors for and the entries in the main diagonal of are the corresponding eigenvalues. You can easily verify the corresponding statements about and very similarly.
Actually, these definitions give you a rough method to calculate the decomposition:
- Compute and .
- Find the eigenvalues of both and (they share the same eigenvalues).
- Calculate the non-negative roots of these eigenvalues. Then put them in the diagonal entries of a matrix .
- Compute the eigenvectors of and scale them in order to have length . Put them as the columns of .
- Repeat the last step for building the matrix .
- Finally, .
In the following section, you'll develop a much shorter algorithm.
Building the decomposition
The method from the previous section has a serious drawback: you have to build two matrices, and , and then build a spectral decomposition for each one. This sounds like a lot of work. Let's take a closer look at the pieces of the decomposition in order to improve the algorithm.
It's customary to denote the singular values as and to order them in non-increasing order . .
Since is diagonal, its rank is the number of nonzero rows it has, which is, therefore, the number of non-zero singular values of . Well, if is the rank of , then , thus:
Thus, and . Let's analyze the pieces by expressing and in terms of its columns:
The matrix equation implies that . Take a closer look at the columns of these new matrices:
Since these two matrices are equal, their columns are equal too. This implies that the first columns of can be obtained by:
Then the rest of the columns of can be calculated by extending the available ones so that they form an orthonormal basis. So, you have developed an easier method to get the decomposition:
- Start by computing
- Build a spectral decomposition for this matrix: by ordering the positive singular values in decreasing order
- Compute for every .
- Extend the set to an orthonormal basis and put the vectors as the columns of .
Now, you should get your hands dirty with some examples.
A direct example
Consider the following rectangular matrix:
The first step is computing a spectral decomposition for the positive definite matrix:
Its eigenvalues are , and . This means the singular values of are their square roots, so and . This also implies that since there are only two positive singular values. Now, an orthonormal basis corresponding to the eigenvalues is:
Now put these vectors as the columns of the matrix and the singular values on the diagonal of the matrix :
After that, the two columns of can be obtained via:
Hence:
And that's it. The SVD decomposition of is complete. You should verify that .
More steps
Let's see a more difficult decomposition. Take a square matrix:
Start by computing the positive definite matrix:
Since its eigenvalues are , and , the singular values of are their square roots and . An orthonormal basis corresponding to these eigenvalues is:
Now you can build matrices and :
But only has two singular values, so you can only compute the first two columns of :
You can find the last column of by extending to an orthonormal basis of , perhaps with the Gram-Schmidth process or with the cross product. This can lead you to the vector . Thus:
Again, try to check that .
Geometry
You can easily decompose the geometric behavior of any matrix in simple steps. First, notice that the linear operator of is given by the following composition of simpler pieces:So, the behavior of is described by three stages:
- As is orthogonal, the action of is just a rotation and/or reflection of ,
- after that, the fact that is diagonal implies that only stretches and then embeds in ,
- finally is a rotation and/or reflection of ,.
Furthermore, the two radii of the ellipse are exactly the singular values σ 1 and σ 2 of the matrix,
Conclusion
Take a matrix with a rank equal to .
-
There are orthogonal matrices and (of sizes and , respectively), and a diagonal matrix with non-negative entries, such that .
-
The diagonal entries of are the singular values of .
-
There are exactly non-zero singular values which are in decreasing order .
-
In order to compute the decomposition, you first calculate a spectral decomposition for and then the first columns of are given by .
-
The geometry of the linear transformation associated with is the composition of an isometry, a stretching, and other isometry.