skoro v0.0.0

Writeup

The geometry begins with smooth manifolds, tangent vectors and the tangent bundle as Lee defines them, fixes a basis of each tangent space by a convention that need not be smooth, and only then defines a retraction; every later note speaks in tangent coordinates alone.

Updated 2026-11-18 · 14 min read

Context#

The order of the first two notes#

The Mathematics section opens with Retractions and tangent charts (geometry, 1) and comes back to Derivatives in tangent charts (geometry, 3), after the note on automatic differentiation. The first defines a retraction as a smooth map R:TX→XR : \T\manifold \to \manifold with

Rx(0)=xandDRx(0)=Id, R_\point(0) = \point \qquad \text{and} \qquad \D R_\point(0) = I_\dimension ,

“with TxX\T_\point\manifold identified with Rd\R^\dimension”. The third defines D\D, the derivative of a map between manifolds, by reading the map in the charts that retractions provide.

So the derivative a retraction is defined by is not defined until two notes later, and when it is, it is defined through retractions. The definition rests on a derivative in some chart, which the notes never name. Neither do they define what TX\T\manifold is, or what it means for a map on it to be smooth. Both definitions are standard and short, and the notes need them.

The identification of tangent spaces#

The first note handles the tangent spaces in one paragraph: each TxX\T_\point\manifold “is identified with Rd\R^\dimension by a basis chosen smoothly in x\point”. It then concedes that the sphere has no such basis, by the hairy ball theorem, and asks a computation to stay where the basis is smooth. That assumption carries more weight than it looks. First-order notions (the derivative at a point, the chain rule, the tangent chart at a point) need a basis at each point and nothing more. Second-order notions (the mirror identity, the chart Hessian, densities read in the chart at a moving point) compare bases at nearby points, and they do need the bases to vary smoothly. The note does not say which is which.

skoro itself works only in coordinates. Every space’s tangent is a Vector of the space’s dimension, as the doc comment of crates/skoro-core/src/retraction.rs says (read at d90aa47):

//! The tangent of every space is a `Vector` of the space's dimension.

Its sphere, the embedded type of the acceptance test, carries exactly the data in question (crates/skoro/tests/common/sphere.rs, at d90aa47):

//! The unit sphere `S²` of the acceptance test: storage 3, dimension 2, with the basis `B(x)`
//! smooth off the south pole and the inverse stereographic retraction scaled so that its
//! derivative at 0 is `B(x)`.

B(x)B(\point) is a basis of the tangent space at each point but the south pole, smooth where it is defined. The retraction is built so that, read through B(x)B(\point), its derivative at 00 is the identity. The mathematics should say this in its own terms: a basis of each tangent space, how regular that basis is, and a retraction defined independently of it.

Decision#

The note keeps its slug, retraction, so that the links to it stay valid. Its sections follow, in order.

Smooth manifolds and smooth maps#

The note cites [Lee13, Chapters 1 and 2] for a cohesive theory, and recalls what it uses. X\manifold is a smooth manifold of dimension d\dimension: a topological manifold with a smooth structure, that is, a maximal atlas of charts (U,φ)(U, \varphi) whose transition maps are smooth. A map F:X→Y\map : \manifold \to \otherManifold, between smooth manifolds of dimensions dx\dimx and dy\dimy, is of class CkC^k when it is continuous and, for every chart (U,φ)(U, \varphi) of X\manifold and every chart (V,ψ)(V, \psi) of Y\otherManifold, the coordinate representation

ψ∘F∘φ−1:φ(U∩F−1(V))→Ryd \psi \circ \map \circ \varphi^{-1} : \varphi\bigl(U \cap \map^{-1}(V)\bigr) \to \R^\dimy

is of class CkC^k. Continuity makes U∩F−1(V)U \cap \map^{-1}(V) open, so the representation is a map between open subsets of Euclidean spaces. Because the transition maps are smooth, it suffices to check this for the charts of any atlas. The set of these maps is Ck(X,Y)C^k(\manifold, \otherManifold), and a smooth map is one of class C∞C^\infty.

Tangent vectors and the tangent bundle#

The note cites [Lee13, Chapter 3] for these, and recalls:

  1. the tangent space TxX\T_\point\manifold, a real vector space of dimension d\dimension, and the differential dFx:TxX→TF(x)Y\dd\map_\point : \T_\point\manifold \to \T_{\map(\point)}\otherManifold of a smooth map, which is linear and satisfies the chain rule d(G∘F)x=dGF(x)∘dFx\dd(G \circ \map)_\point = \dd G_{\map(\point)} \circ \dd\map_\point;
  2. that a chart (U,φ)(U, \varphi) around x\point gives a basis of TxX\T_\point\manifold, its coordinate basis, in which dFx\dd\map_\point has the Jacobian of the coordinate representation as its matrix;
  3. that a vector space EE has each TeE\T_e E identified with EE itself, canonically, so that on Rn\R^n the differential is the Jacobian;
  4. the tangent bundle TX=⨆xTxX\T\manifold = \bigsqcup_\point \T_\point\manifold, a smooth manifold of dimension 2d2\dimension whose charts are built from those of X\manifold, a point paired with the components of a vector in that chart’s coordinate basis; and its zero section 0x0_\point.

This is everything the definition of a retraction needs, and the note needs nothing more from Lee.

A basis of each tangent space#

The note then fixes, for each point x\point, a linear isomorphism

ιx:Rd→TxX,(1) \basis_\point : \R^\dimension \to \T_\point\manifold , \tag{1}
(1)

a basis of the tangent space at x\point. Its columns ιxe1,…,ιxed\basis_\point e_1, \dots, \basis_\point e_\dimension are the basis vectors. The coordinate basis of a chart around x\point is one choice, and every choice is the coordinate basis of some chart. In these bases, the derivative of a smooth map is a matrix:

DF(x)≔ιF(x)−1∘dFx∘ιx∈Rdy×dx.(2) \D\map(\point) \defeq \basis_{\map(\point)}^{-1} \circ \dd\map_\point \circ \basis_\point \in \R^{\dimy \times \dimx} . \tag{2}
(2)

On Rn\R^n the convention is the identity, under the canonical identification, so D\D of a map between Euclidean spaces is its Jacobian. The chain rule becomes the product of matrices, D(G∘F)(x)=DG(F(x)) DF(x)\D(G \circ \map)(\point) = \D G(\map(\point))\, \D\map(\point), because the bases at F(x)\map(\point) cancel. This is Proposition 3, which the third note used to prove and the first note now proves in one line.

No regularity in x\point is asked of the convention, and it need not be defined everywhere. It may be given on an open subset X∘⊆X\manifold_\circ \subseteq \manifold only, and everything below is then said of points of X∘\manifold_\circ, with every computation kept inside it. The sphere is the example. No convention on S2S^2 is smooth everywhere, by the hairy ball theorem, and the basis B(x)B(\point) above is defined everywhere except the south pole and smooth where it is defined. On the rotations, a group’s left translations give a convention that is defined and smooth everywhere.

A convention without regularity is enough for everything at one point: the derivative, the chain rule and the tangent chart at x\point. It is not enough for what compares the bases at nearby points: the mirror identity, the chart Hessian and the second-order half of the passes, and densities read in the chart at a moving point. For example, x⊖(x⊕v)\point \ominus (\point \oplus \tangent) is measured in the basis at x⊕v\point \oplus \tangent, and if that basis jumps, the mirror identity fails at first order. Those results assume that the convention is smooth near x\point: that (y,v)↦ιyv(\otherPoint, \tangent) \mapsto \basis_\otherPoint \tangent is smooth from W×RdW \times \R^\dimension to TX\T\manifold on an open W∋xW \ni \point, which says that its columns form a smooth local frame on WW ([Lee13, Chapter 8]). The retractions section shows that this is the same as ⊕\oplus being smooth near x\point, which is how later notes state it.

Retractions#

With the tangent bundle and the differential in hand, a retraction is defined without any basis, as in optimization on manifolds (Absil, Mahony and Sepulchre, Optimization Algorithms on Matrix Manifolds, Section 4.1):

A retraction on X\manifold is a smooth map retract⁡:TX→X\retr : \T\manifold \to \manifold such that, for every x\point, its restriction retract⁡x\retr_\point to TxX\T_\point\manifold satisfies retract⁡x(0x)=x\retr_\point(0_\point) = \point and d(retract⁡x)0x=idTxX\dd(\retr_\point)_{0_\point} = \mathrm{id}_{\T_\point\manifold}, where T0x(TxX)\T_{0_\point}(\T_\point\manifold) is identified with TxX\T_\point\manifold as in item 3.

The condition on the differential is coordinate-free, so it holds whatever the convention. Read in the bases (1), the retraction at x\point is a map from Rd\R^\dimension:

Rx≔retract⁡x∘ιx:Rd→X,x⊕v≔Rx(v),(3) R_\point \defeq \retr_\point \circ \basis_\point : \R^\dimension \to \manifold , \qquad \point \oplus \tangent \defeq R_\point(\tangent) , \tag{3}
(3)

and its two conditions become, for every convention,

x⊕0=xandDRx(0)=ιx−1∘d(retract⁡x)0x∘ιx=Id. \point \oplus 0 = \point \qquad \text{and} \qquad \D R_\point(0) = \basis_\point^{-1} \circ \dd(\retr_\point)_{0_\point} \circ \basis_\point = I_\dimension .

“The derivative at the origin is the identity” now has a meaning, given by (2), before it is used.

The note also shows that the convention is smooth on an open set WW if and only if (x,v)↦x⊕v(\point, \tangent) \mapsto \point \oplus \tangent is smooth on W×RdW \times \R^\dimension. If the convention is smooth, ⊕\oplus is the composite of retract⁡\retr with a smooth map. Conversely, the retraction’s condition on its differential gives

ιxv=ddt∣t=0(x⊕tv), \basis_\point \tangent = \frac{\dd}{\dd t}\Big|_{t=0} (\point \oplus t\tangent) ,

the velocity of a curve that depends smoothly on (x,v)(\point, \tangent) when ⊕\oplus does. So later notes can state the regularity they need as ”⊕\oplus is smooth near x\point”, and never need to mention the basis.

The note keeps the two examples, rewritten to show the two pieces apart. On Rd\R^\dimension, retract⁡x(w)=x+w\retr_\point(w) = \point + w, with the identity convention. On the positive reals, with TxR>0=R\T_\point\positive = \R canonically, the retraction is retract⁡x(w)=x ew/x\retr_\point(w) = \point\, e^{w / \point}, and the convention ιx(v)=x v\basis_\point(\tangent) = \point\, \tangent measures relative change. Together they give x⊕v=x ev\point \oplus \tangent = \point\, e^\tangent.

Tangent charts#

RxR_\point is smooth and its differential at 00 is ιx\basis_\point, an isomorphism. The inverse function theorem for manifolds ([Lee13, Chapter 4]) makes it a diffeomorphism from an open neighbourhood of 00 onto an open neighbourhood of x\point. Its inverse, y↦y⊖x≔Rx−1(y)\otherPoint \mapsto \otherPoint \ominus \point \defeq R_\point^{-1}(\otherPoint), is a smooth chart centred at x\point, compatible with the smooth structure because it is a diffeomorphism onto an open subset of Rd\R^\dimension. Its coordinate basis at x\point is ιx\basis_\point: the tangent chart reproduces the convention at its centre, and nowhere else need it agree with any other chart. The equations (3) and roundtrip keep their tags.

Derivatives through the retraction#

Because DRx(0)=I\D R_\point(0) = I and, by the inverse function theorem, D(⋅⊖y)(y)=I\D(\cdot \ominus \otherPoint)(\otherPoint) = I, the chain rule gives the formula every later note computes with. For smooth F\map and y=F(x)\otherPoint = \map(\point),

DF(x)=D[(⋅⊖y)∘F∘(x⊕⋅)](0),DF(x) v=ddt∣t=0(F(x⊕tv)⊖y), \D\map(\point) = \D\bigl[(\cdot \ominus \otherPoint) \circ \map \circ (\point \oplus \cdot)\bigr](0), \qquad \D\map(\point)\, \tangent = \frac{\dd}{\dd t}\Big|_{t=0} \bigl(\map(\point \oplus t\tangent) \ominus \otherPoint\bigr) ,

the Jacobian at 00 of a map between open subsets of Euclidean spaces. The derivative that (2) defines from the differential and the derivative read through the retraction are the same matrix. This is the statement the third note now makes as a definition, together with the recipe for deriving a Jacobian by hand: perturb, push through, solve for the tangent, and differentiate.

The mirror identity#

The mirror identity stays in this note, with its hypothesis made explicit: the convention is smooth near x\point. Its proof differentiates φ(v,c)=Rx−1(Rx⊕v(c))\varphi(\tangent, c) = R_\point^{-1}(R_{\point \oplus \tangent}(c)) in v\tangent, which moves the basis.

From here on#

The note ends with an index of every place where later notes abuse notation, each standing for an object of this note read through the convention. A later note never writes retract⁡\retr, dFx\dd\map_\point or ιx\basis_\point. It treats a tangent vector as a column of d\dimension numbers attached to a point, as skoro does, and keeps writing TxX\T_\point\manifold for the space of those columns, so that it is visible which point a vector belongs to. Inside this note TxX\T_\point\manifold is the space of derivations. After it, TxX\T_\point\manifold is its coordinate space, and the index says so first.

written later asstands forfirst used in
TxX=Rd\T_\point\manifold = \R^\dimension, the tangent space at x\pointTxX\T_\point\manifold, through ιx\basis_\pointevery later note
v∈TxX\tangent \in \T_\point\manifold, a column of d\dimension numbersthe tangent vector ιxv\basis_\point \tangentevery later note
a frame, a d×n\dimension \times n matrix of tangent vectors at x\pointnn tangent vectors, each through ιx\basis_\pointautomatic differentiation; gradients and Hessians
a cotangent α∈Rd\alpha \in \R^\dimension, a column acting by α⊤v\alpha\transpose \tangentthe covector α⊤ιx−1\alpha\transpose \basis_\point^{-1} on TxX\T_\point\manifoldgradients and Hessians
DF(x)∈Rdy×dx\D\map(\point) \in \R^{\dimy \times \dimx}the differential dFx\dd\map_\point, by (2)this note, and every later one
DF(x)⊤\D\map(\point)\transpose, applied to a cotangentthe pull-back of a covector by dFx\dd\map_\pointgradients and Hessians
the gradient g(x)=Df(x)⊤1g(\point) = \D f(\point)\transpose 1the differential dfx\dd f_\point, not a Riemannian gradientgradients and Hessians
x⊕v\point \oplus \tangent, y⊖x\otherPoint \ominus \point, RxR_\point, Rx−1R_\point^{-1}retract⁡(ιxv)\retr(\basis_\point \tangent) and its local inversethis note, and every later one
pairs (x,v)(\point, \tangent) with v∈Rd\tangent \in \R^\dimensionthe tangent bundle TX\T\manifold over the convention’s domainthis note
”⊕\oplus is smooth near x\point”the convention is a smooth local frame near x\pointthis note; gradients and Hessians; chart volume
TxX=Tx1X1⊕⋯⊕TxkXk\T_\point\manifold = \T_{\point_1}\manifold_1 \oplus \cdots \oplus \T_{\point_k}\manifold_k, stacked columnsthe direct sum, with the convention that is each factor’s on its blockproduct manifolds
the Lebesgue measure on TxX\T_\point\manifold, and densities with respect to itLebesgue measure on Rd\R^\dimension, carried to TxX\T_\point\manifold by ιx\basis_\point, which depends on the conventionchart volume; the normal

The last row is the one where the convention matters most. A density on a tangent space changes by ∣det⁡∣\lvert\det\rvert of a change of basis, so a density “on TxX\T_\point\manifold” is always one in the coordinates the convention gives.

Gradients and Hessians in tangent charts#

The derivative, its formula through the retraction and the chain rule move into the first note, as above. The third note keeps the rest under its slug, derivatives-in-charts, retitled Gradients and Hessians in tangent charts: the gradient (1), the chart Hessian (2), and the statement that the passes of automatic differentiation compute them. These cannot move into the first note: the passes rest on automatic differentiation (geometry, 2), and the build refuses a note that depends on a later one. Keeping the slug keeps the archive’s references to the gradient, the chart Hessian and the passes valid. Only the references to derivative and to the chain rule follow those results into the first note. The chart Hessian and the second-order half of the passes now state their hypothesis, that ⊕\oplus is smooth near x\point.

Consequences#

The definitions come in order. Every symbol in the definition of a retraction is defined before it. The regularity the bases need is stated once and invoked where it is used, rather than assumed for every point and then conceded for the sphere.

Later notes stay in coordinates. After the table, a reader works with ⊕\oplus, ⊖\ominus, D\D and vectors in Rd\R^\dimension alone, as the code does. Two notes speak of an action that “carries the basis at x\point to the basis at” its image: the quotient and the chart volume. That is the matrix statement D(g ⋅)(x)=Id\D(g\,\cdot)(\point) = I_\dimension under (2), and at publish they restate it that way. The regularity they need becomes ”⊕\oplus is smooth”. A rule goes into authoring.md, under “The math notes”, so that new notes keep to it: past the first note, the geometry is written in tangent coordinates.

The first note gets longer, and reads quickly. It adds four short sections of recalled definitions, each a paragraph citing Lee, and proves only what is new: the coordinate form of the retraction’s conditions, the tangent charts, and the derivative through the retraction.

References to keep true. At publish:

  • eq:math/retraction/oplus and roundtrip keep their tags in the first note. The heading ## The definition, cited from archive/core/math as math/retraction/#the-definition, is kept or the reference is amended, since the build does not check anchors.
  • eq:math/derivatives-in-charts/derivative, cited from archive/core/math, archive/core/implementation and archive/rotations/statements/first-order, moves to the first note, and those references are amended and listed under amends: to eq:math/retraction/derivative where they cite the definition, and to eq:math/retraction/directional, the derivative written through the retraction, where they cite the formula a finite difference checks.
  • statement:math/derivatives-in-charts/chain-rule moves to the first note, and the proof of the passes cites it there.
  • derivatives-in-charts keeps its slug and its place, geometry 3, retitled Gradients and Hessians in tangent charts. Each note that lists it in depends_on is reread. One that used it for the derivative alone depends on retraction instead. quotient-manifold, which cites the chart Hessian, keeps it.
  • The notes after the first that rely on the old wording are reread: product-manifold (its stacking of tangent spaces), quotient-manifold and chart-volume (the action on bases, restated as D(g ⋅)(x)=I\D(g\,\cdot)(\point) = I, and the smoothness of ⊕\oplus that their densities need), and rotations (its retraction, smooth everywhere).
  • \basis becomes a site-wide macro in site/katex.config.ts, and Absil, Mahony and Sepulchre enter references.bib.

No code changes. The library already works this way, so the entry changes only the notes, and the pages that link to them, concepts/spaces and concepts/queries, need at most new link text.

Alternatives#

Keep the order, and assume a smooth basis. This is today’s note. It defines a retraction with a derivative not yet defined, and its assumption is false on the sphere, which it then has to concede.

A chart at each point. One could fix a chart φx\varphi_\point centred at each point and define DF(x)\D\map(\point) as the Jacobian at 00 of ψF(x)∘F∘φx−1\psi_{\map(\point)} \circ \map \circ \varphi_\point^{-1}. That gives the same derivatives as (1): only the chart’s differential at its centre is ever used, and that differential is a basis. A chart carries second-order information that nothing reads, and suggests that the second-order notions are fixed by it, when they depend on how the bases vary from point to point. The basis is exactly the data used.

A retraction defined in coordinates. One could skip TX\T\manifold and define a retraction as a smooth ⊕:X×Rd→X\oplus : \manifold \times \R^\dimension \to \manifold. That requires a basis smooth everywhere, which only parallelizable manifolds have, and so rules out the sphere. It also hides the fact that the retraction and the basis are separate choices, a fact the positive reals’ example shows.

The exponential map of a metric. A Riemannian structure gives a canonical retraction and orthonormal bases. The notes have avoided a metric so far, and nothing here needs one: a retraction is only required to agree with the exponential map to first order.

Tangent spaces as subspaces of an ambient space. For a manifold embedded in Rn\R^n, TxX\T_\point\manifold is a subspace of Rn\R^n and needs no derivations. Not every space of the notes is embedded as it is stored (the rotations are stored up to the sign of a quaternion), and the ambient coordinates have nn entries rather than d\dimension, while every tangent in skoro is a vector of the space’s dimension.

Revisions#

2026-11-17. The publish moved the chain-rule statement into the first note, so this writeup’s reference to it, written while it was still in the third, no longer resolved. The reference now points to statement:math/retraction/chain-rule. The list of moved labels also said that the archive’s references to the derivative would all go to eq:math/retraction/derivative. Most of them cite the derivative as a finite difference checks it, so the publish sent them to eq:math/retraction/directional, and the list now says so.

References

  1. [Lee13] John M. Lee. Introduction to Smooth Manifolds. Second edition. Springer, 2013.