Three dials feed two meters. The first dial moves only the first meter, the second dial moves only the second, and the third dial moves both meters by the same amount. Three inputs are read through just two numbers, so some combination of turns must leave both meters still, and it is not obvious which inputs behave simply. This lesson shows that every real matrix, square or rectangular, has perpendicular input directions that it stretches onto perpendicular output directions or erases, and reads the rank, the kernel and the largest stretch from those directions.
Key terms
Singular value decomposition
Definition Let be a real matrix, a map from to , and let . A singular value decomposition, or SVD, of is a factorization
in which is an orthogonal matrix, is an orthogonal matrix, and is an rectangular diagonal matrix. That means whenever , and the diagonal entries for satisfy
Every real matrix has a singular value decomposition, and the next card explains where the factors come from. Read from right to left, the factorization acts in three steps. First gives the coordinates of an input along the orthonormal columns of . Then multiplies the first coordinates by , drops any coordinates beyond the th, and fills the remaining output coordinates with zeros when . Finally assembles the output from the orthonormal columns of . The orthogonal factors preserve lengths and angles and may include reflections as well as rotations, so every change of length happens in .
In plain words Every matrix does three simple things in turn. It measures the input along well-chosen perpendicular axes, stretches each measurement by a nonnegative factor or erases it, and lays the results along perpendicular axes of the output space. The input axes belong to the input space and the output axes to the output space, which may have a different dimension.
Example Tuples such as stand for column vectors on this page. The matrix
sends to , the dials and meters of the opening. One SVD has
and with columns , and . Follow the input through the factors. Its coordinates along the columns of are the dot products ,
The factor multiplies the first coordinate by , keeps the second and drops the third, which gives . Then combines its columns and with these weights,
which agrees with the direct product .
Singular values
Definition The singular values of a real matrix are the diagonal entries of in an SVD, where . They are determined by alone, whichever SVD is used. The matrix is symmetric, and for every , so its eigenvalues are real and nonnegative. If they are listed with repetition as , then
and when the remaining eigenvalues are all . The positive singular values are also the square roots of the positive eigenvalues of the matrix , with the same multiplicities.
This is also why an SVD exists. The spectral theorem gives an orthonormal basis of made of eigenvectors of , listed so that their eigenvalues decrease. For each with set . These vectors are orthonormal, because
which is when and otherwise. The remaining satisfy , since . Any orthonormal basis of that extends the gives , and then .
In plain words Singular values are the stretch factors of the map, listed from largest to smallest and never negative. A singular value of zero marks an input direction that the map erases.
Example For the matrix above,
has eigenvalues , and , with eigenvectors , and . For instance . Here , so the singular values are and , and the eigenvalue belongs to the extra input direction. The smaller matrix has rows and and eigenvalues and , the same two squares.
Right and left singular vectors
Definition In an SVD of a real matrix, the columns of are the right singular vectors, an orthonormal basis of the input space . The columns of are the left singular vectors, an orthonormal basis of the output space . Comparing columns in and in gives
When , the right singular vectors without a partner satisfy for . When , the left singular vectors without a partner satisfy for . Each is an eigenvector of and each is an eigenvector of , with eigenvalue when and eigenvalue beyond.
In plain words Right singular vectors are input directions and left singular vectors are output directions. The map carries the th right singular vector to the th left one, stretched by , and sends a right singular vector without a partner to zero, so these perpendicular inputs go to perpendicular outputs or to zero. Other perpendicular pairs of inputs need not keep their right angle. The two vectors of a pair belong to the input space and the output space, which may even have different dimensions, so in general they are not two arrows in one picture.
Example For the matrix above, with and ,
In the other direction . The inputs and are perpendicular in , and their images and are perpendicular in . The third input direction has no partner, since has room for only two perpendicular directions.
Largest stretch
Definition Let be a real matrix with largest singular value and first right singular vector . Then
and the maximum is attained at , so equals the induced Euclidean norm . To see this, write a unit vector as with . Then , and since the are orthonormal,
When the same computation shows that the smallest stretch of a unit vector is , attained at . For an invertible matrix this gives the condition number .
In plain words No unit input is stretched by more than , and the first right singular vector is stretched by exactly that much. So the largest singular value measures the size of the map as its greatest stretch factor.
Example For the matrix above the largest stretch is , reached at , whose image has length . The unit vector goes to , of length . A unit vector with coordinates along the right singular vectors goes to with . So the unit circle in the plane of and maps onto the ellipse with semiaxes and , and the whole unit sphere of maps onto the filled region bounded by that ellipse. The component along the erased direction pulls a point inward.
Rank from singular values
Definition Let be an SVD of a real matrix, and let be the number of positive singular values, counted with repetition. Then , and
where a span of no vectors means . The reason is that goes to . These outputs fill the span of , and the output is zero exactly when . The same argument applied to gives the other two lines. So the kernel is spanned by the right singular vectors with singular value zero together with the unpaired ones beyond index . All of this is exact. When singular values are computed in floating point, a tiny value may stand for an exact zero or for a genuinely small stretch, and treating it as zero is a separate decision that should be stated.
In plain words Count the nonzero stretch factors and you have the rank. The input directions with zero stretch, or with no output partner at all, make up the kernel, and the leftover output directions, perpendicular to everything the map reaches, make up the left null space.
Example The matrix above has singular values and , so its rank is . Its column space is all of and its kernel is the line spanned by , which matches rank-nullity, . For that reason the input produces the same output as , and so does every point of the line through in the direction . A matrix with singular values and would instead have rank , a kernel spanned by , and a left null space spanned by and .
Singular values versus eigenvalues
Definition Eigenvalues and singular values answer different questions. An eigenvalue of a square matrix is a number with for some nonzero , so input and output are compared in the same space. A diagonalization uses one basis on both sides, that basis need not be orthonormal, and over it may not exist. Eigenvalues can be negative and need not be real. Singular values exist for every real matrix of any shape, are real and nonnegative, and come with two orthonormal bases, one for each space. For a square matrix
because and equal . If is symmetric with eigenvalues , its singular values are arranged in decreasing order, and if is also positive semidefinite the two lists coincide. Symmetric positive semidefinite matrices are the only real square matrices whose eigenvalues, counted with multiplicity, are exactly their singular values, so for every other real square matrix the two lists differ.
In plain words An eigenvector is a direction that the map sends back onto its own line. A singular pair joins an input direction to an output direction, usually a different one, by a nonnegative stretch. Signs and turning belong to the orthogonal factors, never to the singular values.
Example The matrix has eigenvalues and but singular values and . One SVD takes , and , a reflection that carries the sign. The matrix
has characteristic polynomial , so it has no real eigenvalues at all. Still , so its singular values are and , and with , and the counterclockwise quarter turn with columns and . In both examples the absolute value of the determinant is the product of the singular values, and .
Check yourself
- A real matrix has singular values , and . Find its rank, the dimension of its kernel and the dimension of the kernel of . What is the largest length of for a unit vector ?
Show the answer
The rank counts the positive singular values, so it is , not . The input space is , so the kernel has dimension . It is spanned by , whose singular value is , and by the unpaired . The output space is , so the kernel of has dimension and is spanned by . The largest stretch is , reached at .
- Find the singular values, the rank and the largest stretch of the matrix below, and give a full SVD.
Show the answer
The product has eigenvalues and with eigenvectors and , so the singular values are and , the rank is , and the largest stretch is , at . Take . Then and , and completes the basis and spans the kernel of . So and
The product is . The negative entry is absorbed by , and the singular value stays .
- The shear with rows and has the eigenvalue twice. Someone concludes that its singular values are and . Test the claim with the unit vector , then find the singular values.
Show the answer
The image is , of length . The largest singular value is the largest stretch, so it exceeds and the claim is false. To find the singular values, use
whose characteristic polynomial has roots . Since , the singular values are
Their product is , as it must be. A repeated eigenvalue does not determine how unevenly the map stretches different directions.