Relationship between the Frobenius norm and singular values in SVD

2023/03/22

Problem

Note: I was brushing up on my SVD using the brilliant “Mathematics for Machine Learning” book, but the exercises listed in the book for SVD were a bit basic, so I decided to try use ChatGPT to generate a question. The problem below is what came out, quite impressive, although there were quite a few errors in the question that I had to fix (e.g the dimensionalities of the matrices).

Let A A be an m×n m \times n with mn m\geq n matrix with rank r r , and let its singular value decomposition (SVD) be given by A=UΣVT A = U \Sigma V^T , where U U is an m×m m \times m orthonormal matrix, Σ \Sigma is an m×n m \times n diagonal matrix with non-negative entries σ1σ2σn>0 \sigma_1 \geq \sigma_2 \geq \dots \geq \sigma_n > 0 , and V V is an n×n n \times n orthonormal matrix. Show that the Frobenius norm of A A is equal to the square root of the sum of the squares of the singular values.

Source: ChatGPT, Mathematics for Machine Learning by Deisenroth, Faisal and Ong

Solution

The Frobenius norm is given by,

AF2=i,jAi,j2 ||A||^2_F = \sum_{i,j}A^2_{i,j}

which we can equivalently write (it is not so hard to show this) as

AF2=tr(AA). ||A||^2_F = \operatorname{tr}(A^\top A).

Subbing in the SVD representation of A A , we get

tr(AA)=tr((UΣV)(UΣV))=tr(VΣUUΣV)=tr(VΣΣV). \begin{align} \operatorname{tr}(A^\top A) &= \operatorname{tr}\left( (U\Sigma V^\top)^\top(U\Sigma V^\top)\right)\\ &= \operatorname{tr}\left(V\Sigma^\top U^\top U\Sigma V^\top\right) \\ &= \operatorname{tr}\left(V\Sigma^\top \Sigma V^\top\right). \end{align}

We can see by inspection that ΣΣ=diag(σ12,,σn2)=Λ \Sigma^\top\Sigma = \operatorname{diag}(\sigma^2_1, \dots, \sigma^2_n)=\Lambda . This implies that

[VΛV]ii=σi2vivi=σi2, [V\Lambda V^\top]_{ii} = \sigma_i^2\mathbf{v}^\top_i\mathbf{v}_i = \sigma_i^2,

where vi \mathbf{v}_i is column i i of V V and the second equality follows from the othonormality of V V . Putting it all together we get that

AF2=tr(AA)=iσi2, ||A||^2_F = \operatorname{tr}(A^\top A) = \sum_i \sigma_i^2,

as required.