# Jacobian of the change of variables by QR decomposition $A = QR$

One can view typical matrix factorizations, like the QR decomposition $A = QR$, as a change of variables. We consider each factor as living in the appropriate submanifold of $\mathbb R^N$ for some $N$:

• $A \in \mathbb R^{m \times n} \simeq \mathbb R^{mn}$ in the obvious way. The chart is trivial.
• $R$ is in the set $T(m, n)$ of upper-triangular matrices in $\mathbb R^{m \times n} \simeq \mathbb R^{\frac{(2n-m+1)m}{2}}$ in the obvious way (we've assumed $m \leq n$). The chart here is also trivial.
• $Q$ lies in the Stiefel manifold/orthogonal lie group, which is a $\frac{m(m-1)}{2}$ dimensional submanifold of $\mathbb R^{m \times m} \simeq \mathbb R^{m^2}$. The chart is not obvious.

Then we consider $f : O(n) \times T(m,n) \to \mathbb R^{m \times n}$ given by $f(Q, R) = QR$. This is a map of same-dimensional manifolds, and the Jacobian for the change of variables $f$ is the absolute determinant of the derivative, $\left| \det Df \right|$.

Now in sources by Edelman, like on page 31 or page 9 or page 5, the Jacobian is given as $$dA = \prod_{i=1}^m r_{ii}^{n-i} \, dR \, dQ \qquad\text{or}\qquad (dA) = \prod_{i=1}^m r_{ii}^{n-i} \, (dR) \, (Q^T dQ).$$ What I don't understand is how to derive this formula or interpret his $dQ$ stuff. When doing similar problems, $Df$ is easy to compute in coordinates; here, we don't know coordinates relating to $Q$. And the only way I know how to interpret Jacobians would be as in the context of $$\int_{f(\mathcal Q, \mathcal R)} g(A) \, dA = \int_{\mathcal Q} \int_{\mathcal R} g(f(Q, R)) \prod_{i=1}^m r_{ii}^{n-i} \, dR \, d\mu,$$ where $g$ is some measurable function. The inner integral makes sense to me and the outer integral only makes sense to me where $\mu$ is the Haar measure on $O(n)$. But the notation $(Q^T \, dQ)$ seems an odd choice if $d \mu$ is what he means, so I suspect I'm missing something.

Can someone elaborate on what's going on here?

We assume $m=n$, $R=[r_{i,j}]$ and let $f:(Q,R)\rightarrow QR$; we seek $J(Q,R)=\det(Df_{Q,R})$. Since $O(n)$ is a group, I think that it is not difficult to see (and we admit) that $J(Q,R)=J(I,R)$. We show that $$J(I,R)=\Pi_{i=1}^n{r_{i,i}}^{n-i}.$$
$\phi=Df_{I,R}:(H,K)\rightarrow HR+K$ where $H$ is skew symmetric (it is in the tangent space to $O(n)$ in $I$) and $K$ is upper triangular. If $A\in M_n$, let $g(A)\in M_n$ be its strictly lower triangular part.
One has $\det(\phi)=\det(\psi)$ where $\psi:g(H)\in \mathbb{R}^{n(n-1)/2}\rightarrow g(HR)\in\mathbb{R}^{n(n-1)/2}$. Note that, when $i>j$, $(HR)_{i,j}=h_{i,1}r_{1,j}+\cdots+h_{i,j}r_{j,j}$. We write the $((HR)_{i,j})_{i>j}$ and the $(H_{i,j})_{i>j}$ in the lexicographic order. Then the matrix $D\psi$ is upper triangular and the elements of the diagonal are the $(r_{j,j})$. More precisely, we have a look at the case $n=4$:
$\text{Element, on the diagonal, of index: }2,1\rightarrow r_{1,1};3,1\rightarrow r_{1,1};3,2\rightarrow r_{2,2};4,1\rightarrow r_{1,1};4,2\rightarrow r_{2,2};4,3\rightarrow r_{3,3}$.
When $n=4$, $\det(D\psi)=r_{1,1}^3r_{2,2}^2r_{3,3}$ and, more generally, for any $n$, $\det(D\psi)=J(I,R)=\Pi_{i=1}^n{r_{i,i}}^{n-i}$. $\square$