# $QR$ decomposition of matrix

Let $Q_1$, $Q_2$ be unitary matrix and $R_1$, $R_2$ be upper triangular with positive diagonal elements. How do I prove that if $Q_1 R_1=Q_2 R_2$, then $Q_1=Q_2$ and $R_1=R_2$?

-

If $Q_1 R_1 = Q_2 R_2$, then we have that $$Q_2^{-1} Q_1 = R_2 R_1^{-1} = B$$ Note that $R_2 R_1^{-1}$ is an upper triangular matrix with positive entries on the diagonal and $Q_2^{-1} Q_1$ is again a unitary matrix. Hence, we have $B$ to be upper triangular with positive entries on the diagonal and also unitary. Can you now finish it off?
(What should $B$ be? Any triangular unitary matrix with positive entries on the diagonal is $\underline{\hspace{2em}}$)