Use that the square matrix \(A\) has a \(QR\) factorisation to prove that
where, as usual, \(a_j\) is column \(j\) of \(A\text{.}\)