Prove this theorem about QR factorization

linear algebramatricesmatrix decomposition

Theorem:

Let $A$ be a nonsingular $(n \times n)$ matrix. Then the QR-factorization is
essentially unique. That is, if $A = Q_1 R_1 = Q_2 R_2$, then there is a unitary diagonal matrix
$D = \operatorname{diag}(d_i)$ with $\left|d_i\right| = 1$ such that $Q_1 = Q_2D$ and $D R_1 = R_2$

I found this theorem's statement in my book and I search a lot to find a complete solution, but I couldn't find one. Is there anywhere that has the complete proof to this theorem?

Best Answer

Suppose

$$A = Q_1 R_1 = Q_2 R_2.$$

Since $A$ is assumed to be non-singular, it follows that $R_1$ and $R_2$ are non-singular. Hence

$$Q = Q_2^H Q_1 = R_2 R_1^{-1} = R.$$

The matrix $Q$ on the left is unitary and $R$ is upper-triangular, implying

$$R R^H = I. \tag{$\ast$}$$

Equating the corresponding elements in $(\ast)$ yields

$$r_{kj} = 0 \quad (k \neq j), \qquad \lvert r_{kk} \rvert = 1.$$

Therefore, we can write

$$R = \operatorname{diag}(\mathrm i \theta_k ), \qquad Q_1 = Q_2 \operatorname{diag}(\mathrm i \theta_k ).$$

If you define $D = \operatorname{diag}(\mathrm i \theta_k )$, then $D$ is an unitary diagonal matrix which fulfills your properties.