Gradient of the composite of a function and the inverse of another

61 Views Asked by At

Let $f:\mathbb{R}^m \xrightarrow{} \mathbb{R}^m$ and $g: \mathbb{R}^m \xrightarrow{}\mathbb{R}$ such that $f$ has inverse $f^{-1}$. What would be the gradient of the composition of $g$ with the inverse of $f$, $\nabla( g \;\circ \; f^{-1})$?

My thoughts are that we have the chain rule for the Jacobian matrix that says that the Jacobian of the composite is the product of the Jacobian of the outer function evaluated at the inner function with the Jacobian of the inner function, also the Jacobian matrix of the inverse function is simply the inverse of the Jacobian matrix of $f$, the combination of these results would give me

$$ Jg(f(x))(Jf(x))^{-1} $$

Then for any $g: \mathbb{R}^m \xrightarrow{}\mathbb{R}$, $J(g(x))=(\nabla g(x))^{\top}$,

$$ \begin{align} J(g \;\circ \; f^{-1}) &= (\nabla g(f(x)))^\top(Jf(x))^{-1} \\ \nabla (g \;\circ \; f^{-1}) &= (\nabla g(f(x))^\top(Jf(x))^{-1})^\top \\ &= (Jf(x))^{-1})^\top\nabla g(f(x)) \end{align} $$

I would appreciate insights, thanks in advance.