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.