20.8  Principal Angles

The sections so far measured how far eigenvalues move. The next section asks how far eigenvectors move, and more generally invariant subspaces, and before it can answer it needs a way to say how far apart two subspaces are. For two lines there is an obvious answer, the angle between them. This section shows that for subspaces of dimension k≥2 one angle is not enough, and that the right replacement is a list of k angles read off from a singular value decomposition. It then proves the two facts Section 9 will use: the sines of these angles are the singular values of a matrix built from the orthogonal complement, and the largest sine is the distance between the two orthogonal projections.

Throughout, F is R or C, and Fn carries its standard inner product ⟨x,y⟩=y∗x, with x∗=x⊤ when F=R. For a subspace U of Fn, PU is the orthogonal projection onto U (Definition 11.3.2), identified with its matrix in the standard basis. Singular values of a matrix with k columns follow the convention of Chapter 17 §09: σi:=0 for min(rows,k)<i≤k, so that σi2 is the i-th largest eigenvalue of A∗A for every i≤k (Eq. 17.9.1).

20.8.1. One angle is not enough

For two lines span(u) and span(w) there is one number to compute, the angle between them. For planes the first idea is to copy it: call the angle between U and W the smallest angle between a line in U and a line in W.

That idea fails at once in R3. Two distinct planes U,W⊆R3 always meet in a line, since dim⁡(U∩W)=2+2−dim⁡(U+W)≥4−3=1 by Theorem 1.7.3. So the smallest angle is 0 for every pair of planes: it cannot tell a plane tilted by one degree from a plane at right angles.

Taking the largest such angle instead does no better in R4. Let U=span(e1,e2) and compare W1=span(e1,e3),W2=span(e3,e4). Each contains a vector perpendicular to all of U (namely e3), so each has a line at angle π/2 from U. But W1 shares the whole line span(e1) with U, while W2 is perpendicular to U in every direction. One number cannot record both facts. A list can: (0,π/2) for W1 and (π/2,π/2) for W2. The rest of this section explains where such a list comes from in general, when the subspaces are not lined up with the coordinate axes.

Two subspaces can be given orthonormal bases that face each other in pairs; the principal angles are the angles between the partners.

20.8.2. Principal angles

Everything will be computed from orthonormal bases written as the columns of a matrix, so we first record how such matrices behave.

Let U⊆Fn be a subspace with dim⁡U=k≥1. An orthonormal basis matrix of U is a matrix Q∈Mn×k(F) whose columns form an orthonormal basis of U. One exists: apply Gram–Schmidt (Theorem 11.2.2) to any basis of U.

Lemma 20.8.1 (Orthonormal Basis Matrices)

Let U⊆Fn have dimension k≥1 and let Q∈Mn×k(F) be an orthonormal basis matrix of U.

  • (a) Q∗Q=Ik and PU=QQ∗.
  • (b) ‖Qy‖=‖y‖ for every y∈Fk. For every matrix Y with k rows and every matrix Z with k columns, ‖QY‖2=‖Y‖2,‖QY‖F=‖Y‖F,‖ZQ∗‖2=‖Z‖2,‖ZQ∗‖F=‖Z‖F.
  • (c) Every orthonormal basis matrix of U is QR for some R∈U(k) (orthogonal when F=R).
  • (d) In−PU=PU⊥. If moreover k<n and Q⊥∈Mn×(n−k)(F) is an orthonormal basis matrix of U⊥, then the square matrix (Q∣Q⊥) is unitary, and QQ∗+Q⊥Q⊥∗=In.

Proof.

  • (a) The (i,j) entry of Q∗Q is qi∗qj=⟨qj,qi⟩=δij, because the columns q1,…,qk are orthonormal. By Theorem 11.3.3 (a), for every v∈Fn, PUv=∑i=1k⟨v,qi⟩qi=∑i=1kqi(qi∗v)=QQ∗v, the last step being column-times-row expansion of QQ∗.

  • (b) By (a), ‖Qy‖2=y∗Q∗Qy=y∗y=‖y‖2. Hence ‖QYx‖=‖Yx‖ for every x, and taking the maximum over unit x (Definition 16.3.2) gives ‖QY‖2=‖Y‖2. For the Frobenius norm, ‖QY‖F2=tr(Y∗Q∗QY)=tr(Y∗Y)=‖Y‖F2. Next, ‖ZQ∗‖F2=tr(QZ∗ZQ∗)=tr(Z∗ZQ∗Q)=‖Z‖F2, by Theorem 0.9.6 (3). For the spectral norm, let x∈Fn. By the first sentence and (a), ‖Q∗x‖=‖QQ∗x‖=‖PUx‖≤‖x‖ (Theorem 11.3.3 (c)). So ‖ZQ∗x‖≤‖Z‖2‖Q∗x‖≤‖Z‖2‖x‖ by Theorem 16.3.2 (a), and ‖ZQ∗‖2≤‖Z‖2. Conversely, choose a unit y∈Fk with ‖Zy‖=‖Z‖2 (Lemma 16.3.1). Then x=Qy is a unit vector with ZQ∗x=Zy, so ‖ZQ∗‖2≥‖Z‖2.

  • (c) Let Q′ be another orthonormal basis matrix of U, and put R=Q∗Q′∈Mk(F). Each column of Q′ lies in U, where PU is the identity, so Q′=PUQ′=QQ∗Q′=QR by (a). Then R∗R=Q′∗QQ∗Q′=Q′∗PUQ′=Q′∗Q′=Ik, so the square matrix R is unitary (Definition 11.7.2).

  • (d) For the first identity, let v∈Fn and write v=u+w with u∈U and w∈U⊥, which is possible in exactly one way by Theorem 11.3.2 (a). Then PUv=u by Definition 11.3.2. Since (U⊥)⊥=U by Theorem 11.3.2 (b), the splitting v=w+u is also the one that defines PU⊥, so PU⊥v=w=v−PUv. As v was arbitrary, In−PU=PU⊥. Nothing here restricts k: when k=n, U⊥={0} and both sides are O.

Now let k<n. The columns of Q and of Q⊥ are orthonormal, and each column of Q is orthogonal to each column of Q⊥ because U⊥U⊥. Their number is k+(n−k)=n, by Theorem 11.3.2 (c). So the square matrix W=(Q∣Q⊥)∈Mn(F) satisfies W∗W=In, hence is unitary, and then WW∗=In as well, since W∗=W−1. By block multiplication (Theorem 8.1.1), WW∗=QQ∗+Q⊥Q⊥∗. This also re-proves the first identity here, since Q⊥Q⊥∗=PU⊥ by (a) applied to U⊥.

Now the definition. The question is how much of U survives when it is projected into W. By parts (a) and (b) of the lemma, for a unit vector u=QUy of U the surviving length is ‖PWu‖=‖QWQW∗u‖=‖QW∗u‖=‖(QW∗QU)y‖. So the matrix QW∗QU records the answer for every direction of U at once, and its singular values are the stretch factors along the best directions.

Definition 20.8.1 (Principal Angles)

Let U,W⊆Fn be subspaces with 1≤k=dim⁡U≤l=dim⁡W, and let QU∈Mn×k(F) and QW∈Mn×l(F) be orthonormal basis matrices of U and W. The principal angles between U and W are the k numbers 0≤θ1≤θ2≤⋯≤θk≤π2 determined by cos⁡θi=σi(QW∗QU)(i=1,…,k). We write Θ(U,W)=diag(θ1,…,θk) and sin⁡Θ(U,W)=diag(sin⁡θ1,…,sin⁡θk).

In words: fix orthonormal bases of the two subspaces, form the l×k matrix whose (i,j) entry is the inner product of the j-th basis vector of U with the i-th basis vector of W, and take its k singular values. These lie in [0,1], as we check next, so each is the cosine of exactly one angle in [0,π/2]. The largest cosine gives the smallest angle, so the decreasing singular values produce increasing angles. The number of angles is the smaller dimension, k, and the definition asks for k≤l; for a pair with dim⁡U>dim⁡W, swap the names. The two notations at the end are for use in norms: ‖sin⁡Θ(U,W)‖2=sin⁡θk, the largest entry of a nonnegative diagonal matrix (Lemma 17.3.5), and ‖sin⁡Θ(U,W)‖F=(∑isin2⁡θi)1/2.

Well-definedness. Three things need checking. The answer must not depend on the orthonormal bases chosen. The singular values must be at most 1, or there is no angle. And when k=l the definition treats U and W asymmetrically, so we should check that swapping them changes nothing.

Proposition 20.8.2 (Principal Angles Are Well Defined)

In the setting of Definition 20.8.1, put M=QW∗QU∈Ml×k(F).

  • (a) The singular values of M do not depend on the choice of the orthonormal basis matrices QU and QW.
  • (b) 1≥σ1(M)≥⋯≥σk(M)≥0, so θ1,…,θk exist, are unique, and are nondecreasing.
  • (c) σi(QU∗QW)=σi(M) for i=1,…,k. In particular, if k=l, the principal angles between W and U are those between U and W.
  • (d) If k=1 and U=span(u) with ‖u‖=1, then cos⁡θ1=‖PWu‖. If also l=1 and W=span(w) with ‖w‖=1, then cos⁡θ1=|⟨u,w⟩|.

Proof.

  • (a) By Lemma 20.8.1 (c), any other choices are QUR and QWR′ with R∈U(k) and R′∈U(l). The new matrix is M′=R′∗MR, and M′∗M′=R∗M∗R′R′∗MR=R∗(M∗M)R, using R′R′∗=Il. Since R∗=R−1, this is similar to M∗M, so the two have the same characteristic polynomial (Theorem 7.10.3) and the same eigenvalues with multiplicity. By Definition 13.9.1, M′ and M have the same singular values.

  • (b) By Theorem 16.3.2 (d) and Lemma 20.8.1 (b), ‖M‖2≤‖QW∗‖2‖QU‖2, and ‖QU‖2=‖QUIk‖2=‖Ik‖2=1 by Theorem 16.3.2 (c). Also ‖QW∗x‖=‖PWx‖≤‖x‖, as in the proof of that lemma, so ‖QW∗‖2≤1. Hence σ1(M)=‖M‖2≤1 by Theorem 16.3.3 (c), and all singular values lie in [0,1]. The cosine is a strictly decreasing bijection from [0,π/2] onto [0,1], so each σi(M) is cos⁡θi for exactly one θi∈[0,π/2], and σ1≥⋯≥σk gives θ1≤⋯≤θk.

  • (c) Let M=YΣZ∗ be a singular value decomposition (Theorem 13.9.1). Then M∗=ZΣ⊤Y∗, where Z,Y are unitary and Σ⊤∈Mk×l(R) carries the same diagonal entries σ1(M)≥⋯≥σk(M) and zeros elsewhere. So this is a factorization of M∗ of the shape in Theorem 13.9.1, and Theorem 13.9.2 gives σi(M∗)=σi(M). Since M∗=QU∗QW, this is the first claim. When k=l, the principal angles between W and U are defined by σi(QU∗QW), so they coincide with those between U and W.

  • (d) With QU=u, the matrix M=QW∗u is a single column, and its one singular value is (M∗M)1/2=‖QW∗u‖. By Lemma 20.8.1 (b) and (a), ‖QW∗u‖=‖QWQW∗u‖=‖PWu‖. If l=1 and QW=w, then M=w∗u=⟨u,w⟩, whose singular value is |⟨u,w⟩|.

Examples.

  1. Two lines in R2. For u=e1 and w=(1,1)/2, part (d) gives cos⁡θ1=1/2, so θ1=π/4. Replacing w by −w changes neither the line nor the answer.
  2. Nested subspaces. If U⊆W, then every column of QU is fixed by PW, so M∗M=QU∗QWQW∗QU=QU∗PWQU=QU∗QU=Ik. All singular values are 1 and all principal angles are 0. The degenerate case U=W is included, and it is the reason the angles start at 0.
  3. Perpendicular subspaces. If U⊆W⊥, every entry of M is the inner product of a vector of U with a vector of W, hence 0, so all principal angles are π/2.
  4. The planes of the opening. For U=span(e1,e2) and W1=span(e1,e3), take the standard vectors as orthonormal bases. Then M=QW1⊤QU=(1000), with singular values 1,0, so the principal angles are (0,π/2). For W2=span(e3,e4) we are in Example 3, with angles (π/2,π/2). These are the two lists that the single-number attempts could not tell apart.

Nonexample by minimal change. In Example 4, replace the orthonormal basis (e1,e3) of W1 by the basis (e1,(e1+e3)/2), whose vectors still have length 1 but are no longer orthogonal. The matrix of inner products becomes (101/20), with largest singular value 3/2>1, and no angle has that cosine. What fails is the orthogonality of the columns of QW: without it, QWQW∗ is not the projection PW, and the matrix no longer measures how much of U survives in W.

Why this definition: the principal vectors. The singular value decomposition of M does more than produce numbers. It produces bases of U and W in which the whole configuration is visible, and this is the precise meaning of the slogan.

Proposition 20.8.3 (Principal Vectors)

In the setting of Definition 20.8.1, let QW∗QU=YΣZ∗ be a singular value decomposition (Theorem 13.9.1), with Y∈Ml(F) and Z∈Mk(F) unitary, columns y1,…,yl and z1,…,zk. Put ui=QUzi (1≤i≤k),wj=QWyj (1≤j≤l). Then (u1,…,uk) is an orthonormal basis of U, (w1,…,wl) is an orthonormal basis of W, and ⟨ui,wj⟩={cos⁡θiif i=j,0if i≠j.

Proof. The matrix QUZ has columns u1,…,uk, all in U, and (QUZ)∗(QUZ)=Z∗Z=Ik by Lemma 20.8.1 (a). So the ui are k orthonormal vectors of U. They are linearly independent (Theorem 11.1.4), and dim⁡U=k, so they form a basis. The same argument applies to the wj in W. Finally, ⟨ui,wj⟩=wj∗ui=yj∗(QW∗QU)zi=yj∗YΣZ∗zi=ej∗Σei, which is the (j,i) entry of Σ: it equals σi=cos⁡θi when j=i, and 0 otherwise.

So U and W have orthonormal bases that face each other in pairs. Each ui makes the angle θi with its partner wi, in the sense of part (d) of the proposition, and is perpendicular to every other wj. The last l−k vectors of W have no partner, and they are perpendicular to all of U. The vectors ui,wi are called principal vectors. Two subspaces, however they sit in Fn, look like a list of k independent pairs of lines, and the principal angles are the angles within the pairs.

The principal vectors are usually not the basis vectors one started with. For U=W=R2 with bases (e1,e2) and ((e1+e2)/2,(e1−e2)/2), each given basis vector of U is at angle π/4 from each given basis vector of W. The principal angles are nevertheless 0,0, by Example 2, since the subspaces are equal. Pairing the given columns one by one measures the bases, not the subspaces.

Warning. Lines have no orientation, so principal angles use |⟨u,w⟩| and lie in [0,π/2]. The angle of Definition 11.1.5 is between vectors in a real space, and it can reach π. For u=e1 and w=−e1 in R2 that angle is π, yet span(u)=span(w) and the principal angle is 0. Over C the vector angle is not even defined: u=e1 and w=ie1 span the same complex line, ⟨u,w⟩=i―=−i is not real, and the principal angle is again 0 because |−i|=1.

Quick check. Find the principal angle between the line U=span((1,2,2)) and the plane W={x∈R3:x3=0}.

Solution. Here k=1≤2=l. The unit vector u=13(1,2,2) spans U, and PWu=13(1,2,0), since (e1,e2) is an orthonormal basis of W (Theorem 11.3.3 (a)). By Proposition 20.8.2 (d), cos⁡θ1=‖PWu‖=5/3. So θ1=arccos⁡(5/3)≈41.8∘, and sin⁡θ1=2/3, which is the distance from u to the plane.

20.8.3. Sines and the orthogonal complement

The cosines measure how much of U survives projection into W. What Section 9 can actually bound is the part that does not survive: the component of U in W⊥. Pythagoras says the two parts are complementary, and the theorem makes this exact.

Theorem 20.8.4 (Sines of Principal Angles)

Let U,W⊆Fn with 1≤k=dim⁡U≤l=dim⁡W, principal angles θ1≤⋯≤θk, and orthonormal basis matrices QU,QW.

  • (a) Suppose l<n, and let QW⊥∈Mn×(n−l)(F) be an orthonormal basis matrix of W⊥. Put M=QW∗QU and N=QW⊥∗QU∈M(n−l)×k(F). Then M∗M+N∗N=Ik, and the eigenvalues of N∗N, with multiplicity, are sin2⁡θ1,…,sin2⁡θk. Equivalently, σi(N)=sin⁡θk+1−i for i=1,…,k, with the convention for σi stated at the start of the section.
  • (b) For every l≤n, ‖(I−PW)PU‖2=‖(I−PW)QU‖2=sin⁡θk=‖sin⁡Θ(U,W)‖2, and ‖(I−PW)PU‖F=‖(I−PW)QU‖F=‖sin⁡Θ(U,W)‖F.

Idea. Split the identity of Fn along W⊕W⊥ and sandwich it between QU∗ and QU. That gives two Hermitian k×k matrices adding up to Ik, and such matrices share their eigenvectors, with eigenvalues c and 1−c. The first has eigenvalues cos2⁡θi by definition, so the second has eigenvalues sin2⁡θi. Part (b) then removes the orthonormal factors, which change no norm.

Proof.

  • (a) By Lemma 20.8.1 (d) applied to W, In=QWQW∗+QW⊥QW⊥∗. Multiplying on the left by QU∗ and on the right by QU, and using QU∗QU=Ik (part (a) of the lemma), gives Ik=M∗M+N∗N.

    The matrix M∗M∈Mk(F) is Hermitian (real symmetric when F=R). By Corollary 12.4.3 (or Corollary 12.5.2 when F=R) there is an orthonormal basis z1,…,zk of Fk consisting of eigenvectors of M∗M. Since M has l≥k rows, all k eigenvalues of M∗M are squared singular values (Definition 13.9.1), so we may number the zi so that M∗Mzi=σi(M)2zi=cos2⁡θizi. Then N∗Nzi=(Ik−M∗M)zi=(1−cos2⁡θi)zi=sin2⁡θizi. So the unitary matrix with columns z1,…,zk diagonalizes N∗N with diagonal sin2⁡θ1,…,sin2⁡θk, and these are its eigenvalues with multiplicity (Theorem 7.10.3). The sine is increasing on [0,π/2], so in decreasing order they read sin2⁡θk≥⋯≥sin2⁡θ1≥0. By Eq. 17.9.1, the i-th largest eigenvalue of N∗N is σi(N)2 for every i≤k, with the stated convention. Taking nonnegative square roots gives σi(N)=sin⁡θk+1−i.

  • (b) If l=n, then W=Fn, so U⊆W and every θi=0 (Example 2 above), while I−PW=O; all four norms are 0. Suppose l<n. By Lemma 20.8.1 (d) and (a), (I−PW)QU=QW⊥QW⊥∗QU=QW⊥N, and (I−PW)PU=QW⊥NQU∗. By part (b) of the lemma, applied to QW⊥ and then to QU, both matrices have the spectral and Frobenius norms of N. Now ‖N‖2=σ1(N)=sin⁡θk by Theorem 16.3.3 (c) and part (a). Also ‖N‖F2=tr(N∗N), which is the sum of the eigenvalues of N∗N (Theorem 9.3.3), that is ∑isin2⁡θi=‖sin⁡Θ(U,W)‖F2. This proves the theorem.

Part (b) has a plain geometric reading. For a unit vector u∈U, the vector (I−PW)u is the error in approximating u from W, and its length is the distance from u to W (Theorem 11.3.5). So sin⁡θk is the largest distance from a unit vector of U to W, and θk is the worst angle any direction of U makes with W. That is the number to bound when one asks whether a computed subspace is close to the true one, and part (a) turns it into the norm of the concrete matrix QW⊥∗QU. In Section 9, U will be an invariant subspace of A and W the corresponding one for A+E. The columns of QW⊥ will be the remaining eigenvectors of A+E, and N will turn out to satisfy a Sylvester equation, so the bounds of Section 7 will apply to it.

20.8.4. The distance between two subspaces

A subspace is determined by its orthogonal projection, since U=imPU by Theorem 4.5.1 (b), applied to Fn=U⊕U⊥. So a second natural way to compare U and W is the size of PU−PW. When the dimensions agree, this measures exactly the largest principal angle.

Theorem 20.8.5 (The Distance Between Projections)

Let U,W⊆Fn with dim⁡U=dim⁡W=k≥1, and principal angles θ1≤⋯≤θk. Then

  • (a) ‖PU−PW‖2=sin⁡θk;
  • (b) ‖PU−PW‖F=2‖sin⁡Θ(U,W)‖F;
  • (c) ‖PU−PW‖2≤1, with equality if and only if U∩W⊥≠{0}.

Idea. For (b), the squared Frobenius norm of the Hermitian matrix D=PU−PW is tr(D2), which expands into traces of projections: k+k−2tr(PUPW), and tr(PUPW)=∑cos2⁡θi. For (a), split x=x1+x2 along U⊕U⊥. Then D sends x1 to (I−PW)x1∈W⊥ and x2 to −PWx2∈W, so Pythagoras separates the two contributions. The first is controlled by the sines for (U,W), the second by the sines for (W,U), and equal dimensions make these the same list.

Proof. Put D=PU−PW, and let QU,QW be orthonormal basis matrices and M=QW∗QU∈Mk(F).

  • (b) By Lemma 20.8.1 (a), PU=QUQU∗ and PW=QWQW∗ are Hermitian and satisfy PU2=PU, PW2=PW. Hence D is Hermitian and ‖D‖F2=tr(D∗D)=tr(D2)=tr(PU)+tr(PW)−tr(PUPW)−tr(PWPU). By Theorem 0.9.6 (3), tr(PU)=tr(QU∗QU)=tr(Ik)=k, likewise tr(PW)=k, and tr(PWPU)=tr(PUPW). Also tr(PUPW)=tr(QUQU∗QWQW∗)=tr(QW∗QUQU∗QW)=tr(MM∗), and tr(MM∗)=‖M∗‖F2=‖M‖F2=tr(M∗M)=∑icos2⁡θi, since the eigenvalues of M∗M are cos2⁡θ1,…,cos2⁡θk (Definition 13.9.1, Theorem 9.3.3). Therefore ‖D‖F2=2k−2∑i=1kcos2⁡θi=2∑i=1ksin2⁡θi, which is (b).

  • (c) Put s=sin⁡θk. By Theorem 20.8.4 (b), ‖(I−PW)PU‖2=s. The same theorem with the roles of U and W exchanged, which is allowed because dim⁡W=dim⁡U, gives ‖(I−PU)PW‖2=s too, because by Proposition 20.8.2 (c) the principal angles between W and U are those between U and W.

Let x∈Fn, and write x1=PUx∈U and x2=x−x1∈U⊥ (Definition 11.3.2). Then PUx=x1 and PWx=PWx1+PWx2, so Dx=(I−PW)x1−PWx2. The first term lies in W⊥ and the second in W, by Theorem 11.3.2, so they are orthogonal, and by Theorem 11.1.3

‖Dx‖2=‖(I−PW)x1‖2+‖PWx2‖2.
(20.8.1)

We bound the two terms. Since x1=PUx1, ‖(I−PW)x1‖=‖(I−PW)PUx1‖≤s‖x1‖ by Theorem 16.3.2 (a). For the second term, PW is Hermitian and idempotent and x2=(I−PU)x2, so ‖PWx2‖2=⟨PWx2,x2⟩=⟨PWx2,(I−PU)x2⟩=⟨(I−PU)PW(PWx2),x2⟩≤s‖PWx2‖‖x2‖, using Theorem 11.3.3 (b) for I−PU=PU⊥ (Lemma 20.8.1 (d)), then PW=PW2, then Cauchy–Schwarz (Theorem 11.1.5) with ‖(I−PU)PW‖2=s. Hence ‖PWx2‖≤s‖x2‖, the case PWx2=0 being trivial. Adding, and using ‖x1‖2+‖x2‖2=‖x‖2 (Theorem 11.1.3), ‖Dx‖2≤s2(‖x1‖2+‖x2‖2)=s2‖x‖2. So ‖D‖2≤s. For the reverse, Theorem 20.8.4 (b) gives ‖(I−PW)QU‖2=s, and by Lemma 16.3.1 there is a unit y∈Fk with ‖(I−PW)QUy‖=s. The vector x=QUy∈U is a unit vector (Lemma 20.8.1 (b)) with PUx=x, so Dx=(I−PW)x and ‖Dx‖=s. Hence ‖D‖2=s.

  • (c) By (a) and Proposition 20.8.2 (b), ‖D‖2=sin⁡θk≤1, with equality if and only if cos⁡θk=σk(M)=0. The square matrix M has σk(M)=0 if and only if rankM<k (Theorem 13.9.1), that is, if and only if My=0 for some y≠0. Put u=QUy, which is a nonzero vector of U exactly when y≠0, by Lemma 20.8.1 (b). Then My=QW∗u, and QW∗u=0 if and only if PWu=QWQW∗u=0, again by parts (b) and (a) of the lemma. Finally PWu=0 means that u∈kerPW=W⊥, by Theorem 4.5.1 (b) applied to Fn=W⊕W⊥. So equality holds if and only if U contains a nonzero vector of W⊥.

The factor 2 in (b) has a clean explanation. When k=l, the principal vectors of Proposition 20.8.3 give PU=∑iuiui∗ and PW=∑iwiwi∗ (Lemma 20.8.1 (a)), so PU−PW is a sum of the k terms uiui∗−wiwi∗. These act in the mutually orthogonal planes span(ui,wi). Each term is Hermitian with trace 0 and rank at most 2, so its nonzero eigenvalues are a pair ±ti, and being Hermitian it is normal, so ‖uiui∗−wiwi∗‖F2=ti2+ti2 by Theorem 12.11.1. On the other hand, expanding the trace with ui∗ui=wi∗wi=1 and |⟨ui,wi⟩|=cos⁡θi (Proposition 20.8.3), ‖uiui∗−wiwi∗‖F2=2−2|⟨ui,wi⟩|2=2sin2⁡θi, so ti=sin⁡θi. Each angle is therefore counted twice in the Frobenius norm and once in the spectral norm. The worked example below shows the ± pairs explicitly.

Example (Two Planes in Four Dimensions)

Let U=span(e1,e2)⊆R4 and W=span(a,b), where a=(3,4,4,3),b=(3,−4,4,−3). Find the principal angles, a pair of principal vectors for each, the sines from Theorem 20.8.4, and ‖PU−PW‖ in both norms. Then check the last two numbers directly.

Solution. Orthonormal bases. ⟨a,b⟩=9−16+16−9=0 and ‖a‖2=‖b‖2=50, so QW=152(a∣b) is an orthonormal basis matrix of W, and QU=(e1∣e2). The matrix QW⊤QU holds the first two entries of a and b: M=QW⊤QU=152(343−4),M⊤M=(9/250016/25). So the singular values are 4/5 and 3/5, and θ1=arccos⁡45≈36.87∘,θ2=arccos⁡35≈53.13∘. Note sin⁡θ1=3/5=cos⁡θ2, so θ1+θ2=π/2 here.

Principal vectors. The eigenvector of M⊤M for 16/25 is z1=e2, and y1=Mz1/σ1=152(4,−4)⋅54=12(1,−1). By Proposition 20.8.3, u1=e2,w1=QWy1=110(a−b)=(0,45,0,35), and ⟨u1,w1⟩=4/5. Likewise z2=e1, y2=12(1,1), u2=e1, and w2=110(a+b)=(35,0,45,0), with ⟨u2,w2⟩=3/5, while ⟨u1,w2⟩=⟨u2,w1⟩=0. So W is obtained from U by tilting e2 towards e4 through θ1 and e1 towards e3 through θ2, in two perpendicular planes.

Sines. The vectors c=(4,−3,−3,4) and d=(4,3,−3,−4) are orthogonal to a, to b, and to each other: ⟨c,a⟩=12−12−12+12=0,⟨c,b⟩=12+12−12−12=0,⟨d,a⟩=12+12−12−12=0,⟨d,b⟩=12−12−12+12=0, and ⟨c,d⟩=16−9+9−16=0. Also ‖c‖2=‖d‖2=50. Since dim⁡W⊥=2 (Theorem 11.3.2 (c)), QW⊥=152(c∣d) is an orthonormal basis matrix of W⊥, and N=QW⊥⊤QU=152(4−343),N⊤N=(16/25009/25). Its eigenvalues are 16/25=sin2⁡θ2 and 9/25=sin2⁡θ1, and M⊤M+N⊤N=I2, as Theorem 20.8.4 (a) says.

Distances. By Theorem 20.8.5, ‖PU−PW‖2=sin⁡θ2=4/5 and ‖PU−PW‖F=2(925+1625)1/2=2.

Direct check. By Lemma 20.8.1 (a), PW=QWQW⊤=150(aa⊤+bb⊤), and PW=150(180240032024240320024018),PU=diag(1,1,0,0). In D=PU−PW, coordinates 1,3 do not interact with coordinates 2,4, and the two 2×2 blocks are 150(32−24−24−32),150(18−24−24−18). Each is symmetric with trace 0, so its eigenvalues are ±−det: ±150322+242=±45 and ±150182+242=±35. So D has eigenvalues ±45,±35. By Lemma 17.3.5, ‖D‖2=4/5, and ‖D‖F2=tr(D2)=2(1625+925)=2. Both agree with the theorem, and the eigenvalues come in the ±sin⁡θi pairs described before the example.

Remark. A metric, and why the dimensions must match. On the set of k-dimensional subspaces of Fn, the number d(U,W)=‖PU−PW‖2=sin⁡θk is a metric. It is symmetric. It is zero only when PU=PW, that is, when U=imPU=imPW=W. And it satisfies the triangle inequality because ‖⋅‖2 is a norm (Theorem 16.3.2 (b)). Between subspaces of different dimensions it is useless. If k<l, then dim⁡(W∩U⊥)≥l+(n−k)−n>0 by Theorem 1.7.3, so some unit w∈W is perpendicular to U. For it (PU−PW)w=−w, so ‖PU−PW‖2≥1. On the other hand, Eq. 20.8.1, which did not use the dimensions, together with ‖Pv‖≤‖v‖ for orthogonal projections (Theorem 11.3.3 (c)), gives ‖PU−PW‖2≤1. So the distance is exactly 1, whatever the principal angles are. This is why Section 9 always compares invariant subspaces of the same dimension.

20.8.5. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define the principal angles between subspaces U,W⊆Fn with 1≤dim⁡U≤dim⁡W.
  • (b) True or false: if U⊆W, then every principal angle between U and W is 0. Justify your answer.
  • (c) True or false: the principal angle between span(u) and span(−u), for u≠0, is π. Justify your answer.
  • (d) True or false: if U∩W≠{0}, then θ1=0. Justify your answer.
  • (e) State the formula for ‖PU−PW‖2 in terms of principal angles, with its hypothesis.
  • (f) True or false: for two distinct lines U,W in R2, ‖PU−PW‖2<1. Justify your answer.

Solution.

  • (a) Choose orthonormal basis matrices QU∈Mn×k(F) and QW∈Mn×l(F). The principal angles 0≤θ1≤⋯≤θk≤π/2 are defined by cos⁡θi=σi(QW∗QU), i=1,…,k (Definition 20.8.1). They do not depend on the bases (Proposition 20.8.2).

  • (b) True. As in Example 2 after Proposition 20.8.2, M∗M=QU∗PWQU=QU∗QU=Ik, so every cos⁡θi=1.

  • (c) False. The two lines are equal, so the angle is 0: with u0=u/‖u‖, |⟨u0,−u0⟩|=1 (Proposition 20.8.2 (d)). The value π is the angle between the vectors u and −u of Definition 11.1.5, which is a different notion.

  • (d) True. Take a unit u∈U∩W and write u=QUy with ‖y‖=1 (Lemma 20.8.1 (b)). Then ‖My‖=‖QW∗u‖=‖PWu‖=‖u‖=1, so σ1(M)=‖M‖2≥1. With Proposition 20.8.2 (b), cos⁡θ1=1.

  • (e) If dim⁡U=dim⁡W=k≥1, then ‖PU−PW‖2=sin⁡θk, the sine of the largest principal angle (Theorem 20.8.5 (a)).

  • (f) False. The two axes U=span(e1) and W=span(e2) have U∩W⊥=U≠{0}, so ‖PU−PW‖2=1 by Theorem 20.8.5 (c). Directly, PU−PW=diag(1,−1).

B. Practice

Exercise (B1: Two planes in three dimensions)

Let U=span(e1,e2) and W=span((1,0,0),(1,3,4)) in R3.

  • (a) Find an orthonormal basis matrix of W.
  • (b) Compute the principal angles between U and W.
  • (c) Hence compute ‖PU−PW‖2 and ‖PU−PW‖F.
  • (d) Explain why θ1=0 could have been predicted without computation.

Solution.

  • (a) Gram–Schmidt: q1=e1, and (1,3,4)−⟨(1,3,4),e1⟩e1=(0,3,4), of length 5, so q2=(0,35,45) and QW=(q1∣q2).

  • (b) With QU=(e1∣e2), the matrix M=QW⊤QU holds the first two entries of q1 and q2: M=(1003/5). It is diagonal with nonnegative entries, so M⊤M=diag(1,925) and the singular values are 1 and 35. So θ1=0 and θ2=arccos⁡35≈53.13∘, with sin⁡θ2=45.

  • (c) By Theorem 20.8.5, ‖PU−PW‖2=sin⁡θ2=45 and ‖PU−PW‖F=2(0+1625)1/2=425.

  • (d) Two planes in R3 meet in a line (Theorem 1.7.3, as in the opening of the section), and a common unit vector forces cos⁡θ1=1 (Exercise A1 (d)). Here the common line is span(e1).

Exercise (B2: Which projections are at distance one?)

Determine, for each pair, whether ‖PU−PW‖2=1. Justify your answer.

  • (a) U=span(e1,e2) and W=span(e2,e3) in R3.
  • (b) U=span((1,1,0)) and W=span((1,−1,1)) in R3.
  • (c) U=span(e1,e2) and W=span((1,0,1),(0,1,1)) in R3.
  • (d) U=span((1,2,3)) and W=span((1,0,0),(0,1,0)) in R3.

Solution.

  • (a) Yes. W⊥=span(e1)⊆U, so U∩W⊥≠{0}, and Theorem 20.8.5 (c) applies since both dimensions are 2.

  • (b) Yes. ⟨(1,1,0),(1,−1,1)⟩=0, so U⊆W⊥, and (c) of the theorem applies with k=1.

  • (c) No. Both are planes, and W⊥=span((1,1,−1)), since (1,1,−1) is orthogonal to both spanning vectors of W and dim⁡W⊥=1. This vector has nonzero third entry, so it is not in U, and U∩W⊥={0}. By the theorem, ‖PU−PW‖2<1. (In fact the principal angles are 0 and arccos⁡(1/3), so the distance is 2/3.)

  • (d) Yes, for a different reason: the dimensions are 1 and 2, and the remark after Example (Two Planes in Four Dimensions) shows that ‖PU−PW‖2=1 whenever the dimensions differ. The theorem itself does not apply. Its principal angle θ1=arccos⁡(5/14) is far from π/2, which illustrates why the projection distance is only used for equal dimensions.

Exercise (B3: Two lines)

Let u,w∈Fn be unit vectors and c=|⟨u,w⟩|. Prove that ‖uu∗−ww∗‖2=1−c2,‖uu∗−ww∗‖F=21−c2.

Solution. Let U=span(u) and W=span(w), both of dimension 1. By Lemma 20.8.1 (a) with QU=u and QW=w, PU=uu∗ and PW=ww∗. By Proposition 20.8.2 (d), the single principal angle satisfies cos⁡θ1=c, so sin⁡θ1=1−c2, since sin⁡θ1≥0 on [0,π/2]. Now Theorem 20.8.5 (a) and (b) with k=1 give ‖PU−PW‖2=sin⁡θ1 and ‖PU−PW‖F=2sin⁡θ1, which are the two claims.

C. Going deeper

Exercise (C1: Counting zero and right angles)

Let U,W⊆Fn with 1≤k=dim⁡U≤l=dim⁡W, orthonormal basis matrices QU,QW, and M=QW∗QU.

  • (a) Prove that y∗(Ik−M∗M)y=‖(I−PW)QUy‖2 for every y∈Fk.
  • (b) Deduce that the number of principal angles equal to 0 is dim⁡(U∩W).
  • (c) Prove that the number of principal angles equal to π/2 is dim⁡(U∩W⊥).

Hint for (b): a positive semidefinite matrix B with y∗By=0 has By=0.

Solution.

  • (a) Let u=QUy. By Lemma 20.8.1 (a) and (b), y∗y=‖u‖2 and y∗M∗My=‖QW∗u‖2=‖PWu‖2. Since u=PWu+(I−PW)u with the two parts orthogonal (Theorem 11.3.2), Theorem 11.1.3 gives ‖u‖2−‖PWu‖2=‖(I−PW)u‖2.

  • (b) Put B=Ik−M∗M. It is Hermitian, and by (a) it is positive semidefinite (Definition 13.1.1). Its eigenvalues are 1−cos2⁡θi=sin2⁡θi, with an orthonormal eigenbasis z1,…,zk (as in the proof of Theorem 20.8.4). So the number of i with θi=0 is the number of zero eigenvalues, which is dim⁡kerB.

    We claim kerB={y:QUy∈W}. If By=0, then y∗By=0, so (I−PW)QUy=0 by (a), and QUy=PWQUy∈W. Conversely, if QUy∈W, then y∗By=0 by (a). Writing y=∑icizi, this says ∑isin2⁡θi|ci|2=0. So ci=0 whenever sin⁡θi≠0, and then By=∑icisin2⁡θizi=0. This proves the claim; the second half of it is the fact in the hint, proved here for this B.

    The map y↦QUy is linear and injective (Lemma 20.8.1 (b)). It carries kerB onto {u∈U:u∈W}=U∩W, because every vector of U is QUy for some y. So dim⁡kerB=dim⁡(U∩W).

  • (c) θi=π/2 exactly when σi(M)=0. The number of nonzero singular values of M is rankM (Theorem 13.9.1), so the number of zero ones among the k is k−rankM=dim⁡kerM, by the Rank–Nullity Theorem (Theorem 2.3.1) for y↦My on Fk. Next, My=QW∗QUy=0 if and only if PWQUy=QW(QW∗QUy)=0, because QW is injective. That holds if and only if QUy∈W⊥. As in (b), y↦QUy carries kerM injectively onto U∩W⊥, so the count is dim⁡(U∩W⊥).
Exercise (C2: The smallest angle as a maximum)

Let U,W⊆Fn with 1≤k=dim⁡U≤l=dim⁡W and principal angles θ1≤⋯≤θk.

  • (a) Prove that cos⁡θ1=max{|⟨u,w⟩|:u∈U, w∈W, ‖u‖=‖w‖=1}, and that the maximum is attained at the principal vectors u1,w1.
  • (b) Deduce that θ1 is the smallest principal angle between a line of U and a line of W, which is the notion tried and rejected at the start of the section.
  • (c) Hence explain, in one sentence, why θ1 alone cannot distinguish the pairs (U,W1) and (U,U) of the opening, but the full list θ1,θ2 can.

Solution.

  • (a) Let u∈U and w∈W be unit vectors. By Lemma 20.8.1 (a) and (b), u=QUy and w=QWz with y=QU∗u and z=QW∗w unit vectors. Then ⟨u,w⟩=z∗QW∗QUy=z∗My, and by Cauchy–Schwarz and Theorem 16.3.2 (a), |⟨u,w⟩|≤‖z‖‖My‖≤‖M‖2=σ1(M)=cos⁡θ1, using Theorem 16.3.3 (c). By Proposition 20.8.3, the unit vectors u1∈U and w1∈W satisfy ⟨u1,w1⟩=cos⁡θ1, so the maximum exists and equals cos⁡θ1.

  • (b) By Proposition 20.8.2 (d), the principal angle between the lines span(u) and span(w) is arccos⁡|⟨u,w⟩|. Since arccos is decreasing, the smallest such angle corresponds to the largest |⟨u,w⟩|, which by (a) is cos⁡θ1.

  • (c) Both pairs share a line, so both have θ1=0, and the first number cannot separate them. The second angle is π/2 for (U,W1) and 0 for (U,U), by Examples 4 and 2 after Proposition 20.8.2.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.