Uniquness of a QR-Decomposition: Show that there exists an orthogonal diagonal matrix $ S \in \mathbb{R}^{n \times n} $

278 Views Asked by At

Let $ A=Q_{1} R_{1}=Q_{2} R_{2} $ be two $ Q R $-decompositions of a quadratic matrix $A \in \mathbb{R}^{n \times n} $ with full rank, i.e., $ \operatorname{rank}(A)=n $. This means $ Q_{1}, Q_{2} \in \mathbb{R}^{n \times n} $ are orthogonal matrices and $ R_{1}, R_{2} \in \mathbb{R}^{n \times n} $ are upper triangular matrices. Show that there exists an orthogonal diagonal matrix $ S \in \mathbb{R}^{n \times n} $ such that it holds $ \begin{array}{l} Q_{1}=Q_{2} S^{T} \\ R_{1}=S R_{2} \end{array} $.

I do not understand how to find such an orthogonal diagonal matrix. Does anyone have an idea?

I found something very similar online, but unfortunately it does not show how to get to this S: How unique is QR?

Edit: possible proof

Can someone check if this proof I have written here to the above statement is coherent?

Let $ A=Q_{1} R_{1}=Q_{2} R_{2} $ be two $ Q R $-decompositions of a quadratic matrix $A \in \mathbb{R}^{n \times n} $ with full rank, i.e., $ \operatorname{rank}(A)=n $. This means $ Q_{1}, Q_{2} \in \mathbb{R}^{n \times n} $ are orthogonal matrices and $ R_{1}, R_{2} \in \mathbb{R}^{n \times n} $ are upper triangular matrices.

Since A has full rank, A is regular. Because of the regularity of A holds: $ 0 \ne det(A) = det(Q_1) \cdot det(R_1)= det(Q_2) \cdot det(R_2)$.

Since Q are orthogonal matrices,i.e. $Q^{-1}_1 = Q^t_1 \Leftrightarrow Q_1Q^t_1=I$ and $Q^{-1}_2 = Q^t_2 \Leftrightarrow Q_2Q^t_2=I$, so holds: $det(Q_1) = \pm 1$ and $det(Q_2) = \pm 1$. Thus applies: $det(Q_1)\ne 0$, $det(Q_2) \ne 0$ and $det(R_1)\ne 0$, $det(R_2)\ne 0$. Therefore, $R_1,R_2$ are regular upper triangular matrices.

Then we have \begin{align} Q_{1} R_{1}=Q_{2} R_{2}, \hspace{3cm} (1) \end{align} and left-multiplying by $ Q_{2}^{T} $ and right-multiplying by ${R}_{1}^{-1} $ yields \begin{align} {Q}_{2}^{T} {Q}_{1}={R}_{2} {R}_{1}^{-1} \hspace{3cm} (2) \end{align}

Note that the right-hand side of Eqn (2) is upper-triangular (since $R_1,R_2$ are).

Let $D:={Q}_{2}^{T} {Q}_{1}={R}_{2} {R}_{1}^{-1}$ be, then $D$ is regular and upper triangular matrix, i.e. $D^{-1}$ is upper triangular matrix and thus $D^t$ is a lower triangular matrix.

But since $D$ is also orthogonal, $D^{-1} = D^t$, where $D^{-1}$ is upper triangular matrix and $D^t$ is lower triangular matrix, which is only possible if $D^t$ and therefore $D$ itself is a diagonal matrix with $D^2=I$.

Thus D is an orthogonal diagonal matrix with entries $\pm1$ on the diagonal.

When left-multiplying Eqn (1) by $ Q_{1}^{T} $ and right-multiplying by ${R}_{2}^{-1} $ gives $D^t= {Q}_{1}^{T} {Q}_{2}={R}_{1}{R}_{2}^{-1} $:

\begin{equation} \Rightarrow Q_{1} R_{1}=Q_{2} R_{2}\\ \Leftrightarrow Q_1 R_1 R_1^{-1}=Q_{2} R_{2} R_{1}^{-1}\\ \Leftrightarrow Q_1=Q_2D^t \end{equation}

Multiplying this by its transpose and using orthogonality of $ Q_1, Q_2$ we get $ I=Q_{1}^{t} Q_{1}=\left(Q_{2} D^t\right)^{t}\left(Q_{2} D^t\right)=D Q_{2}^{t} Q_{2} D^t=DD^{T}=D^{2} $. This proves $ D^{2}=I $, so $ D=S $, a diagonal matrix with entries $ \pm 1 $. So $\boldsymbol{Q}_{1}=\boldsymbol{Q_2}\boldsymbol{S^t} $.

Left multiplying Eqn (1) by $ Q_{1}^{t}=S Q_{2}^{t} $ then yields: \begin{equation} \Rightarrow Q_{1} R_{1}=Q_{2} R_{2}\\ \Leftrightarrow Q_1^tQ_1R_1=Q_1^tQ_2R_2\\ \Leftrightarrow R_1=SQ_2^tQ_2 R_2\\ \Leftrightarrow R_1=SR_2 \end{equation} proving that $ \boldsymbol{R}_{1}=\boldsymbol{S} \boldsymbol{R}_{2} $.

If one additionally specifies the condition that $R$ has only positive diagonal elements, this is also true for $R^{-1}$. Since here $D=S={R}_{2} {R}_{1}^{-1}$ is an orthogonal diagonal matrix, it follows with the positivity of the diagonal entries: $D=S=I$. Thus the uniqueness of Q and R follows.