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?