QR decomposition help
Solution 1:
Here, $Q$ stands for an orthogonal matrix (one whose columns and rows are orthogonal unit vectors), and $R$ is an upper triangular matrix (entries below the main diagonal are zero).
The QR algorithm can be proved by showing that the columns of $Q$ are orthogonal and the matrix $R$ is upper triangular using the Gram-Schmidt orthonormalisation method. If $A$ is non-singular, then this process yields $R$ with a positive diagonal.
The fact that $R$ now has a positive diagonal leads to its importance in uniqueness. Given two decompositions $Q_1R_1$ and $Q_2R_2$ with upper triangular factors having positive diagonals, write $Q^*_2Q_1= R_2R^{-1}_1$. Note that $R_2R^{-1}_1$ is upper triangular and has a positive diagonal, and $Q^*_2Q_1$ is unitary. The only upper triangular unitary matrices are diagonal matrices, and the only unitary matrix with positive diagonal is the identity matrix. This leads to $Q^*_2Q=I$ and hence $Q_1=Q_2$.