skoro v0.0.0

Derivatives in tangent charts

The derivative of a map between manifolds, its gradient and its Hessian product, all read in the tangent charts a retraction provides, and why automatic differentiation computes them unchanged.

Updated 2026-10-12 · 4 min read

A retraction gives every point of a manifold a chart, its tangent space. This note reads derivatives in those charts: the derivative of a map between manifolds as a matrix, the gradient of a scalar function as a vector, and its second derivative along a direction. Each is what an optimizer or a sampler needs at a point, and none needs a metric.

The derivative#

Let F:X→Y\map : \manifold \to \otherManifold be smooth, between manifolds of dimensions d\dimension and ee, each with a retraction, and let y=F(x)\otherPoint = \map(\point). The derivative of F\map at x\point is the e×de \times \dimension matrix of F\map read in the chart at x\point and the chart at y\otherPoint:

DF(x) v≔ddt∣t=0(F(x⊕tv)⊖y),v∈Rd.(1) \D \map(\point)\, \tangent \defeq \frac{\dd}{\dd t}\Big|_{t=0} \bigl(\map(\point \oplus t \tangent) \ominus \otherPoint\bigr), \qquad \tangent \in \R^\dimension . \tag{1}
(1)

Equivalently, DF(x)\D \map(\point) is the ordinary Jacobian at 00 of the local representative F^x=Ry−1∘F∘Rx\hat \map_\point = R_\otherPoint^{-1} \circ \map \circ R_\point, a map from a neighbourhood of 00 in Rd\R^\dimension to Re\R^e. Because each DRx(0)\D R_\point(0) is the identity, it is also the intrinsic differential of F\map, written in the bases that identify the tangent spaces with Rd\R^\dimension and Re\R^e.

Proposition 2(The chain rule in tangent charts).

For smooth F:X→Y\map : \manifold \to \otherManifold and G:Y→ZG : \otherManifold \to \bbZ, D(G∘F)(x)=DG(F(x)) DF(x)\D(G \circ \map)(\point) = \D G(\map(\point))\,\D \map(\point), every derivative taken in tangent charts.

Proof.

Near 00, G∘F^x=Rz−1∘G∘F∘Rx=(Rz−1∘G∘Ry)∘(Ry−1∘F∘Rx)=G^y∘F^x\widehat{G \circ \map}_\point = R_z^{-1} \circ G \circ \map \circ R_\point = (R_z^{-1} \circ G \circ R_\otherPoint) \circ (R_\otherPoint^{-1} \circ \map \circ R_\point) = \hat G_\otherPoint \circ \hat \map_\point, with z=G(y)z = G(\otherPoint), because Ry∘Ry−1R_\otherPoint \circ R_\otherPoint^{-1} is the identity near y\otherPoint. The ordinary chain rule at 00, with F^x(0)=0\hat \map_\point(0) = 0, gives the claim.

∎

So derivatives in charts compose exactly as Jacobians do, and the passes of automatic differentiation apply unchanged to a program whose steps are maps between manifolds, as long as each step’s derivative is taken in charts. To derive one by hand:

  1. perturb the input, xt=x⊕tv\point_t = \point \oplus t \tangent;
  2. push it through, yt=F(xt)\otherPoint_t = \map(\point_t);
  3. solve yt=y⊕v(t)\otherPoint_t = \otherPoint \oplus \otherTangent(t) for v(t)\otherTangent(t);
  4. the Jacobian–vector product is v′(0)\otherTangent'(0), and the vector–Jacobian product is its transpose.

The transpose is taken in coordinates: a cotangent at y\otherPoint is a row of ee numbers acting on tangent coordinates, and DF(x)⊤\D \map(\point)\transpose maps it to a cotangent at x\point. No inner product on the tangent spaces is involved.

The gradient#

For a scalar function f:X→Rf : \manifold \to \R, its gradient in the chart at x\point is

g(x)≔∇(f∘Rx)(0)=Df(x)⊤1∈Rd,(3) g(\point) \defeq \nabla (f \circ R_\point)(0) = \D f(\point)\transpose 1 \in \R^\dimension, \tag{3}
(3)

the cotangent that a reverse pass seeded with 11 delivers. It says how ff changes along a step: f(x⊕v)=f(x)+g(x)⊤v+O(∥v∥2)f(\point \oplus \tangent) = f(\point) + g(\point)\transpose \tangent + O(\lVert\tangent\rVert^2). With no metric in play, it is the differential of ff written in chart coordinates, not a Riemannian gradient.

The Hessian product#

The second derivative needs a choice that the first does not, because moving along a direction moves the chart as well. The chart Hessian differentiates the gradient along a direction v\tangent, reading the gradient at each point in that point’s own chart:

H(x) v≔ddt∣t=0g(x⊕tv).(4) H(\point)\, \tangent \defeq \frac{\dd}{\dd t}\Big|_{t=0} g(\point \oplus t \tangent) . \tag{4}
(4)

The other candidate is the Hessian of the pull-back f∘Rxf \circ R_\point, which keeps the chart at x\point fixed. On a flat manifold the two are the same matrix, the ordinary Hessian. On a curved one they differ by a term proportional to the gradient.

Proposition 5(The chart Hessian and the Hessian of the pull-back).

Let xt=x⊕tv\point_t = \point \oplus t \tangent and φt=Rx−1∘Rxt\varphi_t = R_\point^{-1} \circ R_{\point_t}, defined near 00 for small tt. Then

H(x) v=∇2(f∘Rx)(0) v+(ddt∣t=0Dφt(0))⊤g(x), H(\point)\,\tangent = \nabla^2 (f \circ R_\point)(0)\, \tangent + \Bigl(\frac{\dd}{\dd t}\Big|_{t=0} \D\varphi_t(0)\Bigr)\transpose g(\point),

so H(x) v=∇2(f∘Rx)(0) vH(\point)\,\tangent = \nabla^2 (f \circ R_\point)(0)\, \tangent at every stationary point, where g(x)=0g(\point) = 0.

Proof.

For small tt and uu near 00, Rxt(u)=Rx(φt(u))R_{\point_t}(u) = R_\point(\varphi_t(u)), with φ0\varphi_0 the identity and φt(0)=Rx−1(xt)=tv\varphi_t(0) = R_\point^{-1}(\point_t) = t \tangent by (3). So f∘Rxt=(f∘Rx)∘φtf \circ R_{\point_t} = (f \circ R_\point) \circ \varphi_t near 00, and

g(xt)=Dφt(0)⊤ ∇(f∘Rx)(tv). g(\point_t) = \D \varphi_t(0)\transpose\, \nabla (f \circ R_\point)(t \tangent) .

Differentiating at t=0t = 0, with Dφ0(0)=I\D \varphi_0(0) = I and ∇(f∘Rx)(0)=g(x)\nabla (f \circ R_\point)(0) = g(\point), gives the claim.

∎

On the rotations, with the retraction Rx(u)=xExp⁡(u)R_\point(u) = \point \operatorname{Exp}(u), the Baker–Campbell–Hausdorff formula gives φt(u)=tv+u+t2 v×u\varphi_t(u) = t \tangent + u + \tfrac{t}{2}\, \tangent \times u, up to terms of order t2∥u∥t^2 \lVert u\rVert and t∥u∥2t \lVert u\rVert^2, so the correction is 12[g(x)]×v\tfrac12 [g(\point)]_\times \tangent: the chart Hessian is the Hessian of the pull-back plus the skew-symmetric matrix 12[g(x)]×\tfrac12 [g(\point)]_\times, and it is not symmetric away from a stationary point. On the positive reals, with Rx(u)=x euR_\point(u) = \point\, e^{u}, the charts commute instead: φt(u)=tv+u\varphi_t(u) = t \tangent + u, whose derivative does not move with tt, so the correction vanishes and the two Hessians agree everywhere. Which symmetric matrix to use where they differ, if one is needed, is the algorithm’s decision. At a stationary point, which is where curvature is most often read (a Laplace approximation, a Newton step’s convergence), the two agree.

Programs over manifolds#

The chart Hessian is the one a forward-over-reverse pass computes, provided each step’s second-order map is read in charts the same way.

Proposition 6(The passes compute chart derivatives).

Let a program’s steps be maps between manifolds, with partial derivatives ∂jF\partial_j \map taken in tangent charts, and define each step’s second-order map at its inputs ss, with velocities vs\tangent_s, by

hvp⁡j(α)=ddt∣t=0∂jF(s⊕tvs)⊤α. \hvp_j(\alpha) = \frac{\dd}{\dd t}\Big|_{t=0} \partial_j \map(s \oplus t\tangent_s)\transpose \alpha .

Then for a scalar target ff, the reverse pass delivers the chart gradient g(x)g(\point) at the roots, and forward-over-reverse with velocities v\tangent delivers the chart Hessian product H(x) vH(\point)\,\tangent.

Proof.

First order is Proposition 2 applied step by step. For the second, the reverse recurrence holds identically in x\point, with every ∂jF\partial_j \map evaluated at the slot values computed from x\point and read in the charts at those values. Differentiate it along xt=x⊕tv\point_t = \point \oplus t \tangent. Each slot traces a curve s(xt)s(\point_t) through s(x)s(\point) whose velocity in the chart at s(x)s(\point) is vs=Ds(x) v\tangent_s = \D s(\point)\, \tangent, the velocity the forward pass computes. The derivative of the smooth function s↦∂jF(s)⊤αs \mapsto \partial_j \map(s)\transpose \alpha along a curve depends only on the curve’s velocity, so it equals the derivative along s⊕tvss \oplus t \tangent_s, which is hvp⁡j(α)\hvp_j(\alpha). The product rule then gives the forward-over-reverse recurrence, and at a root the differentiated quantity is g(xt)g(\point_t), whose derivative is (4).

∎

Built on by