316 CHAPTER 12. INNER PRODUCT SPACES, LEAST SQUARES

Thus Q preserves lengths and so, by Lemma 12.3.5, it follows that Q∗Q = I. Also, thisshows that Q maps V onto V and so a generic element of V is of the form Qx. Now

|Q∗Qx|2 = (Q∗Qx,Q∗Qx) =

Qx,Q

=I︷︸︸︷Q∗Qx

= (Qx,Qx) = |Qx|2

showing that Q∗ also preserves lengths. Hence it is also the case that QQ∗ = I because fromthe definition of the adjoint, (Q∗)∗ = Q. ■

Definition 12.3.7 If U ∈L (X ,X) for X an inner product space, then U is called unitaryif U∗U =UU∗ = I.

Note that it is actually shown that QV = span(e1, · · · ,ep) and that in case p= n one ob-tains that a linear transformation which maps an orthonormal basis to an orthonormal basisis unitary. Unitary matrices are also characterized by preserving length. More generally

Corollary 12.3.8 Suppose U ∈ L (X ,X) where X is an inner product space. Then U isunitary if and only if |Ux|= |x| for all x so it preserves distance.

Proof:⇒ If U is unitary, then |Ux|2 = (Ux,Ux) = (U∗Ux,x) = (x,x) = |x|2.⇐ If |Ux| = |x| for all x then by Lemma 12.3.5, U∗U = I. Thus U is onto since it

is one to one and so a generic element of X is Ux. Note how this would fail if you hadU ∈L (X ,Y ) where the dimension of Y is larger than the dimension of X . Then as above,

|U∗Ux|2 = (U∗Ux,U∗Ux) = (Ux,UU∗Ux) = (Ux,Ux) = |Ux|2

Thus also UU∗ = I because U∗ preserves distances and (U∗)∗ =U from the definition. ■Now here is an important result on factorization of an m× n matrix. It is called a QR

factorization.

Theorem 12.3.9 Let A be an m×n complex matrix. Then there exists a unitary Q and R,all zero below the main diagonal (Ri j = 0if i > j) such that A = QR.

Proof: This is obvious if m = 1.(a1 · · · an

)= (1)

(a1 · · · an

)Suppose true for m−1 and let

A =(

a1 · · · an

), A is m×n

Using Theorem 12.3.6, there exists Q1 a unitary matrix such that Q1 (a1/ |a1|) = e1 in casea1 ̸= 0. Thus Q1a1 = |a1|e1. If a1 = 0, let Q1 = I. Thus

Q1A =

(a bT

0 A1

)where A1 is (m−1)× (n−1). If n = 1, this obtains

Q1A =

(a0

), A = Q∗1

(a0

), let Q = Q∗1.

316 CHAPTER 12. INNER PRODUCT SPACES, LEAST SQUARESThus Q preserves lengths and so, by Lemma 12.3.5, it follows that Q*Q = J. Also, thisshows that Q maps V onto V and so a generic element of V is of the form Qx. Now=I—~\0* Ox|? = (Q* Ox," Ox) = | Ox, Q0*Ox | = (Ox, Ox) = |Ox|showing that Q* also preserves lengths. Hence it is also the case that QQ* = J because fromthe definition of the adjoint, (Q*)* = Q.Definition 12.3.7 [fU © &(X,X) for X an inner product space, then U is called unitaryifU*U =UU* =1.Note that it is actually shown that QV = span (e1,--- ,e,) and that in case p = n one ob-tains that a linear transformation which maps an orthonormal basis to an orthonormal basisis unitary. Unitary matrices are also characterized by preserving length. More generallyCorollary 12.3.8 Suppose U € &(X,X) where X is an inner product space. Then U isunitary if and only if |Ux| = |x| for all x so it preserves distance.Proof: => If U is unitary, then |Ux|° = (Ux,Ux) = (U*Ux,x) = (x,x) = |x|’.<= If |Ux| = |x| for all x then by Lemma 12.3.5, U*U =I. Thus U is onto since itis one to one and so a generic element of X is Ux. Note how this would fail if you hadU € £ (X,Y) where the dimension of Y is larger than the dimension of X. Then as above,|U*Ux|? = (U*Ux,U*Ux) = (Ux,UU*Ux) = (Ux,Ux) = |Ux|?Thus also UU* = I because U* preserves distances and (U*)* =U from the definition. liNow here is an important result on factorization of an m x n matrix. It is called a QRfactorization.Theorem 12.3.9 Let A be an m x n complex matrix. Then there exists a unitary Q and R,all zero below the main diagonal (Rj; = Oifi > j) such that A = QR.Proof: This is obvious if m= 1.(a _ an )=() (a o an )Suppose true for m— | and letA=( Qi «+ Gy ).A ismxnUsing Theorem 12.3.6, there exists Q; a unitary matrix such that Q; (a;/|a,|) = e; in casea, #0. Thus Q,a; = |a;|e;. If a; = 0, let Q; = /. ThusO\A= a bt"No Aywhere A, is (m—1) x (n—1). If n = 1, this obtainsQ\A= ( 0 )a=0%{ , ) 10-93.