Continuous, single-column reading. Equations, tables, proofs, references and appendices stay in document order.
Contents · 95 sections
Higher Categorical Semantics Monograph Volume II
Symplectic Diffeology in
Higher Categories
Moment maps, prequantisation, and reduction
behind Chapter 9 of Iglesias-Zemmour’s Diffeology
with applications to arithmetic, cryptography,
machine learning, artificial intelligence, and system design
A horizontal lift of a closed path to the Heisenberg group, for the connection form λ=dz+xdy.
The lift closes up to a vertical translation equal to the enclosed area: curvature, holonomy, and the Weil pairing in one picture.
Anonymous submission
Prepared for higher-categorical-semantics.pages.dev 27 November 2026
Abstract
Chapter 9 of Patrick Iglesias-Zemmour’s Diffeology [1] builds symplectic geometry on arbitrary diffeological spaces: for every closed 2-form ω on a space X and every diffeological group G of automorphisms of (X,ω) there is a moment map, with values in a quotient of the space G∗ of invariant 1-forms on G, with no hypothesis of dimension, non-degeneracy or smoothness of orbits. Volume I of this series [2] placed Chapters 1–8 of [1] in the cohesive ∞-topos H of smooth ∞-groupoids. This volume does the same for Chapter 9 and continues to prequantisation and reduction.
Part I. A closed 2-form is a map X→Ωcl2 to a classifying sheaf with one point, and the category of parasymplectic spaces is a slice of the topos of smooth sets. The moment map of [1] is the transgression of ω along the orbits of G; for an invariant primitive α it is the obstruction to the descent of α to the homotopy quotient X//G. The coadjoint orbit attached to a homogeneous space is the coimage of an orbit map, in the sense of the two factorisation systems of [I, Theorem 3.2].
Part II. A prequantisation is a lift of ω:X→Ωcl2 to the stack B(TP)conn of principal bundles with connection for a torus of periods TP=R/P, where P⊂R is any proper subgroup. Three theorems are proved for arbitrary diffeological spaces and groups. (A) An equivariant prequantum bundle (Y,λ) has a canonical equivariant moment map, μ(x)=y^∗λ, the pullback of the connection form along an orbit map; the holonomy and the Souriau class of [1] vanish. (B) The equivariant bundle is a map X//G→B(TP)conn exactly when μ=0. (C) If G acts principally on μ−1(0) then the quotient μ−1(0)/G carries a reduced closed 2-form and a reduced prequantum bundle with the same structure group, with no regularity hypothesis on the level set. Reduction of C2×C2 at an irrational level produces the prequantum bundle of S2×S2 as the leaf space (S3×S3)/R of an irrational flow, with structure group an irrational torus.
Part III consists of applications. In number theory, products R/a×R/b of one-dimensional tori attached to ideals of a number field are classified up to diffeomorphism by the Steinitz class [ab] and up to symplectomorphism by the ideal ab, which is the group of periods; their symplectic mapping class groups are Hilbert modular groups, and their prequantum bundles are Heisenberg quasi-nilmanifolds. In cryptography, the theta group of a polarised torus is the group of automorphisms of its prequantum bundle over the translations, the Weil pairing is its commutator, isogenies that preserve the polarisation are the quotients by isotropic subgroups, and the Gram–Schmidt profile of a symplectic lattice basis, including the NTRU bases of the signature scheme Falcon, is symmetric. In machine learning, Noether’s theorem holds for actions of arbitrary diffeological groups, compact symmetries of a loss give conserved momenta of Hamiltonian dynamics, non-compact symmetries give conserved quadratic forms of gradient flow, splitting integrators conserve the momenta exactly, and the symmetry accelerates training in four ways, by the choice of a level, by motion along orbits, by equivariant updates and by projection. In artificial intelligence, the momentum is a reachability invariant, the net motion produced by a cycle of shape changes is a holonomy, and a two-body system with irrational inertia ratio has a first integral with values in an irrational torus and none with values in a manifold. In system design, linear Lagrangian and Dirac relations compose, isotropic correspondences of diffeological spaces compose with no transversality hypothesis, and reduction commutes with interconnection. The common structure is stated in a final chapter: an objective on a quotient, a dynamics on an atlas, and a connection whose exact part gives conserved quantities and whose non-closed part gives phases; without the metric it holds in every ∞-topos, with it in a differentially cohesive ∞-topos, where the atlas of a quotient is a quotient by a formal group followed by a formally étale map, and for the syntax of an algebraic theory it is the theory of normal forms. In a last chapter the structure is made executable: architectures are terms of an initial algebra, the denotation, the two modes of differentiation and the parameter symmetries are its homomorphisms, and by a compiler to JAX the specifications of five published networks become optimizers whose forward and backward passes are selected at run time, and derivatives that are composites of the two modes are evaluated by plans of least cost.
The volume contains 31 numbered figures and a frontispiece, 19 tables, 79 numbered results and 79 solved exercises graded from warm-up to proof.
The second volume of a categorical companion to [1]. Volume I [2] is devoted to Chapters 1–8 of the book: plots, the quasitopos Diff, cohesion, shape, differential forms, fibre bundles and stacks. The present volume covers Chapter 9, Symplectic Diffeology, and to two subjects that follow it: prequantisation, for which the integration bundles of art. 8.42 are the starting point, and symplectic reduction.
The method is the one of Volume I. Each construction of the book is first stated in its own terms, with the article number; it is then identified with a universal construction in the quasitopos Diff, the topos SmoothSet of smooth sets or the ∞-topos H=Sh∞(Cart); and the identification is used to prove something further. In Part II the further results are the three theorems (A), (B), (C) of the abstract, proved by elementary arguments with plots and valid for every diffeological space and every diffeological group.
What is used from Volume I
The reader needs the following, cited as [I, …].
A diffeological space is a concrete sheaf on the site Cart of Cartesian spaces; Diff↪SmoothSet↪H are full embeddings [I, Theorems 2.2, 4.5]. Limits, colimits and function spaces exist in Diff[I, Theorems 1.6, 1.9].
A differential k-form on X is a map X→Ωk in SmoothSet. A form descends along a subduction π:X→B if and only if it takes equal values on plots with equal projections, and π∗ is injective [I, Proposition 6.4].
An action of a diffeological group G on X is principal if (g,x)↦(x,gx) is an induction; this holds if and only if the diffeological quotient is the homotopy quotient, X/G≃X//G[I, Theorem 7.2]. Principal bundles are classified by maps to the stack BG[I, Theorem 7.5]; over a Cartesian space they are trivial [I, Lemma 7.4].
For any action there are three quotients X//G→π0(X//G)→X/G: stack, smooth set, diffeological space [I, Theorem 7.8].
A quasi-torus is a quotient TΓ=Rn/Γ by a countable subgroup. Smooth maps between quasi-tori with dense Γ lift to affine maps [I, Theorem 9.1].
Attribution
A Theorem, Proposition or Lemma with a name or a reference in its heading is taken from the literature, and is given with that reference and, when it is short, a proof. Every other numbered statement is proved in the text. Formalisation in a proof assistant is the subject of a sequel; in Coda the statements are sorted by the infrastructure required.
How to read
Parts I and II are cumulative. The application chapters depend on them as follows.
Every chapter ends with solved exercises. Their level is marked by one to four stars: warm-up, computation, argument, proof. Exercises of the fourth level are propositions of the text whose proofs were deferred.
Conventions
Domains are open subsets of some Rn; plots are defined on domains, or equivalently on Cartesian spaces. Manifolds are finite-dimensional, Hausdorff and paracompact. Groups act on the left. For a diffeological group G, the space G∗ of momenta is the space of left-invariant 1-forms on G[IZ, art. 7.12]. A torus of periods is a quotient TP=R/P by a subgroup P⊊R; its canonical 1-form θ is the image of dt. The Heisenberg group of a bilinear form B on a vector space V is HB=V×R with (v,z)(v′,z′)=(v+v′,z+z′−B(v,v′)). References of the form [IZ, art. 9.1] are to articles of [1].
Symplectic diffeology
Closed 2-forms
A parasymplectic space is a diffeological space with a closed 2-form, that is, a map to the classifying sheaf Ωcl2. The category of parasymplectic spaces is a slice of the topos of smooth sets. We list the examples used throughout, compute the forms on quasi-tori, recall the chain-homotopy operator K that transgresses forms to path spaces, and prove a lemma on 1-forms on products that carries most of the proofs of Part II.
Parasymplectic spaces
A differential k-form on a diffeological space X assigns to every plot P:U→X a form ω(P)∈Ωk(U), compatibly with smooth reparametrisation [IZ, art. 6.28]. Equivalently it is a map X→Ωk in SmoothSet, where Ωk is the sheaf U↦Ωk(U) on Cart[I, §6.1]. The exterior derivative is a map of sheaves d:Ωk→Ωk+1, and its kernel in degree 2 is the sheaf Ωcl2 of closed 2-forms. The sheaf Ωcl2 has exactly one point, since a 2-form on R0 vanishes.
Definition 1.1. A parasymplectic space is a pair (X,ω) of a diffeological space and a closed 2-form ω∈Ω2(X), dω=0. A morphism (X,ω)→(X′,ω′) is a smooth map f with f∗ω′=ω. The category is denoted PSymp, and the group of automorphisms of (X,ω), with the functional diffeology, is Diff(X,ω).
No condition of non-degeneracy is imposed. A diffeological space has no tangent spaces on which to state one, and in [1] its role is taken by a property of the universal moment map (Coadjoint orbits). The term parasymplectic is that of [43].
Proposition 1.2 (The slice).
PSymp is the full subcategory of the slice topos SmoothSet/Ωcl2 on the objects ω:X→Ωcl2 with X diffeological, and Diff(X,ω) is the automorphism group of ω in the slice.
PSymp has pullbacks and equalisers, computed in Diff. The product of (X,ω) and (X′,ω′) in PSymp is the diffeological space X×ωX′=X×Ωcl2X′, whose underlying set is X×X′ and whose plots are the pairs of plots (P,P′) with ω(P)=ω′(P′).
The addition of forms +:Ωcl2×Ωcl2→Ωcl2 induces a symmetric monoidal structure (X,ω)⊞(X′,ω′)=(X×X′,pr1∗ω+pr2∗ω′) with unit the point, and (X,ω)↦X=(X,−ω) is an involution.
Proof. (i) A map X→Ωcl2 is a closed 2-form, and a map over Ωcl2 is a smooth map compatible with the forms. (ii) Limits of connected diagrams in a slice are computed in the ambient category, and Diff↪SmoothSet preserves limits [I, Theorem 4.5]. The product in a slice is the fibre product over the base. The fibre product X×Ωcl2X′ is a subsheaf of the concrete sheaf X×X′, hence concrete; its sections over U are the pairs (P,P′) with equal images in Ωcl2(U); and its points are all pairs (x,x′), because Ωcl2 has one point. (iii) The sheaf Ωcl2 is an abelian group object, and the stated product is the composite X×X′→Ωcl2×Ωcl2→Ωcl2. ◻
The space X×ωX′ has the points of the product and fewer plots. It is used in System design: composition, ports, and reduction as the universal isotropic correspondence: a smooth map (s,t):L→X×X′ factors through X×ωX′ if and only if s∗ω=t∗ω′.
Parasymplectic spaces as objects over Ωcl2: a morphism, the product in the slice, and the monoidal sum.
Examples
Example 1.3 (Manifolds). A manifold with a closed 2-form is a parasymplectic space, and PSymp contains the category of presymplectic manifolds and form-preserving maps as a full subcategory. Symplectic manifolds are characterised inside PSymp by Theorem 1.6.
Example 1.4 (Dimension one). Every 2-form on the irrational torus Tα=R/(Z+αZ) vanishes: its pullback to R is a 2-form on a 1-manifold, and pullback along a subduction is injective. The same holds for every quotient of a 1-manifold.
Proposition 1.5 (Forms on quasi-tori). Let Γ⊂Rn be a dense subgroup and q:Rn→TΓ=Rn/Γ the projection. Then q∗ identifies Ωk(TΓ) with the space Λk(Rn)∗ of constant k-forms. Every form on TΓ is closed, and (TΓ,ωΩ) is a parasymplectic space for every alternating bilinear form Ω on Rn.
Example 1.6 (The cone orbifold). Let Qm=C/Zm be the quotient of the plane by the rotations of order m, identified with C by z↦w=zm. The form dx∧dy is invariant under rotations and descends to a closed 2-form ωm on Qm, and every 2-form on Qm is fωm for a smooth function f[IZ, art. 9.32]. In the coordinate w=u+iv of the regular stratum, ωm=m−2∣w∣2/m−2du∧dv ([exo:cone-form]): a smooth form on Qm whose coefficient in the coordinate w is singular at the origin.
Example 1.7 (Infinite dimensions). On the Hilbert space H of square-summable complex sequences with the fine diffeology, α=2i1∑k(zˉkdzk−zkdzˉk) is a 1-form, ω=dα is a closed 2-form, and both restrict to the unit sphere and descend to the infinite projective space [IZ, art. 9.33]. The spaces of this example are diffeological vector spaces and their quotients; none is a Banach manifold with its usual structure.
Three parasymplectic spaces used throughout: a symplectic quasi-torus, the cone orbifold, and a product of spheres with incommensurable areas.
Transgression to paths
The space Paths(X)=C∞(R,X) carries the functional diffeology, and 0^,1^:Paths(X)→X are the evaluations at 0 and 1.
Theorem 1.8 (The chain-homotopy operator, [IZ, art. 6.83–6.86]). For every diffeological space X and every k≥1 there is a linear operator K:Ωk(X)→Ωk−1(Paths(X)) such that K∘d+d∘K=1^∗−0^∗, natural in X: for a smooth f:X→X′ with induced f∗:Paths(X)→Paths(X′), one has K∘f∗=(f∗)∗∘K. For a plot Φ:U→Paths(X) with adjunct Φ~:U×R→X, (Kω)(Φ)=∫01(ι∂tΦ~∗ω)U×{t}dt. For k=1, Kα is the function p↦∫pα.
The operator is integration along the fibres of Paths(X)×[0,1]→Paths(X) of the pullback of ω by the evaluation map, and (1) is Stokes’ formula for that fibre. If ω is closed then by (1) the restriction of Kω to Loops(X) is closed.
Definition 1.9 ([IZ, art. 8.42]). Let (X,ω) be parasymplectic. The group of periodsPω⊂R is the group of the integrals of Kω over the loops in Loops(X). A smooth map S:T2→X has the toric period∫T2S∗ω∈Pω.
Example 1.10. For the quasi-torus (TΓ,ωΩ) and γ,γ′∈Γ, the map (s,t)↦q(sγ+tγ′) is defined on T2 and has toric period Ω(γ,γ′). So Pω⊇Ω(Γ∧Γ), the subgroup generated by the values of Ω on Γ. For S2×S2 with the form c1ω1+c2ω2, where ∫S2ωi=2π, the group of periods is 2π(c1Z+c2Z): it is dense in R when c1/c2 is irrational.
One-forms on products
The following lemma replaces, for 1-forms, the decomposition of a tangent vector to a product into its two components.
Lemma 1.11 (Slices). Let A and B be diffeological spaces. A 1-form β on A×B is determined by its restrictions to the slices A×{b} and {a}×B. Precisely, for plots P:U→A and Q:U→B let β1,β2 be the components of β(P×Q)∈Ω1(U×U) along the two factors; then β(P,Q)=Δ∗β(P×Q),β1∣U×{s}=β(P,constQ(s)),β2∣{r}×U=β(constP(r),Q), where Δ:U→U×U is the diagonal.
The proof is [exo:slices]. The statement is false for 2-forms: dx∧dy on R×R restricts to zero on every slice.
Corollary 1.12. Let G act smoothly on Y, with action map Φ:G×Y→Y, and let λ∈Ω1(Y). Then Φ∗λ=prY∗λ on G×Y if and only if gY∗λ=λ for every g∈G and y^∗λ=0 for every y∈Y, where y^:G→Y is the orbit map g↦g⋅y.
Proof. Apply 1.11 to β=Φ∗λ−prY∗λ. Its restriction to {g}×Y is gY∗λ−λ, and its restriction to G×{y} is y^∗λ, because prY is constant on that slice. ◻
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Show that a closed 2-form on a quotient M/∼ of a surface M by an equivalence relation is determined by a closed 2-form on M, and that on a quotient of a curve it vanishes.
Solution. The projection q:M→M/∼ is a subduction, so q∗ is injective on forms [I, Proposition 6.4]. A form ω on the quotient is therefore determined by q∗ω∈Ω2(M), which is closed. If M is a curve then Ω2(M)=0. ◀
2 Verify the formula ωm=m−2∣w∣2/m−2du∧dv of 1.6 on the regular stratum of Qm, and show that the form du∧dv in the coordinate w is also a smooth 2-form on Qm. Which function f gives du∧dv=fωm?
Solution. The projection is πm(z)=zm=w. For a holomorphic map, πm∗(du∧dv)=∣πm′(z)∣2dx∧dy=m2∣z∣2m−2dx∧dy. Since ∣z∣=∣w∣1/m, on the regular stratum dx∧dy=πm∗(m−2∣w∣2/m−2du∧dv), which is the formula. For the second statement, the plots of Qm are locally of the form φm with φ a smooth parametrisation in C[IZ, art. 9.32], so they are smooth parametrisations in C and every form on the manifold C restricts to a form on Qm. By the first computation du∧dv=fωm with f(w)=m2∣w∣2−2/m, and f∘πm=m2∣z∣2m−2 is smooth, so f is a smooth function on Qm. ◀
2 Let f:X→X′ be a smooth map between parasymplectic spaces. Show that the following are equivalent: (a)f∗ω′=ω; (b) the graph (id,f):X→X⊞X′ pulls the form back to zero; (c) the graph is a smooth map X→X×ωX′.
Solution. The form of X⊞X′ is pr2∗ω′−pr1∗ω, and its pullback by (id,f) is f∗ω′−ω; so (a)⟺(b). For a plot P of X, the pair (P,f∘P) is a plot of X×ωX′ if and only if ω(P)=ω′(f∘P)=(f∗ω′)(P); so (a)⟺(c). ◀
Solution. Let ω∈Ωk(TΓ) and ω~=q∗ω∈Ωk(Rn). For γ∈Γ the translation tγ satisfies q∘tγ=q, so tγ∗ω~=ω~: the coefficients of ω~ are smooth functions invariant under a dense group of translations, hence constant. Conversely let ω~ be a constant form, and let P,P′ be plots of Rn with q∘P=q∘P′. Then P′−P is continuous with values in the countable set Γ, so it is locally constant, P′=tγ∘P locally, and ω~(P′)=ω~(P). By the descent criterion [I, Proposition 6.4] there is a unique ω with q∗ω=ω~. Since q∗ is injective and commutes with d, and constant forms are closed, every form on TΓ is closed. ◀
Solution. The plot (P,Q):U→A×B is the composite of the diagonal Δ with the plot P×Q:U×U→A×B, (r,s)↦(P(r),Q(s)), so β(P,Q)=Δ∗β(P×Q) by the compatibility of a form with reparametrisation. Write β(P×Q)=β1+β2, where β1 is a combination of the dri and β2 of the dsj, with coefficients smooth in (r,s). The restriction of β(P×Q) to U×{s} is the value of β on the plot r↦(P(r),Q(s)), which is the plot (P,constQ(s)) of the slice A×{Q(s)}; and that restriction is β1∣U×{s}, because the dsj vanish on the slice. The same argument gives β2. Hence the restrictions of β to the slices determine β1 and β2 for every pair of plots, and so determine β(P,Q). Every plot of A×B is of the form (P,Q), so β is determined. ◀
Moment maps
For a diffeological group G acting on a parasymplectic space, a moment map is constructed in [1, 44] with values in a quotient of the space of momenta of G. We state the construction and its properties with the article numbers, compute the examples, and identify the moment map in the exact case as the obstruction to the descent of a primitive to the homotopy quotient.
Momenta
Definition 1.1 ([IZ, art. 7.12, 7.15]). Let G be a diffeological group, with left and right multiplications L(g):k↦gk and R(g):k↦kg. The space of momenta of G is the vector space G∗={α∈Ω1(G)∣L(g)∗α=αfor all g∈G}, with the functional diffeology. The coadjoint action of G on G∗ is Ad∗(g)(α)=Ad(g−1)∗α=R(g)∗α.
The notation recalls the dual of a Lie algebra, and for a Lie group G∗ is that dual, a left-invariant 1-form being determined by its value at the identity. In general G∗ is defined by invariance and by no duality.
Example 1.2.
If G is discrete, every form of positive degree on G vanishes and G∗=0.
For a torus of periods TP=R/P, the pullback of a momentum to R is a translation-invariant 1-form, so G∗=Rθ. For a quasi-torus Rn/Γ, and for the vector group Rn itself, G∗=(Rn)∗, and the coadjoint action is trivial.
For G=Diff(X,ω) the space Gω∗ is infinite-dimensional in general; it is the target of the universal moment map of Coadjoint orbits.
The paths moment map
Let (X,ω) be a parasymplectic space and ρ:G→Diff(X,ω) a smooth action, written g⋅x. For a path p∈Paths(X) let p^:G→Paths(X) be the orbit map g↦g∘p.
Theorem 1.3 (The paths moment map, [IZ, art. 9.1–9.6]). The 1-form Ψ(p)=p^∗(Kω) on G is left-invariant, and the paths moment mapΨ:Paths(X)→G∗ is smooth. Moreover:
Ψ(p∨p′)=Ψ(p)+Ψ(p′) for composable stationary paths;
Ψ(g∘p)=Ad∗(g)(Ψ(p));
dΨ(p)=x^1∗ω−x^0∗ω, where xi=p(i) and x^:G→X is the orbit map of a point;
Ψ(p)=Ψ(p′) if p and p′ are homotopic with fixed ends.
For a plot P:U→G, with a~:U×R→X, a~(r,t)=P(r)⋅p(t), Ψ(p)(P)=∫01(ι∂ta~∗ω)U×{t}dt.
Left-invariance follows from the naturality of K and the invariance of ω, and (3) is the formula of Theorem 1.8; for a manifold it is the formula Ψ(p)(P)r(δr)=∫01ω(p˙(t),δp(t))dt of [IZ, art. 9.20]. Parts (ii) and (iii) are [exo:Psi].
Formula (3) has a geometric content (1.1). A plot of G moves the path p and sweeps a strip in X; the moment Ψ(p) evaluated on the plot is the integral of ω over the strip, in the direction of the path. In the language of Closed 2-forms: Ψ(p) is the transgression of ω along the map G×[0,1]→X, (g,t)↦g⋅p(t).
Left: the paths moment map integrates ω over the strip swept by a path under a plot of G; its differential is carried by the two ends. Right: the passage from the paths moment map to the two-points moment map and to a moment map.
Holonomy, moment maps, and the Souriau class
From now on X is connected.
Theorem 1.4 ([IZ, art. 9.7–9.10]). Let G act on the connected parasymplectic space (X,ω).
Holonomy.Γ=Ψ(Loops(X)) is a subgroup of G∗, the image of a homomorphism π1(X)→G∗. Its elements are closed and invariant under the coadjoint action.
Two-points moment map. There is a unique smooth ψ:X×X→G∗/Γ with ψ(p(0),p(1))=classΨ(p). It satisfies ψ(x,x′′)=ψ(x,x′)+ψ(x′,x′′) and ψ(gx,gx′)=Ad∗Γ(g)ψ(x,x′).
Moment maps. There is a smooth μ:X→G∗/Γ with ψ(x,x′)=μ(x′)−μ(x), unique up to an additive constant.
Souriau cocycle. The map θ(g)=μ(gx)−Ad∗Γ(g)μ(x) is independent of x and satisfies θ(gg′)=Ad∗Γ(g)θ(g′)+θ(g). Its class σ∈H1(G,G∗/Γ) is independent of the choice of μ.
The action is called Hamiltonian if Γ=0 and exact if σ=0, that is, if some moment map is equivariant.
Two features distinguish this from the classical definition. The moment map exists for every action that preserves ω; the obstructions appear in its target G∗/Γ and in the class σ. And the target is in general a diffeological space that is not a vector space: for the translations of a quasi-torus it is again a quasi-torus (1.9).
Theorem 1.5 (The exact case, [IZ, art. 9.11]). Suppose ω=dα with α invariant under G. Then Ψ(p)=x^1∗α−x^0∗α, the action is Hamiltonian and exact, and μ:X→G∗,μ(x)=x^∗α, is an equivariant moment map.
Proof. By (1), Kω=Kdα=1^∗α−0^∗α−d(Kα). The function Kα∘p^ is g↦∫g∘pα=∫pg∗α=∫pα, a constant; so p^∗d(Kα)=0 and Ψ(p)=(1^∘p^)∗α−(0^∘p^)∗α, with ^∘p^=x^i. For a loop this vanishes. Equivariance: gx=x^∘R(g), so μ(gx)=R(g)∗μ(x)=Ad∗(g)μ(x). ◻
The moment map as an obstruction to descent
For an action with action map a:G×X→X, the homotopy quotient X//G is the colimit in H of the simplicial object ⋯G×G×X→G×X⇉X[I, §7.2]. Since Ωk is a sheaf of sets, a map X//G→Ωk is a form on X whose two pullbacks to G×X coincide: Ωk(X//G)={β∈Ωk(X)∣a∗β=prX∗β}.
Proposition 1.6 (Basic forms).
If the action is principal, π∗ identifies Ωk(X/G) with the space (4).
For k=1 the condition a∗β=prX∗β holds if and only if β is invariant and x^∗β=0 for every x∈X.
If α is an invariant 1-form with dα=ω and μ is the moment map of 1.5, then a∗α−prX∗α is the 1-form on G×X whose restriction to G×{x} is μ(x) and whose restriction to {g}×X is zero. In particular α is a 1-form on X//G if and only if μ=0.
The proof is [exo:basic]. Part (iii) is the first appearance of the theme of Part II: the moment map is the component along G of the difference of the two pullbacks to G×X. Invariance is a condition on each slice {g}×X; the moment map is the remaining condition on the slices G×{x}.
Examples
Example 1.7 (Rotations). On C with ω=dx∧dy=dα, α=21(xdy−ydx), the circle S1=R/2πZ acts by rotations and preserves α. The orbit map of z is φ↦eiφz, and z^∗α=21∣z∣2dφ: the moment map is μ(z)=21∣z∣2 in the basis dφ of G∗. On the cone orbifold Qm the moment map of the residual circle is μm(w)=2m1∣w∣2/m ([exo:cone-moment]).
Example 1.8 (Translations, [IZ, art. 9.30]). The group G=Rn acts on itself by translations and preserves every constant 2-form Ω. By (3), for a path from x to y, Ψ(p)=Ω(y−x,⋅)∈(Rn)∗. The holonomy is trivial, the moment maps are μ(x)=Ω(x,⋅)+c, and the Souriau cocycle is θ(u)=Ω(u,⋅), because the coadjoint action is trivial. The class σ is not zero unless Ω=0: no moment map is equivariant. In Equivariance and the moment map the class σ is identified with the commutator of the Heisenberg group.
Two moment maps. For rotations the target is the line G∗ and the levels are the orbits. For the translations of a symplectic quasi-torus the target is a quotient of G∗ by the holonomy, and the moment map is an isomorphism.
Proposition 1.9 (The moment map of a quasi-torus). Let Γ⊂Rn be a subgroup and Ω a non-degenerate alternating form. For the action of Rn on (TΓ,ωΩ) by translations, the holonomy is Ω(Γ,⋅)⊂(Rn)∗, and the moment map μ:TΓ=Rn/Γ⟶(Rn)∗/Ω(Γ,⋅),[x]↦[Ω(x,⋅)] is a diffeomorphism onto a quasi-torus. The action is Hamiltonian only if Γ=0.
Proof. A loop in TΓ lifts to a path in Rn from x to x+γ, and the paths moment maps of TΓ and Rn correspond under the projection, by naturality of K; so Γhol=Ω(Γ,⋅) by 1.8. The linear isomorphism x↦Ω(x,⋅) maps Γ onto Ω(Γ,⋅) and induces a diffeomorphism of the quotients, which is a moment map by the same naturality. ◻
So a symplectic quasi-torus is identified by its own moment map with a quotient of the space of momenta of its group of translations. This is the first instance of the statement of Coadjoint orbits that homogeneous symplectic spaces are coadjoint orbits.
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Compute the momenta and the coadjoint action for (a) the group Z+αZ⊂R with the subspace diffeology, (b) the irrational torus Tα, (c) the affine group of the line.
Solution. (a) The plots of a countable subgroup of R with the subspace diffeology are locally constant, so the group is discrete and G∗=0. (b) G∗=Rθ by 1.2(b), with trivial coadjoint action since the group is abelian. (c) G={x↦ax+b} is a Lie group with coordinates (a,b), a>0 on the identity component. The left-invariant forms are spanned by da/a and db/a. Right multiplication by (a0,b0) is (a,b)↦(aa0,ab0+b), so Ad∗(a0,b0) fixes da/a and maps db/a to a0−1(b0da/a+db/a). ◀
2 Compute the moment map of the circle acting on the cone orbifold Qm by w↦eiφw.
Solution. The form α=21(xdy−ydx) is invariant under rotations, so it descends to a 1-form αm on Qm with dαm=ωm (Example 1.6). The rotation w↦eiφw of Qm is covered by z↦eiφ/mz. By 1.5, μm(w)=w^∗αm, and with w=πm(z) the orbit map of w is φ↦πm(eiφ/mz); hence w^∗αm=21∣z∣2d(φ/m)=2m1∣w∣2/mdφ. The image of the moment map is the half-line, as for the plane, and its level sets are the circles ∣w∣=const. ◀
2 For the ordinary torus T2=R2/Z2 with ω=dx∧dy and the action of R2 by translations, compute the holonomy, a moment map and the Souriau cocycle.
Solution. By 1.9 with Γ=Z2 and Ω((x,y),(x′,y′))=xy′−x′y: the holonomy is Ω(Z2,⋅), the lattice of linear forms with integer coefficients, G∗/Γhol=R2/Z2, and μ[x,y]=[−y,x] in the basis dual to the coordinates: a rotation of the torus by a quarter turn. The Souriau cocycle is θ(u)=[Ω(u,⋅)]. The action is neither Hamiltonian nor exact; in the classical theory it has no moment map. ◀
Solution. (i) If β=π∗β0 then a∗β=(π∘a)∗β0=(π∘prX)∗β0=prX∗β. Conversely let a∗β=prX∗β and let P,P′ be plots of X with π∘P=π∘P′. Since the action is principal, P′=g⋅P for a plot g of G[I, Theorem 7.2], that is, P′=a∘(g,P). Then β(P′)=(g,P)∗a∗β=(g,P)∗prX∗β=β(P), and β descends by [I, Proposition 6.4]; π∗ is injective. (ii) is Corollary 1.12 with Y=X. (iii) The form β=a∗α−prX∗α restricts to g∗α−α=0 on {g}×X and to x^∗α=μ(x) on G×{x}; by Lemma 1.11 these restrictions determine it, and it vanishes if and only if μ=0. ◀
4 Prove parts (ii) and (iii) of 1.3, and deduce that the holonomy consists of closed momenta.
Solution. (ii) For g,k∈G, g∘p(k)=k∘g∘p=p^(kg), so g∘p=p^∘R(g) and Ψ(g∘p)=R(g)∗p^∗(Kω)=Ad∗(g)Ψ(p). (iii) dΨ(p)=p^∗d(Kω)=p^∗(1^∗ω−0^∗ω−Kdω) by (1), and dω=0. The composite 1^∘p^ is g↦g⋅p(1), the orbit map of x1; likewise for 0^. For a loop, x0=x1 and dΨ(ℓ)=0. ◀
Coadjoint orbits
Every parasymplectic space has a universal moment map, for the action of its whole group of automorphisms. When that group acts transitively, the moment map is a fibration onto an affine coadjoint orbit; when in addition its fibres are discrete, the space is called symplectic. For manifolds this recovers non-degeneracy. The diffeology of the orbit is a coimage, in the sense of the two factorisation systems of Diff.
The universal moment map
Let (X,ω) be a connected parasymplectic space and Gω=Diff(X,ω), the automorphism group of ω:X→Ωcl2 in the slice (Proposition 1.2). All the constructions of Theorem 1.4 apply to Gω; they are written Ψω, Γω, ψω, μω, θω, σω and depend only on (X,ω).
Proposition 1.1 (Functoriality, [IZ, art. 9.12–9.14]). Let ρ:G→Gω be a smooth action and ρ∗:Gω∗→G∗ the pullback of momenta. Then Ψ=ρ∗∘Ψω,Γ=ρ∗(Γω),ψ=ρΓ∗∘ψω,μ=ρΓ∗∘μω+const, where ρΓ∗:Gω∗/Γω→G∗/Γ is induced by ρ∗.
Proof. The orbit maps satisfy p^G=p^Gω∘ρ, so Ψ(p)=ρ∗p^∗(Kω)=ρ∗Ψω(p). The other identities follow from the definitions in Theorem 1.4. ◻
So every moment map of every symmetry group of (X,ω) is a quotient of one map, which depends on the form alone. The group Gω contains a largest connected subgroup with trivial holonomy, the group Ham(X,ω) of Hamiltonian diffeomorphisms[IZ, art. 9.15]; for a symplectic manifold it is the classical group of that name [IZ, art. 9.22].
Homogeneous spaces
Let θ be the Souriau cocycle of a moment map μ. The affine coadjoint action of G on G∗/Γ is Ad∗Γ,θ(g)(m)=Ad∗Γ(g)(m)+θ(g)[IZ, art. 7.16]; it is an action by the cocycle identity, and μ is equivariant for it by the definition of θ. Its orbits are the (Γ,θ)-coadjoint orbits.
Recall that X is homogeneous under G if the orbit map x^0:G→X is a subduction for one, hence every, point x0[IZ, art. 7.8].
Theorem 1.2 (The homogeneous case, [IZ, art. 9.18]). Let X be homogeneous under an action of G preserving ω, let μ be a moment map with cocycle θ, and let μ0=μ(x0). Then O=μ(X) is a (Γ,θ)-coadjoint orbit, and St(x0)⊆St(μ0). Give O the pushforward of the diffeology of G by the orbit map μ^0:g↦Ad∗Γ,θ(g)(μ0). Then in the commutative triangle x^0 and μ^0 are principal bundles with groups St(x0) and St(μ0), and μ is a fibre bundle with fibre the homogeneous space St(μ0)/St(x0).
For the first assertions see [exo:homogeneous]. By [I, Corollary 7.3] the two orbit maps are principal bundles.
Remark 1.3 (The orbit is a coimage). The orbit map μ^0:G→G∗/Γ has two factorisations in Diff[I, Theorem 3.2]: through its coimage, the set O with the quotient diffeology of G, and through its image, the set O with the subspace diffeology of G∗/Γ. The diffeology chosen in 1.2 is the coimage. The two coincide when μ^0 is strict, and the fibration statements of the theorem are statements about the coimage. The same choice occurs in [I, Theorem 11.1] for hypothesis spaces and in [I, Theorem 13.1] for minimal realisations.
Symplectic spaces
Definition 1.4 ([IZ, art. 9.17, 9.19]). The characteristics of a moment map μ are the connected components of its fibres. A connected parasymplectic space (X,ω) is a homogeneous symplectic space if it is homogeneous under Diff(X,ω) and the characteristics of the universal moment map μω are points.
The definition is justified by two theorems on manifolds.
Theorem 1.5 (Souriau–Noether, [IZ, art. 9.25]). Let ω be a closed 2-form on a manifold M. If two points are joined by a path p with p˙(t)∈kerωp(t) for all t, then μω takes the same value at both. Consequently every moment map of every action preserving ω is constant along the characteristic distribution kerω.
Proof. By (3), Ψω(p) evaluated on a plot is ∫01ω(p˙(t),δp(t))dt, which vanishes when p˙∈kerω. So μω(p(1))−μω(p(0))=0, and the consequence follows from 1.1. ◻
Theorem 1.6 (Symplectic manifolds are coadjoint orbits, [IZ, art. 9.23]). Let ω be a closed 2-form on a connected manifold M. Then ω is non-degenerate if and only if
M is homogeneous under Diff(M,ω), and
the universal moment map μω:M→Gω∗/Γω is injective.
In that case μω identifies M with a (Γω,θω)-coadjoint orbit of Diff(M,ω).
So non-degeneracy, a pointwise condition on tangent vectors, is equivalent to a condition on maps: transitivity of the automorphism group and injectivity of one map out of M. The second form is available on every diffeological space. By 1.5 condition (B) fails when kerω=0; for a homogeneous presymplectic manifold the fibres of μω are exactly the leaves of the characteristic foliation [IZ, art. 9.26].
Proposition 1.7 (Symplectic quasi-tori). Let Γ⊂Rn be a dense subgroup and Ω a non-degenerate alternating form on Rn. Then (TΓ,ωΩ) is a homogeneous symplectic space, and its moment map for the translations identifies it with the affine coadjoint orbit (Rn)∗/Ω(Γ,⋅) of the group Rn.
Parasymplectic spaces and the two conditions of 1.4: homogeneity under Diff(X,ω) and the characteristics of μω. The third row is an instance of [IZ, art. 9.26]; the last is [IZ, art. 9.32].
(X,ω)
homogeneous
characteristics
conclusion
symplectic manifold
yes
points
coadjoint orbit
(M,0)
yes
M
μω constant
contact form dα on S3
yes
Hopf circles
μω factors through S2
(Rn/Γ,ωΩ), Ω non-degenerate
yes
points
affine orbit, a quasi-torus
cone orbifold (Qm,ωm)
no: 0 is fixed
—
two strata
The universal moment map of a homogeneous parasymplectic space is a fibration onto a coadjoint orbit. Its fibres are unions of characteristics; the space is symplectic when they are points.
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Show that the plane (R2,dx∧dy) is a single affine coadjoint orbit of its group of translations.
Solution. By Example 1.8, G∗=(R2)∗, Γ=0, the coadjoint action is trivial, μ(x)=Ω(x,⋅) and θ(u)=Ω(u,⋅). The affine action is m↦m+Ω(u,⋅), which is simply transitive on (R2)∗ because Ω is non-degenerate. So O=(R2)∗, both stabilisers are trivial, and μ is the diffeomorphism x↦Ω(x,⋅). For the linear coadjoint action every orbit is a point: the cocycle is what makes the orbit two-dimensional. ◀
2 Let M be a connected manifold with ω=0. Compute Diff(M,ω), the universal moment map and its characteristics.
Solution. Every diffeomorphism preserves 0, so Diff(M,0)=Diff(M), which is transitive. Since K0=0, the paths moment map vanishes, Γω=0, and μω is constant. The unique characteristic is M, the orbit is a point, and the fibration of 1.2 is M→∗. ◀
2 On the cylinder X=R×S1 with ω=dr∧dφ, compute the moment maps of (a) the rotations φ↦φ+s and (b) the translations r↦r+s.
Solution. (a) ω=d(rdφ) with rdφ invariant, so by Theorem 1.5μ(r,φ)=r in the basis ds of G∗: the height. (b) The form −φdr is not defined on X, and Theorem 1.5 does not apply. By (3), for a path p=(r(t),φ(t)) with a continuous determination of the angle, Ψ(p)=∫01ω(p˙,∂r)dtds=−(φ(1)−φ(0))ds. A loop winding once gives −2πds, so Γ=2πZds, the action is not Hamiltonian, and the moment map is μ(r,φ)=−φ∈R/2πZ: the angle is a moment map with values in a circle. ◀
3 In the situation of 1.2, prove that μ(X) is a (Γ,θ)-orbit, that St(x0)⊆St(μ0), and that μ:X→O is a subduction when O carries the pushforward diffeology of G.
Solution. Equivariance of μ for the affine action gives μ(gx0)=Ad∗Γ,θ(g)(μ0), that is, μ∘x^0=μ^0. Since x^0 is surjective, μ(X)=μ^0(G) is the orbit of μ0, and gx0=x0 implies Ad∗Γ,θ(g)(μ0)=μ0. The orbit map x^0 is a subduction by homogeneity, so μ is smooth into O if and only if μ∘x^0=μ^0 is, which holds by the definition of the pushforward diffeology. A plot of O lifts locally along μ^0 to a plot of G, whose image under x^0 is a local lift along μ; so μ is a subduction. ◀
Solution.Homogeneity. Translations preserve ωΩ, so there is a smooth homomorphism ρ:Rn→Diff(TΓ,ωΩ). Let P be a plot of TΓ and x0=q(x~0). Locally P=q∘P~ with P~ smooth in Rn, and r↦ρ(P~(r)−x~0) is a plot of Diff(TΓ,ωΩ) whose image under the orbit map of x0 is P. So the orbit map is a subduction. Characteristics. By 1.1, the moment map μ of the translations is ρΓ∗∘μω up to a constant. By Proposition 1.9, μ is injective; hence μω is injective and its fibres are points. The orbit. For G=Rn the coadjoint action is trivial and θ(u)=[Ω(u,⋅)], so the affine action on (Rn)∗/Ω(Γ,⋅) is by translations and is transitive; μ is the diffeomorphism of Proposition 1.9. ◀
One level up
Prequantisation
A prequantisation of a parasymplectic space is a principal bundle with connection whose curvature is the given form; its structure group is a torus of periods R/P, and P need not be cyclic. In H it is a lift of ω:X→Ωcl2 to the stack B(TP)conn. We describe that stack, bound the periods, compute the examples, and determine the automorphisms of a prequantum bundle that cover the identity.
Tori of periods and bundles with connection
Let P⊊R be a subgroup. A proper subgroup of R contains no interval, so its plots for the subspace diffeology are locally constant: P is discrete as a diffeological group, countable or not, and R→TP=R/P is a covering [IZ, art. 8.37]. The form dt descends to the canonical form θ∈Ω1(TP). For P=Z this is the circle; for P=Z+αZ it is the irrational torus.
Definition 1.1 ([IZ, art. 8.37]). Let π:Y→X be a principal TP-bundle of diffeological spaces, with action (τ,y)↦τ⋅y and orbit maps y^:TP→Y. A connection form is a 1-form λ on Y which is invariant, τY∗λ=λ for all τ, and calibrated, y^∗λ=θ for all y.
Lemma 1.2. Let λ be a connection form on π:Y→X, and ΦT:TP×Y→Y the action map.
ΦT∗λ=prT∗θ+prY∗λ. For a plot s of Y and a plot g of TP on the same domain, (g⋅s)∗λ=s∗λ+g∗θ.
There is a unique closed 2-form ω on X, the curvature, with π∗ω=dλ.
For a smooth τ:X→TP, the gauge transformation y↦τ(π(y))⋅y maps λ to λ+π∗τ∗θ.
Proof. (i) Both sides are 1-forms on a product with the same restrictions to the slices: τY∗λ=λ on {τ}×Y and y^∗λ=θ on TP×{y}. They coincide by Lemma 1.11. The second formula is the pullback of the first by (g,s). (ii) By (i), ΦT∗dλ=prY∗dλ, since dθ=0. The action is principal, so dλ descends by Proposition 1.6(i); the descended form is closed because π∗ is injective. (iii) The gauge transformation is ΦT∘(τ∘π,idY); pull back (i). ◻
The stack B(TP)conn is defined on Cartesian spaces by the groupoids B(TP)conn(U)={objects A∈Ω1(U);morphisms g:A→A+g∗θ,g∈C∞(U,TP)}, the groupoid of connection forms on the trivial bundle U×TP and gauge transformations [I, §6.5]. There are maps where F(A)=dA is the curvature, the horizontal maps send a form to the trivial bundle with that connection and a bundle with connection to its underlying bundle, and the row is a fibre sequence.
Proposition 1.3. For a diffeological space X, the groupoid Map(X,B(TP)conn) is equivalent to the groupoid of principal TP-bundles over X with a connection form and their connection-preserving isomorphisms. Under this equivalence, composition with F is the curvature of 1.2.
Proof. As in [I, Theorem 7.5], X is the colimit in H of its plots and Map(X,B(TP)conn)≃lim(U→X)B(TP)conn(U). Given (Y,λ) and a plot P:U→X, the pullback P∗Y is trivial [I, Lemma 7.4]; a section s gives the object As=s∗λ, and by 1.2(i) another section g⋅s gives As+g∗θ, an isomorphic object. This defines a point of the limit. Conversely a point of the limit has an underlying map X→BTP, which is a principal bundle Y[I, Theorem 7.5], together with a connection form λP on each P∗Y, compatible with reparametrisation. For a plot R of Y let P=π∘R; then R is a section of P∗Y and λ(R)=R∗λP defines a 1-form on Y, invariant and calibrated because each λP is. The two constructions are inverse, and dAs=s∗dλ=P∗ω. ◻
Prequantum bundles
Definition 1.4. A prequantisation of a parasymplectic space (X,ω) with group of periods P is a principal TP-bundle with connection (Y,λ) over X with curvature ω; equivalently, a lift
Theorem 1.5 (Integration bundles, [IZ, art. 8.42]; [I, Theorem 6.11]). Let (X,ω) be connected and simply connected, with group of periods Pω=R. Then (X,ω) has a prequantisation with structure group TPω=R/Pω.
The classical condition that the periods be integral, up to a common factor, is the condition that Pω be cyclic, so that TPω is a circle. No such condition appears in the theorem: for S2×S2 with incommensurable areas the structure group is an irrational torus (Example 1.10), and the bundle is constructed in Theorem 1.5. Conversely the periods bound the structure group from below.
Proposition 1.6 (Periods lie in P). If (X,ω) has a prequantisation with structure group TP, then for every smooth map S from T2 or S2 to X the period ∫S∗ω belongs to P.
Proof. For the torus, pull (Y,λ) back along R2→T2SX. Over R2 the bundle is trivial, with connection A∈Ω1(R2), dA=S~∗ω. The translations τ1,τ2 by the basis vectors act on the pulled-back bundle; in the trivialisation they are gauge transformations gi:R2→TP with τi∗A=A+gi∗θ, and gi lifts to g^i:R2→R. Stokes’ formula on the unit square (1.1) gives ∫[0,1]2dA=(g^1(e2)−g^1(0))−(g^2(e1)−g^2(0)). The two translations commute, so g2(x+e1)+g1(x)=g1(x+e2)+g2(x) in TP, and the right-hand side is the value at 0 of a function with values in P. The sphere is [exo:sphere-periods]. ◻
Left: the proof of 1.6. Right: the three ways of presenting a closed 2-form, as a form, as a curvature, and as an exact form.
Examples
Example 1.7 (Exact forms). If ω=dα, then for every P the trivial bundle Y=X×TP with λ=prX∗α+prT∗θ is a prequantisation. Two primitives that differ by dh give isomorphic prequantisations ([exo:exact-prequantum]).
Example 1.8 (The Heisenberg bundle). On R2 with ω=dx∧dy=d(xdy), the previous example with P=0 is Y=R3 with λ=dz+xdy. The group structure (x,y,z)(x′,y′,z′)=(x+x′,y+y′,z+z′−xy′) on Y makes it the Heisenberg group H; left multiplications preserve λ and cover the translations of the plane. The subgroup N=Z3 acts on the left, λ descends to N\H, and N\H→R2/Z2 is a prequantisation of the torus of area 1 with P=Z. In Number theory: periods, ideals, and Heisenberg quasi-nilmanifoldsZ is replaced by the ring of integers of a number field.
Example 1.9 (The cone). The form ωm of the cone orbifold is exact, ωm=dαm ([exo:cone-moment]), so Qm×TP is a prequantisation for every P. It is the quotient of the trivial bundle C×TP by Zm acting on the first factor.
Automorphisms
An automorphism of a prequantum bundle (Y,λ) is a diffeomorphism ϕ of Y that commutes with the action of TP and satisfies ϕ∗λ=λ. It covers a diffeomorphism of X, which preserves ω because π∗ is injective. The group Aut(Y,λ) has the functional diffeology.
Theorem 1.10 (The Kostant–Souriau sequence). Let (Y,λ) be a prequantisation of a connected parasymplectic space (X,ω). The sequence of diffeological groups 1⟶TP⟶Aut(Y,λ)⟶Diff(X,ω) is exact, and TP is central. If X=R2n with a constant symplectic form and P=0, the last map is surjective, and the preimage of the group of translations is the Heisenberg group.
Proof. An automorphism covering the identity is a gauge transformation by some τ:X→TP. By 1.2(iii) it preserves λ if and only if π∗τ∗θ=0, that is, τ∗θ=0. For a plot Q of X, the map τ∘Q lifts locally to a real function f with df=(τ∘Q)∗θ=0, so τ∘Q is locally constant; since X is connected, τ is constant. Constants are central because automorphisms commute with the action of TP. For R2n with ω=dα and Y=R2n×R, λ=dz+α: if f∗ω=ω then f∗α−α=dh for a function h, and (v,z)↦(f(v),z−h(v)) is an automorphism covering f. For translations, with α=B(v,dv) and B bilinear, these are the left multiplications of HB. ◻
The Kostant–Souriau sequence of 1.10 and, for X=R2n and P=0, its restriction to the translations. Both groups are automorphism groups in slices of H, and the sequence is induced by the curvature map F.
In the language of [28, 27]: Aut(Y,λ) is the automorphism group of ∇:X→B(TP)conn in the slice H/B(TP)conn, as Diff(X,ω) is the automorphism group of ω in the slice over Ωcl2 (Proposition 1.2), and the sequence is induced by F. The kernel TP is the group of automorphisms of the trivial flat bundle over a connected space.
Proposition 1.11 (Characters). The smooth homomorphisms TP→U(1) are [t]↦e2πikt with k∈R, kP⊆Z. If P contains two elements with irrational ratio, the only one is trivial.
Proof. A smooth homomorphism TP→R/Z composed with R→TP lifts to a smooth homomorphism R→R, t↦kt, which maps P into Z. If a,b∈P and ka,kb∈Z with k=0 then a/b∈Q. ◻
So a prequantum bundle with a dense group of periods has no associated Hermitian line bundle, and the usual passage from the principal bundle to a space of sections is not available. The three presentations of a closed 2-form are compared in 1.1.
Three levels of structure and their classifying objects.
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Verify that λ=prX∗α+prT∗θ is a connection form on X×TP with curvature dα, and that the prequantisations defined by α and α+dh are isomorphic.
Solution. The action of TP is by translation of the second factor; θ is translation-invariant and prX is invariant, so λ is invariant. The orbit map of (x,τ) is σ↦(x,σ+τ), which pulls λ back to θ. dλ=prX∗dα. The gauge transformation by τ=[h]:X→TP maps λ to λ+prX∗dh by 1.2(iii), since [h]∗θ=dh. ◀
2 In the Heisenberg bundle (R3,dz+xdy), compute the horizontal lift of the boundary of the rectangle [x0,x0+a]×[y0,y0+b], traversed counter-clockwise from (x0,y0,z0).
Solution. A curve is horizontal if z˙=−xy˙. Along the bottom edge y˙=0 and z=z0. Along the right edge x=x0+a and z decreases by (x0+a)b. Along the top edge z is constant. Along the left edge x=x0, y decreases by b, and z increases by x0b. The lift ends at z0−ab: the holonomy is minus the area, as in the frontispiece, in accordance with ∫dλ=∫ω and 1.2(ii). ◀
2 Compute the smooth characters of TP for P=Z, P=Z+2Z and P=Q.
Solution. By 1.11 the characters are indexed by {k∈R∣kP⊆Z}. For P=Z this is Z. For P=Z+2Z, k∈Z and k2∈Z force k=0. For P=Q, k/n∈Z for all n forces k=0. In the last two cases the group TP has no non-trivial smooth unitary character, although R/Q has many discontinuous ones. ◀
Solution. Pull the bundle back to S2 by S. Let UN,US be the complements of the south and north poles; they are diffeomorphic to R2, so the bundle is trivial over each, with connections AN,AS, dAN=S∗ω, dAS=S∗ω. On UN∩US the trivialisations differ by g:UN∩US→TP and AN=AS+g∗θ by 1.2(i). Stokes’ formula on the two closed hemispheres, whose common boundary is the equator E with opposite orientations, gives ∫S2S∗ω=∫E(AN−AS)=∫Eg∗θ. The map g∣E:S1→R/P lifts along the covering R→S1 to g^:R→R with g^(t+1)−g^(t)∈P, and ∫Eg∗θ=g^(1)−g^(0)∈P. ◀
4 Let X=R2, ω=dx∧dy, (Y,λ)=(R3,dz+xdy). Determine the automorphisms of (Y,λ) covering the linear symplectic maps A∈SL2(R), and show that A↦A^ can be chosen to be a homomorphism.
Solution. By the proof of 1.10, the lifts of A are (v,z)↦(Av,z−h(v)+c) with dh=A∗α−α, α=xdy. Put β=21(xdy−ydx), which is invariant under SL2(R), and note α=β+d(21xy). Then A∗α−α=d(21(xy)∘A−21xy), so h=qA with qA(v)=21((xy)(Av)−xy), a quadratic form. The choice A^(v,z)=(Av,z−qA(v)) is a homomorphism: in the coordinate ζ=z+21xy it is (v,ζ)↦(Av,ζ), and λ=dζ+β. So SL2(R) acts on the Heisenberg bundle by automorphisms, and Aut(Y,λ) contains the semidirect product of SL2(R) with the Heisenberg group. ◀
Equivariance and the moment map
When the action of a group lifts to a prequantum bundle, the moment map is the pullback of the connection form along the orbits upstairs. It is equivariant, and it vanishes exactly when the bundle with its connection descends to the homotopy quotient. When the action does not lift, it lifts for a central extension of the group, and the Souriau cocycle is the coadjoint action of the extension on its central momentum.
The moment map of an equivariant prequantum bundle
Throughout, (X,ω) is a connected parasymplectic space with a prequantisation (Y,λ), π:Y→X, with group of periods P, and ρ:G→Diff(X,ω) is a smooth action of a diffeological group.
Definition 1.1. An equivariant prequantisation is a smooth action Φ:G×Y→Y by automorphisms of (Y,λ) covering ρ; equivalently, a smooth homomorphism G→Aut(Y,λ) lifting ρ through the sequence of Theorem 1.10.
Theorem 1.2 (A: the prequantum moment map). Let (Y,λ) be an equivariant prequantisation. For x∈X choose y∈π−1(x) and put μ(x)=y^∗λ∈Ω1(G),y^:G→Y,g↦g⋅y.
μ(x) is independent of y and is left-invariant; μ:X→G∗ is smooth.
μ(g⋅x)=Ad∗(g)μ(x).
For every path p in X, the paths moment map of Theorem 1.3 is Ψ(p)=μ(p(1))−μ(p(0)).
Consequently the holonomy Γ and the Souriau class σ of the action vanish, and μ is an equivariant moment map in the sense of Theorem 1.4.
Proof. (i) For τ∈TP, τy=τY∘y^ because the two actions commute, and τY∗λ=λ. For h∈G, y^∘L(h)=hY∘y^ and hY∗λ=λ, so L(h)∗μ(x)=μ(x). Smoothness: over a plot of X with Cartesian domain U the bundle has a section s, and r↦μ(Q(r)) is the family of restrictions to the slices G×{r} of the form (Φ∘(id×s))∗λ on G×U. (ii) gy=y^∘R(g), and gy lies over gx. (iii) The pullback p∗Y is a principal bundle over R, hence trivial, so p has a smooth lift p~∈Paths(Y). Let π∗:Paths(Y)→Paths(X) be induced by π; then π∗∘p~^=p^, where p~^(g)=gY∘p~. By naturality of K and (1), Ψ(p)=p~^∗(π∗)∗Kω=p~^∗K(π∗ω)=p~^∗K(dλ)=p~^∗(1^∗λ−0^∗λ−d(Kλ)). The function Kλ∘p~^ is g↦∫gY∘p~λ=∫p~gY∗λ=∫p~λ, a constant, so the last term vanishes. The composite 1^∘p~^ is the orbit map of p~(1), which lies over p(1); so the first term is μ(p(1)), and the second is μ(p(0)). For a loop Ψ=0; hence Γ=0, ψ(x,x′)=μ(x′)−μ(x), and θ=0 by (ii). ◻
For the trivial bundle of an invariant primitive α (Example 1.7), with G acting on the first factor, μ(x)=x^∗α: 1.2 contains Theorem 1.5. The classical formula ⟨μ,ξ⟩=λ(ξY) for the moment map of a prequantised Hamiltonian action of a Lie group, due to Kostant and Souriau [53, 79], is the value of y^∗λ at the identity.
Proposition 1.3 (Characters and levels). The equivariant structures on (Y,λ) covering ρ form a torsor under the group Hom∞(G,TP) of smooth characters, or are absent. Twisting by a character χ, g⋆y=χ(g)⋅(g⋅y), changes the moment map to μ+χ∗θ. For G=S1=R/2πZ the moment maps of the equivariant structures are μ0+c with 2πc∈P.
The proof is [exo:levels]. So the constant of Theorem 1.4(iii), which is arbitrary for the form ω, is quantised for the bundle: the admissible levels are c∈2π1P. If the level is prescribed, the group of periods must contain 2πc. This is the origin of the integrality condition in the reduction of Reduction.
Left: the 1-form Φ∗λ−prY∗λ on G×Y is determined by its restrictions to the two families of slices (Lemma 1.11). Right: the corresponding factorisations of the prequantum bundle.
Descent to the homotopy quotient
Let Gδ be the group G with the discrete diffeology. The identity Gδ→G induces X//Gδ→X//G, and there is the projection X//G→X/G.
Theorem 1.4 (B: descent).
Map(X//Gδ,B(TP)conn) is the groupoid of prequantum data (Y,λ) with an action of the abstract group G by automorphisms.
The groupoid of equivariant prequantum data is the fibre product Map(X//G,BTP)×Map(X//Gδ,BTP)Map(X//Gδ,B(TP)conn), and its objects have the moment maps μ of 1.2, which are equivariant smooth maps X→G∗.
Map(X//G,B(TP)conn) is the full subgroupoid of equivariant prequantum data with μ=0.
If the action of G on X is principal and μ=0, then (Y,λ) is the pullback of a bundle with connection (Y0,λ0) on X/G, unique up to isomorphism, whose curvature ω0 satisfies πG∗ω0=ω.
Proof. The homotopy quotient is the colimit of the simplicial object G∙×X, and B(TP)conn is 1-truncated, so a map out of it is a descent datum: an object over X, an isomorphism between its two pullbacks to G×X, and a cocycle condition over G×G×X. By Proposition 1.3 the object is a pair (Y,λ). An isomorphism prX∗Y→a∗Y of principal bundles over G×X is a smooth map Φ:G×Y→Y covering the action and commuting with TP; the cocycle condition is that Φ be an action; and the isomorphism preserves the connections if and only if Φ∗λ=prY∗λon G×Y. By Corollary 1.12, (6) holds if and only if gY∗λ=λ for all g and y^∗λ=0 for all y, that is, if and only if Φ is an equivariant prequantisation with μ=0. This is (iii). For Gδ the plots of the first factor are locally constant, the slices G×{y} contribute nothing, and smoothness in g is no condition; this is (i). For (ii), the fibre product imposes that the bundle isomorphism be smooth over G×X and preserve the connection on each slice {g}×X. (iv) By [I, Theorem 7.2], X/G≃X//G, so (iii) is a map X/G→B(TP)conn, which is a bundle with connection by Proposition 1.3; its curvature pulls back to ω because F is a map of stacks. ◻
Three conditions that are stated together in the classical theory are separate in the theorem. Invariance of the connection under each group element is descent to X//Gδ. Smoothness of the lifted action is descent of the underlying bundle to X//G. The vanishing of the moment map is the remaining condition for the connection: it is the statement that the connection has no component along the group.
The central extension
Suppose only that each ρ(g) lifts to an automorphism of (Y,λ), and let G^=G×Diff(X,ω)Aut(Y,λ)={(g,ϕ)∣ϕ covers ρ(g)} with the subspace diffeology of the product.
Theorem 1.5 (The prequantum extension).
1→TPiG^→G→1 is a central extension of diffeological groups.
G^ acts on (Y,λ) by automorphisms, so (Y,λ) is an equivariant prequantisation for G^, with an equivariant moment map μ^:X→G^∗ by 1.2.
i∗μ^(x)=θ for every x: the moment map of the centre is the constant 1.
The equivariant prequantisations for G are the smooth homomorphic sections s of G^→G, and the moment map of s is s∗∘μ^.
The proof is [exo:extension]. By part (iv) the obstruction to an equivariant prequantisation is the class of the extension: if G^→G has no homomorphic section there is no equivariant prequantisation, although every element of G preserves the isomorphism class of the bundle.
Example 1.6 (Translations and the Heisenberg group). Let X=R2n with a constant symplectic form Ω, the antisymmetrisation of a bilinear form B, and G=R2n acting by translations. By Theorem 1.10, G^ is the Heisenberg group HB acting on Y=HB by left multiplication. The commutator of (u,c) and (v,c′) is (0,−Ω(u,v)), while G is abelian: there is no homomorphic section. The moment map of HB is computed from the orbit map (a,c)↦(a,c)(x,0)=(a+x,c−B(a,x)): μ^(x)=λH+Ω(x,⋅),λH=dc+B(a,da), where λH is the left-invariant form dual to the centre. The coadjoint action on it is Ad∗(u,c)λH=λH+Ω(u,⋅) ([exo:heis-coadjoint]).
Comparing with Example 1.8: the non-equivariant moment map μ(x)=Ω(x,⋅) of the translations is the non-central part of the equivariant moment map μ^ of the Heisenberg group, and its Souriau cocycle θ(u)=Ω(u,⋅) is the coadjoint action of the extension on the central momentum. The affine coadjoint orbit of [exo:plane-orbit] is the linear coadjoint orbit of λH in G^∗.
Four successive obstructions for a group acting on a prequantised space.
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 For the rotations of C and the trivial bundle C×TP with λ=α+θ, list the equivariant structures and their moment maps.
Solution. The action eiφ⋅(z,t)=(eiφz,t) is an equivariant structure with μ0(z)=21∣z∣2 (Example 1.7). By 1.3 the others are eiφ⋆(z,t)=(eiφz,t+cφ), defined when 2πc∈P, with moment map 21∣z∣2+c. For P=0 only c=0 occurs; for P=2πZ the levels are the integers; for P=2π(Z+αZ) they are the dense set Z+αZ. ◀
Solution. The form λ=dz+B(v,dv) pulled back by (a,c)↦(a+x,c−B(a,x)) is dc−B(da,x)+B(a+x,da)=dc+B(a,da)+B(x,da)−B(da,x)=λH+Ω(x,da). Right multiplication by (u,c′) is (a,c)↦(a+u,c+c′−B(a,u)), and pulls λH back to dc−B(da,u)+B(a+u,da)=λH+Ω(u,da). ◀
3 Let Y=S3⊂C2 with λ=Im(zˉ1dz1+zˉ2dz2) and the action of U(1) by scalars. Show that U(2) acts by automorphisms, that the induced action on S2=Y/U(1) is that of SO(3), and that the extension G^→SO(3) of 1.5 has no homomorphic section.
Solution.λ is the restriction of the imaginary part of the Hermitian form ⟨z,dz⟩, which is U(2)-invariant, and U(2) commutes with scalars. The induced action on CP1=S2 is by PU(2)=U(2)/U(1)≅SO(3), and the kernel U(1) is the structure group; by Theorem 1.10 the automorphisms covering a given rotation are a coset of U(1), so G^=U(2). A homomorphic section SO(3)→U(2) would be a two-dimensional unitary representation of SO(3) inducing the identity of PU(2). The irreducible representations of SO(3) have odd dimension, so a two-dimensional one is a sum of characters, hence trivial since SO(3) is perfect; this contradicts the condition on PU(2). So the Hopf bundle is an equivariant prequantisation for SU(2) and for U(2), and for no action of SO(3). ◀
Solution. Let Φ,Φ′ be two equivariant structures covering ρ. For each g, gY′∘gY−1 is an automorphism covering the identity, hence the action of a constant χ(g)∈TP by Theorem 1.10. Since TP is central in Aut(Y,λ), χ is a homomorphism; it is smooth because Φ and Φ′ are. Conversely g⋆y=χ(g)⋅(g⋅y) is an action by automorphisms. Its orbit map is ΦT∘(χ,y^), and by Lemma 1.2(i) it pulls λ back to χ∗θ+y^∗λ. For G=R/2πZ, a smooth character to R/P lifts to φ↦cφ with 2πc∈P, and χ∗θ=cdφ. ◀
Solution. (i) The projection G^→G is a smooth homomorphism, surjective by hypothesis, with kernel the automorphisms covering the identity, which is TP by Theorem 1.10, central in Aut(Y,λ) and hence in G^. (ii) The second projection G^→Aut(Y,λ) is a smooth homomorphism covering the action ρ∘pr1 of G^ on X. (iii) The orbit map of y restricted to the centre is the orbit map of the principal action of TP, and λ is calibrated. (iv) A smooth homomorphic section s is a smooth homomorphism G→Aut(Y,λ) lifting ρ, and conversely. The orbit maps satisfy y^G=y^G^∘s, so the moment map is s∗μ^. ◀
Reduction
The reduced space of an equivariantly prequantised space is the quotient of the zero level of the moment map. When the group acts principally on the level set, the quotient is a parasymplectic space with a prequantum bundle of the same structure group, and no regularity of the level set is required. Reduction at an irrational level produces prequantum bundles whose structure group is an irrational torus. For non-principal actions the prequantum data are defined on the stack quotient, and reduction can be performed in stages.
The reduction theorem
Let (Y,λ) be an equivariant prequantisation of (X,ω) for a diffeological group G, with moment map μ:X→G∗ (Theorem 1.2). Put Z=μ−1(0)⊆X,YZ=π−1(Z)⊆Y,X0=Z/G,Y0=YZ/G, with subspace and quotient diffeologies. The subset Z is invariant because μ is equivariant and the coadjoint action is linear. The space X0 is the reduced space.
Lemma 1.1.
If G acts principally on Z and W→Z is a smooth equivariant map of G-spaces, then G acts principally on W.
If commuting actions of H and K on W define a principal action of H×K, then K acts principally on W/H, with quotient W/(H×K). Conversely, if H acts principally on W and K acts principally on W/H, then H×K acts principally on W.
If q:W→B is a subduction and A⊆W is saturated, A=q−1(q(A)), then q∣A:A→q(A) is a subduction for the subspace diffeologies.
Theorem 1.2 (C: reduction). Suppose G acts principally on Z=μ−1(0). Then:
there is a unique closed 2-form ω0 on X0 with πG∗ω0=ω∣Z;
Y0→X0 is a principal TP-bundle, and λ∣YZ descends to a connection form λ0 on Y0 with curvature ω0;
(Y0,λ0) is the bundle with connection on Z/G≃Z//G of Theorem 1.4(iv).
So (X0,ω0) is a parasymplectic space prequantised by (Y0,λ0) with the same group of periods P.
Proof.The bundle. The projection YZ→Z is equivariant, so G acts principally on YZ by 1.1(a). The torus TP acts principally on YZ, the restriction of a principal bundle. The product G×TP acts principally on YZ: if (g,τ)⋅y=y then g fixes π(y), so g=1 and then τ=1; and if r↦(yr,grτryr) is a plot of YZ×YZ then r↦gr is a plot of G by principality on Z, hence r↦τryr is a plot, and r↦τr is a plot of TP. By 1.1(b), TP acts principally on Y0=YZ/G with quotient YZ/(G×TP)=(YZ/TP)/G=Z/G.
The connection. Every gY preserves λ, and for y∈YZ the orbit pullback y^∗λ=μ(π(y)) vanishes. By Corollary 1.12, Φ∗λ=prY∗λ on G×YZ, and by Proposition 1.6(i) the form λ∣YZ descends to a form λ0 on Y0. It is invariant under TP because λ is and the quotient map q:YZ→Y0 is equivariant. It is calibrated: the orbit map of q(y) under TP is q∘y^, and (q∘y^)∗λ0=y^∗λ=θ.
The curvature. Let ω0 be the curvature of λ0 (Lemma 1.2), so π0∗ω0=dλ0 with π0:Y0→X0. Then π∗πG∗ω0=q∗π0∗ω0=q∗dλ0=dλ∣YZ=π∗(ω∣Z), and π∗ is injective; so πG∗ω0=ω∣Z. Uniqueness holds because πG∗ is injective. (iii) Both bundles pull back to (YZ,λ) with its descent datum, and descent data determine the descended object. ◻
Three features of the statement differ from the theorem of Marsden and Weinstein [64]. The level set is an arbitrary subset with the subspace diffeology: 0 need not be a regular value, and Z need not be a manifold. The group is an arbitrary diffeological group. And the hypothesis is the single condition that the action on Z be principal, which for a Lie group acting on a manifold Z is the classical condition that the action be free and proper [I, §7.1].
Corollary 1.3 (The exact case). Let α be an invariant 1-form on X, ω=dα, μ(x)=x^∗α. If G acts principally on Z=μ−1(0), then α∣Z descends to a 1-form α0 on Z/G and ω0=dα0.
Reduction of a prequantised space. Each column is a principal TP-bundle with connection; the right-hand squares are pullbacks of bundles with connection.
Levels and periods
Reduction at a non-zero level is reduction at zero for a twisted lift. By Proposition 1.3, a character χ:G→TP changes the moment map to μ+χ∗θ; so μ−1(−χ∗θ) is the zero level of an equivariant prequantisation, and 1.2 applies to it. For the circle the admissible levels are the c with 2πc∈P. If ω is exact, every P is available for the bundle upstairs (Example 1.7), and the level determines the smallest one: reduction of an exact form at the level c produces a prequantum bundle whose group of periods is generated by 2πc.
Example 1.4 (Projective space). Let X=Cn+1 with α=21∑(xkdyk−ykdxk), and let S1 act by scalars, μ0=21∣z∣2. Fix c>0, P=2πcZ, Y=Cn+1×TP, λ=α+θ, with the lift eiφ⋅(z,t)=(eiφz,t−cφ) and moment map 21∣z∣2−c. The zero level is the sphere of radius 2c, on which S1 acts principally, and X0=CPn. Each orbit in YZ intersects {t=0} exactly once, so Y0≅S2n+1 with λ0=α∣S2n+1: the Hopf bundle, with ∫CP1ω0=2πc.
Theorem 1.5 (The prequantum bundle of S2×S2). Let c1,c2>0, P=2π(c1Z+c2Z), and let T2 act on X=C2×C2 by scalars on the two factors, lifted to Y=X×TP by (φ1,φ2)⋅(z,w,t)=(eiφ1z,eiφ2w,t−c1φ1−c2φ2). Let K⊂R2 be the line c1φ1+c2φ2=0 and Kˉ its image in T2.
The reduced space is (S2×S2,c1ω1+c2ω2) with ∫S2ωi=2π.
The reduced prequantum bundle is Y0≅(S3×S3)/K, the space of orbits of the linear flow of slope −c1/c2 on the tori T2⋅(z,w), with structure group T2/Kˉ≅TP.
If c1/c2 is rational, Kˉ is a circle, Y0 is a compact 5-manifold and TP is a circle.
If c1/c2 is irrational, TP is an irrational torus, K≅R acts principally on S3×S3, and Y0 has the shape of S3×S3; its D-topology is not Hausdorff.
Proof. The lift is defined on T2 because 2πci∈P, and it preserves λ=α1+α2+θ. By Proposition 1.3 the moment map is (21∣z∣2−c1,21∣w∣2−c2), with zero level Z=S3×S3, on which T2 acts freely and properly. This gives (i) by 1.2 and 1.4. (ii) The map S3×S3→Y0, (z,w)↦[z,w,0], is a subduction: a plot of Y0 lifts locally to S3×S3×R, and the rotation by φ1=t/c1 moves it into {t=0}. Two points of {t=0} are identified if and only if they differ by (φ1,φ2) with c1φ1+c2φ2∈P, that is, by an element of K+(2πZ)2. The structure group acts through T2/Kˉ=R2/(K+(2πZ)2), which (φ1,φ2)↦c1φ1+c2φ2 maps isomorphically to R/P. (iii) is clear. (iv) The map K→T2 is the irrational winding, an induction [IZ, Exercise 31]; so a plot of T2 with values in Kˉ is a plot of K, and the action of K on S3×S3, a restriction of the principal action of T2, is principal. By [I, Theorem 5.4] the shape of Y0 is the quotient of the shape of S3×S3 by that of K≅R, which is contractible. The D-topology is [exo:nonhausdorff]. ◻
So the prequantum bundle of a product of spheres with incommensurable areas, which exists by Theorem 1.5, has the explicit model (S3×S3)/R: a diffeological space of dimension 5 with the homotopy type of S3×S3, fibred over S2×S2 by irrational tori. As the ratio c1/c2 varies, the manifolds of (iii) and the spaces of (iv) alternate densely.
Left: the kernel of T2→TP in 1.5 is a dense line; the structure group is its space of leaves. Right: the levels at which a circle action can be reduced together with its prequantum bundle form the group 2π1P.
Non-principal actions
When the action on Z is not principal, Theorem 1.4(iii) still applies to the G-space Z.
Theorem 1.6 (Reduction to the stack). For every equivariant prequantisation, the restriction of (Y,λ) to Z=μ−1(0) is a map ∇0:Z//G→B(TP)conn, and ω∣Z is a closed 2-form on Z//G in the sense of (4), the curvature of ∇0.
Proof. The moment map of the G-space Z with the restricted bundle is zero, so Theorem 1.4(iii) gives ∇0. Composing with F gives a map Z//G→Ωcl2 restricting to ω∣Z. ◻
By [I, Theorem 7.8] the stack Z//G maps to the diffeological orbit space Z/G, and the question is which of the data descend further. For the form there is a general answer when Z is a manifold.
Theorem 1.7 (Karshon–Watts [48). ]Let a Lie group G act on a manifold M so that its identity component acts properly. Then π∗ is an isomorphism from the diffeological forms on M/G onto the basic forms on M, that is, the invariant forms annihilated by the contractions with the generators of the action.
Corollary 1.8. In the situation of 1.7, let M=Z=μ−1(0) be a submanifold of a manifold X. Then ω∣Z descends to a closed 2-form on the diffeological space Z/G. The bundle YZ/G→Z/G has fibre TP/χz(Gz) over the orbit of z, where χz:Gz→TP is the character by which the stabiliser acts on the fibre of Y over z.
Proof.ω∣Z is invariant, and ιξZω∣Z=−d⟨μ,ξ⟩∣Z=0, so it is basic. The stabiliser Gz preserves the fibre Yz and commutes with TP, so it acts by translations through a homomorphism χz, and the fibre of YZ/G over [z] is Yz/Gz. ◻
For the circle acting on C2 with weights (1,2) at a positive level, Z=S3, Z/G is the teardrop orbifold with one point of structure group Z2, the reduced form exists by 1.8, and the reduced bundle is a principal bundle away from that point. An example with X of infinite dimension and singular reduced space is in [43].
Reduction in stages
Theorem 1.9 (Stages). Let G and H act on X by commuting actions, and let (Y,λ) be an equivariant prequantisation for G×H, with moment map (μG,μH):X→G∗×H∗ and zero levels ZG, ZH.
μH is G-invariant. The group H acts on XG=ZG/G, and (ZG∩ZH)/(G×H)≅((ZG∩ZH)/G)/H as diffeological spaces, where (ZG∩ZH)/G is a subspace of XG.
If G acts principally on ZG and H acts principally on (ZG∩ZH)/G, then G×H acts principally on ZG∩ZH, the reduced space XG is prequantised and H-equivariant with moment map induced by μH, and the reduction of XG by H is the reduction of X by G×H, with the same 2-form and the same prequantum bundle.
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Reduce the plane C by the rotations at a level c>0, with P=2πcZ.
Solution. With the lift of 1.4 for n=0, the zero level is the circle ∣z∣2=2c, on which S1 acts principally, and X0 is a point. The bundle YZ=S1×TP has the action eiφ⋅(z,t)=(eiφz,t−cφ), and Y0≅S1 by the slice t=0; under TP=R/2πcZ the orbit of a point of Y0 is all of Y0. So Y0→X0 is TP→∗, the only principal bundle over a point, and ω0=0. ◀
2 In 1.5 let c1=p and c2=q be coprime positive integers. Describe Kˉ, TP and Y0.
Solution.P=2π(pZ+qZ)=2πZ, so TP is the circle of length 2π. The line pφ1+qφ2=0 is φ=s(q,−p), and its image in T2 is the circle s∈R/2πZ, embedded because p,q are coprime. So Y0=(S3×S3)/S1 for the action eis⋅(z,w)=(eiqsz,e−ipsw), which is free; Y0 is a compact 5-manifold, a circle bundle over S2×S2 with Chern class (p,q) in the basis dual to the two spheres, since the curvature has the periods 2πp and 2πq on them. ◀
3 Show that for c1/c2 irrational the D-topology of Y0=(S3×S3)/K is not Hausdorff, and determine the closure of a point.
Solution. The D-topology of a quotient is the quotient of the D-topology [IZ, art. 2.12], here of the manifold topology of S3×S3. The orbit of (z,w) under K is dense in the orbit under T2, because Kˉ is dense in T2. A saturated closed set containing (z,w) therefore contains T2⋅(z,w), and conversely the T2-orbit is closed and saturated. So the closure of the point [z,w]∈Y0 is the fibre of Y0→S2×S2 through it, a copy of TP, and two points of one fibre have no disjoint neighbourhoods. The quotient of Y0 by the relation of having the same closure is S2×S2. ◀
Solution. (a) If gw=w then g fixes the image of w in Z, so g=1. Let r↦(wr,grwr) be a plot of W×W. Its image in Z×Z is a plot r↦(zr,grzr), so r↦gr is a plot of G, because the action map of Z is an induction; then r↦(gr,wr) is a plot of G×W. (b) If k[w]=[w] then kw=hw for some h, so (h−1,k) fixes w and k=1. Let r↦([wr],kr[wr]) be a plot of (W/H)2; locally it lifts to a plot r↦(wr,wr′) of W2 with wr′=hrkrwr, and r↦(hr,kr) is a plot of H×K by principality, so r↦kr is a plot. The quotient of W/H by K is W/(H×K) because a composite of subductions is a subduction. Conversely, if (h,k)w=w then k[w]=[w], so k=1 and then h=1; and for a plot r↦(wr,hrkrwr) the projection to (W/H)2 gives that r↦kr is a plot, hence r↦hrwr=kr−1wr′ is a plot, and r↦hr is a plot. (c) Let Q be a plot of B with values in q(A). Locally Q=q∘Q~ with Q~ a plot of W, and Q~ takes its values in q−1(q(A))=A; so Q~ is a plot of the subspace A. ◀
Solution.Momenta of a product. A left-invariant 1-form on G×H is determined by its restrictions to the slices (Lemma 1.11), which by invariance are determined by the restrictions to G×{1} and {1}×H; conversely prG∗β+prH∗γ is left-invariant. So the momenta of G×H are G∗×H∗, and since the factors commute, Ad∗(g,1) is the identity on H∗. Equivariance of the moment map (Theorem 1.2) gives μH(gx)=μH(x).
(i) The action of H preserves ZG and commutes with G, so it descends to XG. The set ZG∩ZH is saturated for ZG→XG because μH is G-invariant; by 1.1(c) its image in XG, with the subspace diffeology, is the quotient (ZG∩ZH)/G. The displayed isomorphism holds because both sides are quotients of ZG∩ZH by the same equivalence relation and subductions compose.
(ii) By 1.2, XG is prequantised by YG=YZG/G with λG. The action of H on YZG commutes with G and preserves λ, so it descends to an action on YG preserving λG. Its moment map at [x] is the pullback of λG by the orbit map q∘y^H, which is (y^H)∗λ=μH(x). So the zero level in XG is (ZG∩ZH)/G. The restriction of the principal action of G to the invariant subspace ZG∩ZH is principal, and by 1.1(b) so is the action of G×H. Both reductions are therefore defined on the same space. The two reduced 2-forms pull back to ω∣ZG∩ZH and the two connection forms to λ∣YZG∩ZH; pullback along a subduction is injective, so they coincide. ◀
Applications
Number theory: periods, ideals, and Heisenberg quasi-nilmanifolds
Let K⊂R be a number field with ring of integers O. For fractional ideals a,b the product R/a×R/b is a two-dimensional symplectic quasi-torus. Its diffeomorphism type is the Steinitz class of a⊕b, its symplectic type is the ideal ab, which is its group of periods, its symplectic mapping class group is a Hilbert modular group, and its prequantum bundle is a quotient of the Heisenberg group by an arithmetic subgroup, with structure group R/ab.
Symplectic rigidity
Volume I attached to an irrational number α the one-dimensional torus Tα and read the arithmetic of Z+αZ from its diffeology [I, Chapter 9]. A one-dimensional space carries no non-zero 2-form (Example 1.4); the first symplectic examples are quotients of the plane.
Theorem 1.1 (Symplectic rigidity of quasi-tori). Let Γ,Γ′⊂R2n be dense subgroups and Ω,Ω′ non-degenerate alternating forms.
(TΓ,ωΩ)≅(TΓ′,ωΩ′) in PSymp if and only if there is A∈GL2n(R) with AΓ=Γ′ and A∗Ω′=Ω.
Diff(TΓ,ωΩ)={[x]↦[Ax+b]∣A∈Sp(Γ,Ω),b∈R2n}, where Sp(Γ,Ω)={A∈Sp(Ω)∣AΓ=Γ}. Its identity component is the group TΓ of translations, and its group of components is Sp(Γ,Ω).
The group Ω(Γ∧Γ)⊂R generated by the toric periods Ω(γ,γ′) is an invariant of (TΓ,ωΩ).
For a lattice Γ in the plane the only invariant is the area of the torus. For a dense subgroup the form Ω restricted to Γ is a homomorphism Λ2Γ→R of a group of rank (2rkΓ), and its image is a dense subgroup of R with its own arithmetic.
Tori attached to ideals
Fix a number field K of degree d≥2 with an embedding K⊂R. A fractional ideal a is a dense subgroup of R of rank d, and Ta=R/a is a one-dimensional quasi-torus with End(Ta)=O; two of them are diffeomorphic if and only if the ideals have the same class in Cl(K)[I, Proposition 9.5, Theorem 10.2]. For two fractional ideals put Xa,b=Ta×Tb=R2/(a⊕b),ω=the image of dx∧dy.
Theorem 1.2 (Steinitz class and periods).
Xa,b≅Xa′,b′ as diffeological spaces if and only if [ab]=[a′b′] in Cl(K).
The group of toric periods of (Xa,b,ω) is the ideal ab⊂R.
(Xa,b,ω)≅(Xa′,b′,ω) in PSymp if and only if ab=a′b′.
The symplectic mapping class group π0Diff(Xa,b,ω) is SL(a⊕b)={(acbd)a,d∈O,b∈ab−1,c∈a−1b,ad−bc=1}, which is conjugate in SL2(K) to the Hilbert modular group SL(O⊕ab).
Proof. Let M=a⊕b and M′=a′⊕b′, dense subgroups of R2. A matrix A∈GL2(R) with AM⊆M′ has entries in K: its first column maps a into a′ and into b′, so a∈a′a−1 and c∈b′a−1, and similarly for the second column. Hence A is K-linear on K2 and commutes with multiplication by O: it is a homomorphism of O-modules M→M′.
(i) By [I, Theorem 9.1], Xa,b≅Xa′,b′ if and only if AM=M′ for some A∈GL2(R), that is, if and only if M≅M′ as O-modules. By Steinitz’s theorem [67] a finitely generated torsion-free module over a Dedekind domain is determined by its rank and its Steinitz class, which for a⊕b is [ab].
(ii) For m=(x,y) and m′=(x′,y′) in M, Ω(m,m′)=xy′−x′y, and these elements generate ab.
(iii) If the spaces are symplectomorphic the groups of periods coincide, by 1.1(iii). Conversely let ab=a′b′=c. By (i) there is B∈GL2(K) with B(O⊕c)=M. For m,m′∈K2, Ω(Bm,Bm′)=detB⋅Ω(m,m′), so by (ii) ab=detB⋅c, and detB is a unit of O. Then B⋅diag((detB)−1,1) has determinant 1 and maps O⊕c onto M. The same holds for M′, and the composite M→O⊕c→M′ has determinant 1; apply 1.1(i).
(iv) By 1.1(ii) the group is {A∈SL2(R)∣AM=M}. The inclusions aa⊆a, bb⊆a, ca⊆b, db⊆b give the stated conditions, which are stable under inversion in SL2. Conjugation by the matrix of (iii) carries it to SL(O⊕c). ◻
Corollary 1.3. Ta×Tb≅TO×Tab, and Ta×Ta−1≅TO×TO. The diffeomorphism classes of the spaces Xa,b are in bijection with Cl(K), and under this bijection the product of tori is the multiplication of ideal classes.
So the class group, which in [I, Theorem 10.2] acted on the set of tori with real multiplication, is here the set of diffeomorphism types of their pairwise products, with its group law. The finer invariant of (iii) is not a class: it is the ideal itself, as a subgroup of R. Rescaling the form multiplies it: (XO,c,λω)≅(XO,λc,ω) for λ∈K, λ>0.
The groups of periods of (XO,O,ω) and of (XO,p,ω) for K=Q(10): two dense subgroups of R, one of index 2 in the other, and not related by any rescaling since p is not principal.
Heisenberg quasi-nilmanifolds
Let H=R3 with (x,y,z)(x′,y′,z′)=(x+x′,y+y′,z+z′−xy′) and λ=dz+xdy (Example 1.8), and for an integer n≥1 let Hn be the same with −nxy′ and λn=dz+nxdy. Put c=ab and Na,b={(a,b,c)∣a∈a,b∈b,c∈c},Ya,b(n)=Na,b\Hn. The set Na,b is a subgroup of Hn because nab⊆c. It is dense in Hn, and Ya,b(n) is a diffeological space of dimension 3: a Heisenberg quasi-nilmanifold.
Theorem 1.4 (Arithmetic prequantisation).
Ya,b(n)→Xa,b is a principal Tc-bundle, λn descends to a connection form, and the curvature is nω. For n=1 the structure group is the smallest possible: c is the group of toric periods.
A translation of Xa,b lifts to an automorphism of (Ya,b(n),λn) if and only if it is a translation by a point of Xa,b[n]=n1(a⊕b)/(a⊕b)≅(O/n)2. The lifts form a central extension 1⟶Tc⟶Gn⟶Xa,b[n]⟶1, whose commutator is the pairing en(v,w)=nΩ(v~,w~)modc with values in n1c/c≅O/n; it is O-bilinear, alternating and perfect.
Every A∈SL(a⊕b) with A≡1mod2 lifts to an automorphism of (Ya,b(n),λn).
Proof. (i) Let ZH={(0,0,z)} be the centre and L=Na,bZH=a×b×R. Then Na,b is normal in L, L/Na,b≅R/c by (a,b,z)↦[z], and L\Hn=R2/(a⊕b). By [exo:tower], N\Hn→L\Hn is a principal L/N-bundle. Left multiplication by (a,b,c) maps (x,y,z) to (a+x,b+y,c+z−nay), and d(z−nay)+n(a+x)dy=λn: the form is left-invariant, and it descends to the quotient by the discrete group Na,b. The centre acts by translation of z, so the descended form is invariant and calibrated, and dλn=ndx∧dy. Minimality for n=1 is Proposition 1.6 with 1.2(ii).
(ii) Left multiplication by h∈Hn descends to N\Hn if and only if h normalises N. Conjugation by h=(v,z) maps (m,c) to (m,c−nΩ(v,m)), so the normaliser is {(v,z)∣nΩ(v,a⊕b)⊆c}=n1(a⊕b)×R; here Ω(v,a⊕b)⊆n1c if and only if v∈n1(a⊕b) because the ideals are invertible. These automorphisms preserve λn, commute with the centre and cover the translations by v; the group they form is Gn=Norm(N)/N. By Theorem 1.10 every lift of a translation that has one is of this form. A translation by v∈/n1(a⊕b) has no lift: it changes the holonomy of the loop t↦[tγ], γ∈a⊕b, by nΩ(v,γ)modc. The commutator in Hn is [(v,z),(w,z′)]=(0,−nΩ(v,w)). Bilinearity over O and the alternating property are clear, and the pairing is perfect because Ω identifies n1a⊕n1b with the dual of a⊕b into n1c.
(iii) In the coordinate ζ=z+2nxy the group law is ζ+ζ′−2nΩ(v,v′) and λn=dζ+2n(xdy−ydx), both invariant under SL2(R) acting on v ([exo:quantomorphisms]). So A^(v,z)=(Av,z−nqA(v)), with qA(x,y)=21acx2+21bdy2+bcxy, is an automorphism of Hn preserving λn. It preserves Na,b if qA(a⊕b)⊆c. For x∈a, y∈b: bcxy∈c always, and if b∈2ab−1, c∈2a−1b then 21acx2∈c and 21bdy2∈c. ◻
For n=1 part (ii) is the statement that no translation of Xa,b other than the identity lifts: in the classical terminology the polarisation is principal, for every pair of ideals. For general n the group Gn is the theta group of Cryptography: pairings, isotropic kernels, symplectic lattices, and en is a Weil pairing with values in the n-torsion of the torus of periods Tc, an O-module of rank one. The restriction to the congruence subgroup in (iii) is the classical phenomenon of theta characteristics.
Left: the Heisenberg quasi-nilmanifold as a principal Tc-bundle over Xa,b, c=ab; rows are quotients by dense subgroups, columns are central extensions. Right: the product of tori attached to ideals realises the multiplication of ideal classes (1.3).
Proposition 1.5 (Duality). The moment map of the translations identifies Xa,b with Xb,a, by [x,y]↦[−y,x] in the coordinates dual to (x,y).
Proof.Proposition 1.9: the holonomy Ω(a⊕b,⋅) is the set of linear forms (x′,y′)↦xy′−x′y, with coefficients (−y,x)∈b⊕a. ◻
The symplectic quasi-torus Xa,b as an arithmetic object.
invariant of (Xa,b,ω)
value
arithmetic
shape
BZ2d
degree d=[K:Q]
diffeomorphism type
[ab]∈Cl(K)
Steinitz class
group of periods
ab⊂R
an ideal, not only its class
π0Diff(X,ω)
SL(O⊕ab)
Hilbert modular group
prequantum bundle
Na,b\H, group Tab
arithmetic subgroup of H
lifts of translations to nω
extension of (O/n)2 by Tab
theta group, Weil pairing in O/n
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 For K=Q(2) and a=b=O, compute the group of periods of (XO,O,ω), the shape of XO,O, and the rank of Λ2Γ.
Solution.Γ=Z[2]2 has rank 4, so the shape is BZ4, the homotopy type of a 4-torus, and Λ2Γ has rank 6. The periods xy′−x′y with x,y,x′,y′∈Z[2] generate Z[2], of rank 2. So the period homomorphism Λ2Γ→R has a kernel of rank 4: a two-dimensional space with a closed 2-form, the homotopy type of a 4-torus, and two independent periods. ◀
2 Let K=Q(10), p=(2,10), q=(3,1+10). Find A∈SL2(K) with A(O⊕pq)=p⊕q, and deduce the symplectic type of Xp,q.
Solution. The ideals have norms 2 and 3, so p+q=O; indeed a=−2∈p, b=3∈q, a+b=1. The map (s,t)↦(as−t,bs+t) has matrix A=(−23−11) of determinant 1. It maps O⊕pq into p⊕q because pq⊆p∩q, and onto: for (x,y)∈p⊕q take s=x+y and t=ay−bx∈pq. The ideal pq has norm 6 and contains 4+10 of norm 6, so pq=(4+10). By 1.2, (Xp,q,ω)≅(XO,(4+10),ω)≅(XO,O,(4+10)ω). Neither p nor q is principal, since x2−10y2=±2,±3 have no solutions modulo 5; their product is. The computation is verified in checks.py. ◀
2 For K=Q(2) exhibit an element of infinite order in π0Diff(XO,O,ω) that is diagonal, and one that is not conjugate to a diagonal element over K.
Solution. The group is SL2(Z[2]). With ε=1+2, a unit, diag(ε,ε−1) acts on TO×TO by the unit ε on one factor and its inverse on the other; each factor is the hyperbolic symmetry of [I, Theorem 9.3], and the product preserves ω because the determinant is 1. The matrix (1011) is unipotent, of infinite order, and not diagonalisable. So the symplectic mapping class group contains hyperbolic and parabolic elements, as the modular group of an ordinary torus does, and in addition the diagonal units, which have no analogue for a lattice. ◀
Solution. (i) Let f be a diffeomorphism with f∗ωΩ′=ωΩ. By [I, Theorem 9.1], f lifts to F(x)=Ax+b with A∈GL2n(R) and AΓ=Γ′. Then q∗f∗ωΩ′=F∗q′∗ωΩ′=F∗Ω′=A∗Ω′, and q∗ωΩ=Ω; since q∗ is injective, A∗Ω′=Ω. The converse is the same computation. (ii) Take Γ′=Γ, Ω′=Ω in (i); translations preserve every ωΩ. Let r↦fr be a plot of Diff(TΓ,ωΩ), so that (r,x)↦fr(q(x)) is smooth and lifts locally to Fr(x)=Arx+br, smooth in (r,x). For γ∈Γ, Arγ=Fr(x+γ)−Fr(x) is continuous in r with values in the countable set Γ, hence locally constant; as Γ spans, Ar is locally constant. So the linear part is constant on components, and the translations, a quotient of R2n, are connected. (iii) If AΓ=Γ′ and A∗Ω′=Ω then Ω′(Aγ,Aγ′)=Ω(γ,γ′). ◀
3 For K=Q(2), a=b=O and n=2, describe X[2], the pairing e2, and the number of its Lagrangian O-submodules.
Solution.X[2]=(O/2)2 with O/2=F2[ϵ]/(ϵ2), ϵ=2; it has 16 elements, and e2(v,w)=v1w2−v2w1∈O/2. A Lagrangian submodule is a submodule L equal to its orthogonal; since the pairing is perfect over the ring O/2 of length 2, L has 4 elements. The free submodules generated by one element v with a unit coordinate are isotropic and have 4 elements: there are ∣P1(O/2)∣=6 of them. The submodule ϵX[2] has 4 elements and is isotropic because ϵ2=0. A submodule with 4 elements is either free of rank one or annihilated by ϵ, and in the second case it is ϵX[2], which has exactly 4 elements. So there are 7 Lagrangian submodules. They are the analogues for XO,O of the Lagrangian kernels of Theorem 1.2, with the additional condition of stability under O. ◀
4 Let N⊆L be subgroups of a diffeological group H, with N normal in L. Prove that N\H→L\H is a principal bundle with group L/N.
Solution. The group L/N acts on N\H by [l]⋅Nh=Nlh, well defined because Nlnh=N(lnl−1)lh=Nlh for n∈N. The orbits are the fibres of N\H→L\H, and the action is free: Nlh=Nh implies l∈N. Let r↦(Nhr,Nhr′) be a plot of pairs in the same fibre. The projection H→N\H is a subduction, so locally hr and hr′ are plots of H, and hr′hr−1 is a plot of H with values in L, hence a plot of the subgroup L. Its class in L/N is the unique element carrying Nhr to Nhr′, and it is a plot of L/N. So the action map is an induction, the action is principal, and its quotient is L\H because subductions compose [I, Theorem 7.2, Corollary 7.3]. ◀
Three objects of public-key cryptography are parts of the prequantum geometry of a torus. The theta group is the group of automorphisms of the prequantum bundle over the translations, and the Weil pairing is its commutator. The isogenies that preserve a polarisation are the quotients by isotropic subgroups, because those are the subgroups along which the prequantum bundle descends. And the Gram–Schmidt profile of a symplectic basis of a lattice is symmetric, which applies to the NTRU bases of the signature scheme Falcon.
The theta group and the Weil pairing
A polarised torus is a triple (V,Λ,Ω): a real vector space of dimension 2n, a lattice, and a non-degenerate alternating form with Ω(Λ,Λ)⊆Z. Put T=V/Λ and Λ#={v∈V∣Ω(v,Λ)⊆Z}⊇Λ. The polarisation is principal if Λ#=Λ. Choose a bilinear form B on V with B(v,w)−B(w,v)=Ω(v,w) and B(Λ,Λ)⊆Z, which exists by the normal form of an integral alternating form, and let HB=V×R with (v,z)(v′,z′)=(v+v′,z+z′−B(v,v′)), λ=dz+B(v,dv), N=Λ×Z. As in Theorem 1.4, Y=N\HB→T is a prequantisation of (T,ωΩ) with P=Z: a circle bundle with connection of curvature Ω. Over C, when V has a complex structure compatible with Ω, it is the unit circle bundle of the line bundle of the polarisation.
The translation of T by [v] lifts to an automorphism of (Y,λ) if and only if v∈Λ#.
The lifts of translations form the group G(Ω)=Norm(N)/N, a central extension 1⟶R/Z⟶G(Ω)⟶Λ#/Λ⟶1.
The commutator of two lifts is e(v,w)=Ω(v~,w~)modZ, up to sign. The pairing e on Λ#/Λ is alternating and non-degenerate.
If Ω is principal and N≥1, then for the polarisation NΩ the group (Λ#)NΩ/Λ is the N-torsion subgroup T[N]=N1Λ/Λ, and eN(x,y)=NΩ(x~,y~)modZ takes its values in N1Z/Z.
Proof. The argument of Theorem 1.4(ii) applies with a⊕b replaced by Λ and c by Z: conjugation by (v,z) maps (m,c)∈N to (m,c−Ω(v,m)), the normaliser is Λ#×R, left multiplications by its elements descend to automorphisms of (Y,λ), any two lifts of one translation differ by a constant by Theorem 1.10, and a translation by v∈/Λ# changes holonomies. The commutator in HB is (0,−Ω(v,w)). If Ω(v,w)∈Z for all w∈Λ# then v∈(Λ#)#=Λ. For (iv), NΩ(v,Λ)⊆Z if and only if Nv∈Λ#=Λ. ◻
The group G(NΩ) is the theta group of the N-th power of a principal polarisation, and eN is the Weil pairing on the N-torsion points, in its complex-analytic form. For an elliptic curve C/(Z+τZ) with Ω(1,τ)=1 it is eN(Na+bτ,Nc+dτ)=Nad−bcmodZ. In the present terms the pairing is a holonomy: the translations by x and y commute on T, their lifts to the prequantum bundle do not, and the defect is the integral of the curvature NΩ over the parallelogram spanned by the lifts of x and y (1.1). Bilinearity and the alternating property are properties of area.
Left: the Weil pairing as the integral of the curvature over a parallelogram. Centre and right: for an elliptic curve and p=3, the Lagrangian subgroups of T[3] are its four lines, and each is the kernel of an isogeny along which the polarisation descends.
Isotropic kernels
Let K⊆Λ#/Λ be a subgroup, ΛK⊆Λ# its preimage, and f:T→T′=V/ΛK the quotient map, an isogeny with kernel K.
Theorem 1.2 (Descent of the polarisation). The following are equivalent:
K is isotropic for the pairing e;
Ω(ΛK,ΛK)⊆Z, that is, (V,ΛK,Ω) is a polarised torus;
there is a prequantisation (Y′,λ′) of (T′,ωΩ) with f∗(Y′,λ′)≅(Y,λ).
In that case the descents (Y′,λ′) of (Y,λ) correspond to the homomorphic lifts K→G(Ω), a torsor under Hom(K,R/Z); the group ΛK#/ΛK of the quotient is K⊥/K, of order ∣Λ#/Λ∣/∣K∣2; and the quotient is principally polarised if and only if K is Lagrangian, K=K⊥.
Proof. (a)⟺(b) by the definition of e. (a)⇒(c): the preimage GK of K in G(Ω) is a central extension of the finite abelian group K by R/Z with trivial commutator pairing, hence abelian, and it splits because R/Z is divisible. A splitting is a group K~≅K of automorphisms of (Y,λ) covering the translations by K. It acts freely on Y, commutes with the circle, and Y′=Y/K~→T/K is a principal circle bundle to which the invariant form λ descends; its pullback to T is Y. (c)⇒(a): the deck transformations of f∗Y′→Y′ are automorphisms of (Y,λ) covering the translations by K and forming a group isomorphic to K, so commutators of lifts of elements of K are trivial. Two splittings differ by a character of K. Finally v∈ΛK# if and only if Ω(v,ΛK)⊆Z, that is, [v]∈K⊥; and ∣K⊥∣=∣Λ#/Λ∣/∣K∣ because e is non-degenerate. ◻
Corollary 1.3 (N-isogenies). Let (V,Λ,Ω) be principally polarised. The quotients T→T/K for which NΩ descends to a principal polarisation are those with K⊆T[N] Lagrangian for eN; then ∣K∣=Nn. For N=p prime their number is ∏i=1n(pi+1).
The count is [exo:lagrangian-count]; the values 3,4,6 for n=1 and 15,40 for n=2, p=2,3 are confirmed by enumeration in checks.py.
For n=1 every cyclic subgroup of order N is Lagrangian, and the p+1 quotients are the edges of the isogeny graphs on which the protocols of [18] and their predecessors operate. For n=2 and p=2 the 15 quotients are the Richelot isogenies. The polynomial-time attacks on the SIDH protocol [17, 61, 74] compute isogenies from products of elliptic curves, in dimensions 2, 4 and 8, whose kernels are maximal isotropic for a Weil pairing; isotropy is the condition under which the quotient is again principally polarised. Theorem 1.2 is the statement over C; over a finite field the same statement holds with the algebraic theta group [69]. Its geometric form is that of Theorem 1.4: a bundle with connection descends along a quotient exactly when the group acts on it, and for a finite group of translations the obstruction is the commutator.
Symplectic lattices
Let Rn be the n×n matrix with ones on the antidiagonal, and J=(0−RnRn0),JT=−J=J−1. For a basis b1,…,bm of Rm, written as the rows of a matrix B, let b1∗,…,bm∗ be its Gram–Schmidt orthogonalisation.
Theorem 1.4 (Duality of the Gram–Schmidt profile). Let B∈GL2n(R) satisfy BJBT=cJ with c>0. Then ∥bi∗∥⋅∥b2n+1−i∗∥=c(1≤i≤2n).
Proof. Replacing B by c−1/2B we may take c=1. Then B−T=JBJT. Row i of JB is ±b2n+1−i, so the dual basis is di=±b2n+1−iJT, and the dual basis in reversed order is (±b1JT,…,±b2nJT): the image of the basis B under an orthogonal map and changes of sign, with the same Gram–Schmidt norms as B. By [exo:reversed-dual] the reversed dual basis has Gram–Schmidt norms ∥b2n∗∥−1,…,∥b1∗∥−1. Comparing, ∥bj∗∥=∥b2n+1−j∗∥−1. ◻
Corollary 1.5 (NTRU bases; Gama–Howgrave-Graham–Nguyen [32). ]Let R=Z[x]/(xn+1) and let u=(g,−f), u′=(G,−F) in R2 satisfy fG−gF=q. Then the basis u,xu,…,xn−1u,u′,xu′,…,xn−1u′ of the NTRU lattice, written in coefficients, satisfies BJBT=qJ, and ∥bi∗∥∥b2n+1−i∗∥=q. The same holds for the public basis (10hq).
Proof. The form ωR(v,w)=v1w2−v2w1 on R2 is R-bilinear and alternating. Its value on (u,u′) is q, and its value on the public basis (1,h), (0,q) is also q. Let ℓ:R→Z be the coefficient of xn−1. For 0≤i,j<n, ℓ(xi+j)=1 if i+j=n−1 and 0 otherwise, since xi+j=−xi+j−n for i+j≥n has degree at most n−2. So ℓ∘ωR has the matrix J in the coefficient basis of R2, and ℓωR(xiu,xju′)=qℓ(xi+j),ℓωR(xiu,xju)=0. That is BJBT=qJ; apply 1.4. ◻
So the second half of the Gram–Schmidt profile of an NTRU basis is determined by the first. The key generation of Falcon [30] must bound maxi∥bi∗∥ for the secret basis, and by the corollary it suffices to bound ∥bi∗∥ and q/∥bi∗∥ for i≤n; the symmetry is also the reason that the profile of such a basis is centred at q (1.2). In the terms of this monograph, an NTRU lattice is a polarised torus (R2n,Λ,q−1ℓωR) whose polarisation is principal, the ring R acts on it by endomorphisms, as O does on Xa,b, and the symmetry of the profile is the self-duality Λ#=Λ in metric form. The moduli of principally polarised tori with a compatible metric is the Siegel orbifold Sp2n(Z)\Sp2n(R)/U(n), a diffeological orbifold by the argument of [I, Theorem 10.6]; the isomorphism problem for symplectic lattices is the search problem on its stack.
The Gram–Schmidt profile of a symplectic basis is symmetric about 21logc: the pairs (i,2n+1−i) joined by arrows have product q. Data computed in checks.py.
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 For Λ=Z+τZ⊂C with Ω(1,τ)=1, derive the formula for eN and check that eN(x,x)=0 and that eN(x,⋅)=0 implies x=0.
Solution.Ω(a+bτ,c+dτ)=ad−bc by bilinearity, so eN(Na+bτ,Nc+dτ)=N⋅N2ad−bc=Nad−bcmodZ. It vanishes on the diagonal. If ad−bc≡0modN for all (c,d), take (c,d)=(0,1) and (1,0): a≡b≡0. ◀
2 For T=R2/Z2 with Ω=dx∧dy and N=2, write the lifts of the translations by (21,0) and (0,21) to the prequantum bundle of 2Ω, and compute their commutator.
Solution. In H2, with law z+z′−2xy′, the lifts are the left multiplications by h1=(21,0,0) and h2=(0,21,0), which normalise N=Z3. Then h1h2=(21,21,−21) and h2h1=(21,21,0), so h1h2=(0,0,−21)h2h1: the two lifts commute up to the element −21∈R/Z of the centre, which acts on the associated line bundle by −1. The squares h12=(1,0,0) and h22=(0,1,0) lie in N, so the lifts have order 2 on Y and generate, with the centre, the Heisenberg group of level 2. ◀
2 Count the Lagrangian subspaces of a symplectic vector space of dimension 4 over Fp, and state the general formula.
Solution. Count ordered bases (v,w) of Lagrangian planes: v=0 gives p4−1 choices, and w∈v⊥∖⟨v⟩ gives p3−p. Each plane has (p2−1)(p2−p) ordered bases. The quotient is (p2−1)p(p−1)(p2−1)(p2+1)p(p2−1)=(p2+1)(p+1): 15 for p=2, 40 for p=3. In dimension 2n the same count, or induction through v⊥/⟨v⟩, gives ∏i=1n(pi+1). ◀
3 Let K⊆T[N] be Lagrangian for eN and f:T→T′=T/K. Show that f(T[N])⊆T′[N] is Lagrangian for eN′, and that the quotient of T′ by it is T again.
Solution.T′=V/ΛK with the principal polarisation Ω′=NΩ, and eN′(x,y)=NΩ′(x~,y~)=N2Ω(x~,y~) on N1ΛK/ΛK. The image of T[N] is K′=N1Λ/ΛK, and for x~,y~∈N1Λ, N2Ω(x~,y~)∈Z: K′ is isotropic. Its order is [N1Λ:ΛK]=N2n/Nn=Nn, so it is Lagrangian. The quotient T′/K′=V/N1Λ is identified with T=V/Λ by multiplication by N, and the composite T→T′→T is multiplication by N: the second map is the dual isogeny. ◀
3 Let B have rows b1,…,bm with Gram–Schmidt norms d1,…,dm. Show that the dual basis in reversed order has Gram–Schmidt norms dm−1,…,d1−1.
Solution. Gram–Schmidt orthogonalisation is the factorisation B=LDQ with L lower triangular with unit diagonal, D=diag(di) and Q orthogonal, and it is unique. The dual basis is B−T=L−TD−1Q, with L−T upper unitriangular. Let R be the permutation matrix reversing the order. Then RB−T=(RL−TR)(RD−1R)(RQ), where RL−TR is lower unitriangular, RD−1R=diag(dm−1,…,d1−1) and RQ is orthogonal. By uniqueness this is the Gram–Schmidt factorisation of the reversed dual basis. ◀
4 Complete the proof of 1.4: show that BJBT=J implies B−T=JBJT, that row i of JB is ±b2n+1−i, and that the operations used preserve Gram–Schmidt norms.
Solution. From BJBT=J, B−1=JBTJ−1 and B−T=J−TBJT=JBJT, since J−T=(−J)−1=J. For i≤n, row i of J has its only non-zero entry, 1, in column n+(n+1−i)=2n+1−i; for i=n+k it has −1 in column n+1−k=2n+1−i. So row i of JB is ±b2n+1−i. Multiplying all vectors of a basis on the right by an orthogonal matrix replaces Q by QJT in the factorisation LDQ and leaves D unchanged. Changing the sign of a basis vector bi changes the sign of bi∗ and of the coefficients μji, μij, and leaves every norm unchanged. Hence the reversed dual basis (±bjJT)j has the Gram–Schmidt norms of B, which is what the proof uses. ◀
Machine learning: conservation laws of learning dynamics
A symmetry of a loss function constrains the dynamics of training, and the form of the constraint depends on the dynamics. Noether’s theorem holds for every diffeological group of symmetries of an exact symplectic manifold. For a linear symmetry group stable under transposition, the compact directions give conserved momenta of Hamiltonian and momentum dynamics, the non-compact directions give conserved quadratic forms of gradient flow, and splitting integrators conserve the former exactly. The zero level of the gradient-flow invariants of a linear network is a slice for its non-compact symmetry.
Noether’s theorem for diffeological groups
Theorem 1.1 (Noether). Let M be a manifold with a 1-form α such that ω=dα is symplectic, and let Ht be a smooth time-dependent Hamiltonian with vector field ιXtω=−dHt. Let a diffeological group G act smoothly on M, preserving α and every Ht. Then the moment map μ:M→G∗, μ(x)=x^∗α, of Theorem 1.5 is constant along every integral curve of Xt.
Proof. Let P:U→G be a plot, r∈U, δr a tangent vector at r, and ks=P(r+sδr)P(r)−1, a smooth path in G with k0=1. Let η be the vector field ηy=dsd0ks⋅y on M, and f=α(η). By the definition of the pullback, μ(x)(P)r(δr)=α(dsd0P(r+sδr)⋅x)=f(P(r)⋅x). Since ks∗α=α and k0=id, Lηα=0, so df=dιηα=−ιηω; and since Ht∘ks=Ht, η(Ht)=0. Hence Xt(f)=−ω(η,Xt)=−dHt(η)=0. Each g∈G preserves ω and Ht, so it commutes with the flow, and f(P(r)⋅x(t)) is the value of f along the integral curve through P(r)⋅x(0), which is constant. ◻
The classical statement is the case of a Lie group, where G∗ is the dual of the Lie algebra. No such assumption is made in the theorem. For a discrete group G∗=0 and there is no conserved momentum: a permutation symmetry of the units of a network constrains gradient flow to fixed-point sets [I, Proposition 11.2] and gives no conservation law. For a group of gauge transformations G∗ is infinite-dimensional and the theorem gives one conserved quantity for each momentum.
For learning, the relevant phase space is M=T∗Θ=Θ×Θ∗ for a parameter space Θ=Rd, with α=⟨p,dθ⟩. A subgroup G⊆GL(Θ) acts by g⋅(θ,p)=(gθ,g−Tp) and preserves α; for a one-parameter subgroup esA the momentum is μA(θ,p)=⟨p,Aθ⟩. A Hamiltonian neural network [33] is a parametrised family Hw of Hamiltonians fitted to observed trajectories. If the architecture makes every Hw invariant under G, then by 1.1 every predicted trajectory conserves every μA, for every value of the weights: the conservation law is a property of the hypothesis class and is independent of the quality of the fit.
Two conservation laws for a symmetric loss
Let L:Θ→R be a smooth loss, invariant under a group G⊆GL(Θ): L(gθ)=L(θ). Differentiating along esA, ⟨∇L(θ),Aθ⟩=0for all A∈g.
Theorem 1.2 (Momentum and gradient flow). Let A∈g.
Momentum dynamics. If AT=−A, then along every solution of θ¨+γθ˙=−∇L(θ) the momentum JA=⟨θ˙,Aθ⟩ satisfies JA(t)=e−γtJA(0). It is conserved for γ=0.
Gradient flow. If AT=A, then QA(θ)=21⟨θ,Aθ⟩ is constant along every solution of θ˙=−∇L(θ).
Gradient descent. If AT=A and θ+=θ−h∇L(θ), then QA(θ+)=QA(θ)+2h2⟨∇L(θ),A∇L(θ)⟩.
If AT=−A, every solution of gradient flow satisfies ⟨θ˙,Aθ⟩=0: the velocity is orthogonal to the orbits of the compact directions.
Proof. (a) J˙A=⟨θ¨,Aθ⟩+⟨θ˙,Aθ˙⟩=−⟨∇L,Aθ⟩−γ⟨θ˙,Aθ⟩+0=−γJA by (8) and antisymmetry. (b) Q˙A=⟨θ˙,Aθ⟩=−⟨∇L,Aθ⟩=0, using symmetry in the first step. (c) Expand 21⟨θ−h∇L,A(θ−h∇L)⟩; the term of order h is −h⟨∇L,Aθ⟩=0. (d) is (8). ◻
If g is stable under transposition it decomposes as g=k⊕s into antisymmetric and symmetric parts, the Cartan decomposition of a reductive group. The two halves are compared in 1.1. Part (a) is 1.1 for the Hamiltonian 21∣p∣2+L(θ) and the momentum (7). Part (b) is not an instance of Noether’s theorem: gradient flow is not Hamiltonian, and the conserved quantity is quadratic in θ alone. Special cases of (b) and (c) are the balancedness of linear and homogeneous networks [6, 24] and the conservation laws catalogued in [54].
The two halves of a reductive symmetry algebra and the corresponding conservation laws.
compact: k, AT=−A
non-compact: s, AT=A
example
rotations of a layer
rescaling of a unit; GLk between linear layers
momentum dynamics
⟨θ˙,Aθ⟩ conserved, or decaying as e−γt
—
gradient flow
⟨θ˙,Aθ⟩=0 identically
21⟨θ,Aθ⟩ conserved
gradient descent, step h
—
drift 2h2⟨∇L,A∇L⟩ per step
geometric meaning
moment map of the cotangent lift
derivative of 21∣θ∣2 along the orbit
Example 1.3 (Three symmetric directions). (i) For a unit with positively homogeneous activation, the rescaling (win,wout)↦(swin,s−1wout) preserves the loss; A is +1 on the incoming and −1 on the outgoing weights, and QA=21(∣win∣2−∣wout∣2). (ii) For a linear network W2W1, the group GLk acts by (W2g−1,gW1), and the symmetric generators give the conserved matrix W1W1T−W2TW2. (iii) After a normalisation layer the loss is invariant under θ↦sθ; A=1 and QA=21∣θ∣2: the norm is constant under gradient flow, and by (c) its square increases by h2∣∇L∣2 at each step of gradient descent.
Left: gradient flow of a two-parameter network moves along the hyperbolas w2−a2=const of 1.2(b) to the curve of minima; the balanced line Q=0 is invariant. Right: 1.5; the leapfrog scheme conserves the angular momentum to rounding error and explicit Euler does not. Data from checks.py.
The balanced slice
The function Q:Θ→s∗, Q(θ)(A)=QA(θ), is equivariant for the compact part of G, and dsd021∣esAθ∣2=2QA(θ). So Q(θ)=0 if and only if θ is a critical point of the norm on its orbit under the non-compact directions. For a real reductive group the zeros of Q are the vectors of minimal norm in the closed orbits, and each closed orbit intersects Q−1(0) in one orbit of the maximal compact subgroup [49, 73]. For the deep linear network the identification of the invariants with a moment map, and the resulting decomposition of training into a flow along the fibres and a flow on the balanced manifold, are in [58]; quiver moduli as hypothesis spaces are in [46], and [86] is a survey of parameter symmetries. For linear networks the statement is elementary.
Theorem 1.4 (Balanced factorisations; compare [58, 84). ]Let Θ=Rm×k×Rk×n∋(W2,W1) with G=GLk, and Q(W2,W1)=W1W1T−W2TW2.
Q is constant along gradient flow of every loss of the form ℓ(W2W1); in particular the balanced set Q−1(0) is invariant.
The map (W2,W1)↦W2W1 induces a bijection from Q−1(0)/O(k) onto the set of m×n matrices of rank at most k.
The composite Q−1(0)/O(k)→Θ/GLk is injective, and its image is the set of closed orbits.
Parts (i) and (ii) are [exo:balanced]; (iii) follows from (ii) and the theorem of [73].
In [I, Theorem 11.1] the hypothesis space of a model had two diffeologies, the quotient Θ/G and the image in the space of functions. For a linear network the quotient by GLk is not Hausdorff, because of the non-closed orbits. A third description follows from 1.4: gradient flow from a balanced initialisation is a flow on Q−1(0)/O(k), the quotient of a real algebraic set by a compact group, whose points are exactly the hypotheses. The reduction from GLk to O(k) is the passage from g to k in 1.1: the non-compact directions are fixed by the conservation law and the compact ones remain as a symmetry. By 1.2(d) the flow is orthogonal to the orbits of O(k).
The balanced slice for the scalar two-layer network. The orbits of the rescaling group are the hyperbolas aw=const; on each, the points of minimal norm are the points where the orbit is tangent to a circle, and they lie on Q=0, that is, w=±a. The residual symmetry O(1)={±1} exchanges the two points of each orbit.
Discrete conservation
Theorem 1.5 (Integrators). Let H(q,p)=T(p)+V(q) on Rd×Rd with V(gq)=V(q) and T(g−Tp)=T(p) for g in a group G⊆GLd, and let A∈g.
The maps (q,p)↦(q,p−h∇V(q)) and (q,p)↦(q+h∇T(p),p) preserve μA=⟨p,Aq⟩. Hence so do symplectic Euler, the leapfrog scheme and every composition of these two maps.
(Cooper [22]) The implicit midpoint rule z+=z+hf(2z+z+) for z˙=f(z) conserves every quadratic first integral.
Explicit Euler changes μA by −h2⟨∇V(q),A∇T(p)⟩ at each step.
Proof. Invariance gives ⟨∇V(q),Aq⟩=0 and ⟨p,A∇T(p)⟩=0. (a) The first map changes μA by −h⟨∇V(q),Aq⟩ and the second by h⟨p,A∇T(p)⟩. (b) is [exo:midpoint]. (c) ⟨p−h∇V,A(q+h∇T)⟩=μA+h⟨p,A∇T⟩−h⟨∇V,Aq⟩−h2⟨∇V,A∇T⟩. ◻
Part (a) is the discrete form of 1.1 for the integrators used in Hamiltonian Monte Carlo and in the rollout of Hamiltonian networks: with an invariant potential and kinetic energy, every leapfrog trajectory stays on a level set of the moment map, exactly and for every step size. For a posterior with a continuous symmetry, a sampler of this kind explores within one trajectory only the level set μ−1(c), and the refreshment of the momentum is the only mechanism that changes the level. The reduced dynamics is a Hamiltonian flow on the reduced space μ−1(c)/Gc, which by Theorem 1.2 and Corollary 1.3 is a parasymplectic diffeological space whenever the action on the level set is principal, without any assumption that the level be regular.
Acceleration
A conservation law by itself changes no convergence rate, as the two-parameter network already shows.
Proposition 1.6 (Rate and sharpness). Let L(a,w)=21(aw−1)2, m=aw, Q=21(w2−a2).
Along gradient flow, m˙=−2Q2+m2(m−1).
At a minimum the Hessian has the eigenvalues 0 and λQ=2Q2+1.
Gradient descent linearised at the minimum multiplies the error in m by 1−hλQ at each step. The contraction factors attained by the stable steps 0<h<2/λQ form the interval (−1,1) for every Q.
Proof. With ρ=m−1, m˙=a˙w+aw˙=−ρ(a2+w2), and (a2+w2)2=(w2−a2)2+4a2w2=4Q2+4m2. At a minimum the Hessian is ∇ρ∇ρT with ∇ρ=(w,a), of norm squared a2+w2. (iii) follows from (ii). ◻
So for a single unit the level of Q rescales the speed of the flow and the largest stable step by the same factor. A gain is available when several blocks with different levels share one step size: the block with the largest λQ bounds h, and every other block converges at the rate hλQ′. The symmetry can be used in four ways to remove this mismatch, and the next three propositions make them explicit.
Proposition 1.7 (The induced dynamics on the product). Let (B,A)∈Rm×r×Rr×n have rank r, X=BA, and let G=∇ℓ(X) for a loss ℓ(X).
Gradient descent on (B,A) with step η gives X+=X−η(BBTG+GATA)+η2GXTG. On the balanced slice of 1.4, BBT=(XXT)1/2 and ATA=(XTX)1/2.
The scaled update B+=B−ηGAT(AAT)−1, A+=A−η(BTB)−1BTG commutes with the action of GLr, and X+=X−η(PcG+GPr)+η2GX†G, where Pc and Pr are the orthogonal projectors onto the column and row spaces of X and X† is the Moore–Penrose inverse.
Let ℓ(X)=21∥X−M∥2 with M of rank r and singular values σ1≥⋯≥σr. Linearised at X=M, the component of the error along the singular vectors ui,vj is multiplied by 1−η(σi+σj) in case (i) on the balanced slice, with σi=0 for i>r, and by 1−2η or 1−η in case (ii).
Parts (i) and (ii) are [exo:induced]. For (iii), G is the error E to first order, the preconditioners are evaluated at M, and (MMT)1/2, (MTM)1/2, Pc, Pr are diagonal in the singular bases. In case (i) the stable steps satisfy η<1/σ1 and the slowest tangent direction contracts by 1−ησr: the number of steps grows as the condition number σ1/σr. In case (ii) the rates do not involve the singular values. Part (i) on the balanced slice is the preconditioned end-to-end dynamics of [6]; part (ii) is the scaled gradient descent of [80], where convergence at a rate independent of the condition number is proved for several low-rank estimation problems. In the terms of this chapter, the update of (ii) is defined on the quotient Θ/GLr: it is independent of the level of Q. Low-rank adapters W0+BA have this symmetry, and so do the key–query and value–output pairs of an attention head, whose output depends on the products only; the usual initialisation of an adapter, B=0 and A random, lies at the level Q=AAT, far from the balanced slice [37].
Factorisation of a 2×2 matrix with singular values 1 and 10−2 from the same initial point. The update that commutes with GL2 reaches rounding error in 7 iterations; gradient descent on the factors takes about 800. Data from checks.py.
Proposition 1.8 (Weight decay on scale-invariant weights). Let L(sθ)=L(θ) for s>0, and θ+=(1−hλ)θ−h∇L(θ). Then ∣θ+∣2=(1−hλ)2∣θ∣2+∣θ∣2h2∣g^∣2,g^=∇L(θ/∣θ∣), the norm is stationary at ∣θ∣4=h∣g^∣2/λ(2−hλ), and there the effective step size h/∣θ∣2 on the unit sphere is hλ(2−hλ)/∣g^∣, so that each step has angular length hλ(2−hλ).
The proof is [exo:weight-decay]. The stationary effective step depends on h and λ through the product hλ alone, to first order [55]: the drift of 1.2(c) balances the decay, and the two hyperparameters act through their product.
Proposition 1.9 (Horizontal projection). Let A∈s and let θ+=θ+u be any update. Then QA(θ+)−QA(θ)=⟨u,Aθ⟩+21⟨u,Au⟩. For u=−h∇L(θ) the first term vanishes. For u=−hD∇L(θ) with a positive diagonal matrix D, as in adaptive methods, it is −h⟨D∇L,Aθ⟩, of first order in h. For the projected update u⊥=u−j∑∣Ajθ∣2⟨u,Ajθ⟩Ajθ, over generators Aj with mutually orthogonal Ajθ, the first term vanishes again.
Proof. Expand 21⟨θ+u,A(θ+u)⟩ with A symmetric, and use (8). ◻
For the sign update u=−hsign(∇L) on the two-parameter network, the invariant Q changes over a unit of time by 0.31 for h=10−2 and by 0.32 for h=10−3; with the projection the changes are 6.2⋅10−3 and 6.2⋅10−4 (checks.py). For the scale symmetry, A=1, the projection removes the radial part of the update, which is the method of [39].
The four uses are therefore: to choose the level of Q at initialisation, which by 1.7(i) is a choice of preconditioner; to move along the orbit during training, at no cost in loss, either back to the balanced slice or to the point of the orbit with the largest gradient [85]; to make the update equivariant, so that it is defined on the quotient (1.7(ii), [4]); and to project a non-gradient update onto the directions orthogonal to the orbits (1.9). All four are instances of one geometric statement, Theorem 1.3 of The general structure: descent along an atlas.
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Compute the momentum (7) for the rotations of Θ=R2, and for the scalings.
Solution. For A=(01−10), Aθ=(−θ2,θ1) and μA=p2θ1−p1θ2, the angular momentum. For A=1, μA=⟨p,θ⟩, the generator of dilations. The first is antisymmetric and governed by 1.2(a); the second is symmetric, and under gradient flow of a scale-invariant loss the conserved quantity is 21∣θ∣2 by (b). ◀
2 For L(a,w)=21(aw−1)2 verify 1.2(b),(c) directly, and solve gradient flow on the balanced line.
Solution. The symmetry is (a,w)↦(s−1a,sw), A=diag(−1,1), Q=21(w2−a2). With ρ=aw−1, a˙=−ρw, w˙=−ρa, so dtd(w2−a2)=−2ρaw+2ρaw=0. One step of gradient descent gives w+2−a+2=(w2−a2)(1−h2ρ2), that is, Q+=Q+2h2ρ2(a2−w2), which is (c) with ∇L=ρ(w,a). On the line a=w=s the flow is s˙=−(s2−1)s, with the stable equilibrium s=1: the balanced solution of aw=1. In checks.py the drift of Q over a fixed time is proportional to h, as (c) predicts. ◀
2 Let L be invariant under θ↦sθ, s>0. Show that under gradient descent ∣θk∣ is non-decreasing and that the tangent of the angular step is h∣∇L(θk/∣θk∣)∣/∣θk∣2.
Solution. By 1.2(c) with A=1, ∣θk+1∣2=∣θk∣2+h2∣∇L(θk)∣2. Scale invariance gives ∇L(sθ)=s−1∇L(θ) and ⟨∇L,θ⟩=0, so the step h∇L(θk) is tangent to the sphere of radius ∣θk∣, of length h∣∇L(θk/∣θk∣)∣/∣θk∣, and the tangent of the angle it subtends is the stated quantity. The effective step size on the unit sphere is h/∣θk∣2 and decreases along training. ◀
3 Let f(x)=∑iviσ(⟨wi,x⟩) with σ positively homogeneous of degree 1. Derive the conserved quantities of gradient flow for a loss depending on f alone, at parameters where the loss is differentiable.
Solution. For each i and s>0, (wi,vi)↦(swi,s−1vi) leaves f unchanged. The generator is Ai=diag(+1 on wi,−1 on vi), a symmetric matrix, and (8) holds wherever L is differentiable. By 1.2(b), Qi=21(∣wi∣2−vi2) is conserved for every unit. These are the balancedness conditions of [24]; the group is (R>0)k, all of whose directions are non-compact, so no momentum of type (a) arises from it. ◀
Solution. Let I(z)=⟨z,Cz⟩+⟨c,z⟩ with C symmetric be a first integral: ⟨2Cz+c,f(z)⟩=0 for all z. With m=21(z+z+) and z+−z=hf(m), I(z+)−I(z)=⟨z+−z,C(z++z)⟩+⟨c,z+−z⟩=h⟨f(m),2Cm+c⟩=0.◀
Solution. (i) The loss is invariant under (W2g−1,gW1). For a symmetric S the generator maps (W2,W1) to (−W2S,SW1), a symmetric operator for the Frobenius inner product, and QS=21tr(SW1W1T)−21tr(W2SW2T)=21tr(S(W1W1T−W2TW2)). By 1.2(b) this is conserved for every S, so the matrix is conserved.
(ii) Surjectivity. Let M=UΣVT be a singular value decomposition with Σ of size k×k. Then W2=UΣ1/2, W1=Σ1/2VT is balanced and W2W1=M. Injectivity. Let (W2,W1) and (W2′,W1′) be balanced with the same product M. Then MMT=W2(W1W1T)W2T=(W2W2T)2, so W2W2T=(MMT)1/2=W2′W2′T, and two m×k matrices with the same Gram matrix of rows differ by an orthogonal matrix: W2′=W2R, R∈O(k). Put D=RW1′−W1. Then W2D=W2′W1′−W2W1=0, so the columns of D lie in kerW2=kerW2TW2=kerW1W1T, the orthogonal complement of the column space of W1; hence W1TD=0. Balancedness of both pairs gives (RW1′)(RW1′)T=RW2′TW2′RT=W2TW2=W1W1T, and taking traces, tr(W1W1T)=tr((W1+D)(W1+D)T)=tr(W1W1T)+2tr(W1TD)+tr(DDT). So tr(DDT)=0, D=0, and (W2′,W1′)=(W2R,RTW1). ◀
2 Prove 1.8, and compute the stationary norm and the angular step for h=0.05, λ=0.1, ∣g^∣=1.
Solution. Scale invariance gives ⟨∇L(θ),θ⟩=0 and ∇L(θ)=g^/∣θ∣, so the two terms of θ+ are orthogonal and ∣θ+∣2=(1−hλ)2∣θ∣2+h2∣g^∣2/∣θ∣2. The norm is stationary when (1−(1−hλ)2)∣θ∣4=h2∣g^∣2, that is, ∣θ∣4=h∣g^∣2/λ(2−hλ). The step on the unit sphere is h∣∇L(θ)∣/∣θ∣=h∣g^∣/∣θ∣2; substituting, the effective step size is hλ(2−hλ)/∣g^∣ and the angular length is hλ(2−hλ). For the given values ∣θ∣4=0.2506, ∣θ∣=0.7075, and the angular step is 0.0999; the simulation in checks.py gives ∣θ∣4=0.250627. ◀
Solution. The gradients of ℓ(BA) are GAT and BTG. (i) (B−ηGAT)(A−ηBTG)=X−ηGATA−ηBBTG+η2GATBTG. For a balanced pair, XXT=B(AAT)BT=B(BTB)BT=(BBT)2, and likewise XTX=(ATA)2. (ii) Under (B,A)↦(Bg−1,gA) the product and G are unchanged, GATgT(gAATgT)−1=GAT(AAT)−1g−1 and (g−TBTBg−1)−1g−TBTG=g(BTB)−1BTG; so (B+,A+)↦(B+g−1,gA+). The product is X−ηB(BTB)−1BTG−ηGAT(AAT)−1A+η2GAT(AAT)−1(BTB)−1BTG. The matrices Pc=B(BTB)−1BT and Pr=AT(AAT)−1A are the orthogonal projectors onto the column space of B and the row space of A, which are those of X because the rank is r. The matrix X†=AT(AAT)−1(BTB)−1BT satisfies XX†=Pc, X†X=Pr, XX†X=X and X†XX†=X†, the four conditions that characterise the Moore–Penrose inverse. ◀
Artificial intelligence: invariants, phases, and reachability
For an agent whose dynamics has a symmetry, the moment map is an invariant of every admissible trajectory, and it bounds the reachable set for every controller. At zero momentum the motion of the agent along the symmetry directions is the holonomy of a connection on the bundle of configurations over shapes. For the simplest two-body system the connection is flat, its holonomy is a rotation by an angle fixed by the ratio of inertias, and when the ratio is irrational the universal first integral takes its values in an irrational torus.
Momentum as a reachability invariant
A controlled Hamiltonian system is a family Hu, u∈U, of Hamiltonians on an exact symplectic manifold (M,dα); a control is a piecewise smooth map t↦u(t), and the trajectory follows the Hamiltonian vector field of Hu(t).
Theorem 1.1 (Invariance of the reachable set). Let a diffeological group G act on M preserving α and every Hu, with moment map μ:M→G∗. Then for every control the trajectory from x stays in μ−1(μ(x)). Consequently:
a set B⊆M with μ(x)∈/μ(B) is unreachable from x under every controller of the class;
the system induces a controlled system on the quotient μ−1(c)/Gc of each level by the stabiliser of c, and when Gc acts principally on the level this quotient is a parasymplectic diffeological space.
Proof. On each interval where the control is smooth, Theorem 1.1 applies to the time-dependent Hamiltonian Hu(t); μ is continuous along the trajectory, so its value is the same on all intervals. (i) is immediate. (ii) The flows commute with G and preserve the level, which Gc preserves by equivariance. For c=0 the quotient is the reduced space of Corollary 1.3; a level c fixed by the coadjoint action is brought to zero by Proposition 1.3 when c=−χ∗θ for a character χ. ◻
Part (i) is a certificate of safety of the strongest kind: it is exact, it requires no simulation, and it holds for every policy, learned or not, as long as the actuation preserves the symmetry. A free-floating robot whose actuators exert only internal forces cannot change its angular momentum; a learned controller for it cannot reach a state of different momentum, whatever its training. Part (ii) is the statement that planning and learning for such a system take place on the reduced space, of dimension smaller by twice the dimension of the group at regular points.
The geometric phase
At a fixed momentum the remaining freedom of the agent is its shape, and the symmetry variables are determined by the history of the shape.
Let Q be a configuration manifold with a free and proper action of G=R or S1, generated by a vector field ξQ, and let S=Q/G be the shape space. Let g be a G-invariant Riemannian metric, the kinetic energy. The momentum of a velocity q˙ is J(q,q˙)=g(q˙,ξQ(q)), which is the moment map (7) of the cotangent lift under the Legendre transform. The mechanical connection is the 1-form A=g(ξQ,ξQ)g(⋅,ξQ)∈Ω1(Q).
Theorem 1.2 (Holonomy of zero-momentum motion; [65, 68). ]
A is a connection form on the principal bundle Q→S in the sense of Definition 1.1, and a curve in Q has zero momentum if and only if it is horizontal for A. Every shape curve has a unique zero-momentum lift through each point of the fibre over its origin.
Let F∈Ω2(S) be the curvature. If a closed shape curve c bounds a disc D, its zero-momentum lift ends at exp(Δξ)⋅q(0) with Δ=−∫DF.
If F=0, the displacement of a loop depends only on its homotopy class, and the displacements form the image of a homomorphism π1(S)→G.
Proof. (i) A is invariant because g and ξQ are, and A(ξQ)=1, which is calibration. J(q,q˙)=0 if and only if A(q˙)=0. In a local trivialisation Q∣V≅V×G with fibre coordinate φ, A=dφ+a with a∈Ω1(V), and the horizontal lift of c solves φ˙=−a(c˙). (ii) Over the disc the bundle is trivial, F=da, and Δ=φ(1)−φ(0)=−∮ca=−∫Dda. (iii) A flat connection has locally constant horizontal sections, so the lift of a contractible loop closes, and concatenation of loops adds displacements. ◻
The theorem is the abelian case of the gauge theory of locomotion: a body that changes its shape cyclically, with no external force and no momentum, is displaced by the holonomy of the cycle [77, 68]. For a planner the consequence is a division of the problem: the shape variables are controlled directly, and motion in the group direction is obtained from the area enclosed in shape space, weighted by the curvature (1.1). If the curvature does not vanish, every displacement is the holonomy of some loop ([exo:variable-beanie]).
Left: the displacement produced by a cycle of shape changes is minus the integral of the curvature over the enclosed region. Right: for the two-body system of 1.3 the connection is flat and the zero-momentum motions are the leaves of a linear foliation of the torus; one turn of the joint rotates the body by −2πα.
A first integral with values in an irrational torus
Two planar rigid bodies with moments of inertia I1,I2 are joined at their common centre of mass by a motor. The configuration is (θ,ψ)∈T2=(R/2πZ)2, where θ is the orientation of the first body and ψ the joint angle; the kinetic energy is 21I1θ˙2+21I2(θ˙+ψ˙)2, the rotations act on θ, and the momentum is J=I1θ˙+I2(θ˙+ψ˙). With α=I1+I2I2∈(0,1), the mechanical connection is A=dθ+αdψ. The shape space is the circle of joint angles.
The two-body system and the orientations θ0−2πkα reachable at zero momentum with the joint returned to its initial angle.
Theorem 1.3 (The two-body system). Consider the zero-momentum motions of the system, the curves in T2 with dθ+αdψ=0.
The connection is flat. The set reachable from (θ0,ψ0) is the leaf {(θ0−αs,ψ0+s)∣s∈R}. The orientations reachable with the joint returned to ψ0 are θ0−2παZ.
The map c:T2→R/2π(Z+αZ), c(θ,ψ)=[θ+αψ], is a smooth first integral and a subduction whose fibres are the reachable sets. It is universal: every smooth map from T2 to a diffeological space that is constant on zero-momentum curves factors uniquely and smoothly through c.
If α=p/q in lowest terms, the reachable sets are circles, the target of c is a circle, and the reachable orientations at a fixed joint angle are q points.
If α is irrational, the target of c is the irrational torus Tα; every reachable set is dense and, with the subspace diffeology, diffeomorphic to R; every first integral with values in a manifold is constant; and for each convergent pj/qj of α, every orientation is reached within 3π/qj by fewer than qj turns of the joint.
Proof. (i) dA=0. The lift of the shape curve ψ0+s is θ0−αs, and one turn of the joint is s=2π. (ii) The linear map (θ,ψ)↦θ+αψ from R2 to R is a subduction, it maps (2πZ)2 into 2π(Z+αZ), and two points have the same image in the quotient if and only if they lie on one leaf. So c is a subduction with the leaves as fibres, and the universal property is that of a quotient diffeology. (iii) The group 2π(Z+qpZ)=q2πZ is discrete. (iv) The target is R/2π(Z+αZ)≅Tα. The leaf is the image of the irrational winding R→T2, which is an induction [IZ, Exercise 31]. A first integral f:T2→N is continuous and constant on a dense leaf, hence constant on T2 when N is Hausdorff. The bound is [exo:approx]. ◻
Zero-momentum reachability of the two-body system as a function of the inertia ratio.
α=p/q
α irrational
holonomy group
cyclic of order q
2παZ, dense in the circle
reachable set
a closed curve
a dense leaf, ≅R
universal first integral
circle-valued
Tα-valued
real-valued first integrals
functions on a circle
constants
exact controllability of θ
no
no
approximate controllability
no
yes, at a cost set by the convergents of α
For an analysis based on real-valued invariants the irrational system has no conserved quantity on the zero-momentum level and its orbits are dense, the usual indications of controllability. It is not controllable: each reachable set is a single leaf, of measure zero. The invariant that separates the reachable sets exists, is smooth, and is unique up to diffeomorphisms of its target; its target is a diffeological space that is not a manifold. This is the situation of [I, Theorem 12.4]: the smooth real functions on Tα are the constants, and the structure of Tα is carried by its plots. Along a leaf, planning is elementary, since the leaf is a line and has a smooth planner [I, Theorem 12.1]; between leaves no motion exists. By the last clause of (iv) the cost of approximate control is bounded in terms of the continued fraction of the inertia ratio, the invariant that classifies Tα up to diffeomorphism [I, Corollary 9.2].
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 For I1=I2 compute the rotation of the first body produced by one turn of the joint at zero momentum, and the reachable orientations.
Solution.α=21, so one turn of the joint rotates the first body by −π and the second by +π relative to the frame: the system returns to its shape with both bodies reversed. Two turns restore the configuration. The reachable orientations at a fixed joint angle are θ0 and θ0+π, and c=[θ+21ψ]∈R/πZ is a circle-valued first integral. ◀
2 For α=p/q in lowest terms, show that the leaf through (θ0,ψ0) closes after q turns of the joint, and describe the leaf as a curve on the torus.
Solution. After k turns the orientation is θ0−2πkp/q, equal to θ0 modulo 2π exactly when q divides k, since p and q are coprime. The leaf is the closed curve s↦(θ0−qps,ψ0+s), s∈[0,2πq], winding q times in the direction of ψ and −p times in the direction of θ: a torus knot of type (q,−p) when the torus is embedded in space. The orientations visited at the joint angle ψ0 are the q points θ0−2πk/q. ◀
3 Suppose the second body can also change its moment of inertia, I2=I2(r) with r in an interval and I2′=0. Show that every orientation is reachable at zero momentum with the shape returned to its initial value.
Solution. The shape space is the cylinder of (r,ψ) and A=dθ+α(r)dψ with α(r)=I2(r)/(I1+I2(r)), so F=α′(r)dr∧dψ=0. Consider the shape loop: turn the joint once at r1, change r from r1 to r2, turn the joint once backwards, return to r1. Changes of r at fixed ψ do not move θ. The displacement is −2πα(r1)+2πα(r2), a continuous function of r2 vanishing at r2=r1 and not locally constant. So an interval of rotations around 0 is reachable by one such loop, and every rotation by repeating it. The loop is contractible in the cylinder and its displacement is −∫DF over the annulus it bounds, in accordance with 1.2(ii). ◀
3 Let α be irrational. Show that the D-topology of the target of c is trivial, and deduce directly that a first integral with values in a space whose D-topology is Hausdorff is constant. Which smooth first integral is not constant?
Solution. The D-topology of R/2π(Z+αZ) is the quotient topology, and a saturated open set of R is invariant under a dense group of translations, so it is empty or R. A first integral f factors as fˉ∘c with fˉ smooth, hence D-continuous; a continuous map from an indiscrete space to a Hausdorff space is constant. The map c itself is a non-constant smooth first integral, with values in Tα, whose D-topology is not Hausdorff. ◀
4 Let α be irrational with convergents pj/qj. Prove that every point of R/Z is within 2qj3 of one of the points kα, 0≤k<qj, and deduce the last clause of 1.3(iv).
Solution. The convergents satisfy ∣qjα−pj∣<1/qj+1 [36]. For 0≤k<qj, ∣kα−kpj/qj∣=qjk∣qjα−pj∣<1/qj+1. Since pj and qj are coprime, the points kpj/qjmod1, 0≤k<qj, are all the multiples of 1/qj, and every point of the circle is within 2qj1 of one of them. So every point is within 2qj1+qj+11≤2qj3 of some kα. In the system, k turns of the joint rotate the body by −2πkα; multiplying by 2π, every orientation is within 3π/qj of one reached by fewer than qj turns. ◀
System design: composition, ports, and reduction
Open physical systems are composed along shared ports, and the composite of energy-conserving systems should be energy-conserving. For linear systems this is the theorem that Lagrangian and Dirac relations compose. For non-linear systems the composite of two correspondences is a fibre product, which exists in Diff without transversality hypotheses. Port-Hamiltonian systems are closed under interconnection, and the reduction of a symmetric component commutes with its interconnection to the rest of a design.
Correspondences
A design assembles components by identifying variables at their interfaces. In Hamiltonian terms an interface is a parasymplectic space of port variables, and a component is a relation between its ports that is compatible with the forms.
Definition 1.1. An isotropic correspondence from (X,ω) to (X′,ω′) is a diffeological space L with smooth maps s:L→X, t:L→X′ such that s∗ω=t∗ω′; equivalently a span X←L→X′ in the slice SmoothSet/Ωcl2; equivalently a smooth map L→X×ωX′ to the product of Proposition 1.2; equivalently a smooth map L→X⊞X′ that pulls the form back to zero.
Theorem 1.2 (Composition). Isotropic correspondences compose by fibre product, (X′s′L′t′X′′)∘(XsLtX′)=(Xs∘prL×X′L′t′∘pr′X′′), and with this composition the parasymplectic spaces are the objects of a bicategory Corr. The graph of a morphism of PSymp is a correspondence, and composition of graphs is composition of maps. The sum ⊞ is a symmetric monoidal structure on Corr, and correspondences X↛X′ are the correspondences ∗↛X⊞X′.
Proof. The fibre product exists in Diff[I, Theorem 1.6], and (s∘pr)∗ω=pr∗t∗ω′=(t∘pr)∗ω′=(s′∘pr′)∗ω′=(t′∘pr′)∗ω′′, because t∘pr=s′∘pr′ on the fibre product. Associativity and units hold up to the canonical isomorphisms of iterated fibre products, as for spans in any category with pullbacks. For a morphism f the graph is XidXfX′ ([exo:graph]), and X×X′X′≅X. The last statement is the last clause of 1.1. ◻
In the category of manifolds the fibre product L×X′L′ exists only under a transversality condition, and the composition of Lagrangian correspondences is for that reason only partially defined [82]. In Diff the composite always exists; when transversality fails it is a diffeological space that is not a manifold, with its forms, its plots and its homotopy type. The condition of being Lagrangian, isotropic of half dimension, is pointwise and is available when the tangent spaces are; the linear case is next.
Left: composition of isotropic correspondences is composition of spans over Ωcl2. Right: symplectic reduction is a correspondence from a space to its reduced space.
Linear relations
Let V be a finite-dimensional real vector space with a non-degenerate bilinear form ⟨,⟩, symmetric or antisymmetric, and V the same space with the opposite form. A subspace L is Lagrangian if L=L⊥. A Lagrangian relationV1↛V2 is a Lagrangian subspace of V1⊕V2, and the composite of relations is L2∘L1={(v1,v3)∣∃v2:(v1,v2)∈L1,(v2,v3)∈L2}.
Theorem 1.3 (Lagrangian relations compose).
Reduction. If C⊆V is coisotropic, C⊥⊆C, and L⊆V is Lagrangian, then LC=(L∩C+C⊥)/C⊥ is Lagrangian in C/C⊥.
The composite of two Lagrangian relations is a Lagrangian relation, with no hypothesis of transversality.
The statement holds for forms of either symmetry type.
Proof. (i) The form of V induces a non-degenerate form on C/C⊥, for which LC is isotropic. Since (L∩C)⊥=L⊥+C⊥=L+C⊥, dim(L∩C)=dimV−dimL−dimC⊥+dim(L∩C⊥), and with dimL=21dimV and dimC=dimV−dimC⊥ this gives dimLC=dim(L∩C)−dim(L∩C⊥)=21(dimC−dimC⊥). An isotropic subspace of half dimension is equal to its orthogonal. (ii) In V=V1⊕V2⊕V2⊕V3 the subspace L=L1⊕L2 is Lagrangian and C=V1⊕ΔV2⊕V3 is coisotropic with C⊥=0⊕ΔV2⊕0, because the diagonal of V2⊕V2 is Lagrangian. Then C/C⊥=V1⊕V3 and LC=L2∘L1. ◻
For antisymmetric forms this is the linear symplectic category [35]. For the symmetric pairing ⟨(f,e),(f′,e′)⟩=e(f′)+e′(f) on a space F⊕F∗ of flows and efforts, a Lagrangian subspace is a Dirac structure: the constitutive relation of a lossless interconnection, on which the power e(f) vanishes.
Corollary 1.4 (Cervera–van der Schaft–Baños [19). ]The interconnection of two Dirac structures on F1⊕F2 and on F2⊕F3 through the shared port, with f2=−f2′ and e2=e2′, is a Dirac structure on F1⊕F3.
The proof is [exo:dirac]. Kirchhoff’s laws, ideal transformers and rigid kinematic constraints are Dirac structures, and the corollary is the statement that a network of lossless interconnections is a lossless interconnection. In the passive linear case the composition of circuits is of this kind [9]; eliminating an internal node is a composition of relations, and no non-degeneracy of the eliminated block is needed ([exo:schur]).
Port-Hamiltonian systems
A port-Hamiltonian system on a manifold X with energy H is x˙=(J(x)−R(x))∇H(x)+g(x)u,y=g(x)T∇H(x), with J antisymmetric, R symmetric positive semi-definite, input u and output y [75].
Theorem 1.5 (Interconnection).
Along every trajectory of (9), H˙=−∇HTR∇H+yTu≤yTu.
The feedback interconnection u1=−y2+e1, u2=y1+e2 of two port-Hamiltonian systems is port-Hamiltonian on X1×X2 with H=H1+H2,J=(J1g2g1T−g1g2TJ2),R=(R100R2),g=(g100g2).
Hence H(x(t))−H(x(0))≤∫0t(y1Te1+y2Te2)dτ: the composite is passive with storage function H1+H2.
Proof. (i) H˙=∇HTx˙=∇HTJ∇H−∇HTR∇H+∇HTgu, and the first term vanishes. (ii) Substituting, x˙1=(J1−R1)∇H1−g1g2T∇H2+g1e1 and x˙2=(J2−R2)∇H2+g2g1T∇H1+g2e2; the off-diagonal blocks are negative transposes of each other. (iii) Integrate (i) for the composite. ◻
The feedback law of (ii) is a Dirac structure on the port variables, y1Tu1+y2Tu2=y1Te1+y2Te2, and the theorem is the non-linear, dissipative counterpart of 1.4. The state space of a design assembled in this way is a product of the state spaces of the components, cut down by the constraints of the interconnection and divided by its symmetries. By [I, Theorem 13.1] such state spaces are diffeological spaces in general, and the two operations of cutting down and dividing are the two steps of reduction.
Five compositional settings for open Hamiltonian systems.
Theorem 1.6 (Modular reduction). Let (X1,ω1) be equivariantly prequantised for a group G acting principally on Z1=μ1−1(0), with reduced space (X1,0,ω1,0).
The span X1↩Z1πGX1,0 is an isotropic correspondence R:X1↛X1,0. For every isotropic L→X1 the composite R∘L=L×X1Z1→X1,0 is isotropic.
For every parasymplectic space (X2,ω2), with G acting on X1⊞X2 through the first factor, (Z1×X2)/G≅X1,0×X2,with reduced form ω1,0⊞ω2. A function H1+H2+Hc on X1×X2 with H1 and the coupling Hc invariant under G descends to X1,0×X2.
If a second group H acts on X2 in the same way, the reductions by G, by H and by G×H are related as in Theorem 1.9, and the reduced space is X1,0×X2,0.
The proof is [exo:modular]. In design terms: a component with a symmetry can be replaced by its reduced model inside any larger design whose coupling to it is invariant, and the result is the reduced model of the whole. The reduced component is an object of the same kind, a parasymplectic diffeological space, also when it is singular. This is the Hamiltonian form of the lossless symmetry reduction of [I, Theorem 13.3], and the cases in which the quotient must be taken as a stack are listed in [tab:reduced].
Left: the feedback interconnection of 1.5. Right: 1.6(ii); coupling and reduction commute.
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Show that for morphisms f:X→X′ and f′:X′→X′′ of PSymp the composite of the graphs is the graph of f′∘f.
Solution. The graph of f is L=X with (s,t)=(id,f), and that of f′ is L′=X′ with (id,f′). The fibre product L×X′L′={(x,x′)∣f(x)=x′} is identified with X by the first projection, and under this identification the two legs are id and f′∘f. ◀
2 In V=R4 with coordinates (q1,q2,p1,p2) and the standard symplectic form, let Λ={p=∇S(q)} with S=21aq12+bq1q2+21cq22, and let C={p1=0}. Compute ΛC⊆R2 for a=0 and for a=0=b.
Solution.C⊥ is spanned by ∂q1, and C/C⊥=R2 with coordinates (q2,p2). On Λ∩C: p1=aq1+bq2=0 and p2=bq1+cq2. If a=0 then q1=−bq2/a and ΛC={p2=(c−b2/a)q2}, the graph of the Schur complement: the generating function of the reduced relation is S with the internal variable eliminated. If a=0 and b=0 then q2=0 and p2=bq1 is arbitrary: ΛC is the vertical line {q2=0}. It is Lagrangian, in accordance with 1.3(i), and it is not the graph of a function: elimination of an internal variable with a degenerate block produces a constraint in place of a constitutive law. ◀
2 Write a mass–spring system with force input and velocity output as a port-Hamiltonian system, and compute the feedback interconnection of two of them.
Solution.x=(q,p), H=2m1p2+2kq2, J=(0−110), R=0, g=(0,1)T: q˙=p/m, p˙=−kq+u, y=p/m, the velocity, and H˙=yu, force times velocity. For two such systems, g1g2T is the matrix unit coupling the two momenta, and 1.5(ii) gives p˙1=−k1q1−p2/m2+e1, p˙2=−k2q2+p1/m1+e2: a gyroscopic coupling. The total energy H1+H2 satisfies H˙=y1e1+y2e2 and is conserved for e=0. ◀
Solution. Let Wi=Fi⊕Fi∗ with the symmetric pairing. The map σ(f,e)=(−f,e) satisfies ⟨σw,σw′⟩=−⟨w,w′⟩, so it is an isometry Wi→Wi. A Dirac structure DA on F1⊕F2 is a Lagrangian subspace of W1⊕W2; applying σ to the first factor makes it a Lagrangian relation W1↛W2, and similarly DB becomes a relation W2↛W3 after applying σ to its W2-component. The composite of the two relations identifies (f2,e2) in the first with σ(f2′,e2′)=(−f2′,e2′) in the second, which is the interconnection constraint. By 1.3(ii) the composite is Lagrangian in W1⊕W3, and applying σ to the first factor again gives a Dirac structure on F1⊕F3. ◀
Solution. (i) By Theorem 1.2, πG∗ω1,0=ω1∣Z1, which is the isotropy of the span. The second statement is 1.2 applied to ∗↛X1↛X1,0. (ii) The map πG×id:Z1×X2→X1,0×X2 is a product of subductions, hence a subduction [I, Proposition 1.7], and its fibres are the orbits of G; so it induces a diffeomorphism from (Z1×X2)/G. The form ω1∣Z1⊞ω2 is the pullback of ω1,0⊞ω2, and pullback along a subduction is injective, so the latter is the reduced form. The functions H1∣Z1 and Hc∣Z1×X2 are invariant, hence constant on the fibres of a subduction, and descend to smooth functions; H2 is a function of the second factor. (iii) Apply (ii) twice, or Theorem 1.9 to the commuting actions of G and H on X1⊞X2: the zero level is Z1×Z2 and its quotient by G×H is X1,0×X2,0 by the same argument. ◀
The general structure: descent along an atlas
The conservation laws of Machine learning: conservation laws of learning dynamics, the geometric phases of Artificial intelligence: invariants, phases, and reachability and the four uses of symmetry in Acceleration are one situation: an objective defined on a quotient, and a dynamics defined on an atlas of the quotient by means of a structure that does not descend. We state it symplectically, as a condition on a Lagrangian submanifold, and metrically, as a connection whose exact part gives the conserved quantities and whose non-closed part gives the phases. The part of the statement that uses no tangent structure holds in every ∞-topos. With tangent structure it holds in a differentially cohesive ∞-topos, for every group object acting on a Riemannian manifold, where the atlas of the quotient is the composite of a quotient by a formal group and a formally étale map. For the syntax of an algebraic theory it is the theory of normal forms and of invariant definitions.
Invariance as a Lagrangian condition
Let a Lie group G act on a manifold Θ. The cotangent lift of the action preserves the canonical 1-form α=⟨p,dθ⟩ of T∗Θ, and by Theorem 1.5 its moment map is μ(θ,p)(ξ)=⟨p,ξΘ(θ)⟩, where ξΘ is the vector field generated by ξ∈g.
Theorem 1.1 (Invariant functions and the zero level).
A function L∈C∞(Θ) is invariant under the identity component of G if and only if the graph of dL is contained in μ−1(0).
If G acts freely and properly on Θ, with quotient π:Θ→X, then μ−1(0)=π∗T∗X, the action of G on it is principal, and the reduced space of Corollary 1.3 is T∗X with its canonical forms.
In that case, for L=ℓ∘π, the image of the graph of dL under the reduction correspondence R:T∗Θ↛T∗X of Theorem 1.6 is the graph of dℓ.
Proof. (i) μ(θ,dLθ)(ξ)=dL(ξΘ) is the derivative of L along the orbit; it vanishes for all ξ if and only if L is constant on the orbits of the identity component. (ii) A covector at θ lies in μ−1(0) if and only if it vanishes on the tangent space of the orbit, that is, if and only if it is π∗β for a unique β∈Tπ(θ)∗X. So μ−1(0)=π∗T∗X, and the map (θ,π∗β)↦(π(θ),β) is a principal G-bundle over T∗X, the pullback of π; the action is principal also by Lemma 1.1(a). For a tangent vector v at (θ,π∗β), α(v)=π∗β(dτv)=β(dπdτv) with τ the projection to Θ, which is the pullback of the canonical form of T∗X. (iii) dL=π∗dℓ, so the graph of dL lies in the zero level and its image is {(x,dℓx)}. ◻
Theorem 1.1. An invariant objective is a Lagrangian submanifold of the zero level of the moment map of the cotangent lift, and its reduction is the objective on the quotient.
The theorem contains no dynamics. For an optimisation algorithm one more datum is required, a rule that converts the covector dL into a motion, and on Θ that rule is a metric. If the metric is invariant under G it descends with everything else. The phenomena of Machine learning: conservation laws of learning dynamics arise because the Euclidean metric of the parameters is invariant under a compact subgroup only.
The connection of a metric
Let Θ⊆Rd be open and invariant under a closed subgroup G⊆GLd(R) whose Lie algebra is stable under transposition, g=k⊕s, and let K=G∩O(d). For A∈g let aA=⟨Aθ,dθ⟩∈Ω1(Θ), the 1-form dual to the generator Aθ for the Euclidean metric.
Theorem 1.2 (Exact part and non-closed part).
A vector v at θ is orthogonal to the orbit of G if and only if aA(v)=0 for all A∈g. The gradient of every G-invariant function is orthogonal to the orbits.
For A∈s the form is exact: aA=dQA with QA=21⟨θ,Aθ⟩.
For A∈k the form is not closed unless A=0: daA=−2∑i<jAijdθi∧dθj.
Every curve orthogonal to the orbits lies in a level set of Q:Θ→s∗. On the level set Q−1(0), which K preserves, the orthogonal complement of the G-orbits is the orthogonal complement of the K-orbits, the mechanical connection of Theorem 1.2 for the group K.
Proof. (i) The tangent space of the orbit is gθ, and aA(v)=⟨Aθ,v⟩; the second statement is (8). (ii) d21⟨θ,Aθ⟩=⟨Aθ,dθ⟩ for symmetric A. (iii) aA=∑i,jAijθjdθi and daA=∑i,jAijdθj∧dθi=∑i<j(Aji−Aij)dθi∧dθj. (iv) By (i) and (ii) the functions QA are constant along such a curve. The tangent space of a level set of Q is (sθ)⊥, and (gθ)⊥=(sθ)⊥∩(kθ)⊥. Equivariance of Q under K gives the invariance of the zero level. ◻
So the conservation laws of gradient flow and the geometric phases are the two parts of one object. The symmetric directions give exact forms, hence first integrals and a foliation by slices; the antisymmetric directions give forms that are not closed, and where daA is non-zero on pairs of vectors orthogonal to the orbits the connection has curvature, with a holonomy and no first integral (1.11). Theorem 1.2(b) and (d) are parts (ii) and (i); the two-body system of Theorem 1.3 is the case of a closed form that is not exact, where the first integral exists with values in a quotient of R.
Theorem 1.3 (Four positions). In the situation above, let G act freely and properly on Θ, π:Θ→X, and L=ℓ∘π.
Gauge dependence.dπθ(∇L(θ))=Cθdℓx, where Cθ=dπθ∘dπθT:Tx∗X→TxX is symmetric and positive definite. It satisfies Ckθ=Cθ for k∈K, and it depends on the point of the fibre otherwise.
A slice. If Q−1(0) intersects each fibre in one orbit of K, then C restricted to Q−1(0) is a cometric Cbal on X, and gradient flow from a balanced point projects to x˙=−Cbaldℓ. For the linear network, Cbal(G)=(XXT)1/2G+G(XTX)1/2.
An invariant metric. For a G-invariant metric g′ on Θ the cometric C′ is constant on fibres, and the g′-gradient flow of L projects to x˙=−C′dℓ from every initial point. For the linear network and g′=tr(dBAATdBT)+tr(dATBTBdA), C′(G)=PcG+GPr.
Projection. Every update u∈TθΘ is the sum of a part orthogonal to the orbit and a part tangent to it. Only the first has an image in TxX; the second changes QA at first order by ⟨Aθ,u⟩ for A∈s, and moves θ along its K-orbit for A∈k.
Proof. (a) dL=dℓ∘dπ, so ∇L=dπTdℓ and dπ∇L=dπdπTdℓ. Since π∘k=π and k is orthogonal, dπkθ=dπθ∘k−1 and Ckθ=Cθ. (b) follows from (a), from the invariance of the balanced set (Theorem 1.2(b)), and for the linear network from Proposition 1.7(i) and Theorem 1.4(ii). (c) For an invariant metric π is a Riemannian submersion onto X with the quotient metric, and the gradient of ℓ∘π is the horizontal lift of the gradient of ℓ. The g′-gradients are GAT(AAT)−1 and (BTB)−1BTG, and the formula is Proposition 1.7(ii) to first order in η. (d) is 1.2(i),(ii). ◻
The four positions of 1.3. Fibres are orbits of the symmetry group, the curves are level sets of the invariants of gradient flow, and the same objective on X is descended at different speeds from different levels.
The uses of a parameter symmetry as positions with respect to the quotient map.
The statements of this section are classical in each of their parts: optimisation on quotient manifolds [4], the moment map and the theorem of Kempf and Ness for the balanced set [58], and cotangent bundle reduction [3]. Their placement in the present volume is the following: 1.1 is Corollary 1.3 for a cotangent bundle, position (b) is the reduction of structure group of Theorem 1.4, and position (d) is the connection of Theorem 1.2.
The same structure in an ∞-topos
Three of the four positions use no metric. Let H be an ∞-topos and p:Θ→X an effective epimorphism, an atlas of X, with Čech nerve Cˇ(p)n=Θ×X⋯×XΘ.
Proposition 1.4 (Atlases).
Descent.X is the colimit of Cˇ(p), and Map(X,V) is the limit of Map(Cˇ(p)∙,V) [60]. For a 0-truncated V a map X→V is a map f:Θ→V whose two pullbacks to Θ×XΘ coincide.
Invariant dynamics. If X=Θ//G and u:Θ→Θ is G-equivariant, then u induces uˉ:X→X with p∘u≃uˉ∘p.
Slices. If s:S→Θ is a map such that p∘s is an effective epimorphism, then X is the colimit of Cˇ(p∘s).
Invariants of a dynamics. For an endomorphism u of Θ let Θu be the coequaliser of u and the identity. For a 0-truncated V, the maps Θu→V are the maps f:Θ→V with f∘u=f.
Proof. (i) Groupoid objects of an ∞-topos are effective, so an effective epimorphism is the colimit of its Čech nerve [60, Theorem 6.1.0.6]; for 0-truncated V the limit is the equaliser of the first two terms. (ii) An equivariant map is a map of the simplicial objects G∙×Θ, and colimits are functorial. (iii) is (i) for p∘s. (iv) is the universal property of the coequaliser, the homotopy coherences being vacuous for a 0-truncated target. ◻
Each part has appeared in this volume. Part (i) for V=Ωk is (4), and for the 1-truncated V=B(TP)conn it is Theorem 1.4. Part (ii) is position (c). Part (iii) with S=Q−1(0) is position (b): the Čech nerve of the slice is the action groupoid of the smaller group K. Part (iv) for a flow in place of an endomorphism is the universal first integral of Theorem 1.3(ii), whose target is the irrational torus. The smooth statements of the previous section use one more datum, a splitting of the tangent map of p, which is the connection. It is formulated in differential cohesion in 1.4.
Differential cohesion
Theorem 1.3 was proved for a linear group acting freely and properly on an open subset of Rd, by computation with matrices. Its statements involve tangent vectors, and there are none in 1.4. Two things are required for a general formulation: a tangent functor that commutes with the formation of quotients, and a separation of the infinitesimal part of a symmetry from the rest. Both are part of the structure of a differentially cohesive ∞-topos [76, 50].
Definition 1.5. A differentially cohesive ∞-topos with first-order infinitesimals is an ∞-topos H with
an adjoint triple ℜ⊣ℑ⊣& of endofunctors, in which ℑ is an idempotent monad with unit η and ℜ preserves finite products;
a 0-truncated commutative ring object R and a subobject D⊆R containing 0, with ℜD≃∗, such that the functor T=[D,−] preserves colimits;
the Kock–Lawvere property: (a,b)↦(d↦a+bd) is an equivalence R×R→[D,R].
An object A is coreduced if ηA is an equivalence, and a map f:A→B is formally étale if the naturality square of η is a pullback, A≃B×ℑBℑA. The projection TA→A is evaluation at 0 and the zero section A→TA is restriction along D→∗. For a group object G with unit e, the kernel of TG→G is the group object g=TeG, and the fibre of ηG over the unit is the group object G^.
The model, fixed from 1.10 on, is the ∞-topos of sheaves on the site of formal Cartesian spaces Rn×SpecW, with W a Weil algebra and covers those of the factor Rn. Here R is the line, D=SpecR[ε]/(ε2), ℜ(Rn×SpecW)=Rn and (ℑA)(U)=A(ℜU). The functor T is restriction along U↦U×D, under which the covers of U and of U×D correspond, so T has both adjoints. The 0-truncated objects form the Cahiers topos [25, 52]. Manifolds embed fully faithfully, and [D,M] is the tangent bundle of a manifold M. Smooth sets embed by a functor that preserves colimits and finite products, and diffeological spaces embed through smooth sets. In the model ηG is an effective epimorphism for every group object G, since ℜU is a retract of U for every object U of the site.
Lemma 1.6.
ℑ and T preserve limits and colimits.
[D,ℑA]≃ℑA for every A: all tangent vectors of a coreduced object are zero.
Formally étale maps are stable under pullback, and every map between coreduced objects is formally étale.
Proposition 1.7 (Tangent and infinitesimal shape of an atlas). Let p:Θ→X be an effective epimorphism. Then Tp and ℑp are effective epimorphisms, with Čech nerves TCˇ(p) and ℑCˇ(p). For a group object G acting on Θ, T(Θ//G)≃TΘ//TG,ℑ(Θ//G)≃ℑΘ//ℑG.
Proof. Both functors preserve colimits and limits (1.6(i)), and the Čech nerve and the action groupoid are built from fibre products; TG and ℑG are group objects because the functors preserve finite products. ◻
For a Lie group acting on a manifold, TΘ//TG is the tangent stack of the quotient stack, and its sections are the vector fields on the stack defined in [40].
Theorem 1.8 (Infinitesimal and étale parts of a symmetry). Let G act on Θ, p:Θ→X=Θ//G, and X^=X×ℑXℑΘ.
p factors as ΘeX^εX with ℑe an equivalence and ε formally étale, and the factorisation with these properties is unique [20].
ε is a principal bundle for the coreduced group ℑG: X≃X^//ℑG, X^≃(Θ×ℑG)//G and X^×XΘ≃ℑG×Θ. If ηG is an effective epimorphism, then X^≃Θ//G^.
TX^≃X^×XTX. Hence the relative tangent map TΘ→Θ×XTX of p is the relative tangent map of e.
ℑG^≃∗ and TeG^≃g.
p is formally étale if and only if ηG×id:G×Θ→ℑG×Θ is an equivalence. This holds when G is coreduced, and then g≃∗.
Proof. (i) Let e=(p,ηΘ) and ε=pr1. Since ℑ preserves fibre products and is idempotent, ℑX^≃ℑX×ℑXℑΘ≃ℑΘ, and ℑe is the identity under this equivalence. The map ε is a pullback of ℑp, a map between coreduced objects, and is formally étale by 1.6(iii). The ℑ-equivalences and the formally étale maps are the two classes of an orthogonal factorisation system. (ii) and (iii) are [exo:dc-factorisation]. (iv) ℑ preserves finite products, so ℑG is a group object and ηG a homomorphism. ℑG^ is the fibre of ℑηG, an equivalence. T preserves fibres and TℑG≃ℑG by 1.6(ii), so TG^≃TG×ℑG∗≃TG×GG^, whose fibre over e is g. (v) By uniqueness in (i), p is formally étale if and only if e is an equivalence, which may be tested after pullback along the effective epimorphism X^×XΘ→X^. The pullback of e is Θ×XΘ≃G×Θ→ℑG×Θ, the map ηG×id. If G is coreduced, TG≃[D,ℑG]≃ℑG≃G and the fibre of TG→G is a point. ◻
Theorem 1.8. The atlas of a quotient is the composite of a map inverted by ℑ, the quotient by the formal group G^, and a formally étale map, the quotient by the coreduced group ℑG, along which tangent objects are pulled back.
So every statement about tangent vectors, vertical directions and connections for the atlas p is a statement about e:Θ→X^, and depends on G through the formal group G^ only; the rest of the symmetry is in ε, along which there are no vertical tangent directions. The object X^ is the formal completion of X along p, and in derived algebraic geometry the maps Θ→X^ of this kind are the Lie algebroids on Θ [31]; here it is the action algebroid, whose anchor is the map a of the next proposition.
Proposition 1.9 (The relative tangent sequence). Let G act on Θ with action map act, p:Θ→X=Θ//G, and let g act on TΘ by restriction of the action of TG.
The relative tangent map q:TΘ→Θ×XTX is an effective epimorphism, and Θ×XTX≃TΘ//g.
The fibre of q over the zero section is g×Θ, with the map a:g×Θ→TΘ, a(ξ,θ)=Tact(ξ,0θ), the infinitesimal action.
If Θ is a manifold, g acts by translations: ξ⋅v=v+a(ξ,θ) for v over θ.
Let Θ be a manifold with a Riemannian metric g, and H⊆TΘ the subobject of the vectors v over θ with g(a(ξ,θ),v)=0 for all ξ. If G is a Lie group and the action is locally free, then H is a vector bundle and q restricts to an equivalence H→Θ×XTX: a splitting of the relative tangent map, by the orthogonal complement of the orbits of 1.2(i).
Proof. (i) By 1.7, TΘ×TXTΘ≃T(G×Θ)=TG×TΘ, and the fibre product of q with itself is the part of it over the diagonal Θ→Θ×XΘ≃G×Θ, θ↦(e,θ), which is g×TΘ: the Čech nerve of q is the action groupoid of g. The pullback of q along the effective epimorphism Θ×XTΘ→Θ×XTX is the map TG×TΘ→G×TΘ, which has a section, so q is an effective epimorphism. (ii) is the restriction of (i) to the zero section. (iii) In a chart, by the Kock–Lawvere property, a tangent vector of G at e acts as x↦x+dF1(x), and a tangent vector at θ is d↦θ+dv; the composite is d↦θ+d(v+F1(θ)) since d2=0, and F1(θ)=a(ξ,θ). (iv) The map a is linear in ξ and injective on fibres, with image a subbundle E. The action of g on TΘ is free, its quotient is the vector bundle TΘ/E, and H=E⊥ is a complement of E. ◻
So the pullback to Θ of the tangent object of the quotient is the quotient of the complex g×Θ→TΘ, for every group object and without conditions on the action. A connection is a splitting of q. A metric gives the subobject H in every case, and H is a splitting when the action is locally free. The next theorem is 1.3 in this generality: the group is an arbitrary group object of the model, the action need be neither free nor proper, and the quotient is a stack.
Theorem 1.10 (Positions in differential cohesion). Let H be the model, Θ a manifold with a Riemannian metric g, G a group object of H acting on Θ, p:Θ→X=Θ//G, and L:Θ→R.
Objective and connection.L=ℓ∘p for a unique ℓ:X→R if and only if L∘act=L∘prΘ. In that case g(∇L(θ),a(ξ,θ))=0 on g×Θ: the gradient is a section of H.
Exact part. For a point ξ of g let aξ=g(a(ξ,−),−), a 1-form on Θ. If aξ=dQξ, then Qξ is constant along the gradient flow of every invariant L.
Invariant metric. If g(Tact(0h,v),Tact(0h,w))=g(v,w) on G×(TΘ×ΘTΘ) and L is invariant, then ∇L is equivariant, and there is a section σ of TX→X with σ∘p=Tp∘∇L.
Étale symmetry. If G is coreduced, then g≃∗, parts (a) and (b) are empty, TΘ≃Θ×XTX, and a vector field on Θ induces a section of TX→X if and only if it is G-equivariant.
General symmetry. The objects a, H, aξ and Qξ of (a) and (b) depend on G through G^ only, and X≃X^//ℑG with ℑG coreduced and TX^≃X^×XTX.
Proof. (a) R is 0-truncated, so the first statement is 1.4(i). The differential of L is dL=pr2∘TL:TΘ→R×R→R, by the Kock–Lawvere property, and g(∇L,v)=dL(v). Then dL(a(ξ,θ))=pr2T(L∘act)(ξ,0θ)=pr2T(L∘prΘ)(ξ,0θ)=pr2TL(0θ)=0. (b) Along an integral curve of −∇L the derivative of Qξ is −dQξ(∇L)=−g(a(ξ,−),∇L), which vanishes by (a). (c) Write h∗=Tact(0h,−) for a generalised element h of G. For w over hθ, g(h∗∇L(θ),w)=g(∇L(θ),h∗−1w)=d(L∘h−1)(w)=dL(w)=g(∇L(hθ),w), so h∗∇L(θ)=∇L(hθ) by the non-degeneracy of g. Let G act on TΘ through the zero section G→TG, a homomorphism. For 0-truncated objects with an action of G, a map that commutes with the actions is equivariant, by descent along ∗→BG; so ∇L induces Θ//G→TΘ//G, and σ is its composite with the map TΘ//G→TΘ//TG≃TX induced by the zero section. The composite of σ with TX→X is induced by the identity of Θ. (d) By 1.8(v), p and all the face maps of its Čech nerve are formally étale, so by 1.6(iv) the simplicial object TCˇ(p) is the pullback of TX along Cˇ(p)→X. By descent [60] the sections of TX→X are the sections of TΘ→Θ with descent data. Since TG≃G, the descent isomorphism over G×Θ is (h,v)↦(h,h∗v), and for the 0-truncated objects Θ and TΘ a descent datum for a section is the property of equivariance. (e) The fibre of TG^→G^ over e is g, and the rest is 1.8(ii),(iii). ◻
Symmetries of a parameter space and the two parts of their atlases. For a coreduced group the Lie algebra is trivial and there is no function Qξ; the functions Qξ of a general group are those of its formal group.
symmetry G
coreduced
g
X^
the functions Qξ
permutations of units
yes
0
Θ
none
Z+αZ acting on R
yes
0
R, with X=Tα
none
rescalings (R>0)k
no
Rk
Θ//G^
∣win∣2−∣wout∣2 per unit
GLk, linear layers
no
glk
Θ//G^
W1W1T−W2TW2
(R>0)k⋊Sk
no
Rk
as above
the same, permuted by Sk
The positions of 1.3 are recovered as follows. For a locally free action of a Lie group the restriction of g to H is a metric on the pullback Θ×XTX of the tangent stack. It is a descent datum when the maps induced by G on H are isometries, in particular in position (c), and it depends on the point of the fibre in general, which is the gauge dependence of 1.3(a). The slice of position (b) is a level set of the functions Qξ of part (b) together with 1.4(iii), and the projection of position (d) is the splitting of 1.9(iv).
Three consequences are recorded. First, the remark after Theorem 1.1, that a discrete symmetry gives no conserved quantity, is part (d): the atlas of a discrete symmetry is formally étale. Second, the irrational torus is the quotient of R by the coreduced group Z+αZ, so R→Tα is a formally étale atlas, TTα≃Tα×R, and the vector fields on Tα are the constants ([exo:tangent-Talpha]): the tangent object of a space on which every real function is constant is a line bundle with a one-dimensional space of sections. Third, for a network with rescaling and permutation symmetries the hypothesis space is reached in two steps, Θ→X^→X. The first is the quotient by the formal group of the rescalings; the conservation laws and the choice of preconditioner of Acceleration are statements about it. The second is the quotient by the coreduced group ℑG, of which the permutations are a subgroup, and a dynamics descends along it when it is equivariant.
Two refinements follow: a description of all the conserved quantities, and of the vector fields with the same image under the relative tangent map q.
Proposition 1.11 (All conserved quantities; compare [63). ]In the situation of 1.10, let Q:Θ→R.
Q is constant along the gradient flow of every invariant L if and only if g(∇Q,∇L)=0 for every invariant L.
If G is a Lie group acting freely and properly, this holds if and only if dQ vanishes on H, that is, if and only if dQ=g(a(ψ,−),−) for a smooth map ψ:Θ→g, which is then unique.
In the case (ii) the conserved quantities are the first integrals of the distribution H. Near a point where the Lie algebra of vector fields generated by the sections of H has constant rank r, there are dimΘ−r functionally independent ones and no more.
Proof. (i) The derivative of Q at time 0 along the flow of −∇L through θ is −g(∇Q,∇L)(θ). (ii) X is a manifold and p a submersion, so every covector at p(θ) is the differential of a function ℓ, and the gradients ∇(ℓ∘p)(θ)=dpθTdℓ span the orthogonal complement Hθ of the kernel of dpθ. So the condition of (i) is ∇Q(θ)∈Hθ⊥=a(g,θ) for all θ, and ψ=a−1∘∇Q is smooth because a is an isomorphism of g×Θ onto a subbundle. (iii) A function is a first integral of H if and only if it is one of the involutive distribution generated by H, whose leaves have dimension r by the theorem of Frobenius. ◻
Part (iii) is the count of [63], made there for an arbitrary parametrisation in place of a quotient map, with the span of the gradients of its components in the place of H, and with algorithms for the rank. The functions Qξ of 1.10(b) are the conserved quantities with constant ψ. The others have two sources. A function of the Qξ has a non-constant ψ. And a form aξ that is not closed may have an integrating factor: for the rotations of the punctured plane aA=r2dφ, the line field H is involutive, ψ=r−2A, and the conserved quantity is the angle φ, with values in the circle ([exo:dc-angle]). For the rotations of R3∖{0} part (i) gives the direction θ/∣θ∣, with values in the sphere. So the curvature of the connection is the restriction of the forms daξ to pairs of vectors of H, and it is this restriction, not daξ, that excludes a first integral and produces a holonomy.
Proposition 1.12 (Vector fields with the same image; compare [40). ]In the model, let a Lie group G act on a manifold Θ and X=Θ//G. The sections of Θ×XTX→Θ form the groupoid whose objects are the vector fields on Θ and whose morphisms u→u′ are the smooth maps ψ:Θ→g with u′=u+a(ψ,−). In particular q∘u≃q∘u′ if and only if u′−u=a(ψ,−) for some ψ.
Proof. By 1.9(i), a section is a torsor P→Θ for the group object g×Θ over Θ with an equivariant map P→TΘ over Θ. An effective epimorphism onto a manifold has sections over the members of an open cover, so P is given by a Čech cocycle of smooth maps to the vector space g, which is a coboundary by a partition of unity. For the trivial torsor an equivariant map is determined by the image u of the unit section, and an automorphism of the trivial torsor is the translation by a map ψ, which replaces u by u+a(ψ,−) by 1.9(iii). ◻
Hence the part of an update that is tangent to the orbits is isomorphic to zero as a section, and for a locally free action an update and its projection to H are isomorphic sections: this is position (d) of 1.3. For a compact Lie group the vector fields on the stack X are the equivariant vector fields on Θ with the equivariant maps ψ as morphisms [40]. These are the isomorphic vector fields of [51], and they form a Lie 2-algebra [13].
Scope.Lemma 1.6, Proposition 1.7, Theorem 1.8 and 1.9(i),(ii) hold in every H that satisfies (DC1)–(DC3). Proposition 1.9(iii),(iv) and Theorem 1.10, Proposition 1.11, Proposition 1.12 are statements in the model, in which manifolds, tangent bundles and Riemannian metrics are available. The properties of the model that are used are the Kock–Lawvere property, the two adjoints of T and the full embedding of manifolds [25, 52, 76]. The first-order computations for the rescaling, rotation and translation actions are reproduced in exact arithmetic with dual numbers by checks.py.
Sources. The parts of this section are in the literature, in other contexts. The factorisation of 1.8(i) is the factorisation system of a modality [20]. The unit η, along which X^ is a pullback, is the map whose base change is the jet comonad of [50]. The map Θ→X^ is a formal moduli problem under Θ, that is, a Lie algebroid in the sense of [31]. The tangent stack and its sections are those of [40, 13]. The conserved quantities of gradient flows are counted in [63] and attached to symmetries in [54, 84, 86]. They are combined in 1.10 and 1.2: a parameter symmetry is separated into a formal group, to which the connection and the conserved quantities belong, and a coreduced group, along which a dynamics descends when it is equivariant. This combination was not found in a search of the literature on parameter symmetries of networks and on differential cohesion made in November 2026.
Inductive theories
The same structure is present in the syntax of a theory presented by generators and relations. Let Σ be a finitary signature, V a set of variables, and W=TΣ(V) the set of terms: the free Σ-algebra on V, that is, the initial algebra of Y↦V+ΣY, defined by induction. Let E be a set of equations, ≈ the congruence on W that it generates, and p:W⟶F=W/≈ the quotient, the free algebra of the theory T=(Σ,E). The finitely generated free algebras are the objects of the syntactic site of T, whose category of models is the category of T-algebras. The map p is an atlas of the semantic object F by the inductively defined object W.
Proposition 1.13 (Descent of recursive definitions). Let A be a Σ-algebra, ρ:V→A a valuation, and fρ:W→A the unique homomorphism extending ρ.
If A satisfies E then fρ factors through p. If V is infinite and fρ factors through p for every ρ, then A satisfies E.
Let a group Γ act on V, hence on W by renaming, and on A by automorphisms of Σ-algebras. If ρ is equivariant then fρ is equivariant.
Proof. (i) The kernel of fρ is a congruence; if A satisfies E it contains every substitution instance of every equation, hence ≈. Conversely an equation of E in variables of V is a pair t≈t′, and fρ(t)=fρ(t′) for all ρ is its validity in A. (ii) For γ∈Γ the map γA−1∘fρ∘γW is a homomorphism extending γA−1∘ρ∘γV=ρ; by uniqueness it is fρ. ◻
So for an inductively defined object the descent condition of 1.4(i) is checked one constructor at a time: the algebra must satisfy the equations, and the factorisation follows from the uniqueness of the recursion. This is the counterpart of the fact that the gradient of each sample is orthogonal to the orbits, so that no global verification is needed. In type theory the statement is the elimination rule of a quotient inductive type.
A slice of p is a choice of normal forms: a map nf:W→W with nf(t)≈t and nf(t)=nf(t′) whenever t≈t′. In sets a slice exists by choice. The obstruction is one of effectivity, as it was one of smoothness in [I, Theorem 11.4].
Theorem 1.14 (Computable slices). Let Σ and V be countable and E recursively enumerable. The quotient p:W→F has a computable slice if and only if the relation ≈ is decidable. Consequently, for a finitely presented theory with unsolvable word problem, p is an atlas with no computable slice.
For theories with relations and quantifiers the atlas is the space of models, and the quotient is the theory itself.
Theorem 1.15 (Theories as quotients; [47, 15, 59). ]
Every Grothendieck topos is equivalent to the topos of equivariant sheaves on a localic groupoid; if it has enough points, on a topological groupoid of its points.
For a countable first-order language, a Borel set of structures on N is invariant under the permutations of N if and only if it is the set of models of a sentence of Lω1ω.
Part (i) is the statement that the classifying topos of a theory is Θ//G for Θ a space of models and G their isomorphisms; the first-order case with its syntactic reconstruction is [7]. Part (ii) is 1.4(i) for that atlas: a set of models descends to the theory exactly when it is invariant. In the absence of a 2-form the correspondence between symmetries and invariants is therefore of Galois type, invariance against definability, where Noether’s correspondence pairs a symmetry with a function. The quantitative statements of Acceleration, the preconditioner and the drift of order h2, require a tangent structure on the atlas. A syntactic site of a differential calculus has one; such a signature, the layers of a network, is the subject of Semantics of differentiable programs. A bare algebraic theory has none, and there a cost on rewriting steps is an additional datum.
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Verify 1.1(i) for L(a,w)=21(aw−1)2 and the rescaling group.
Solution. The generator is A=diag(−1,1), Aθ=(−a,w), and μA(θ,p)=−apa+wpw. On the graph of dL, p=ρ(w,a) with ρ=aw−1, so μA=−aρw+wρa=0. ◀
2 Compute aA and daA on R2 for the rescaling A=diag(−1,1) and for the rotation A=(01−10), and describe the curves on which each vanishes.
Solution. Rescaling: aA=−ada+wdw=d21(w2−a2), closed, vanishing on the curves tangent to the hyperbolas w2−a2=const. Rotation: Aθ=(−w,a), aA=−wda+adw=r2dφ in polar coordinates, and daA=2da∧dw, twice the area form. The form vanishes on radial curves. No smooth function on the plane has the radial lines as its level sets, and the integral of aA around a closed curve is twice the enclosed area. ◀
2 Let W be the words in two letters x,y and ≈ the congruence generated by xy≈yx. Give a slice, a function that descends and one that does not, and check 1.13(ii) for the exchange of the letters.
Solution.F is the free commutative monoid N2. Sorting the letters, nf(t)=xiyj, is a slice. The homomorphism to (N,+) with ρ(x)=ρ(y)=1, the length, descends because (N,+) is commutative. The identity homomorphism to the monoid of words does not: xy and yx are different words. The exchange of x and y acts on W, and ρ is equivariant for the trivial action on N, so the length is invariant under the exchange; the valuation ρ(x)=1, ρ(y)=2 is not equivariant, and the weighted length is not invariant. ◀
2 In the model of 1.4, let Θ=R2∖{0}∋(w,v) with the Euclidean metric and G=R>0 acting by s⋅(w,v)=(sw,s−1v). Compute a, aξ, Qξ, H and Θ×XTX. What changes for G′=R× acting by the same formula?
Solution.g=R and a(ξ,(w,v))=ξ(w,−v), so aξ=ξ(wdw−vdv)=dQξ with Qξ=2ξ(w2−v2), the invariant of Theorem 1.2(b). The map a is injective on fibres since (w,v)=0, and H={(w˙,v˙):ww˙=vv˙} is a line bundle; by 1.9(iv), Θ×XTX≃H. The action is free and not proper: the orbits of the points of the axes are not separated from the neighbouring hyperbolas, and X is a non-Hausdorff manifold of dimension one. No part of 1.10 is affected. For G′=R>0×{±1} the kernel of TG′→G′ and the formal group are those of G, so a, Qξ, H and X^ are the same, and ℑG′=ℑG×{±1}: the second map ε is in addition a quotient by the sign, along which tangent objects are pulled back, and there is no further conserved quantity. ◀
2 Determine all the quantities conserved by the gradient flows of the invariant functions for the rotations of Θ=R2∖{0}, and for the rescalings (a,w)↦(a/s,sw) of the quadrant a,w>0.
Solution. Both actions are free and proper, so 1.11(ii),(iii) apply, and H is a line field, hence involutive, with r=1: there is one independent conserved quantity. Rotations: aA=−ydx+xdy=r2dφ is not closed, H is the radial line field, and dQ=ψaA holds for Q=F(φ) with F periodic and ψ=F′(φ)/r2. The conserved quantities are the functions of the angle, for instance x/r and y/r, and the universal one is θ/∣θ∣ with values in the circle. Rescalings: aA=−ada+wdw=dQA with QA=21(w2−a2), and the conserved quantities are the functions F(QA), with ψ=F′(QA). In the first case no conserved quantity has constant ψ; in the second the generator is QA. ◀
3 For π(a,w)=aw on the quadrant a,w>0, compute the cometric Cθ of 1.3(a) for the Euclidean metric and for the invariant metric g′=(da/a)2+(dw/w)2, and the projected gradient flows of ℓ(m).
Solution.dπ=(w,a). Euclidean: Cθ=w2+a2=2Q2+m2, which depends on the level Q of the fibre point, and m˙=−2Q2+m2ℓ′(m); for ℓ=21(m−1)2 this is Proposition 1.6(i). Invariant metric: the g′-gradient of L is (a2∂aL,w2∂wL), so a˙=−a2wℓ′, w˙=−w2aℓ′ and m˙=−2m2ℓ′(m): the cometric is C′=2m2, a function on X, and the projected flow is the same from every point of a fibre. The metric g′ is invariant because da/a and dw/w are invariant under (a,w)↦(a/s,sw). ◀
Solution. (i) ℑ has the left adjoint ℜ and the right adjoint &. T has the left adjoint −×D and preserves colimits by (DC2). (ii) For every object U, Map(U,[D,ℑA])≃Map(U×D,ℑA)≃Map(ℜU×ℜD,A)≃Map(ℜU,A)≃Map(U,ℑA), since ℜ preserves finite products and ℜD≃∗. The composite is induced by the projection U×D→U, so the zero section ℑA→[D,ℑA] is an equivalence. (iii) Let f:A→B be formally étale, b:B′→B and A′=A×BB′. Since ℑ preserves pullbacks, B′×ℑB′ℑA′≃B′×ℑB′(ℑB′×ℑBℑA)≃B′×ℑBℑA≃B′×B(B×ℑBℑA)≃B′×BA=A′. For coreduced A and B, B×ℑBℑA≃ℑA≃A. (iv) T preserves the pullback A≃B×ℑBℑA, and by (ii) TℑA≃ℑA and TℑB≃ℑB, compatibly with the projections to the base. Hence TA≃TB×ℑBℑA≃TB×B(B×ℑBℑA)≃TB×BA. ◀
3 In the model, let Γ=Z+αZ with α irrational act on R by translations. Prove that Γ is coreduced, that R//Γ is the irrational torus Tα, that TTα≃Tα×R, and that the sections of TTα→Tα are the constants. Describe their flows.
Solution.Γ is the coproduct of copies of the terminal object indexed by its elements, and ℑ preserves coproducts and the terminal object; so Γ is coreduced. The action is free, so the action groupoid is an equivalence relation and R//Γ is the 0-truncated quotient sheaf: a section over U is given locally by a smooth map to R, up to locally constant maps to Γ. Two smooth maps U→R whose difference has values in the countable set Γ differ by a locally constant map, so the quotient sheaf is concrete, and it is the diffeological quotient Tα. By 1.7 and TΓ≃Γ, TTα≃(R×R)//Γ with γ⋅(x,v)=(x+γ,v), the derivative of a translation being the identity; hence TTα≃Tα×R, in agreement with 1.10(d). A section is a map Tα→R, that is, by 1.4(i), a smooth function on R invariant under the dense subgroup Γ, a constant c. The constant vector field c on R is Γ-equivariant, its flow x↦x+tc is equivariant, and by 1.4(ii) it induces the translation by the class of tc on Tα. ◀
Solution. Fix a computable enumeration t0,t1,… of W. If nf is a computable slice, then t≈t′ if and only if nf(t)=nf(t′), and equality of terms is decidable; so ≈ is decidable. Conversely let ≈ be decidable and let nf(t) be the first tk in the enumeration with tk≈t. The search terminates because t occurs in the enumeration, nf(t)≈t by construction, and t≈t′ implies that the same tk is found for both. The hypothesis that E is recursively enumerable makes ≈ recursively enumerable in general, so that decidability is the only additional condition. For a finitely presented group or semigroup with unsolvable word problem ≈ is undecidable, and by the first part no computable slice exists. ◀
Solution. (ii) By 1.7, ℑX≃ℑΘ//ℑG, so ℑp is a principal bundle for ℑG, and so is its pullback ε; hence X≃X^//ℑG. The bundle ℑp is classified by the map ℑX→BℑG, and ε by the composite X→ℑX→BℑG, which by the naturality of η is the composite of the classifying map X→BG of p with BηG. So X^≃X×BℑG∗≃(Θ//G)×BG(BG×BℑG∗)≃(Θ//G)×BG(ℑG//G)≃(Θ×ℑG)//G, where G acts on ℑG by translations through ηG. If ηG is an effective epimorphism, this action is transitive with stabiliser G^, so ℑG//G≃BG^ and X^≃Θ//G^. The object X^×XΘ is the pullback of the principal bundle ℑp along the composite Θ→ℑΘ→ℑX, and the pullback of ℑp along itself is trivial: X^×XΘ≃Θ×ℑΘ(ℑΘ×ℑXℑΘ)≃Θ×ℑΘ(ℑG×ℑΘ)≃ℑG×Θ. (iii) The map ε is formally étale by (i), so TX^≃X^×XTX by 1.6(iv). Then Θ×X^TX^≃Θ×X^(X^×XTX)≃Θ×XTX, and under this equivalence the relative tangent map of e is that of p=ε∘e, since T is a functor. ◀
Semantics of differentiable programs
An architecture is a term of a signature of layers. The terms are an initial algebra, and three semantics are homomorphisms out of it: the denotation, a parametrised map; its image under the tangent functor T=[D,−] of Differential cohesion; and the transposed tangent map. Forward and reverse differentiation are the second and the third, by the uniqueness of homomorphisms. A fourth homomorphism assigns to a term the symmetries of its parameter object, which are 2-cells, and with them the atlas, the connection and the conserved quantities of The general structure: descent along an atlas. A training step is then a position with respect to that atlas. The construction is executable: by a compiler to JAX the specifications of five published networks become optimizers whose forward and backward passes are arguments of one traced program, and every statement of the chapter that has a numerical form is measured on them. Derivatives that are composites of the two modes are evaluated by a plan of least cost.
Terms, the free category, and parametrised maps
Definition 1.1 (Signature of layers). A shape is a finite sequence of positive integers and a type is a finite sequence of shapes. The signature Σ has the generators Dense(n), Conv(c,k), Act, MaxPool(k), GlobalAvgPool, Flatten, BatchNorm, LayerNorm, Attention(h), Downsample(c) and Id, from one shape to one shape, the diagonal Copy from (s) to (s,s), the sum Add from (s,s) to (s), and two constructors, composition t;t′ and tensor t⊗t′. The set W of well-typed terms is the initial algebra of Σ. Let ≈ be the congruence generated by the associativity and unit laws of the two constructors and the interchange law (t;t′)⊗(s;s′)≈(t⊗s);(t′⊗s′), and p:W→F=W/≈ the quotient: F is the set of morphisms of the free strict monoidal category on Σ. The residual block is the derived term Res(t,s)=Copy;(t⊗s);Add.
Definition 1.2 (Parametrised maps; [29, 23). ]Let H be the model of Differential cohesion. A 1-cell A→B of Para(H) is a pair (P,f) with f:P×A→B; the composite of (P,f) and (Q,g) is (P×Q,(p,q,a)↦g(q,f(p,a))), and the tensor is the product. A 2-cell (P,f)⇒(P′,f′) is a map r:P→P′ with f=f′∘(r×id). The symmetry groupAut(P,f) is the group of invertible 2-cells from (P,f) to itself. For a subgroup G the map f is invariant, and for a 0-truncated B it descends to (P//G)×A→B by Proposition 1.4(i); the stack P//G is the hypothesis stack.
The generators Act, x↦max(x,αx) with α≤1, and MaxPool are continuous and piecewise linear. A point (θ,x) is regular for a term if no argument of these generators lies on a locus of non-differentiability in the evaluation at (θ,x); the regular points are an open set, invariant under all the group actions below, and dense for generic x. The statements about tangent maps are statements at regular points.
Theorem 1.3 (Compilation). Let a 1-cell (Pσ,[[σ]]) of Para(H) be given for every generator σ.
There is a unique assignment t↦(Θt,[[t]]) on W that extends it and takes composition and tensor of terms to composition and tensor of 1-cells. It is the fold of Proposition 1.13.
If t≈t′, the reassociation of the product of the parameter objects is an invertible 2-cell (Θt,[[t]])≅(Θt′,[[t′]]). Hence the fold induces a homomorphism of bicategories from the free monoidal category F, with identity 2-cells, to Para(H).
The flattening nf:W→W of nested compositions and tensors, with deletion of identities, is a computable slice of p for the associativity and unit laws, and with Θt the list of the parameter blocks of the generators of t in order of occurrence, Θnf(t)=Θt and [[nf(t)]]=[[t]].
Proof. (i) is initiality. (ii) By Proposition 1.13(i) it suffices that the target satisfies the equations of 1.1, and composition and tensor of Para(H) are associative and unital up to the associativity and unit isomorphisms of the product of H, which are 2-cells by definition. (iii) Flattening terminates, its result is equal for terms that differ by the two laws, and the order of occurrence of the generators is preserved; this is Theorem 1.14 for a decidable congruence. ◻
Four folds out of the initial algebra of terms. Each factors through the free category (Theorem 1.3, Theorem 1.4, Theorem 1.5), and a step of an optimizer is assembled from them and from a configuration read at run time (1.7).
Forward and reverse mode
Theorem 1.4 (Tangent and transpose). At regular points:
T[[t]] is the value at t of the fold with generators T[[σ]]. Since T preserves products and TRn≃Rn×Rn, it is a map of pairs of a value and a tangent, the arithmetic of dual numbers.
Let [[t]]∗ be the fold in which a generator is sent to the fibrewise transpose of T[[σ]], a composite to the composite in the opposite order, Copy to the sum and Add to the diagonal. Then for all tangent vectors (θ˙,x˙) and all cotangent vectors yˉ, ⟨T[[t]](θ˙,x˙),yˉ⟩=⟨(θ˙,x˙),[[t]]∗(yˉ)⟩.
For ℓ:B→R and L=ℓ∘[[t]](−,x), the gradient ∇L(θ) is the component along Θt of [[t]]∗(∇ℓ), and it is computed by one evaluation of each generator and one of each transpose.
Proof. (i) T is a functor that preserves finite products (Lemma 1.6(i)), so t↦T[[t]] takes composition and tensor of terms to composition and tensor; it is a homomorphism that agrees with the tangent fold on generators, and homomorphisms out of W are unique. The identification TRn≃Rn×Rn is the Kock–Lawvere property. (ii) Transposition is a contravariant functor on linear maps of Euclidean spaces that preserves products, the transpose of the diagonal is the sum, and the identity holds for generators by definition; both sides are homomorphisms. (iii) is (ii) with yˉ=∇ℓ and the chain rule. ◻
Part (i) is forward-mode and part (iii) reverse-mode differentiation. The argument is that of [26], and in axiomatic form of reverse derivative categories [21]; the lens form of (ii), with the parameter object, is in [23]. For a higher-order language with algebraic data types, forward-mode differentiation is characterised in [42] as the unique structure-preserving macro for a choice of derivatives of the basic operations, and its correctness is proved by a gluing construction over diffeological spaces, the category of Volume I, with a sketch of the extension to a continuation-based method. Part (i) is that characterisation for the first-order signature of 1.1; in the present chapter the language is first-order and the 2-cells are added.
Symmetries as 2-cells
Three local patterns of a term give automorphisms of its denotation (1.1). In each, L and L′ are linear generators, Dense or Conv.
The symmetry families read off a term, with the functions Q of their symmetric generators. For the pair (Q,K) the matrix M2 is the transpose of the key projection.
pattern in a composition
group
action
Q
L;h1;…;hm;L′, the hi among Act, pooling, Flatten, one of them Act; also with a normalisation for L
(R>0)k⋊Sk
channel j of L, weights and bias, times sj; the weights of L′ on channel j times sj−1
21(∣wjin∣2+bj2−∣wjout∣2)
L;BatchNorm, L;LayerNorm
(R>0)k, R>0
channel c of L times sc; all of L times s
21∣Wc∣2
Dense ;Dense; the pairs (Q,K) and (V,O) of each head of Attention
GLk
M1↦M1g, M2↦g−1M2
21(M1TM1−M2M2T)
Theorem 1.5 (The symmetry fold). Let t be a term and Gt the group generated by the families of 1.1 at all their occurrences in t, with Lie algebra gt and infinitesimal action a.
Gt⊆Aut(Θt,[[t]]), for every value α≤1 of the slope of Act. The assignment t↦(Gt,a) is defined by recursion on terms.
For every ℓ and every batch, L=ℓ∘[[t]] is Gt-invariant. Hence the output of the reverse fold is a section of Ht=a(gt)⊥, the functions Q of 1.1 are constant along gradient flow, and a step θ+=θ−h∇L changes QA by 2h2⟨∇L,A∇L⟩.
T[[t]](a(ξ,θ),0)=0 for ξ∈gt. Two updates u, u′ with u′−u=a(ψ,θ) have the same image under T[[t]]; in particular u and its projection PHu to Ht.
The permutations ∏Sk are coreduced: they have no generator and no function Q, and they are part of the formally étale map ε of Theorem 1.8.
Proof. (i) In the first pattern every hi acts on each channel separately and commutes with multiplication by a positive number, so the factor sj passes from L to the input of L′, where it is cancelled; a permutation of the channels is cancelled in the same way. In the second, a normalisation is invariant under positive rescaling of each of its channels, respectively of its whole input. In the third the pair enters through the product M1M2; for the attention scores, (xMQ)(xMK)T=xMQgg−1MKTxT. An automorphism of a factor of a composite or of a tensor is an automorphism of the whole, by the functoriality of whiskering in Para(H), and the search for the patterns is a recursion on subterms. (ii) Invariance follows from (i), and the three consequences are Theorem 1.10(a),(b) and Theorem 1.2(c); the generators of the first two patterns and the symmetric elements of glk act by symmetric matrices. (iii) Differentiate [[t]](exp(sξ)θ,x)=[[t]](θ,x) at s=0; the second statement follows by linearity, and u−PHu lies in a(gt,θ), the orthogonal complement of Ht at θ. (iv) A finite group is coreduced, and Theorem 1.8(v) and Theorem 1.10(d) apply. ◻
The group Gt is a subgroup of Aut(Θt,[[t]]) and in general a proper one: the permutations of the heads of an attention layer and the translations of the bias before a normalisation are further automorphisms. The hypothesis stack of the chapter is Xt=Θt//Gt.
A training step as a position
Definition 1.6 (Configuration and step). Let b(θ)∈Gt be a balancing element: b(θ)θ lies on the slice St defined by Q=0 for the first and third patterns and ∣Wc∣=1 for the second. A configurationc consists of the slope α; a gauge exponent τ∈[0,1] and a return flag ρ∈[0,1]; a backward algebra, the transpose of 1.4 or the tangent fold along random directions [10], with weights for two substitutions in the transpose, fixed random matrices in place of transposed weights [57] and the identity in place of the transpose of Act [11]; a projection weight π∈[0,1]; and a rule, among gradient descent, heavy ball and Adam, with its constants and the step h. The step Uc is θτθτ+=b(θ)τθ,=θτ−hu′,uUc(θ)=rule(backwardc(θτ)),=b(θ)−τρθτ+.u′=(1−π)u+πPHu,
Theorem 1.7 (Positions of the compiled step).
Projection. For π=1, every backward algebra and every rule, QA(θτ+)=QA(θτ)+2h2⟨u′,Au′⟩ for the symmetric generators A, and T[[t]](u′,0)=T[[t]](u,0): the conserved quantities are preserved to first order in h, and the first-order change of the function is that of the unprojected update.
Slice. For τ=1, ρ=0, the forward pass is evaluated on the slice, and [[t]](θτ,−)=[[t]](θ,−).
Invariant metric. Let τ=ρ=1, with the transpose as backward algebra and gradient descent as rule, and let the slice intersect every orbit of Gt in one orbit of the subgroup Kt of the elements of Gt that are orthogonal. Then Uc(gθ)=gUc(θ) for g∈Gt at the points with trivial stabiliser, the step descends to an endomorphism of Xt, and the functions [[t]](Ucn(θ),−) depend only on the class of θ in Xt. They are the functions obtained in position (b).
Run-time family.Theorem 1.3, Theorem 1.4, Theorem 1.5 hold for every configuration, and (c,θ)↦Uc(θ) is one map; the weights τ, ρ, π and those of the substitutions interpolate between the positions.
Proof. (a) QA(θ−hu′)=QA(θ)−h⟨Aθ,u′⟩+2h2⟨u′,Au′⟩ and ⟨Aθ,u′⟩=aA(u′)=0 on Ht; the second statement is 1.5(iii). (b) b(θ)∈Gt and 1.5(i). (c) Let β(θ)=b(θ)θ and E the Euclidean step, so that Uc(θ)=b(θ)−1E(β(θ)). By hypothesis β(gθ)=kβ(θ) with k∈Kt, that is, b(gθ)g=kb(θ), the stabiliser of θ being trivial. The elements of Kt are isometries that preserve L, so E commutes with them (Theorem 1.10(c)), and Uc(gθ)=b(gθ)−1E(kβ(θ))=b(gθ)−1kE(β(θ))=gb(θ)−1E(β(θ)). The rest is Proposition 1.4(ii) and 1.5(i), and in position (b) the point is β(Ucn(θ)) up to Kt. (d) The slope enters 1.5(i) only through positive homogeneity, and the other entries of c do not enter the forward fold. ◻
The step Uc of 1.6. The gauge move and its inverse are 2-cells and leave the denotation unchanged; under the projection an update is replaced by an isomorphic section in the sense of Proposition 1.12.
The compiler and its measurements
Definition 1.1, Definition 1.6 are implemented in JAX [14] in the package dprog, in the source of this volume. Terms are immutable records; nf is the flattening of 1.3(iii); fold is the homomorphism out of the terms, applied to three algebras, Primal, Tangent and Reverse, whose values on a generator are the JAX expression of the layer, its jvp and its vjp; families is the recursion of 1.5; in Symmetry are computed a, the forms aξ by linear transposition, the projection PH by conjugate gradients on the Gram operator of a, the functions Q, and the balancing elements, in closed form for each family and by alternating sweeps over the families; the value of compile is the step Uc as one traced function of the state, the batch and the configuration. Selections between algebras and rules are lax.switch on entries of c, and all weights are traced numbers, so a change of configuration is not a new compilation.
def basic_block(c, stride): # He et al., CIFAR-10, shortcut option A
body = Seq((Conv(c, 3, stride, bias=False), BatchNorm(), Act(),
Conv(c, 3, bias=False), BatchNorm()))
return Seq((Residual(body, Id() if stride == 1 else Downsample(c)), Act()))
def transformer_layer(d=512, heads=8, ff=2048): # Vaswani et al., encoder layer
return Seq((Residual(Attention(heads)), LayerNorm(),
Residual(Seq((Dense(ff), Act(), Dense(d)))), LayerNorm()))
model = compile(transformer_layer(), (16, 512), loss="mse") # one traced step
state = model.init(key)
cfg = default_cfg # every entry is read at run time
state, m = model.step(state, batch, cfg(lr=5e-4)) # transpose, SGD
state, m = model.step(state, batch, cfg(lr=5e-4, tau=1.0, ret=1.0)) # invariant metric
state, m = model.step(state, batch, cfg(lr=5e-4, fa=1.0, proj=1.0)) # feedback alignment
state, m = model.step(state, batch, cfg(lr=1e-4, rule=2, bmode=1)) # tangent algebra, Adam
assert model.traces == 1
Two specifications and a compiled optimizer whose forward and backward passes are changed between steps.
Five published architectures as terms, with the dimension of the Lie algebra of the symmetries found by the fold of 1.5. The parameter counts follow from the published layer sizes.
The specifications are the deep linear network of [6], LeNet-300-100 and LeNet-5 [56] with rectified activations, ResNet-20 for CIFAR-10 [38] with batch normalisation [45] on batch statistics and the parameter-free shortcut, and the encoder layer of the base Transformer [81] with layer normalisation [8] (1.2). No data set is used: inputs are standard normal, and targets are produced by a fixed random network of the same architecture, labels for the classifiers and outputs for the two regressions. Arithmetic is in double precision.
Measured defects of the statements of this chapter, relative, one random point and batch of four per specification. Rows 1 to 4: 1.3(iii) and 1.4, the differences being central with step 10−6 in a random unit direction. Rows 5 to 10: 1.5. Rows 11 to 13: 1.7(b),(c); the last two rows compare the functions after one step from θ and from gθ for a random g∈Gt.
The verification is in 1.3. The reverse and tangent algebras agree with central differences to the accuracy of the differences, and with each other through the transposition identity to rounding. Invariance, the orthogonality of the gradient to the generators, and the vanishing of T[[t]] on vertical vectors hold to rounding for all five terms. The balancing is exact when the families do not share parameter blocks, as in the Transformer layer, and is otherwise limited by the twelve alternating sweeps; the equivariance of the invariant-metric step has the same accuracy, against a defect of order one for the plain step.
Relative drift of the functions Q over a fixed training time with step h, and its ratio to the drift with step h/2. A drift of order h2 per step gives the ratio 2; a drift of order h per step gives the ratio 1.
transpose
feedback alignment
the same, projected
specification
drift
ratio
drift
ratio
drift
ratio
deep linear
5.3e−3
2.3
5.0e−1
1.0
1.3e−2
2.0
LeNet-300-100
5.3e−5
2.1
2.3e−2
1.0
3.4e−4
2.0
LeNet-5
1.3e−4
2.6
4.6e−3
1.0
3.9e−4
2.1
ResNet-20
2.1e−5
2.2
6.3e−3
1.0
5.8e−5
2.0
Transformer layer
1.0e−3
2.2
8.5e−3
1.0
1.1e−3
2.2
[tab:drift] is 1.5(ii) and 1.7(a). For the transpose the drift is of second order per step. Feedback alignment is not a gradient, its update has a component along the orbits, and the drift is of first order; after projection it is again of second order.
Each specification compiled once and trained under eleven configurations given at run time. Within a column the transpose, feedback alignment and straight-through have one step size, the heavy ball a tenth of it, Adam its own, and the tangent algebra the first multiplied by four times the ratio of the number of directions to the number of parameters; the values are in demo.py.
configuration
deep linear
LeNet-300-100
LeNet-5
ResNet-20
Transformer
final loss, relative to the initial loss
reverse, SGD
0.0980
0.0662
0.0087
0.0371
0.0631
the same, slope 0.2
0.0980
0.0483
0.0089
0.0497
0.0561
on the slice (τ=1)
0.126
0.0187
0.0046
0.0191
0.0812
invariant metric (τ=1, returned)
0.126
0.0187
0.0046
0.0191
0.0812
projected, heavy ball
0.122
0.0689
0.0222
0.0826
0.302
Adam
0.409
3.2e−5
1.5e−4
3.4e−4
0.395
Adam, projected
0.408
3.1e−5
1.5e−4
3.3e−4
0.395
feedback alignment
0.189
0.522
0.0182
0.408
0.143
feedback alignment, projected
0.593
0.523
0.0183
0.406
0.144
straight-through
0.0980
0.0431
0.0107
0.0529
0.0655
tangent algebra, 8 directions
0.594
0.999
0.896
0.999
1.000
pairing of the update with the generators, ∣(aξ(u))ξ∣/∣u∣, mean over the steps
reverse, SGD
3.5e−16
3.4e−17
2.9e−16
2.5e−16
1.1e−16
Adam
7.7e−1
1.5e−1
2.2e−1
9.9e−2
1.2e−1
Adam, projected
1.8e−11
7.6e−13
2.4e−13
8.1e−13
5.1e−12
feedback alignment
1.7e0
9.5e−2
1.8e−1
8.5e−2
4.3e−2
feedback alignment, projected
1.9e−12
3.8e−13
2.6e−13
9.7e−13
1.4e−12
straight-through
3.5e−16
6.7e−2
6.0e−2
8.3e−2
2.6e−2
tangent algebra
1.1e0
6.2e−2
1.2e−1
9.5e−2
2.1e−1
batch
64
32
128
8
4
steps
60
60
60
12
18
traces of the step
1
1
1
1
1
The same function at two points θ and gθ of a fibre. Under plain gradient descent the two losses separate; in the invariant-metric configuration they coincide (1.7(c)).The configuration is changed twice during training, without a new trace: transpose with gradient descent, then feedback alignment with projection, then Adam with projection.
Four observations on 1.5 and fig:gauge, fig:switch. First, the rows of the slice and of the invariant metric are equal: the two configurations differ by a gauge transformation at every step (1.7(c)), and the loss is a function on Xt. Second, the update of Adam pairs with the generators at about a tenth of its norm or more, since the rule is not equivariant, and the removal of that part changes the final loss by a few percent at most, in agreement with 1.5(iii) to first order. Third, the same holds for feedback alignment except on the deep linear network, where the projected run is slower: the alignment of the forward weights with the feedback weights is a motion along the orbits of GLk, and it is removed by the projection. Fourth, the tangent algebra with eight random directions gives an unbiased estimate of the gradient whose variance is proportional to the number of parameters, and in these runs it reduces the loss of the network with 448 parameters by two fifths, that of LeNet-5 by a tenth, and that of the three others by a thousandth or less.
Composition of the two modes
The tangent and the transpose are two homomorphisms. A derivative of a term, its Jacobian, a product with it, a second derivative, is a composite of both, and the composites with one value differ in cost. The choice among them is a choice of a term in a fibre of a quotient map, as in The general structure: descent along an atlas: the value is a function on the classes, the cost is a function on the terms. In the compiler the choice is made by a cost model, and by measurement where the model is indifferent.
Definition 1.8 (Linearisation and plans). The linearisation fold sends a term to a triple (y,push,pull) at a point: one evaluation of the denotation, the linear map T[[t]] at the point, and its transpose, obtained by transposition of the linear map. Let t=ℓ1;…;ℓn be a composition of links with interfaces of dimensions d0,…,dn, linear maps Li after linearisation, and costs ci of one application of a link, of its push or of its pull, and let Cij=ci+1+⋯+cj. An accumulation plan is a binary tree whose leaves are segments (i,j] marked F, the pushes of the di basis vectors, or R, the pulls of the dj basis covectors, and whose nodes are matrix products.
Theorem 1.9 (Accumulation plans).
Every plan has the value Ln⋯L1.
In the cost model F(i,j]↦diCij, R(i,j]↦djCij, product ↦μdjdkdi, a plan of least cost is found by dynamic programming over the segments, in O(n3) operations.
A product yˉTLn⋯L1 with one covector costs at least C0n, and the reverse sweep attains it; a product Ln⋯L1v with one vector costs at least C0n, and the forward sweep attains it. The transpose is optimal for the gradient of a loss and the tangent for a directional derivative.
If dk≤min(d0,dn) for an interior k, the plan F(k,n]⋅R(0,k] costs dkC0n+μdndkd0, and the cheaper pure plan costs min(d0,dn)C0n.
Proof. (i) By 1.4 a leaf is the matrix of the composite of its links, computed by columns or by rows, and the matrix product is associative. (ii) The least cost b(i,j) of a segment satisfies b(i,j)=min(diCij,djCij,mini<k<jb(i,k)+b(k,j)+μdjdkdi). (iii) Every link is applied at least once, and each sweep applies every link once. (iv) The reverse sweep of the first k links has dk seeds, the forward sweep of the others has dk seeds, and one product remains. ◻
The links are the factors of the top-level composition of the normal form. Inside a link, and for a term with shared subterms, the same question is the elimination problem on the graph of the generators, which is NP-complete [70]; the general theory is in [34].
Proposition 1.10 (Composites on one linearisation). Let J be the parameter part of the push at (θ,x) for a batch x, and Hℓ the Hessian of the loss in the outputs, positive semidefinite with ∇ℓ in its range, as for the two losses of this chapter.
JTHℓJ=pull∘Hℓ∘push. The gradient is one pull, and K iterations of conjugate gradients for (JTHℓJ+λ)d=∇L use one evaluation of the denotation, K pushes and K+1 pulls.
The Hessian-vector product is the tangent of the reverse fold, and it is also the transpose of the reverse fold paired with the vector.
The iterates of (i) lie in Ht: the Gauss–Newton direction is a section of Ht, without projection.
For λ→0 and the limit d of the iteration, HℓJd is the same at θ and at gθ for g∈Gt. For positive definite Hℓ the first-order change of the outputs on the batch is a function on Xt.
Proof. (i) and (ii) are the definitions, the equality of pull and transposed push, and the symmetry of second derivatives. (iii) Ja(ξ,θ)=0 by 1.5(iii), so the symmetric operator M=JTHℓJ+λ maps a(gt,θ) to itself and its orthogonal complement Ht to itself; ∇L is in Ht, and the iterates are in the span of the vectors Mm∇L. (iv) The action of g is linear and [[t]](gθ,x)=[[t]](θ,x), so J(gθ)∘g=J(θ), and J(gθ) and J(θ) have the same range. With A=Hℓ1/2J and ∇ℓ=Hℓ1/2r, the limit d is the solution of least norm of ATAd=ATr, so Ad is the orthogonal projection of r to the range of A, which is the same at θ and gθ, and HℓJd=Hℓ1/2Ad. ◻
The interface dimensions of the fourteen links of the deep autoencoder and the plan of least cost for its Jacobian: reverse on the encoder, forward on the decoder (1.9(iv)).
Accumulation of the Jacobian of the denotation in its input, for one example (two for ResNet-20, whose normalisation couples the examples; an input of 2×512 for the Transformer layer). The three plans agree to rounding where they are evaluated; the forward plan of ResNet-20 is not evaluated.
dimensions
cost in the model
milliseconds
specification
d0
least
dn
least-cost plan
F
R
plan
F
R
plan
deep linear
32
8
16
R(1..3)
1.4e4
7.2e3
7.2e3
0.0644
0.146
0.157
LeNet-300-100
784
10
10
R(1..6)
2.1e8
2.7e6
2.7e6
4.3
0.634
0.408
LeNet-5
1 024
10
10
R(1..12)
4.4e8
4.3e6
4.3e6
153
2.75
2.73
ResNet-20
6 144
20
20
R(1..41)
5.1e11
1.7e9
1.7e9
–
292
301
Transformer layer
1 024
1 024
1 024
R(1..8)
6.5e9
6.5e9
6.5e9
136
133
135
autoencoder
784
30
784
F(8..14) ⋅ R(1..7)
2.2e9
2.2e9
1.0e8
37.9
42.4
3.97
Composites of the two modes, medians of five evaluations on two processor cores, with the batches of 1.5 and 32 examples for the autoencoder. The Gauss–Newton direction has K=10 iterations.
milliseconds
linear
LeNet-300
LeNet-5
ResNet-20
Transf.
autoenc.
gradient, the transpose
0.0761
0.841
43.9
205
12.4
11.8
Gauss–Newton direction, one linearisation
0.303
12.7
914
6 707
272
201
the same, the two folds inside the iteration
0.294
13.2
994
7 022
286
204
Hessian-vector product, tangent of the transpose
0.0834
1.54
93.5
513
30.7
19
the same, transpose of the transpose
0.0725
0.976
127
633
30.4
17.7
step, all branches evaluated
1.7
6.37
111
659
255
79.4
step, branches selected at run time
0.359
4.33
83.3
492
48.1
38.4
Gauss–Newton step
0.465
17.7
976
7 352
330
207
pairing of the Gauss–Newton direction with the generators
1.1e−14
1.4e−16
3.0e−15
2.2e−15
5.3e−16
5.9e−16
largest eigenvalue of the Hessian
128
33.3
608
46.8
2 040
68 000
The package contains the linearisation fold, the dynamic programme of 1.9(ii), the evaluation of plans, the Gauss–Newton direction as a third backward algebra of the step, selected at run time like the others, and both composites for the Hessian-vector product. A sixth specification is used here, the deep autoencoder 784-1000-500-250-30 and back of [41], with the activation of the signature and a linear code layer; its bottleneck has the symmetry GL30 of the third pattern.
Three measurements (tab:jac, tab:modes). First, for the autoencoder the plan of least cost is the mixed plan of 1.6; in the model the factor over the pure plans is 21 and the measured factor is about ten, the matrix product being cheaper per multiplication than a sweep. For the classifiers the plan is the reverse sweep, and the forward sweep is slower by factors of about ten and fifty for the two LeNets; for the Transformer layer, of constant width, there is no difference in the model or in the measurement. Second, the step with branches selected at run time, in which the gauge move, its inverse and the substituted transpose are evaluated only when their weights are positive, is 1.3 to 5.3 times faster than the step of 1.5, in which they were always evaluated; the values are equal to rounding. Third, two choices are not separated by the model. The Gauss–Newton direction on one linearisation and the same iteration with both folds inside it take the same time within ten percent: the evaluations of the denotation inside the iteration do not depend on the iterate. The two composites for the Hessian-vector product differ by up to a factor 1.6, in either direction, and the choice between them is made by measurement (tune).
The Gauss–Newton direction pairs with the generators at rounding level, as in 1.10(iii). For 1.10(iv), on batches of four with 400 iterations and damping 10−10 of the largest eigenvalue, the defect of HℓJd between θ and a random gθ is 2.7e−9 and 3.1e−9 for the deep linear network and LeNet-300-100, against 2.2e−1 and 1.4e0 for the gradient in place of d. One step of length one in this direction reduces the loss of the five specifications without batch normalisation and increases that of ResNet-20 at the damping used.
Sources. Parametrised maps and their 2-cells are those of [29, 23], the two modes of differentiation as homomorphisms are in [26, 21], and forward mode as the unique structure-preserving macro, with semantics in diffeological spaces, is in [42]. The symmetries of 1.1 are known separately [54, 86, 24]. They are combined here with Differential cohesion: the symmetries are the 2-cells of the free construction, a backward pass is a position with respect to the atlas they define, and the configurations are one family of algebras over the same terms. The accumulation of Jacobians by mixed plans and its complexity are in [34, 70], the Hessian-vector product by composition of the modes in [71], and the Gauss–Newton direction by conjugate gradients in [66]; parts (iii) and (iv) of 1.10 relate it to the symmetries.
Solved exercises
Ratings: warm-up, computation, argument, proof-level. Every exercise is followed by a complete solution.
1 Write LeNet-300-100 as a term, compute its type and its number of parameters, and give the normal form of (Flatten;(Dense(300);Id));((Act;Dense(100));(Act;Dense(10))).
Solution. The term is Flatten;Dense(300);Act;Dense(100);Act;Dense(10), from the type ((1,28,28)) to ((10)), through the shapes (784), (300), (300), (100), (100). The parameter blocks have 784⋅300+300, 300⋅100+100 and 100⋅10+10 entries, in total 266610. The given term differs from it by the associativity and unit laws, so its normal form is the flat composition above, with the same three blocks in the same order. ◀
2 Compute the tangent and the transpose of the residual block Res(t,Id) from those of t.
Solution.[[Res(t,Id)]](θ,x)=[[t]](θ,x)+x. The tangent fold gives (θ˙,x˙)↦T[[t]](θ˙,x˙)+x˙: the pair is copied by the diagonal and the tangents are added by the sum. In the transpose the order is reversed and the two structural generators are exchanged (1.4(ii)): a cotangent yˉ is copied by the transpose of the sum, the two copies are transported by [[t]]∗ and by the identity, and the results are added by the transpose of the diagonal: θˉ=[[t]]Θ∗(yˉ) and xˉ=[[t]]A∗(yˉ)+yˉ. ◀
2 For the term Dense(k);Act;Dense(m) verify the invariance of 1.5(i) directly, and show that it fails when Act is replaced by x↦log(1+ex).
Solution.y=ϕ(xW1+b1)W2+b2 with ϕ(z)=max(z,αz) applied to each coordinate. For a positive diagonal matrix s, ϕ(zs)=ϕ(z)s, so ϕ(xW1s+b1s)s−1W2=ϕ(xW1+b1)W2. For ϕ=log(1+ez) and one hidden unit with x=0, b1=0: ϕ(0)=log2 before and after the rescaling, and the output changes from w2log2 to s−1w2log2. No positively homogeneous function of degree one on R other than max(c+z,c−z) and min(c+z,c−z) exists, and it is smooth only when it is linear: the symmetry and the locus of non-differentiability come together. ◀
2 A chain has two links of cost 104 each and dimensions (d0,d1,d2)=(1000,10,1000). Compute the costs of the three plans for its Jacobian with μ=1, and of the product of the Jacobian with five vectors.
Solution.F(0,2] costs 1000⋅2⋅104=2⋅107 and R(0,2] the same. The mixed plan F(1,2]⋅R(0,1] costs 10⋅104+10⋅104+1000⋅10⋅1000=1.02⋅107, of which the matrix product is all but two percent: the sweeps are cheaper by a factor 100, and the product is the remaining cost. For five vectors the forward sweep costs 5⋅2⋅104=105 and no Jacobian is formed: with seeds of small rank at one end the pure sweep from that end is optimal, as in 1.9(iii). ◀
3 Let L(W) be invariant under W↦sW, s>0. Prove that ∇L(sW)=s−1∇L(W) and ⟨W,∇L(W)⟩=0, that a step of gradient descent increases ∣W∣2 by h2∣∇L∣2, and that the step of 1.7(c) is W+=W−h∣W∣2∇L(W).
Solution. Differentiating L(sW)=L(W) in W gives s∇L(sW)=∇L(W), and in s at s=1 gives ⟨W,∇L(W)⟩=0, which is Theorem 1.10(a) for the generator A=id. Then ∣W−h∇L∣2=∣W∣2+h2∣∇L∣2, the drift of 1.5(ii) for Q=21∣W∣2. The balancing element is b=1/∣W∣, the point on the slice is W/∣W∣, the Euclidean step there is W/∣W∣−h∇L(W/∣W∣)=W/∣W∣−h∣W∣∇L(W), and its transport by b−1=∣W∣ is W−h∣W∣2∇L(W). This is the gradient step for the invariant metric ∣dW∣2/∣W∣2. ◀
3 For M1∈Rm×k and M2∈Rk×n of rank k, let A=M1TM1 and B=M2M2T. Prove that there is a unique symmetric positive definite g such that (M1g,g−1M2) is balanced, and that g2=A−1/2(A1/2BA1/2)1/2A−1/2.
Solution. The pair (M1g,g−1M2) is balanced when gAg=g−1Bg−1, that is, PAP=B with P=g2. Put Y=A1/2PA1/2; then PAP=B is Y2=A1/2BA1/2. The right-hand side is symmetric positive definite and has a unique symmetric positive definite square root, so Y and P=A−1/2YA−1/2 are determined, and g is the positive square root of P. The matrix P is the geometric mean of A−1 and B. This is the balancing element used by the compiler for the third pattern, and the uniqueness is the hypothesis of 1.7(c) for Kt=O(k). ◀
4 Let u be an update direction with aA(u)=⟨Aθ,u⟩=0 for a symmetric generator A at some point of a trajectory. Prove that over a fixed training time the drift of QA under θ+=θ−hu does not tend to 0 with h in general, and that it is O(h) after projection, as in 1.4.
Solution. One step changes QA by −haA(u)+2h2⟨u,Au⟩. Over n=T/h steps the first terms sum to −h∑iaA(ui), a Riemann sum for −∫0TaA(u(θ(s)))ds along the limiting trajectory θ˙=−u(θ), which is non-zero unless the integral vanishes; this is the ratio 1 of the table. After projection aA(u′)=0 at every step by 1.7(a), and the drift is 2h2∑i⟨ui′,Aui′⟩≤2hT∥A∥sup∣u′∣2, of order h: the ratio 2. For the transpose u=∇L lies in Ht without projection (1.5(ii)), with the same bound. ◀
4 Prove 1.7(c) for a single Dense ;Dense pair without the hypothesis on the slice, by proving the hypothesis.
Solution. Let θ=(M1,M2) of rank k and h⋅θ=(M1h,h−1M2) for h∈GLk. The balanced points of the orbit are the points (M1g,g−1M2) with gT(M1TM1)g=g−1(M2M2T)g−T. If g is a solution then so is gk for k∈O(k), and by the polar decomposition g=pk every solution is of this form with p symmetric positive definite, which is unique by [exo:geomean]. So the slice intersects the orbit in one orbit of Kt=O(k), which is the hypothesis. For h∈GLk the balancing element of h⋅θ is the symmetric positive definite p′ with hp′=b(θ)k for some k∈O(k), by the same uniqueness applied to the orbit, so β(h⋅θ) is the image of β(θ) under the element k of Kt, the stabilisers are trivial because M1 has rank k, and the computation in the proof of 1.7 applies. The Euclidean step commutes with O(k) because the action of O(k) on pairs is orthogonal and the loss is invariant. ◀
4 Prove that the direction of a damped Newton iteration, (∇2L+λ)d=∇L solved by conjugate gradients, is not a section of Ht in general, in contrast with 1.10(iii).
Solution. Differentiating ⟨∇L(θ),Aθ⟩=0 in the direction u gives ⟨∇2Lu,Aθ⟩+⟨∇L,Au⟩=0, so ∇2L(Aθ)=−AT∇L for every generator A: the Hessian maps the vertical vector Aθ to −AT∇L, which vanishes only when AT∇L=0. So the vertical space is not invariant under ∇2L+λ, its orthogonal complement is not invariant either, and the second iterate, a combination of ∇L and ∇2L∇L, pairs with Aθ through ⟨∇2L∇L,Aθ⟩=−⟨∇L,A∇L⟩. For the rescaling generator this is ∣∇outL∣2−∣∇inL∣2, the drift coefficient of 1.5(ii), non-zero in general. The Gauss–Newton operator differs from the Hessian by the term in the second derivative of the denotation, and it is that term that does not vanish on vertical vectors. ◀
Coda
The argument in one page
A closed 2-form on a diffeological space is a map to the sheaf Ωcl2, and the symplectic diffeology of [1] is the study of the slice over that sheaf (Proposition 1.2). The moment map of [1] is defined for every group of automorphisms by transgression along orbits (Theorem 1.3, Theorem 1.4); for an invariant primitive it is the component along the group of the difference of the two pullbacks to G×X, that is, the obstruction to descent to the homotopy quotient (Proposition 1.6). A homogeneous space is fibred by its moment map over a coadjoint orbit, whose diffeology is a coimage (Theorem 1.2, Remark 1.3), and non-degeneracy is the injectivity of the universal moment map (Theorem 1.6).
One level up, Ωcl2 is replaced by the stack B(TP)conn of bundles with connection for a torus of periods. The same three statements hold with the connection form λ in the place of the primitive: the moment map is the pullback of λ along orbits and is equivariant (Theorem 1.2); it vanishes exactly when the bundle descends to X//G (Theorem 1.4); and on the zero level of a principal action everything descends to the quotient (Theorem 1.2). The proofs use one lemma, on 1-forms on a product (Lemma 1.11), and the description of principal actions of [I, Theorem 7.2]. No dimension, regularity or compactness enters, and the structure group may be an irrational torus (Theorem 1.5).
The applications use these statements at three levels of generality. For quasi-tori everything is explicit, and the invariants are arithmetic: ideals as groups of periods, Hilbert modular groups, Heisenberg quasi-nilmanifolds, the Weil pairing as a commutator (Theorem 1.2, Theorem 1.4, Theorem 1.1, Theorem 1.2). For manifolds with symmetry the statements are conservation laws and their discrete and reduced forms (Theorem 1.1, Theorem 1.2, Theorem 1.5, Theorem 1.1). And for composition the relevant fact is the existence of fibre products and quotients in Diff (Theorem 1.2, Theorem 1.6). In each chapter the content is concentrated in one example whose quotient is not a manifold: the torus of periods R/ab, the prequantum bundle (S3×S3)/R, the parameter quotient Θ/GLk, the leaf space of the two-body system, the composite of non-transverse relations.
What these have in common is stated in The general structure: descent along an atlas. An objective on a quotient is a Lagrangian submanifold of the zero level of a moment map (Theorem 1.1); a dynamics on an atlas of the quotient is defined by a metric, whose exact part gives the conserved quantities and whose non-closed part gives the phases (Theorem 1.2); and the uses of a symmetry in optimisation are four positions with respect to the quotient map (Theorem 1.3, Acceleration). The part that uses no metric holds for every atlas in an ∞-topos and, for the syntax of a theory, is the theory of normal forms (Proposition 1.4, Theorem 1.14). In a differentially cohesive ∞-topos the atlas of a quotient is the composite of the quotient by a formal group, in which the tangent directions, the connection and the conserved quantities are located, and a formally étale map; the four positions hold there for every group object acting on a Riemannian manifold (Theorem 1.8, Theorem 1.10). The terms of an architecture are an initial algebra whose homomorphisms are the denotation, the two modes of differentiation and the symmetries; they are realised by a compiler to JAX, with the positions as run-time configurations of one optimizer (Theorem 1.3, Theorem 1.4, Theorem 1.5, Theorem 1.7). Composites of the two modes are evaluated by plans of least cost, and the Gauss–Newton direction is a section of the connection (Theorem 1.9, Proposition 1.10).
The sequence of structures of Part II and the three theorems.
Open questions
Prequantisation of non-simply-connected spaces.Theorem 1.5 assumes π1(X)=0, and the general case is left open in [IZ, art. 8.42]. Theorem 1.4 is an example with π1=Z2d. Determine the set of lifts of ω:X→Ωcl2 to B(TP)conn for a diffeological space X in terms of Pω, the toric periods and Hom(π1(X),TP).
Quantisation without line bundles. By Proposition 1.11 a torus of periods with dense P has no unitary character. Which representations of TP on diffeological vector spaces produce a space of sections of a prequantum TP-bundle on which Aut(Y,λ) acts and which for cyclic P is the classical prequantum Hilbert space?
Symplectic spaces that are not homogeneous. Transitivity of Diff(X,ω) is required in Definition 1.4 and fails for the cone orbifold. Formulate non-degeneracy for orbifolds and quasifolds so that the reduced spaces of Corollary 1.8 satisfy it.
Shifted structures. The pair (Z//G,ω∣Z) of Theorem 1.6 is a stack with a closed 2-form. Compare it with the 0-shifted symplectic structure on the corresponding derived quotient, and extend Theorem 1.2, Theorem 1.4 to bundle gerbes with connection and closed 3-forms.
Theta functions for real multiplication. The pairing en of Theorem 1.4 has values in O/n. Construct the representation of the group Gn that corresponds to the space of theta functions of level n, and relate it to the real multiplication programme of [62].
Stochastic dynamics.Theorem 1.2(c) gives the drift of the gradient-flow invariants for full-batch descent. Compute the stationary distribution of Q under stochastic gradient descent in terms of the covariance of the gradient noise restricted to the directions A∇L.
Diophantine controllability. For the system of Theorem 1.3 the cost of approximate control is governed by the continued fraction of the inertia ratio. Classify the mechanical systems with flat mechanical connection whose leaf space is a quasifold, and bound the control cost by the Diophantine type of the holonomy group.
Metrics on tangent stacks. In Theorem 1.10 the parameter space is a Riemannian manifold, and the cometric of Theorem 1.3(a) is defined on Θ×XTX for a locally free action. Define it for the complex g×Θ→TΘ of Proposition 1.9 when the rank of the infinitesimal action varies and when Θ is a microlinear object in place of a manifold, prove the statement of Kempf and Ness for the level set Q−1(0) in that generality, and determine which syntactic sites have an object D that satisfies (DC2), so that the quantitative statements of Acceleration have analogues for inductive theories.
Programs with recursion and higher order. The signature of Definition 1.1 is first-order and has no iteration. Extend Theorem 1.5, Theorem 1.7 to terms with weight sharing, iteration and recursion, where a parameter block occurs several times and the symmetry group of a composite is smaller than the product of those of its factors, and to the higher-order language of [42], with 2-cells in the gluing construction.
Formalisation
The statements of this volume fall into the three strata of [I, Chapter 14], by the infrastructure required (1.1). Stratum A requires sets, plots, real analysis and linear algebra. Stratum B requires sheaves and stacks on the site of Cartesian spaces. Stratum C requires the ∞-topos H, and in practice the cohesive homotopy type theory of [78], in which the homotopy quotient and the classifying types are primitive; Differential cohesion requires in addition a modality ℑ with the properties of Definition 1.5, and the theory of formally étale maps for a modality is developed in homotopy type theory in [20].
Most of the volume lies in stratum A: Theorem 1.2, Theorem 1.2 are statements about plots and forms whose proofs are finite computations with Lemma 1.11, and the application chapters are linear algebra over R, over number rings and over finite fields. The numerical claims of the examples are reproduced by checks.py, and the measurements of Semantics of differentiable programs by the test-suite of the package dprog. In a proof assistant the terms of Definition 1.1 are an inductive type and the four folds are definitions by recursion, so that Theorem 1.3, Theorem 1.4 are statements about a recursor and the compiler is a target of extraction.
A dictionary
In the first table the vocabulary of Chapters 7–9 of [1] is set beside the categorical vocabulary used here; the book is cited by article in the left column. Notation is listed in the second table.
P. Iglesias-Zemmour, Diffeology, Mathematical Surveys and Monographs 185, American Mathematical Society, Providence, 2013.
Diffeology in Higher Categories: concrete sheaves, cohesive shape, and stacks behind Iglesias-Zemmour’s Diffeology, Volume I of this series, Higher Categorical Semantics, 2026.
R. Abraham and J. E. Marsden, Foundations of Mechanics, 2nd ed., Benjamin/Cummings, 1978.
P.-A. Absil, R. Mahony and R. Sepulchre, Optimization Algorithms on Matrix Manifolds, Princeton University Press, 2008.
J.-M. Andreoli, Logic programming with focusing proofs in linear logic, J. Logic Comput. 2 (1992), 297–347.
S. Arora, N. Cohen and E. Hazan, On the optimization of deep networks: implicit acceleration by overparameterization, Proc. ICML 2018, PMLR 80, 244–253.
S. Awodey and H. Forssell, First-order logical duality, Ann. Pure Appl. Logic 164 (2013), 319–348.
J. L. Ba, J. R. Kiros and G. E. Hinton, Layer normalization, arXiv:1607.06450.
J. C. Baez and B. Fong, A compositional framework for passive linear networks, Theory Appl. Categ. 33 (2018), 1158–1222.
A. G. Baydin, B. A. Pearlmutter, D. Syme, F. Wood and P. Torr, Gradients without backpropagation, arXiv:2202.08587.
Y. Bengio, N. Léonard and A. Courville, Estimating or propagating gradients through stochastic neurons for conditional computation, arXiv:1308.3432.
U. Berger and H. Schwichtenberg, An inverse of the evaluation functional for typed λ-calculus, in Proc. LICS 1991, IEEE, 203–211.
D. Berwick-Evans and E. Lerman, Lie 2-algebras of vector fields, Pacific J. Math. 309 (2020), no. 1, doi:10.2140/pjm.2020.309.1; arXiv:1609.03944.
J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne and Q. Zhang, JAX: composable transformations of Python+NumPy programs, software; version 0.12.1 is used here.
C. Butz and I. Moerdijk, Representing topoi by topological groupoids, J. Pure Appl. Algebra 130 (1998), 223–235.
O. Caramello, Theories, Sites, Toposes, Oxford University Press, 2017.
W. Castryck and T. Decru, An efficient key recovery attack on SIDH, in EUROCRYPT 2023, LNCS 14008, Springer, 2023, 423–447.
W. Castryck, T. Lange, C. Martindale, L. Panny and J. Renes, CSIDH: an efficient post-quantum commutative group action, in ASIACRYPT 2018, LNCS 11274, Springer, 2018, 395–427.
J. Cervera, A. J. van der Schaft and A. Baños, Interconnection of port-Hamiltonian systems and composition of Dirac structures, Automatica 43 (2007), 212–225.
F. Cherubini and E. Rijke, Modal descent, Math. Structures Comput. Sci. 31 (2021), 363–391; arXiv:2003.09713.
R. Cockett, G. Cruttwell, J. Gallagher, J.-S. P. Lemay, B. MacAdam, G. Plotkin and D. Pronk, Reverse derivative categories, arXiv:1910.07065.
G. J. Cooper, Stability of Runge–Kutta methods for trajectory problems, IMA J. Numer. Anal. 7 (1987), 1–13.
G. S. H. Cruttwell, B. Gavranović, N. Ghani, P. Wilson and F. Zanasi, Categorical foundations of gradient-based learning, arXiv:2103.01931.
S. S. Du, W. Hu and J. D. Lee, Algorithmic regularization in learning deep homogeneous models: layers are automatically balanced, in Advances in Neural Information Processing Systems 31 (2018).
E. J. Dubuc, Sur les modèles de la géométrie différentielle synthétique, Cahiers Topologie Géom. Différentielle 20 (1979), 231–279; numdam:CTGDC_1979__20_3_231_0.
C. Elliott, The simple essence of automatic differentiation, arXiv:1804.00746.
D. Fiorenza, C. L. Rogers and U. Schreiber, L∞-algebras of local observables from higher prequantum bundles, Homology Homotopy Appl. 16 (2014), 107–142.
D. Fiorenza, C. L. Rogers and U. Schreiber, Higher U(1)-gerbe connections in geometric prequantization, Rev. Math. Phys. 28 (2016), 1650012.
B. Fong, D. I. Spivak and R. Tuyéras, Backprop as functor: a compositional perspective on supervised learning, arXiv:1711.10455.
P.-A. Fouque, J. Hoffstein, P. Kirchner, V. Lyubashevsky, T. Pornin, T. Prest, T. Ricosset, G. Seiler, W. Whyte and Z. Zhang, Falcon: Fast-Fourier lattice-based compact signatures over NTRU, specification v1.2, submission to the NIST post-quantum cryptography standardisation process, 2020.
D. Gaitsgory and N. Rozenblyum, A Study in Derived Algebraic Geometry, Volume II: Deformations, Lie Theory and Formal Geometry, Mathematical Surveys and Monographs 221, American Mathematical Society, 2017.
N. Gama, N. Howgrave-Graham and P. Q. Nguyen, Symplectic lattice reduction and NTRU, in EUROCRYPT 2006, LNCS 4004, Springer, 2006, 233–253.
S. Greydanus, M. Dzamba and J. Yosinski, Hamiltonian neural networks, in Advances in Neural Information Processing Systems 32 (2019).
A. Griewank and A. Walther, Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation, 2nd ed., SIAM, 2008.
V. Guillemin and S. Sternberg, Some problems in integral geometry and some related problems in micro-local analysis, Amer. J. Math. 101 (1979), 915–955.
G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 6th ed., Oxford University Press, 2008.
S. Hayou, N. Ghosh and B. Yu, LoRA+: efficient low rank adaptation of large models, in Proc. ICML 2024.
K. He, X. Zhang, S. Ren and J. Sun, Deep residual learning for image recognition, arXiv:1512.03385.
B. Heo, S. Chun, S. J. Oh, D. Han, S. Yun, G. Kim, Y. Uh and J.-W. Ha, AdamP: slowing down the slowdown for momentum optimizers on scale-invariant weights, in Proc. ICLR 2021.
R. Hepworth, Vector fields and flows on differentiable stacks, Theory Appl. Categ. 22 (2009), 542–587; arXiv:0810.0979.
G. E. Hinton and R. R. Salakhutdinov, Reducing the dimensionality of data with neural networks, Science 313 (2006), 504–507; doi:10.1126/science.1127647.
M. Huot, S. Staton and M. Vákár, Correctness of automatic differentiation via diffeologies and categorical gluing, arXiv:2001.02209.
P. Iglesias-Zemmour, Example of singular reduction in symplectic diffeology, Proc. Amer. Math. Soc. 144 (2016), 1309–1324.
P. Iglesias-Zemmour, The moment maps in diffeology, Mem. Amer. Math. Soc. 207 (2010), no. 972.
S. Ioffe and C. Szegedy, Batch normalization: accelerating deep network training by reducing internal covariate shift, arXiv:1502.03167.
G. Jeffreys and S.-C. Lau, Kähler geometry of quiver varieties and machine learning, preprint.
A. Joyal and M. Tierney, An extension of the Galois theory of Grothendieck, Mem. Amer. Math. Soc. 51 (1984), no. 309.
Y. Karshon and J. Watts, Basic forms and orbit spaces: a diffeological approach, SIGMA 12 (2016), 026.
G. Kempf and L. Ness, The length of vectors in representation spaces, in Algebraic Geometry (Copenhagen 1978), Lecture Notes in Math. 732, Springer, 1979, 233–243.
I. Khavkine and U. Schreiber, Synthetic geometry of differential equations: I. Jets and comonad structure, arXiv:1701.06238.
S. Klajbor-Goderich, Nonlinear stability of relative equilibria and isomorphic vector fields, SIGMA 14 (2018), 021; arXiv:1707.02828.
A. Kock, Synthetic Differential Geometry, 2nd ed., London Mathematical Society Lecture Note Series 333, Cambridge University Press, 2006; doi:10.1017/CBO9780511550812.
B. Kostant, Quantization and unitary representations, in Lectures in Modern Analysis and Applications III, Lecture Notes in Math. 170, Springer, 1970, 87–208.
D. Kunin, J. Sagastuy-Brena, S. Ganguli, D. L. K. Yamins and H. Tanaka, Neural mechanics: symmetry and broken conservation laws in deep learning dynamics, in Proc. ICLR 2021.
T. van Laarhoven, L2 regularization versus batch and weight normalization, preprint, arXiv:1706.05350.
Y. LeCun, L. Bottou, Y. Bengio and P. Haffner, Gradient-based learning applied to document recognition, Proc. IEEE 86 (1998), 2278–2324.
T. P. Lillicrap, D. Cownden, D. B. Tweed and C. J. Akerman, Random feedback weights support learning in deep neural networks, arXiv:1411.0247.
K. Lindsey and G. Menon, Regularization implies balancedness in the deep linear network, preprint, arXiv:2511.01137.
E. G. K. Lopez-Escobar, An interpolation theorem for denumerably long formulas, Fund. Math. 57 (1965), 253–272.
J. Lurie, Higher Topos Theory, Annals of Mathematics Studies 170, Princeton University Press, 2009.
L. Maino, C. Martindale, L. Panny, G. Pope and B. Wesolowski, A direct key recovery attack on SIDH, in EUROCRYPT 2023, LNCS 14008, Springer, 2023, 448–471.
Yu. I. Manin, Real multiplication and noncommutative geometry, in The Legacy of Niels Henrik Abel, Springer, 2004, 685–727.
S. Marcotte, R. Gribonval and G. Peyré, Abide by the law and follow the flow: conservation laws for gradient flows, in Advances in Neural Information Processing Systems 36 (2023); arXiv:2307.00144.
J. E. Marsden and A. Weinstein, Reduction of symplectic manifolds with symmetry, Rep. Math. Phys. 5 (1974), 121–130.
J. E. Marsden, R. Montgomery and T. Ratiu, Reduction, symmetry, and phases in mechanics, Mem. Amer. Math. Soc. 88 (1990), no. 436.
J. Martens, Deep learning via Hessian-free optimization, in Proceedings of the 27th International Conference on Machine Learning, 2010.
J. Milnor, Introduction to Algebraic K-Theory, Annals of Mathematics Studies 72, Princeton University Press, 1971.
R. Montgomery, Gauge theory of the falling cat, in Dynamics and Control of Mechanical Systems, Fields Inst. Commun. 1, Amer. Math. Soc., 1993, 193–218.
D. Mumford, On the equations defining abelian varieties I, Invent. Math. 1 (1966), 287–354.
U. Naumann, Optimal Jacobian accumulation is NP-complete, Math. Program. 112 (2008), 427–441; doi:10.1007/s10107-006-0042-z.
B. A. Pearlmutter, Fast exact multiplication by the Hessian, Neural Comput. 6 (1994), 147–160.
A. M. Pitts, Nominal Sets: Names and Symmetry in Computer Science, Cambridge University Press, 2013.
R. W. Richardson and P. J. Slodowy, Minimum vectors for real reductive algebraic groups, J. London Math. Soc. 42 (1990), 409–429.
D. Robert, Breaking SIDH in polynomial time, in EUROCRYPT 2023, LNCS 14008, Springer, 2023, 472–503.
A. van der Schaft and D. Jeltsema, Port-Hamiltonian systems theory: an introductory overview, Found. Trends Syst. Control 1 (2014), 173–378.
U. Schreiber, Differential cohomology in a cohesive ∞-topos, arXiv:1310.7930.
A. Shapere and F. Wilczek, Geometry of self-propulsion at low Reynolds number, J. Fluid Mech. 198 (1989), 557–585.
M. Shulman, Brouwer’s fixed-point theorem in real-cohesive homotopy type theory, Math. Structures Comput. Sci. 28 (2018), 856–941.
J.-M. Souriau, Structure des systèmes dynamiques, Dunod, Paris, 1970.
T. Tong, C. Ma and Y. Chi, Accelerating ill-conditioned low-rank matrix estimation via scaled gradient descent, J. Mach. Learn. Res. 22 (2021), no. 150.
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser and I. Polosukhin, Attention is all you need, arXiv:1706.03762.
A. Weinstein, The symplectic “category”, in Differential Geometric Methods in Mathematical Physics, Lecture Notes in Math. 905, Springer, 1982, 45–51.
M. Willsey, C. Nandi, Y. R. Wang, O. Flatt, Z. Tatlock and P. Panchekha, egg: fast and extensible equality saturation, Proc. ACM Program. Lang. 5 (2021), POPL, article 23.
B. Zhao, I. Ganev, R. Walters, R. Yu and N. Dehmamy, Symmetries, flat minima, and the conserved quantities of gradient flow, in Proc. ICLR 2023, arXiv:2210.17216.
B. Zhao, N. Dehmamy, R. Walters and R. Yu, Symmetry teleportation for accelerated optimization, in Advances in Neural Information Processing Systems 35 (2022).
B. Zhao, R. Walters and R. Yu, Symmetry in neural network parameter spaces, preprint, arXiv:2506.13018.
Complete flattened LaTeX source
\documentclass[11pt,oneside,letterpaper]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[sc]{mathpazo}
\linespread{1.045}
\usepackage{microtype}
\usepackage[letterpaper,inner=1.2in,outer=1.2in,top=1.1in,bottom=1.15in,headheight=14pt]{geometry}
\usepackage{amsmath,amssymb,amsthm,mathtools,mathrsfs,stmaryrd,bm}
\usepackage{enumitem,booktabs,array,multicol,longtable}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz,tikz-cd,pgfplots}
\usetikzlibrary{arrows.meta,calc,decorations.markings,decorations.pathmorphing,positioning,patterns,shapes.geometric,fit,backgrounds}
\pgfplotsset{compat=1.18}
\usepackage[most]{tcolorbox}
\usepackage{titlesec,fancyhdr,caption}
\usepackage[colorlinks=true,linkcolor=hcsteal,citecolor=hcsrust,urlcolor=hcsteal,bookmarksnumbered=true,
pdftitle={Diffeology in Higher Categories},pdfsubject={Higher Categorical Semantics monograph}]{hyperref}
\usepackage[nameinlink,capitalise,noabbrev]{cleveref}
\definecolor{hcsteal}{HTML}{0F5C63}
\definecolor{hcsrust}{HTML}{A4491F}
\definecolor{hcsink}{HTML}{1E2630}
\definecolor{hcssand}{HTML}{F5EFE2}
\definecolor{hcsmist}{HTML}{E6F0F0}
\definecolor{hcsgold}{HTML}{C8912B}
\definecolor{hcsgrey}{HTML}{7A8792}
\definecolor{hcsplum}{HTML}{6B3F6E}
\color{hcsink}
\titleformat{\chapter}[display]
{\normalfont\bfseries\color{hcsteal}}
{\large\scshape\MakeLowercase{\chaptertitlename}\ \thechapter}{0.6ex}
{\Huge\color{hcsink}\raggedright}[\vspace{0.6ex}{\color{hcsgold}\titlerule[1.2pt]}]
\titlespacing*{\chapter}{0pt}{0pt}{3.2ex}
\titleformat{\section}{\normalfont\Large\bfseries\color{hcsteal}}{\thesection}{0.8em}{}
\titleformat{\subsection}{\normalfont\large\bfseries\color{hcsink}}{\thesubsection}{0.7em}{}
\titleformat{\part}[display]{\normalfont\Huge\bfseries\color{hcsteal}\centering}{\Large\scshape\MakeLowercase{Part}\ \thepart}{1ex}{}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\small\scshape\color{hcsgrey}\nouppercase{\leftmark}}
\fancyhead[R]{\small\color{hcsgrey}\thepage}
\renewcommand{\headrulewidth}{0.3pt}
\renewcommand{\headrule}{\color{hcsgrey}\hrule height 0.3pt}
\fancypagestyle{plain}{\fancyhf{}\fancyfoot[C]{\small\color{hcsgrey}\thepage}\renewcommand{\headrulewidth}{0pt}\renewcommand{\headrule}{}}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
\captionsetup{font=small,labelfont={bf,color=hcsteal},margin=1.5em}
\setlist{itemsep=0.2ex,topsep=0.6ex}
\setlength{\parskip}{0.25ex plus 0.3ex}
\newtheoremstyle{hcs}{0.4ex}{0.4ex}{\itshape}{}{\bfseries\color{hcsteal}}{.}{0.6em}{}
\newtheoremstyle{hcsdef}{0.4ex}{0.4ex}{\normalfont}{}{\bfseries\color{hcsteal}}{.}{0.6em}{}
\newtheoremstyle{hcsrem}{0.9ex}{0.9ex}{\normalfont}{}{\itshape\color{hcsteal}}{.}{0.6em}{}
\theoremstyle{hcs}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{hcsdef}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{construction}[theorem]{Construction}
\theoremstyle{hcsrem}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{warning}[theorem]{Warning}
\tcbset{hcsbox/.style={enhanced,breakable,boxrule=0pt,frame hidden,sharp corners,
left=9pt,right=8pt,top=5pt,bottom=5pt,before skip=1.6ex plus 0.4ex,after skip=1.6ex plus 0.4ex}}
\tcolorboxenvironment{theorem}{hcsbox,colback=hcsmist,borderline west={2.2pt}{0pt}{hcsteal}}
\tcolorboxenvironment{proposition}{hcsbox,colback=hcsmist,borderline west={2.2pt}{0pt}{hcsteal}}
\tcolorboxenvironment{lemma}{hcsbox,colback=hcsmist!55,borderline west={1.2pt}{0pt}{hcsteal}}
\tcolorboxenvironment{corollary}{hcsbox,colback=hcsmist!55,borderline west={1.2pt}{0pt}{hcsteal}}
\tcolorboxenvironment{definition}{hcsbox,colback=hcssand,borderline west={2.2pt}{0pt}{hcsgold}}
\tcolorboxenvironment{construction}{hcsbox,colback=hcssand,borderline west={2.2pt}{0pt}{hcsgold}}
\newcommand{\hcsstar}{\raisebox{0.05ex}{\scalebox{0.72}{$\bigstar$}}}
\newcommand{\lvl}[1]{ \ifcase#1\or{\color{hcsgold}\hcsstar}{\color{hcsgrey!45}\hcsstar\hcsstar\hcsstar} \or{\color{hcsgold}\hcsstar\hcsstar}{\color{hcsgrey!45}\hcsstar\hcsstar} \or{\color{hcsgold}\hcsstar\hcsstar\hcsstar}{\color{hcsgrey!45}\hcsstar} \or{\color{hcsgold}\hcsstar\hcsstar\hcsstar\hcsstar}\fi}
\newcommand{\lvlname}[1]{\ifcase#1\or warm-up\or computation\or argument\or proof\fi}
\newtcolorbox[auto counter,number within=chapter,crefname={Exercise}{Exercises}]{exercise}[2][]{enhanced,breakable,sharp corners,
colback=white,colframe=hcsrust,boxrule=0.5pt,left=8pt,right=8pt,top=5pt,bottom=5pt,
before skip=2.2ex,after skip=0.8ex,
fonttitle=\bfseries\small,coltitle=white,colbacktitle=hcsrust,
title={Exercise \thetcbcounter\hfill \lvl{#2}\ \ {\normalfont\itshape\lvlname{#2}}},#1}
\newenvironment{solution}{\begin{tcolorbox}[hcsbox,colback=white,borderline west={1.2pt}{0pt}{hcsrust!60},
before skip=0.6ex,after skip=2.2ex]\small\textsc{\color{hcsrust}Solution.}\ }{\hfill{\color{hcsrust}$\blacktriangleleft$}\end{tcolorbox}}
\newcommand{\exercisesheading}{\section*{Solved exercises}\addcontentsline{toc}{section}{Solved exercises} {\small\itshape\color{hcsgrey} Ratings: \lvl{1} warm-up, \lvl{2} computation, \lvl{3} argument, \lvl{4} proof-level.
Every exercise is followed by a complete solution.}\par\medskip}
\newenvironment{chapabstract}{\begin{quote}\small\itshape\color{hcsink!85}}{\end{quote}\medskip}
\newcommand{\source}[1]{{\small\noindent\textsc{\color{hcsrust}Source in the book.}\ #1\par}\medskip}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\T}{\mathbb{T}}
\newcommand{\cat}[1]{\mathsf{#1}}
\newcommand{\Diff}{\cat{Diff}}
\newcommand{\Dom}{\cat{Dom}}
\newcommand{\Cart}{\cat{Cart}}
\newcommand{\Mfd}{\cat{Mfd}}
\newcommand{\Set}{\cat{Set}}
\newcommand{\Top}{\cat{Top}}
\newcommand{\Sh}{\cat{Sh}}
\newcommand{\PSh}{\cat{PSh}}
\newcommand{\ConcSh}{\cat{ConcSh}}
\newcommand{\SmSet}{\cat{SmoothSet}}
\newcommand{\Hh}{\mathbf{H}}
\newcommand{\Spc}{\cat{S}}
\newcommand{\Grpd}{\cat{Grpd}}
\newcommand{\Disc}{\operatorname{Disc}}
\newcommand{\coDisc}{\operatorname{coDisc}}
\newcommand{\conc}{\operatorname{conc}}
\newcommand{\shp}{\mathord{\textstyle\smallint}}
\newcommand{\fl}{\flat}
\newcommand{\shr}{\sharp}
\newcommand{\cinf}{C^{\infty}}
\newcommand{\Paths}{\operatorname{Paths}}
\newcommand{\Loops}{\operatorname{Loops}}
\newcommand{\Hom}{\operatorname{Hom}}
\newcommand{\Map}{\operatorname{Map}}
\newcommand{\End}{\operatorname{End}}
\newcommand{\Aut}{\operatorname{Aut}}
\newcommand{\Dif}{\operatorname{Diff}}
\newcommand{\GL}{\operatorname{GL}}
\newcommand{\SL}{\operatorname{SL}}
\newcommand{\PGL}{\operatorname{PGL}}
\newcommand{\Ort}{\operatorname{O}}
\newcommand{\Pic}{\operatorname{Pic}}
\newcommand{\Fl}{\operatorname{Fl}}
\newcommand{\Bun}{\operatorname{Bun}}
\newcommand{\B}{\mathbf{B}}
\newcommand{\Om}{\Omega}
\newcommand{\dR}{\mathrm{dR}}
\newcommand{\colim}{\operatorname*{colim}}
\newcommand{\holim}{\operatorname*{holim}}
\newcommand{\hocolim}{\operatorname*{hocolim}}
\newcommand{\im}{\operatorname{im}}
\newcommand{\coker}{\operatorname{coker}}
\newcommand{\id}{\mathrm{id}}
\newcommand{\ev}{\mathrm{ev}}
\newcommand{\pr}{\mathrm{pr}}
\newcommand{\op}{\mathrm{op}}
\newcommand{\Lam}{\Lambda}
\newcommand{\Tal}{T_{\alpha}}
\newcommand{\Rd}{\R^{\delta}}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\norm}[1]{\lVert #1\rVert}
\newcommand{\abs}[1]{\lvert #1\rvert}
\newcommand{\set}[1]{\{\,#1\,\}}
\newcommand{\hquot}{/\!\!/}
\newcommand{\IZ}[1]{\textup{[IZ,\,#1]}}
\newcommand{\defn}[1]{\textbf{\color{hcsink}#1}}
\newcommand{\Sub}{\mathrm{sub}}
\newcommand{\xto}[1]{\xrightarrow{\;#1\;}}
\newcommand{\into}{\hookrightarrow}
\newcommand{\onto}{\twoheadrightarrow}
\newcommand{\dten}{\Delta}
\newcommand{\Ob}{\operatorname{Ob}}
\newcommand{\Mor}{\operatorname{Mor}}
\newcommand{\rk}{\operatorname{rk}}
\newcommand{\Sym}{\operatorname{Sym}}
\newcommand{\TC}{\operatorname{TC}}
\newcommand{\AD}{\mathcal{D}}
\tikzset{>={Stealth[length=5pt]},
hookr/.style={{Hooks[right,length=3pt,width=6pt]}->},
hcsnode/.style={draw=hcsteal,fill=hcsmist,rounded corners=2pt,inner sep=4pt,font=\small},
hcsnodeb/.style={draw=hcsgold,fill=hcssand,rounded corners=2pt,inner sep=4pt,font=\small},
hcsnoder/.style={draw=hcsrust,fill=white,rounded corners=2pt,inner sep=4pt,font=\small},
every picture/.style={line cap=round,line join=round}}
\newcommand{\VolI}[1]{\textup{[I,\,#1]}}
\newcommand{\Gs}{\mathcal{G}^{*}}
\newcommand{\Hs}{\mathcal{H}^{*}}
\newcommand{\Omcl}{\Om^{2}_{\mathrm{cl}}}
\newcommand{\BTc}{\B(T_{P})_{\mathrm{conn}}}
\newcommand{\Symp}{\operatorname{Symp}}
\newcommand{\Ham}{\operatorname{Ham}}
\newcommand{\Sp}{\operatorname{Sp}}
\newcommand{\Ad}{\operatorname{Ad}}
\newcommand{\Heis}{\mathsf{H}}
\newcommand{\Norm}{\operatorname{Norm}}
\newcommand{\Cl}{\operatorname{Cl}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\OK}{\mathcal{O}}
\newcommand{\fa}{\mathfrak{a}}
\newcommand{\fb}{\mathfrak{b}}
\newcommand{\fc}{\mathfrak{c}}
\newcommand{\fp}{\mathfrak{p}}
\newcommand{\fq}{\mathfrak{q}}
\newcommand{\fg}{\mathfrak{g}}
\newcommand{\fk}{\mathfrak{k}}
\newcommand{\fpp}{\mathfrak{s}}
\newcommand{\red}{\mathrm{red}}
\newcommand{\transp}{^{\mathsf{T}}}
\newcommand{\ParaSymp}{\cat{PSymp}}
\newcommand{\rel}{\nrightarrow}
\newcommand{\sem}[1]{\llbracket #1\rrbracket}
\newcommand{\Para}{\mathbf{Para}}
\newcommand{\hcsauthor}{Anonymous submission}
\newcommand{\hcsvenue}{higher-categorical-semantics.pages.dev}
\newcommand{\hcsdate}{27 November 2026}
\begin{document}
\frontmatter
\begin{titlepage}
\thispagestyle{empty}
\begin{center}
{\small\scshape\color{hcsgrey} Higher Categorical Semantics \textperiodcentered\ Monograph \textperiodcentered\ Volume II}\par
\vspace{2.0cm}
{\fontsize{32}{38}\selectfont\bfseries\color{hcsteal} Symplectic Diffeology in\\[0.35ex] Higher Categories\par}
\vspace{0.9cm}
{\Large\color{hcsink} Moment maps, prequantisation, and reduction\\[0.3ex]
behind Chapter~9 of Iglesias-Zemmour's \emph{Diffeology}\par}
\vspace{0.5cm}
{\large\itshape\color{hcsrust} with applications to arithmetic, cryptography,\\ machine learning, artificial intelligence, and system design\par}
\vspace{1.2cm}
\begin{tikzpicture}[x={(1cm,0cm)},y={(0.45cm,0.32cm)},z={(0cm,1cm)},scale=2.15]
\fill[hcsmist] (0,0,0)--(3.2,0,0)--(3.2,3.2,0)--(0,3.2,0)--cycle;
\foreach \i in {0,0.8,...,3.21}{\draw[hcsteal!35,line width=0.3pt] (\i,0,0)--(\i,3.2,0); \draw[hcsteal!35,line width=0.3pt] (0,\i,0)--(3.2,\i,0);}
\fill[hcsgold!45] (0.8,0.8,0)--(2.4,0.8,0)--(2.4,2.4,0)--(0.8,2.4,0)--cycle;
\draw[hcsink,line width=0.9pt,->] (0.8,0.8,0)--(2.4,0.8,0);
\draw[hcsink,line width=0.9pt,->] (2.4,0.8,0)--(2.4,2.4,0);
\draw[hcsink,line width=0.9pt,->] (2.4,2.4,0)--(0.8,2.4,0);
\draw[hcsink,line width=0.9pt,->] (0.8,2.4,0)--(0.8,0.8,0);
\node[hcsink,font=\small] at (1.6,1.6,0) {$\int\omega$};
\draw[hcsrust,line width=1.1pt] (0.8,0.8,1.6)--(2.4,0.8,1.6);
\draw[hcsrust,line width=1.1pt] (2.4,0.8,1.6)--(2.4,2.4,0.9);
\draw[hcsrust,line width=1.1pt] (2.4,2.4,0.9)--(0.8,2.4,0.9);
\draw[hcsrust,line width=1.1pt,->] (0.8,2.4,0.9)--(0.8,0.8,1.15);
\draw[hcsgrey,dashed,line width=0.5pt] (0.8,0.8,0)--(0.8,0.8,1.6);
\draw[hcsgrey,dashed,line width=0.5pt] (2.4,0.8,0)--(2.4,0.8,1.6);
\draw[hcsgrey,dashed,line width=0.5pt] (2.4,2.4,0)--(2.4,2.4,0.9);
\draw[hcsgrey,dashed,line width=0.5pt] (0.8,2.4,0)--(0.8,2.4,0.9);
\draw[hcsgold,line width=1.6pt,<->] (0.8,0.8,1.15)--(0.8,0.8,1.6);
\fill[hcsrust] (0.8,0.8,1.6) circle (1.1pt);
\end{tikzpicture}\par
\vspace{0.35cm}
{\footnotesize\color{hcsgrey} A horizontal lift of a closed path to the Heisenberg group, for the connection form $\lambda=\dd z+x\,\dd y$.\\
The lift closes up to a vertical translation equal to the enclosed area: curvature, holonomy, and the Weil pairing in one picture.\par}
\vfill
{\large \hcsauthor\par}
\vspace{0.4ex}
{\small\color{hcsgrey} Prepared for \texttt{\hcsvenue}\ \textperiodcentered\ \hcsdate\par}
\end{center}
\end{titlepage}
\chapter*{Abstract}
\thispagestyle{plain}
Chapter~9 of Patrick Iglesias-Zemmour's \emph{Diffeology} \cite{IZ} builds symplectic geometry on arbitrary diffeological spaces:
for every closed $2$-form $\omega$ on a space $X$ and every diffeological group $G$ of automorphisms of $(X,\omega)$ there is a
moment map, with values in a quotient of the space $\Gs$ of invariant $1$-forms on $G$, with no hypothesis of dimension,
non-degeneracy or smoothness of orbits. Volume~I of this series \cite{DHC} placed Chapters~1--8 of \cite{IZ} in the cohesive
$\infty$-topos $\Hh$ of smooth $\infty$-groupoids. This volume does the same for Chapter~9 and continues to prequantisation and
reduction.
\medskip\noindent
\textbf{Part I.} A closed $2$-form is a map $X\to\Omcl$ to a classifying sheaf with one point, and the category of
parasymplectic spaces is a slice of the topos of smooth sets. The moment map of \cite{IZ} is the transgression of $\omega$
along the orbits of $G$; for an invariant primitive $\alpha$ it is the obstruction to the descent of $\alpha$ to the homotopy
quotient $X\hquot G$. The coadjoint orbit attached to a homogeneous space is the coimage of an orbit map, in the sense of
the two factorisation systems of \VolI{Theorem~3.2}.
\medskip\noindent
\textbf{Part II.} A prequantisation is a lift of $\omega\colon X\to\Omcl$ to the stack $\BTc$ of principal bundles with
connection for a torus of periods $T_P=\R/P$, where $P\subset\R$ is any proper subgroup. Three theorems are proved for
arbitrary diffeological spaces and groups. \emph{(A)} An equivariant prequantum bundle $(Y,\lambda)$ has a canonical
equivariant moment map, $\mu(x)=\hat y^*\lambda$, the pullback of the connection form along an orbit map; the holonomy and
the Souriau class of \cite{IZ} vanish. \emph{(B)} The equivariant bundle is a map $X\hquot G\to\BTc$ exactly when $\mu=0$.
\emph{(C)} If $G$ acts principally on $\mu^{-1}(0)$ then the quotient $\mu^{-1}(0)/G$ carries a reduced closed $2$-form
and a reduced prequantum bundle with the same structure group, with no regularity hypothesis on the level set. Reduction
of $\C^2\times\C^2$ at an irrational level produces the prequantum bundle of $S^2\times S^2$ as the leaf space
$(S^3\times S^3)/\R$ of an irrational flow, with structure group an irrational torus.
\medskip\noindent
\textbf{Part III} consists of applications. In number theory, products $\R/\fa\times\R/\fb$ of one-dimensional tori attached to
ideals of a number field are classified up to diffeomorphism by the Steinitz class $[\fa\fb]$ and up to symplectomorphism
by the ideal $\fa\fb$, which is the group of periods; their symplectic mapping class groups are Hilbert modular groups, and
their prequantum bundles are Heisenberg quasi-nilmanifolds. In cryptography, the theta group of a polarised torus is the
group of automorphisms of its prequantum bundle over the translations, the Weil pairing is its commutator, isogenies that
preserve the polarisation are the quotients by isotropic subgroups, and the Gram--Schmidt profile of a symplectic lattice
basis, including the NTRU bases of the signature scheme Falcon, is symmetric. In machine learning, Noether's theorem holds
for actions of arbitrary diffeological groups, compact symmetries of a loss give conserved momenta of Hamiltonian
dynamics, non-compact symmetries give conserved quadratic forms of gradient flow, splitting integrators conserve
the momenta exactly, and the symmetry accelerates training in four ways, by the choice of a level, by motion along orbits,
by equivariant updates and by projection. In artificial intelligence, the momentum is a reachability invariant, the net motion produced by a cycle of
shape changes is a holonomy, and a two-body system with irrational inertia ratio has a first integral with values in an
irrational torus and none with values in a manifold. In system design, linear Lagrangian and Dirac relations compose,
isotropic correspondences of diffeological spaces compose with no transversality hypothesis, and reduction commutes with
interconnection. The common structure is stated in a final chapter: an objective on a quotient, a dynamics on an atlas, and
a connection whose exact part gives conserved quantities and whose non-closed part gives phases; without the metric it
holds in every $\infty$-topos, with it in a differentially cohesive $\infty$-topos, where the atlas of a quotient is a quotient by a formal group
followed by a formally \'etale map, and for the syntax of an algebraic theory it is the theory of normal forms. In a last chapter the
structure is made executable: architectures are terms of an initial algebra, the denotation, the two modes of differentiation and the
parameter symmetries are its homomorphisms, and by a compiler to JAX the specifications of five published networks become optimizers whose
forward and backward passes are selected at run time, and derivatives that are composites of the two modes are evaluated by plans of least
cost.
\medskip\noindent
The volume contains 31 numbered figures and a frontispiece, 19 tables, 79 numbered results and 79 solved exercises graded from
warm-up to proof.
\medskip\noindent
{\small\color{hcsgrey}\textbf{Keywords.} Diffeological space; closed $2$-form; moment map; Souriau cocycle; coadjoint orbit;
prequantisation; torus of periods; symplectic reduction; Heisenberg group; Weil pairing; symplectic lattice; Noether's theorem;
geometric phase; port-Hamiltonian system.\\
\textbf{MSC 2020.} 58A40, 53D20, 53D50, 18F10, 18N60, 11R29, 14K25, 94A60, 68T07, 93B27.}
\tableofcontents
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\markboth{Preface}{}
\section*{What this is}
The second volume of a categorical companion to \cite{IZ}. Volume~I \cite{DHC} is devoted to Chapters~1--8 of the book: plots,
the quasitopos $\Diff$, cohesion, shape, differential forms, fibre bundles and stacks. The present volume covers
Chapter~9, \emph{Symplectic Diffeology}, and to two subjects that follow it: prequantisation, for which
the integration bundles of art.~8.42 are the starting point, and symplectic reduction.
The method is the one of Volume~I. Each construction of the book is first stated in its own terms, with the article
number; it is then identified with a universal construction in the quasitopos $\Diff$, the topos $\SmSet$ of smooth sets
or the $\infty$-topos $\Hh=\Sh_\infty(\Cart)$; and the identification is used to prove something further. In Part~II the
further results are the three theorems (A), (B), (C) of the abstract, proved by elementary arguments with plots and valid
for every diffeological space and every diffeological group.
\section*{What is used from Volume I}
The reader needs the following, cited as \VolI{\dots}.
\begin{itemize}
\item A diffeological space is a concrete sheaf on the site $\Cart$ of Cartesian spaces; $\Diff\into\SmSet\into\Hh$ are full
embeddings \VolI{Theorems~2.2, 4.5}. Limits, colimits and function spaces exist in $\Diff$ \VolI{Theorems~1.6, 1.9}.
\item A differential $k$-form on $X$ is a map $X\to\Om^k$ in $\SmSet$. A form descends along a subduction $\pi\colon X\to B$ if and
only if it takes equal values on plots with equal projections, and $\pi^*$ is injective \VolI{Proposition~6.4}.
\item An action of a diffeological group $G$ on $X$ is \emph{principal} if $(g,x)\mapsto(x,gx)$ is an induction; this holds if
and only if the diffeological quotient is the homotopy quotient, $X/G\simeq X\hquot G$ \VolI{Theorem~7.2}. Principal bundles
are classified by maps to the stack $\B G$ \VolI{Theorem~7.5}; over a Cartesian space they are trivial \VolI{Lemma~7.4}.
\item For any action there are three quotients $X\hquot G\to\pi_0(X\hquot G)\to X/G$: stack, smooth set, diffeological space
\VolI{Theorem~7.8}.
\item A quasi-torus is a quotient $T_\Gamma=\R^n/\Gamma$ by a countable subgroup. Smooth maps between quasi-tori with dense
$\Gamma$ lift to affine maps \VolI{Theorem~9.1}.
\end{itemize}
\section*{Attribution}
A Theorem, Proposition or Lemma with a name or a reference in its heading is taken from the literature, and is given with that
reference and, when it is short, a proof. Every other numbered statement is proved in the text. Formalisation in a proof
assistant is the subject of a sequel; in \cref{ch:coda} the statements are sorted by the infrastructure required.
\section*{How to read}
Parts I and II are cumulative. The application chapters depend on them as follows.
\begin{center}
\begin{tikzpicture}[font=\small]
\node[hcsnode] (c1) at (0,0) {1 Closed $2$-forms};
\node[hcsnode] (c2) at (3.6,0) {2 Moment maps};
\node[hcsnode] (c3) at (7.2,0) {3 Coadjoint orbits};
\node[hcsnode] (c4) at (0,-1.25) {4 Prequantisation};
\node[hcsnode] (c5) at (3.6,-1.25) {5 Equivariance};
\node[hcsnode] (c6) at (7.2,-1.25) {6 Reduction};
\draw[->] (c1)--(c2); \draw[->] (c2)--(c3);
\draw[->,rounded corners=3pt] (c3.south) -- ++(0,-0.3) -| (c4.north);
\draw[->] (c4)--(c5); \draw[->] (c5)--(c6);
\end{tikzpicture}
\medskip
{\small
\begin{tabular}{@{}ll@{}}\toprule
application chapter & uses\\\midrule
7 Number theory & 1, 2, 4; \VolI{Chapters~9, 10}\\
8 Cryptography & 4, 5; \cref{ch:number-theory}\\
9 Machine learning & 2, 5, 6\\
10 Artificial intelligence & 2, 5, 6; \cref{ch:ml}\\
11 System design & 1, 6\\
12 The general structure & 5, 6; \cref{ch:ml,ch:ai,ch:systems}\\
13 Differentiable programs & \cref{ch:ml,ch:structure}; the package \texttt{dprog}\\\bottomrule
\end{tabular}}
\end{center}
\noindent Every chapter ends with solved exercises. Their level is marked by one to four stars: warm-up, computation,
argument, proof. Exercises of the fourth level are propositions of the text whose proofs were deferred.
\section*{Conventions}
Domains are open subsets of some $\R^n$; plots are defined on domains, or equivalently on Cartesian spaces. Manifolds are
finite-dimensional, Hausdorff and paracompact. Groups act on the left. For a diffeological group $G$, the space $\Gs$ of
momenta is the space of left-invariant $1$-forms on $G$ \IZ{art.~7.12}. A \emph{torus of periods} is a quotient $T_P=\R/P$ by a
subgroup $P\subsetneq\R$; its canonical $1$-form $\theta$ is the image of $\dd t$. The Heisenberg group of a bilinear form $B$
on a vector space $V$ is $\Heis_B=V\times\R$ with $(v,z)(v',z')=(v+v',\,z+z'-B(v,v'))$. References of the form
\IZ{art.~9.1} are to articles of \cite{IZ}.
\mainmatter
\part{Symplectic diffeology}
\chapter{Closed 2-forms}\label{ch:closed}
\chaptermark{Closed 2-forms}
\begin{chapabstract}
A parasymplectic space is a diffeological space with a closed $2$-form, that is, a map to the classifying sheaf $\Omcl$. The category
of parasymplectic spaces is a slice of the topos of smooth sets. We list the examples used throughout, compute the forms on
quasi-tori, recall the chain-homotopy operator $K$ that transgresses forms to path spaces, and prove a lemma on $1$-forms on
products that carries most of the proofs of Part~II.
\end{chapabstract}
\section{Parasymplectic spaces}
A differential $k$-form on a diffeological space $X$ assigns to every plot $P\colon U\to X$ a form $\omega(P)\in\Om^k(U)$, compatibly with
smooth reparametrisation \IZ{art.~6.28}. Equivalently it is a map $X\to\Om^k$ in $\SmSet$, where $\Om^k$ is the sheaf $U\mapsto\Om^k(U)$ on
$\Cart$ \VolI{\S6.1}. The exterior derivative is a map of sheaves $\dd\colon\Om^k\to\Om^{k+1}$, and its kernel in degree $2$ is the sheaf
$\Omcl$ of closed $2$-forms. The sheaf $\Omcl$ has exactly one point, since a $2$-form on $\R^0$ vanishes.
\begin{definition}\label{def:parasymplectic}
A \defn{parasymplectic space} is a pair $(X,\omega)$ of a diffeological space and a closed $2$-form $\omega\in\Om^2(X)$, $\dd\omega=0$.
A morphism $(X,\omega)\to(X',\omega')$ is a smooth map $f$ with $f^*\omega'=\omega$. The category is denoted $\ParaSymp$, and the group of
automorphisms of $(X,\omega)$, with the functional diffeology, is $\Dif(X,\omega)$.
\end{definition}
No condition of non-degeneracy is imposed. A diffeological space has no tangent spaces on which to state one, and in \cite{IZ} its role is
taken by a property of the universal moment map (\cref{ch:orbits}). The term parasymplectic is that of \cite{IZred}.
\begin{proposition}[The slice]\label{prop:slice}
\begin{enumerate}[label=\textup{(\roman*)}]
\item $\ParaSymp$ is the full subcategory of the slice topos $\SmSet/\Omcl$ on the objects $\omega\colon X\to\Omcl$ with $X$ diffeological, and
$\Dif(X,\omega)$ is the automorphism group of $\omega$ in the slice.
\item $\ParaSymp$ has pullbacks and equalisers, computed in $\Diff$. The product of $(X,\omega)$ and $(X',\omega')$ in $\ParaSymp$ is the
diffeological space
\[
X\times_\omega X'\;=\;X\times_{\Omcl}X',
\]
whose underlying set is $X\times X'$ and whose plots are the pairs of plots $(P,P')$ with $\omega(P)=\omega'(P')$.
\item The addition of forms $+\colon\Omcl\times\Omcl\to\Omcl$ induces a symmetric monoidal structure
$(X,\omega)\boxplus(X',\omega')=(X\times X',\ \pr_1^*\omega+\pr_2^*\omega')$ with unit the point, and $(X,\omega)\mapsto\overline{X}=(X,-\omega)$ is an
involution.
\end{enumerate}
\end{proposition}
\begin{proof}
(i) A map $X\to\Omcl$ is a closed $2$-form, and a map over $\Omcl$ is a smooth map compatible with the forms. (ii) Limits of connected diagrams
in a slice are computed in the ambient category, and $\Diff\into\SmSet$ preserves limits \VolI{Theorem~4.5}. The product in a slice is the fibre
product over the base. The fibre product $X\times_{\Omcl}X'$ is a subsheaf of the concrete sheaf $X\times X'$, hence concrete; its sections over
$U$ are the pairs $(P,P')$ with equal images in $\Omcl(U)$; and its points are all pairs $(x,x')$, because $\Omcl$ has one point. (iii) The sheaf
$\Omcl$ is an abelian group object, and the stated product is the composite $X\times X'\to\Omcl\times\Omcl\to\Omcl$.
\end{proof}
The space $X\times_\omega X'$ has the points of the product and fewer plots. It is used in \cref{ch:systems} as the universal isotropic
correspondence: a smooth map $(s,t)\colon L\to X\times X'$ factors through $X\times_\omega X'$ if and only if $s^*\omega=t^*\omega'$.
\begin{figure}[t]
\centering
\begin{tikzcd}[column sep=2.2em,row sep=2.6em]
X \arrow[rr,"f"] \arrow[dr,"\omega"'] && X' \arrow[dl,"\omega'"] & & X\times_\omega X' \arrow[r] \arrow[d] \arrow[dr,phantom,"\lrcorner",very near start] & X' \arrow[d,"\omega'"] & X\times X' \arrow[r,"\omega\times\omega'"] \arrow[dr,"\omega\boxplus\omega'"'] & \Omcl\times\Omcl \arrow[d,"+"]\\
& \Omcl & & & X \arrow[r,"\omega"'] & \Omcl & & \Omcl
\end{tikzcd}
\caption{Parasymplectic spaces as objects over $\Omcl$: a morphism, the product in the slice, and the monoidal sum.}\label{fig:slice}
\end{figure}
\section{Examples}
\begin{example}[Manifolds]\label{ex:manifolds}
A manifold with a closed $2$-form is a parasymplectic space, and $\ParaSymp$ contains the category of presymplectic manifolds and
form-preserving maps as a full subcategory. Symplectic manifolds are characterised inside $\ParaSymp$ by \cref{thm:coadjoint}.
\end{example}
\begin{example}[Dimension one]\label{ex:dim1}
Every $2$-form on the irrational torus $\Tal=\R/(\Z+\alpha\Z)$ vanishes: its pullback to $\R$ is a $2$-form on a $1$-manifold, and pullback
along a subduction is injective. The same holds for every quotient of a $1$-manifold.
\end{example}
\begin{proposition}[Forms on quasi-tori]\label{prop:forms-quasitori}
Let $\Gamma\subset\R^n$ be a dense subgroup and $q\colon\R^n\to T_\Gamma=\R^n/\Gamma$ the projection. Then $q^*$ identifies $\Om^k(T_\Gamma)$ with the
space $\Lambda^k(\R^n)^*$ of constant $k$-forms. Every form on $T_\Gamma$ is closed, and $(T_\Gamma,\omega_\Omega)$ is a parasymplectic space for every
alternating bilinear form $\Omega$ on $\R^n$.
\end{proposition}
\noindent The proof is \cref{exo:forms-quasitori}. For $n=2$ and $\Gamma$ of rank at least $3$ these are the \emph{symplectic irrational tori} of
\IZ{art.~9.30}; their arithmetic is the subject of \cref{ch:number-theory}.
\begin{example}[The cone orbifold]\label{ex:cone}
Let $Q_m=\C/\Z_m$ be the quotient of the plane by the rotations of order $m$, identified with $\C$ by $z\mapsto w=z^m$. The form
$\dd x\wedge\dd y$ is invariant under rotations and descends to a closed $2$-form $\omega_m$ on $Q_m$, and every $2$-form on $Q_m$ is
$f\,\omega_m$ for a smooth function $f$ \IZ{art.~9.32}. In the coordinate $w=u+iv$ of the regular stratum, $\omega_m=m^{-2}\abs w^{2/m-2}\,\dd u\wedge\dd v$
(\cref{exo:cone-form}): a smooth form on $Q_m$ whose coefficient in the coordinate $w$ is singular at the origin.
\end{example}
\begin{example}[Infinite dimensions]\label{ex:infinite}
On the Hilbert space $\mathcal H$ of square-summable complex sequences with the fine diffeology, $\alpha=\tfrac1{2i}\sum_k(\bar z_k\,\dd z_k-z_k\,\dd\bar z_k)$
is a $1$-form, $\omega=\dd\alpha$ is a closed $2$-form, and both restrict to the unit sphere and descend to the infinite projective space
\IZ{art.~9.33}. The spaces of this example are diffeological vector spaces and their quotients; none is a Banach manifold with its usual
structure.
\end{example}
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\fill[hcsmist] (0,0) rectangle (2.6,2.6);
\draw[hcsteal] (0,0) rectangle (2.6,2.6);
\foreach \k in {1,...,34}{
\pgfmathsetmacro{\a}{2.6*(\k*0.6180339-floor(\k*0.6180339))}
\pgfmathsetmacro{\b}{2.6*(\k*0.4142135-floor(\k*0.4142135))}
\fill[hcsrust] (\a,\b) circle (0.9pt);}
\fill[hcsgold,opacity=0.5] (0.4,0.5)--(1.3,0.6)--(1.5,1.4)--(0.6,1.3)--cycle;
\node at (0.95,0.95) {$\Omega$};
\node[below,align=center] at (1.3,-0.1) {$\R^2/\Gamma$, $\Gamma$ dense:\\ constant forms};
\end{scope}
\begin{scope}[xshift=4.6cm,yshift=1.3cm]
\fill[hcsmist] (0,0) -- (0:1.3) arc (0:72:1.3) -- cycle;
\draw[hcsteal] (0,0) -- (0:1.3); \draw[hcsteal] (0,0)--(72:1.3);
\draw[hcsteal,dashed] (0:1.3) arc (0:72:1.3);
\draw[->,hcsrust] (0:0.8) arc (0:72:0.8);
\node[hcsrust] at (36:1.05) {$\zeta$};
\fill (0,0) circle (1.3pt) node[below left] {$0$};
\node[below,align=center] at (0.65,-1.4) {$Q_m=\C/\Z_m$:\\ $\dd x\wedge\dd y$ descends};
\end{scope}
\begin{scope}[xshift=8.3cm,yshift=1.3cm]
\shade[ball color=hcsmist] (0,0) circle (0.85);
\shade[ball color=hcssand] (2.0,0) circle (0.6);
\node at (1.05,0) {$\times$};
\node at (0,-1.05) {$2\pi c_1$};
\node at (2.0,-0.82) {$2\pi c_2$};
\node[below,align=center] at (1.0,-1.4) {$S^2\times S^2$:\\ periods $2\pi(c_1\Z+c_2\Z)$};
\end{scope}
\end{tikzpicture}
\caption{Three parasymplectic spaces used throughout: a symplectic quasi-torus, the cone orbifold, and a product of spheres with
incommensurable areas.}\label{fig:examples}
\end{figure}
\section{Transgression to paths}
The space $\Paths(X)=\cinf(\R,X)$ carries the functional diffeology, and $\hat0,\hat1\colon\Paths(X)\to X$ are the evaluations at $0$ and $1$.
\begin{theorem}[The chain-homotopy operator, \IZ{art.~6.83--6.86}]\label{thm:K}
For every diffeological space $X$ and every $k\ge1$ there is a linear operator $K\colon\Om^k(X)\to\Om^{k-1}(\Paths(X))$ such that
\begin{equation}\label{eq:K}
K\circ\dd+\dd\circ K=\hat1^*-\hat0^* ,
\end{equation}
natural in $X$: for a smooth $f\colon X\to X'$ with induced $f_*\colon\Paths(X)\to\Paths(X')$, one has $K\circ f^*=(f_*)^*\circ K$. For a plot
$\Phi\colon U\to\Paths(X)$ with adjunct $\tilde\Phi\colon U\times\R\to X$,
\[
(K\omega)(\Phi)=\int_0^1\bigl(\iota_{\partial_t}\tilde\Phi^*\omega\bigr)\big|_{U\times\{t\}}\,\dd t .
\]
For $k=1$, $K\alpha$ is the function $p\mapsto\int_p\alpha$.
\end{theorem}
The operator is integration along the fibres of $\Paths(X)\times[0,1]\to\Paths(X)$ of the pullback of $\omega$ by the evaluation map, and
\eqref{eq:K} is Stokes' formula for that fibre. If $\omega$ is closed then by \eqref{eq:K} the restriction of $K\omega$ to $\Loops(X)$ is closed.
\begin{definition}[\IZ{art.~8.42}]\label{def:periods}
Let $(X,\omega)$ be parasymplectic. The \defn{group of periods} $P_\omega\subset\R$ is the group of the integrals of $K\omega$ over the loops in
$\Loops(X)$. A smooth map $S\colon T^2\to X$ has the \emph{toric period} $\int_{T^2}S^*\omega\in P_\omega$.
\end{definition}
\begin{example}\label{ex:periods}
For the quasi-torus $(T_\Gamma,\omega_\Omega)$ and $\gamma,\gamma'\in\Gamma$, the map $(s,t)\mapsto q(s\gamma+t\gamma')$ is defined on $T^2$ and has toric
period $\Omega(\gamma,\gamma')$. So $P_\omega\supseteq\Omega(\Gamma\wedge\Gamma)$, the subgroup generated by the values of $\Omega$ on $\Gamma$. For
$S^2\times S^2$ with the form $c_1\omega_1+c_2\omega_2$, where $\int_{S^2}\omega_i=2\pi$, the group of periods is $2\pi(c_1\Z+c_2\Z)$: it is dense in
$\R$ when $c_1/c_2$ is irrational.
\end{example}
\section{One-forms on products}
The following lemma replaces, for $1$-forms, the decomposition of a tangent vector to a product into its two components.
\begin{lemma}[Slices]\label{lem:slices}
Let $A$ and $B$ be diffeological spaces. A $1$-form $\beta$ on $A\times B$ is determined by its restrictions to the slices $A\times\{b\}$ and
$\{a\}\times B$. Precisely, for plots $P\colon U\to A$ and $Q\colon U\to B$ let $\beta_1,\beta_2$ be the components of $\beta(P\times Q)\in\Om^1(U\times U)$
along the two factors; then
\begin{equation}\label{eq:slices}
\beta(P,Q)=\Delta^*\beta(P\times Q),\quad \beta_1|_{U\times\{s\}}=\beta\bigl(P,\mathrm{const}_{Q(s)}\bigr),\quad \beta_2|_{\{r\}\times U}=\beta\bigl(\mathrm{const}_{P(r)},Q\bigr),
\end{equation}
where $\Delta\colon U\to U\times U$ is the diagonal.
\end{lemma}
\noindent The proof is \cref{exo:slices}. The statement is false for $2$-forms: $\dd x\wedge\dd y$ on $\R\times\R$ restricts to zero on every slice.
\begin{corollary}\label{cor:product-momenta}
Let $G$ act smoothly on $Y$, with action map $\Phi\colon G\times Y\to Y$, and let $\lambda\in\Om^1(Y)$. Then $\Phi^*\lambda=\pr_Y^*\lambda$ on $G\times Y$ if and only
if $g_Y^*\lambda=\lambda$ for every $g\in G$ and $\hat y^*\lambda=0$ for every $y\in Y$, where $\hat y\colon G\to Y$ is the orbit map $g\mapsto g\cdot y$.
\end{corollary}
\begin{proof}
Apply \cref{lem:slices} to $\beta=\Phi^*\lambda-\pr_Y^*\lambda$. Its restriction to $\{g\}\times Y$ is $g_Y^*\lambda-\lambda$, and its restriction to
$G\times\{y\}$ is $\hat y^*\lambda$, because $\pr_Y$ is constant on that slice.
\end{proof}
\exercisesheading
\begin{exercise}[label=exo:dim1]{1}
Show that a closed $2$-form on a quotient $M/{\sim}$ of a surface $M$ by an equivalence relation is determined by a closed $2$-form on $M$, and that
on a quotient of a curve it vanishes.
\end{exercise}
\begin{solution}
The projection $q\colon M\to M/{\sim}$ is a subduction, so $q^*$ is injective on forms \VolI{Proposition~6.4}. A form $\omega$ on the quotient is therefore
determined by $q^*\omega\in\Om^2(M)$, which is closed. If $M$ is a curve then $\Om^2(M)=0$.
\end{solution}
\begin{exercise}[label=exo:cone-form]{2}
Verify the formula $\omega_m=m^{-2}\abs w^{2/m-2}\,\dd u\wedge\dd v$ of \cref{ex:cone} on the regular stratum of $Q_m$, and show that the form
$\dd u\wedge\dd v$ in the coordinate $w$ is also a smooth $2$-form on $Q_m$. Which function $f$ gives $\dd u\wedge\dd v=f\,\omega_m$?
\end{exercise}
\begin{solution}
The projection is $\pi_m(z)=z^m=w$. For a holomorphic map, $\pi_m^*(\dd u\wedge\dd v)=\abs{\pi_m'(z)}^2\dd x\wedge\dd y=m^2\abs z^{2m-2}\dd x\wedge\dd y$. Since
$\abs z=\abs w^{1/m}$, on the regular stratum $\dd x\wedge\dd y=\pi_m^*\bigl(m^{-2}\abs w^{2/m-2}\dd u\wedge\dd v\bigr)$, which is the formula. For the second
statement, the plots of $Q_m$ are locally of the form $\varphi^m$ with $\varphi$ a smooth parametrisation in $\C$ \IZ{art.~9.32}, so they are
smooth parametrisations in $\C$ and every form on the manifold $\C$ restricts to a form on $Q_m$. By the first computation
$\dd u\wedge\dd v=f\omega_m$ with $f(w)=m^2\abs w^{2-2/m}$, and $f\circ\pi_m=m^2\abs z^{2m-2}$ is smooth, so $f$ is a smooth function on $Q_m$.
\end{solution}
\begin{exercise}[label=exo:graph]{2}
Let $f\colon X\to X'$ be a smooth map between parasymplectic spaces. Show that the following are equivalent: \textup{(a)} $f^*\omega'=\omega$;
\textup{(b)} the graph $(\id,f)\colon X\to\overline X\boxplus X'$ pulls the form back to zero; \textup{(c)} the graph is a smooth map
$X\to X\times_\omega X'$.
\end{exercise}
\begin{solution}
The form of $\overline X\boxplus X'$ is $\pr_2^*\omega'-\pr_1^*\omega$, and its pullback by $(\id,f)$ is $f^*\omega'-\omega$; so (a)$\iff$(b). For a plot $P$ of
$X$, the pair $(P,f\circ P)$ is a plot of $X\times_\omega X'$ if and only if $\omega(P)=\omega'(f\circ P)=(f^*\omega')(P)$; so (a)$\iff$(c).
\end{solution}
\begin{exercise}[label=exo:forms-quasitori]{3}
Prove \cref{prop:forms-quasitori}.
\end{exercise}
\begin{solution}
Let $\omega\in\Om^k(T_\Gamma)$ and $\tilde\omega=q^*\omega\in\Om^k(\R^n)$. For $\gamma\in\Gamma$ the translation $t_\gamma$ satisfies $q\circ t_\gamma=q$, so
$t_\gamma^*\tilde\omega=\tilde\omega$: the coefficients of $\tilde\omega$ are smooth functions invariant under a dense group of translations, hence constant.
Conversely let $\tilde\omega$ be a constant form, and let $P,P'$ be plots of $\R^n$ with $q\circ P=q\circ P'$. Then $P'-P$ is continuous with values in the
countable set $\Gamma$, so it is locally constant, $P'=t_\gamma\circ P$ locally, and $\tilde\omega(P')=\tilde\omega(P)$. By the descent criterion
\VolI{Proposition~6.4} there is a unique $\omega$ with $q^*\omega=\tilde\omega$. Since $q^*$ is injective and commutes with $\dd$, and constant forms are closed,
every form on $T_\Gamma$ is closed.
\end{solution}
\begin{exercise}[label=exo:slices]{4}
Prove \cref{lem:slices}.
\end{exercise}
\begin{solution}
The plot $(P,Q)\colon U\to A\times B$ is the composite of the diagonal $\Delta$ with the plot $P\times Q\colon U\times U\to A\times B$, $(r,s)\mapsto(P(r),Q(s))$,
so $\beta(P,Q)=\Delta^*\beta(P\times Q)$ by the compatibility of a form with reparametrisation. Write $\beta(P\times Q)=\beta_1+\beta_2$, where $\beta_1$ is a
combination of the $\dd r_i$ and $\beta_2$ of the $\dd s_j$, with coefficients smooth in $(r,s)$. The restriction of $\beta(P\times Q)$ to
$U\times\{s\}$ is the value of $\beta$ on the plot $r\mapsto(P(r),Q(s))$, which is the plot $(P,\mathrm{const}_{Q(s)})$ of the slice $A\times\{Q(s)\}$; and
that restriction is $\beta_1|_{U\times\{s\}}$, because the $\dd s_j$ vanish on the slice. The same argument gives $\beta_2$. Hence the restrictions of
$\beta$ to the slices determine $\beta_1$ and $\beta_2$ for every pair of plots, and so determine $\beta(P,Q)$. Every plot of $A\times B$ is of the form
$(P,Q)$, so $\beta$ is determined.
\end{solution}
\chapter{Moment maps}\label{ch:moment}
\chaptermark{Moment maps}
\begin{chapabstract}
For a diffeological group $G$ acting on a parasymplectic space, a moment map is constructed in \cite{IZ,IZmoment} with values in a quotient of the space of
momenta of $G$. We state the construction and its properties with the article numbers, compute the examples, and identify the moment map in
the exact case as the obstruction to the descent of a primitive to the homotopy quotient.
\end{chapabstract}
\section{Momenta}
\begin{definition}[\IZ{art.~7.12, 7.15}]\label{def:momenta}
Let $G$ be a diffeological group, with left and right multiplications $L(g)\colon k\mapsto gk$ and $R(g)\colon k\mapsto kg$. The space of
\defn{momenta} of $G$ is the vector space
\[
\Gs=\set{\alpha\in\Om^1(G)\mid L(g)^*\alpha=\alpha\ \text{for all }g\in G},
\]
with the functional diffeology. The \defn{coadjoint action} of $G$ on $\Gs$ is $\Ad_*(g)(\alpha)=\Ad(g^{-1})^*\alpha=R(g)^*\alpha$.
\end{definition}
The notation recalls the dual of a Lie algebra, and for a Lie group $\Gs$ is that dual, a left-invariant $1$-form being determined by its value
at the identity. In general $\Gs$ is defined by invariance and by no duality.
\begin{example}\label{ex:momenta}
\begin{enumerate}[label=\textup{(\alph*)}]
\item If $G$ is discrete, every form of positive degree on $G$ vanishes and $\Gs=0$.
\item For a torus of periods $T_P=\R/P$, the pullback of a momentum to $\R$ is a translation-invariant $1$-form, so $\Gs=\R\,\theta$. For a
quasi-torus $\R^n/\Gamma$, and for the vector group $\R^n$ itself, $\Gs=(\R^n)^*$, and the coadjoint action is trivial.
\item For $G=\Dif(X,\omega)$ the space $\Gs_\omega$ is infinite-dimensional in general; it is the target of the universal moment map of
\cref{ch:orbits}.
\end{enumerate}
\end{example}
\section{The paths moment map}
Let $(X,\omega)$ be a parasymplectic space and $\rho\colon G\to\Dif(X,\omega)$ a smooth action, written $g\cdot x$. For a path $p\in\Paths(X)$ let
$\hat p\colon G\to\Paths(X)$ be the orbit map $g\mapsto g\circ p$.
\begin{theorem}[The paths moment map, \IZ{art.~9.1--9.6}]\label{thm:paths-moment}
The $1$-form $\Psi(p)=\hat p^*(K\omega)$ on $G$ is left-invariant, and the \defn{paths moment map} $\Psi\colon\Paths(X)\to\Gs$ is smooth. Moreover:
\begin{enumerate}[label=\textup{(\roman*)}]
\item $\Psi(p\vee p')=\Psi(p)+\Psi(p')$ for composable stationary paths;
\item $\Psi(g\circ p)=\Ad_*(g)\bigl(\Psi(p)\bigr)$;
\item $\dd\,\Psi(p)=\hat x_1^*\omega-\hat x_0^*\omega$, where $x_i=p(i)$ and $\hat x\colon G\to X$ is the orbit map of a point;
\item $\Psi(p)=\Psi(p')$ if $p$ and $p'$ are homotopic with fixed ends.
\end{enumerate}
For a plot $P\colon U\to G$, with $\tilde a\colon U\times\R\to X$, $\tilde a(r,t)=P(r)\cdot p(t)$,
\begin{equation}\label{eq:Psi}
\Psi(p)(P)=\int_0^1\bigl(\iota_{\partial_t}\tilde a^*\omega\bigr)\big|_{U\times\{t\}}\,\dd t .
\end{equation}
\end{theorem}
\noindent Left-invariance follows from the naturality of $K$ and the invariance of $\omega$, and \eqref{eq:Psi} is the formula of \cref{thm:K};
for a manifold it is the formula $\Psi(p)(P)_r(\delta r)=\int_0^1\omega\bigl(\dot p(t),\delta p(t)\bigr)\dd t$ of \IZ{art.~9.20}. Parts (ii) and (iii) are
\cref{exo:Psi}.
Formula \eqref{eq:Psi} has a geometric content (\cref{fig:strip}). A plot of $G$ moves the path $p$ and sweeps a strip in $X$; the moment
$\Psi(p)$ evaluated on the plot is the integral of $\omega$ over the strip, in the direction of the path. In the language of \cref{ch:closed}:
$\Psi(p)$ is the transgression of $\omega$ along the map $G\times[0,1]\to X$, $(g,t)\mapsto g\cdot p(t)$.
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\fill[hcsgold!35] (0,0) .. controls (1.2,0.9) and (2.4,-0.3) .. (3.6,0.5) -- (3.9,1.7) .. controls (2.7,0.9) and (1.5,2.1) .. (0.3,1.2) -- cycle;
\draw[hcsink,line width=0.9pt,->] (0,0) .. controls (1.2,0.9) and (2.4,-0.3) .. (3.6,0.5) node[right]{$p$};
\draw[hcsteal,line width=0.9pt,->] (0.3,1.2) .. controls (1.5,2.1) and (2.7,0.9) .. (3.9,1.7) node[right]{$g\circ p$};
\draw[hcsrust,->] (0,0)--(0.3,1.2); \draw[hcsrust,->] (3.6,0.5)--(3.9,1.7);
\node[hcsrust,left] at (0.1,0.65) {$\hat x_0$}; \node[hcsrust,right] at (3.8,1.05) {$\hat x_1$};
\node at (1.95,0.85) {$\int\omega$};
\fill (0,0) circle (1.2pt) node[below]{$x_0$}; \fill (3.6,0.5) circle (1.2pt) node[below]{$x_1$};
\end{scope}
\begin{scope}[xshift=6.6cm,yshift=0.2cm]
\node (P) at (0,1.6) {$\Paths(X)$}; \node (G) at (3.2,1.6) {$\Gs$};
\node (XX) at (0,0) {$X\times X$}; \node (GG) at (3.2,0) {$\Gs/\Gamma$};
\node (X) at (0,-1.4) {$X$};
\draw[->] (P)--node[above]{$\Psi$}(G); \draw[->] (XX)--node[above]{$\psi$}(GG);
\draw[->] (P)--node[left]{ends}(XX); \draw[->] (G)--node[right]{class}(GG);
\draw[->] (X)--node[below right]{$\mu$}(GG);
\draw[->,dashed] (XX)--node[left]{$\mu(x')-\mu(x)$}(X);
\end{scope}
\end{tikzpicture}
\caption{Left: the paths moment map integrates $\omega$ over the strip swept by a path under a plot of $G$; its differential is carried by the two
ends. Right: the passage from the paths moment map to the two-points moment map and to a moment map.}\label{fig:strip}
\end{figure}
\section{Holonomy, moment maps, and the Souriau class}
From now on $X$ is connected.
\begin{theorem}[\IZ{art.~9.7--9.10}]\label{thm:moment}
Let $G$ act on the connected parasymplectic space $(X,\omega)$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item \emph{Holonomy.} $\Gamma=\Psi(\Loops(X))$ is a subgroup of $\Gs$, the image of a homomorphism $\pi_1(X)\to\Gs$. Its elements are closed and
invariant under the coadjoint action.
\item \emph{Two-points moment map.} There is a unique smooth $\psi\colon X\times X\to\Gs/\Gamma$ with $\psi(p(0),p(1))=\mathrm{class}\,\Psi(p)$. It satisfies
$\psi(x,x'')=\psi(x,x')+\psi(x',x'')$ and $\psi(g x,g x')=\Ad_*^\Gamma(g)\,\psi(x,x')$.
\item \emph{Moment maps.} There is a smooth $\mu\colon X\to\Gs/\Gamma$ with $\psi(x,x')=\mu(x')-\mu(x)$, unique up to an additive constant.
\item \emph{Souriau cocycle.} The map $\theta(g)=\mu(g x)-\Ad_*^\Gamma(g)\,\mu(x)$ is independent of $x$ and satisfies
$\theta(gg')=\Ad_*^\Gamma(g)\,\theta(g')+\theta(g)$. Its class $\sigma\in H^1(G,\Gs/\Gamma)$ is independent of the choice of $\mu$.
\end{enumerate}
The action is called \defn{Hamiltonian} if $\Gamma=0$ and \defn{exact} if $\sigma=0$, that is, if some moment map is equivariant.
\end{theorem}
Two features distinguish this from the classical definition. The moment map exists for every action that preserves $\omega$; the obstructions
appear in its target $\Gs/\Gamma$ and in the class $\sigma$. And the target is in general a diffeological space that is not a vector space: for the
translations of a quasi-torus it is again a quasi-torus (\cref{prop:dual-torus}).
\begin{theorem}[The exact case, \IZ{art.~9.11}]\label{thm:exact}
Suppose $\omega=\dd\alpha$ with $\alpha$ invariant under $G$. Then $\Psi(p)=\hat x_1^*\alpha-\hat x_0^*\alpha$, the action is Hamiltonian and exact, and
\[
\mu\colon X\to\Gs,\qquad\mu(x)=\hat x^*\alpha,
\]
is an equivariant moment map.
\end{theorem}
\begin{proof}
By \eqref{eq:K}, $K\omega=K\dd\alpha=\hat1^*\alpha-\hat0^*\alpha-\dd(K\alpha)$. The function $K\alpha\circ\hat p$ is $g\mapsto\int_{g\circ p}\alpha=\int_pg^*\alpha=\int_p\alpha$, a
constant; so $\hat p^*\dd(K\alpha)=0$ and $\Psi(p)=(\hat1\circ\hat p)^*\alpha-(\hat0\circ\hat p)^*\alpha$, with $\hat\imath\circ\hat p=\hat x_i$. For a loop this
vanishes. Equivariance: $\widehat{g x}=\hat x\circ R(g)$, so $\mu(gx)=R(g)^*\mu(x)=\Ad_*(g)\mu(x)$.
\end{proof}
\section{The moment map as an obstruction to descent}
For an action with action map $a\colon G\times X\to X$, the homotopy quotient $X\hquot G$ is the colimit in $\Hh$ of the simplicial object
$\cdots G\times G\times X\to G\times X\rightrightarrows X$ \VolI{\S7.2}. Since $\Om^k$ is a sheaf of sets, a map $X\hquot G\to\Om^k$ is a form on $X$ whose
two pullbacks to $G\times X$ coincide:
\begin{equation}\label{eq:basic}
\Om^k(X\hquot G)=\set{\beta\in\Om^k(X)\mid a^*\beta=\pr_X^*\beta}.
\end{equation}
\begin{proposition}[Basic forms]\label{prop:basic}
\begin{enumerate}[label=\textup{(\roman*)}]
\item If the action is principal, $\pi^*$ identifies $\Om^k(X/G)$ with the space \eqref{eq:basic}.
\item For $k=1$ the condition $a^*\beta=\pr_X^*\beta$ holds if and only if $\beta$ is invariant and $\hat x^*\beta=0$ for every $x\in X$.
\item If $\alpha$ is an invariant $1$-form with $\dd\alpha=\omega$ and $\mu$ is the moment map of \cref{thm:exact}, then $a^*\alpha-\pr_X^*\alpha$ is the
$1$-form on $G\times X$ whose restriction to $G\times\{x\}$ is $\mu(x)$ and whose restriction to $\{g\}\times X$ is zero. In particular $\alpha$ is a
$1$-form on $X\hquot G$ if and only if $\mu=0$.
\end{enumerate}
\end{proposition}
\noindent The proof is \cref{exo:basic}. Part (iii) is the first appearance of the theme of Part~II: \emph{the moment map is the component along
$G$ of the difference of the two pullbacks to $G\times X$.} Invariance is a condition on each slice $\{g\}\times X$; the moment map is the
remaining condition on the slices $G\times\{x\}$.
\section{Examples}
\begin{example}[Rotations]\label{ex:rotations}
On $\C$ with $\omega=\dd x\wedge\dd y=\dd\alpha$, $\alpha=\tfrac12(x\,\dd y-y\,\dd x)$, the circle $S^1=\R/2\pi\Z$ acts by rotations and preserves $\alpha$. The
orbit map of $z$ is $\varphi\mapsto e^{i\varphi}z$, and $\hat z^*\alpha=\tfrac12\abs z^2\dd\varphi$: the moment map is $\mu(z)=\tfrac12\abs z^2$ in the basis
$\dd\varphi$ of $\Gs$. On the cone orbifold $Q_m$ the moment map of the residual circle is $\mu_m(w)=\tfrac1{2m}\abs w^{2/m}$
(\cref{exo:cone-moment}).
\end{example}
\begin{example}[Translations, \IZ{art.~9.30}]\label{ex:translations}
The group $G=\R^n$ acts on itself by translations and preserves every constant $2$-form $\Omega$. By \eqref{eq:Psi}, for a path from $x$ to $y$,
$\Psi(p)=\Omega(y-x,\cdot)\in(\R^n)^*$. The holonomy is trivial, the moment maps are $\mu(x)=\Omega(x,\cdot)+c$, and the Souriau cocycle is
$\theta(u)=\Omega(u,\cdot)$, because the coadjoint action is trivial. The class $\sigma$ is not zero unless $\Omega=0$: no moment map is equivariant.
In \cref{ch:equivariant} the class $\sigma$ is identified with the commutator of the Heisenberg group.
\end{example}
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\foreach \r in {0.4,0.8,1.2} \draw[hcsteal,line width=0.6pt] (0,0) circle (\r);
\fill (0,0) circle (1.2pt);
\draw[->,hcsrust,line width=0.7pt] (20:1.2) arc (20:70:1.2);
\draw[->,line width=0.6pt] (1.7,0)--node[above]{$\mu$}(2.7,0);
\draw[hcsink,line width=1pt,->] (3.2,-1.2)--(3.2,1.3) node[right]{$\tfrac12\abs z^2$};
\foreach \y in {-0.95,-0.45,0.4} \fill[hcsteal] (3.2,\y) circle (1.4pt);
\fill (3.2,-1.2) circle (1.2pt);
\node[below,align=center] at (1.6,-1.45) {rotations of $\C$ and of $Q_m$:\\ levels are circles};
\end{scope}
\begin{scope}[xshift=6.4cm,yshift=-1.1cm]
\fill[hcsmist] (0,0) rectangle (2.2,2.2); \draw[hcsteal] (0,0) rectangle (2.2,2.2);
\foreach \k in {1,...,21}{
\pgfmathsetmacro{\a}{2.2*(\k*0.6180339-floor(\k*0.6180339))}
\pgfmathsetmacro{\b}{2.2*(\k*0.4142135-floor(\k*0.4142135))}
\fill[hcsrust] (\a,\b) circle (0.8pt);}
\draw[->,hcsink,line width=0.9pt] (0.4,0.4)--(1.5,0.8) node[right]{$x$};
\draw[->,line width=0.6pt] (2.6,1.1)--node[above]{$\mu$}node[below]{$\cong$}(3.6,1.1);
\fill[hcssand] (4.0,0) rectangle (6.2,2.2); \draw[hcsgold] (4.0,0) rectangle (6.2,2.2);
\foreach \k in {1,...,21}{
\pgfmathsetmacro{\a}{2.2*(\k*0.6180339-floor(\k*0.6180339))}
\pgfmathsetmacro{\b}{2.2*(\k*0.4142135-floor(\k*0.4142135))}
\fill[hcsrust] (6.2-\b,\a) circle (0.8pt);}
\draw[->,hcsink,line width=0.9pt] (5.8,0.4)--(5.4,1.5) node[above]{$\Omega(x,\cdot)$};
\node[below,align=center] at (3.1,-0.35) {translations of $\R^n/\Gamma$: the moment map is a\\ diffeomorphism onto $(\R^n)^*/\Omega(\Gamma,\cdot)$};
\end{scope}
\end{tikzpicture}
\caption{Two moment maps. For rotations the target is the line $\Gs$ and the levels are the orbits. For the translations of a symplectic
quasi-torus the target is a quotient of $\Gs$ by the holonomy, and the moment map is an isomorphism.}\label{fig:moment-examples}
\end{figure}
\begin{proposition}[The moment map of a quasi-torus]\label{prop:dual-torus}
Let $\Gamma\subset\R^n$ be a subgroup and $\Omega$ a non-degenerate alternating form. For the action of $\R^n$ on $(T_\Gamma,\omega_\Omega)$ by translations, the
holonomy is $\Omega(\Gamma,\cdot)\subset(\R^n)^*$, and the moment map
\[
\mu\colon T_\Gamma=\R^n/\Gamma\longrightarrow(\R^n)^*/\Omega(\Gamma,\cdot),\qquad[x]\mapsto[\Omega(x,\cdot)]
\]
is a diffeomorphism onto a quasi-torus. The action is Hamiltonian only if $\Gamma=0$.
\end{proposition}
\begin{proof}
A loop in $T_\Gamma$ lifts to a path in $\R^n$ from $x$ to $x+\gamma$, and the paths moment maps of $T_\Gamma$ and $\R^n$ correspond under the
projection, by naturality of $K$; so $\Gamma_{\mathrm{hol}}=\Omega(\Gamma,\cdot)$ by \cref{ex:translations}. The linear isomorphism $x\mapsto\Omega(x,\cdot)$ maps $\Gamma$
onto $\Omega(\Gamma,\cdot)$ and induces a diffeomorphism of the quotients, which is a moment map by the same naturality.
\end{proof}
So a symplectic quasi-torus is identified by its own moment map with a quotient of the space of momenta of its group of translations. This is
the first instance of the statement of \cref{ch:orbits} that homogeneous symplectic spaces are coadjoint orbits.
\exercisesheading
\begin{exercise}[label=exo:momenta]{1}
Compute the momenta and the coadjoint action for \textup{(a)} the group $\Z+\alpha\Z\subset\R$ with the subspace diffeology, \textup{(b)} the irrational torus
$\Tal$, \textup{(c)} the affine group of the line.
\end{exercise}
\begin{solution}
(a) The plots of a countable subgroup of $\R$ with the subspace diffeology are locally constant, so the group is discrete and $\Gs=0$. (b)
$\Gs=\R\theta$ by \cref{ex:momenta}(b), with trivial coadjoint action since the group is abelian. (c) $G=\set{x\mapsto ax+b}$ is a Lie group with
coordinates $(a,b)$, $a>0$ on the identity component. The left-invariant forms are spanned by $\dd a/a$ and $\dd b/a$. Right multiplication by
$(a_0,b_0)$ is $(a,b)\mapsto(aa_0,ab_0+b)$, so $\Ad_*(a_0,b_0)$ fixes $\dd a/a$ and maps $\dd b/a$ to $a_0^{-1}(b_0\,\dd a/a+\dd b/a)$.
\end{solution}
\begin{exercise}[label=exo:cone-moment]{2}
Compute the moment map of the circle acting on the cone orbifold $Q_m$ by $w\mapsto e^{i\varphi}w$.
\end{exercise}
\begin{solution}
The form $\alpha=\tfrac12(x\,\dd y-y\,\dd x)$ is invariant under rotations, so it descends to a $1$-form $\alpha_m$ on $Q_m$ with
$\dd\alpha_m=\omega_m$ (\cref{ex:cone}). The rotation $w\mapsto e^{i\varphi}w$ of $Q_m$ is covered by $z\mapsto e^{i\varphi/m}z$. By \cref{thm:exact},
$\mu_m(w)=\hat w^*\alpha_m$, and with $w=\pi_m(z)$ the orbit map of $w$ is $\varphi\mapsto\pi_m(e^{i\varphi/m}z)$; hence
$\hat w^*\alpha_m=\tfrac12\abs z^2\,\dd(\varphi/m)=\tfrac1{2m}\abs w^{2/m}\dd\varphi$. The image of the moment map is the half-line, as for the plane, and
its level sets are the circles $\abs w=\mathrm{const}$.
\end{solution}
\begin{exercise}[label=exo:torus-moment]{2}
For the ordinary torus $T^2=\R^2/\Z^2$ with $\omega=\dd x\wedge\dd y$ and the action of $\R^2$ by translations, compute the holonomy, a moment map and the
Souriau cocycle.
\end{exercise}
\begin{solution}
By \cref{prop:dual-torus} with $\Gamma=\Z^2$ and $\Omega\bigl((x,y),(x',y')\bigr)=xy'-x'y$: the holonomy is $\Omega(\Z^2,\cdot)$, the lattice of linear forms
with integer coefficients, $\Gs/\Gamma_{\mathrm{hol}}=\R^2/\Z^2$, and $\mu[x,y]=[-y,x]$ in the basis dual to the coordinates: a rotation of the torus by a
quarter turn. The Souriau cocycle is $\theta(u)=[\Omega(u,\cdot)]$. The action is neither Hamiltonian nor exact; in the classical theory it has no
moment map.
\end{solution}
\begin{exercise}[label=exo:basic]{3}
Prove \cref{prop:basic}.
\end{exercise}
\begin{solution}
(i) If $\beta=\pi^*\beta_0$ then $a^*\beta=(\pi\circ a)^*\beta_0=(\pi\circ\pr_X)^*\beta_0=\pr_X^*\beta$. Conversely let $a^*\beta=\pr_X^*\beta$ and let $P,P'$ be plots
of $X$ with $\pi\circ P=\pi\circ P'$. Since the action is principal, $P'=g\cdot P$ for a plot $g$ of $G$ \VolI{Theorem~7.2}, that is,
$P'=a\circ(g,P)$. Then $\beta(P')=(g,P)^*a^*\beta=(g,P)^*\pr_X^*\beta=\beta(P)$, and $\beta$ descends by \VolI{Proposition~6.4}; $\pi^*$ is injective. (ii) is
\cref{cor:product-momenta} with $Y=X$. (iii) The form $\beta=a^*\alpha-\pr_X^*\alpha$ restricts to $g^*\alpha-\alpha=0$ on $\{g\}\times X$ and to
$\hat x^*\alpha=\mu(x)$ on $G\times\{x\}$; by \cref{lem:slices} these restrictions determine it, and it vanishes if and only if $\mu=0$.
\end{solution}
\begin{exercise}[label=exo:Psi]{4}
Prove parts \textup{(ii)} and \textup{(iii)} of \cref{thm:paths-moment}, and deduce that the holonomy consists of closed momenta.
\end{exercise}
\begin{solution}
(ii) For $g,k\in G$, $\widehat{g\circ p}(k)=k\circ g\circ p=\hat p(kg)$, so $\widehat{g\circ p}=\hat p\circ R(g)$ and
$\Psi(g\circ p)=R(g)^*\hat p^*(K\omega)=\Ad_*(g)\Psi(p)$. (iii) $\dd\Psi(p)=\hat p^*\dd(K\omega)=\hat p^*(\hat1^*\omega-\hat0^*\omega-K\dd\omega)$ by \eqref{eq:K}, and
$\dd\omega=0$. The composite $\hat1\circ\hat p$ is $g\mapsto g\cdot p(1)$, the orbit map of $x_1$; likewise for $\hat0$. For a loop, $x_0=x_1$ and
$\dd\Psi(\ell)=0$.
\end{solution}
\chapter{Coadjoint orbits}\label{ch:orbits}
\chaptermark{Coadjoint orbits}
\begin{chapabstract}
Every parasymplectic space has a universal moment map, for the action of its whole group of automorphisms. When that group acts transitively,
the moment map is a fibration onto an affine coadjoint orbit; when in addition its fibres are discrete, the space is called symplectic. For
manifolds this recovers non-degeneracy. The diffeology of the orbit is a coimage, in the sense of the two factorisation systems of $\Diff$.
\end{chapabstract}
\section{The universal moment map}
Let $(X,\omega)$ be a connected parasymplectic space and $G_\omega=\Dif(X,\omega)$, the automorphism group of $\omega\colon X\to\Omcl$ in the slice
(\cref{prop:slice}). All the constructions of \cref{thm:moment} apply to $G_\omega$; they are written $\Psi_\omega$, $\Gamma_\omega$, $\psi_\omega$,
$\mu_\omega$, $\theta_\omega$, $\sigma_\omega$ and depend only on $(X,\omega)$.
\begin{proposition}[Functoriality, \IZ{art.~9.12--9.14}]\label{prop:universal}
Let $\rho\colon G\to G_\omega$ be a smooth action and $\rho^*\colon\Gs_\omega\to\Gs$ the pullback of momenta. Then
\[
\Psi=\rho^*\circ\Psi_\omega,\qquad\Gamma=\rho^*(\Gamma_\omega),\qquad\psi=\rho^*_\Gamma\circ\psi_\omega,\qquad\mu=\rho^*_\Gamma\circ\mu_\omega+\mathrm{const},
\]
where $\rho^*_\Gamma\colon\Gs_\omega/\Gamma_\omega\to\Gs/\Gamma$ is induced by $\rho^*$.
\end{proposition}
\begin{proof}
The orbit maps satisfy $\hat p^{G}=\hat p^{G_\omega}\circ\rho$, so $\Psi(p)=\rho^*\hat p^*(K\omega)=\rho^*\Psi_\omega(p)$. The other identities follow from the
definitions in \cref{thm:moment}.
\end{proof}
So every moment map of every symmetry group of $(X,\omega)$ is a quotient of one map, which depends on the form alone. The group $G_\omega$ contains a
largest connected subgroup with trivial holonomy, the group $\Ham(X,\omega)$ of \emph{Hamiltonian diffeomorphisms} \IZ{art.~9.15}; for a symplectic
manifold it is the classical group of that name \IZ{art.~9.22}.
\section{Homogeneous spaces}
Let $\theta$ be the Souriau cocycle of a moment map $\mu$. The \defn{affine coadjoint action} of $G$ on $\Gs/\Gamma$ is
$\Ad_*^{\Gamma,\theta}(g)(m)=\Ad_*^\Gamma(g)(m)+\theta(g)$ \IZ{art.~7.16}; it is an action by the cocycle identity, and $\mu$ is equivariant for it by
the definition of $\theta$. Its orbits are the \defn{$(\Gamma,\theta)$-coadjoint orbits}.
Recall that $X$ is \emph{homogeneous} under $G$ if the orbit map $\hat x_0\colon G\to X$ is a subduction for one, hence every, point $x_0$
\IZ{art.~7.8}.
\begin{theorem}[The homogeneous case, \IZ{art.~9.18}]\label{thm:homogeneous}
Let $X$ be homogeneous under an action of $G$ preserving $\omega$, let $\mu$ be a moment map with cocycle $\theta$, and let $\mu_0=\mu(x_0)$. Then
$O=\mu(X)$ is a $(\Gamma,\theta)$-coadjoint orbit, and $\operatorname{St}(x_0)\subseteq\operatorname{St}(\mu_0)$. Give $O$ the pushforward of the diffeology of $G$ by the
orbit map $\hat\mu_0\colon g\mapsto\Ad_*^{\Gamma,\theta}(g)(\mu_0)$. Then in the commutative triangle
\[
\begin{tikzcd}[column sep=3.2em,row sep=2.2em]
& G \arrow[dl,"\hat x_0"'] \arrow[dr,"\hat\mu_0"] & \\
X \arrow[rr,"\mu"'] && O
\end{tikzcd}
\]
$\hat x_0$ and $\hat\mu_0$ are principal bundles with groups $\operatorname{St}(x_0)$ and $\operatorname{St}(\mu_0)$, and $\mu$ is a fibre bundle with fibre the
homogeneous space $\operatorname{St}(\mu_0)/\operatorname{St}(x_0)$.
\end{theorem}
\noindent For the first assertions see \cref{exo:homogeneous}. By \VolI{Corollary~7.3} the two orbit maps are principal bundles.
\begin{remark}[The orbit is a coimage]\label{rem:coimage}
The orbit map $\hat\mu_0\colon G\to\Gs/\Gamma$ has two factorisations in $\Diff$ \VolI{Theorem~3.2}: through its coimage, the set $O$ with the quotient
diffeology of $G$, and through its image, the set $O$ with the subspace diffeology of $\Gs/\Gamma$. The diffeology chosen in \cref{thm:homogeneous}
is the coimage. The two coincide when $\hat\mu_0$ is strict, and the fibration statements of the theorem are statements about the coimage. The same
choice occurs in \VolI{Theorem~11.1} for hypothesis spaces and in \VolI{Theorem~13.1} for minimal realisations.
\end{remark}
\section{Symplectic spaces}
\begin{definition}[\IZ{art.~9.17, 9.19}]\label{def:symplectic}
The \defn{characteristics} of a moment map $\mu$ are the connected components of its fibres. A connected parasymplectic space $(X,\omega)$ is a
\defn{homogeneous symplectic space} if it is homogeneous under $\Dif(X,\omega)$ and the characteristics of the universal moment map $\mu_\omega$ are
points.
\end{definition}
The definition is justified by two theorems on manifolds.
\begin{theorem}[Souriau--Noether, \IZ{art.~9.25}]\label{thm:souriau-noether}
Let $\omega$ be a closed $2$-form on a manifold $M$. If two points are joined by a path $p$ with $\dot p(t)\in\ker\omega_{p(t)}$ for all $t$, then
$\mu_\omega$ takes the same value at both. Consequently every moment map of every action preserving $\omega$ is constant along the characteristic
distribution $\ker\omega$.
\end{theorem}
\begin{proof}
By \eqref{eq:Psi}, $\Psi_\omega(p)$ evaluated on a plot is $\int_0^1\omega(\dot p(t),\delta p(t))\,\dd t$, which vanishes when $\dot p\in\ker\omega$. So
$\mu_\omega(p(1))-\mu_\omega(p(0))=0$, and the consequence follows from \cref{prop:universal}.
\end{proof}
\begin{theorem}[Symplectic manifolds are coadjoint orbits, \IZ{art.~9.23}]\label{thm:coadjoint}
Let $\omega$ be a closed $2$-form on a connected manifold $M$. Then $\omega$ is non-degenerate if and only if
\begin{enumerate}[label=\textup{(\Alph*)}]
\item $M$ is homogeneous under $\Dif(M,\omega)$, and
\item the universal moment map $\mu_\omega\colon M\to\Gs_\omega/\Gamma_\omega$ is injective.
\end{enumerate}
In that case $\mu_\omega$ identifies $M$ with a $(\Gamma_\omega,\theta_\omega)$-coadjoint orbit of $\Dif(M,\omega)$.
\end{theorem}
So non-degeneracy, a pointwise condition on tangent vectors, is equivalent to a condition on maps: transitivity of the automorphism group and
injectivity of one map out of $M$. The second form is available on every diffeological space. By \cref{thm:souriau-noether} condition (B)
fails when $\ker\omega\ne0$; for a homogeneous presymplectic manifold the fibres of $\mu_\omega$ are exactly the leaves of the characteristic foliation
\IZ{art.~9.26}.
\begin{proposition}[Symplectic quasi-tori]\label{prop:quasitori-symplectic}
Let $\Gamma\subset\R^n$ be a dense subgroup and $\Omega$ a non-degenerate alternating form on $\R^n$. Then $(T_\Gamma,\omega_\Omega)$ is a homogeneous symplectic
space, and its moment map for the translations identifies it with the affine coadjoint orbit $(\R^n)^*/\Omega(\Gamma,\cdot)$ of the group $\R^n$.
\end{proposition}
\noindent The proof is \cref{exo:quasitori-symplectic}.
\begin{table}[t]\centering\small
\begin{tabular}{@{}p{4.3cm}p{2.4cm}p{2.6cm}p{3.7cm}@{}}\toprule
$(X,\omega)$ & homogeneous & characteristics & conclusion\\\midrule
symplectic manifold & yes & points & coadjoint orbit\\
$(M,0)$ & yes & $M$ & $\mu_\omega$ constant\\
contact form $\dd\alpha$ on $S^3$ & yes & Hopf circles & $\mu_\omega$ factors through $S^2$\\
$(\R^n/\Gamma,\omega_\Omega)$, $\Omega$ non-degenerate & yes & points & affine orbit, a quasi-torus\\
cone orbifold $(Q_m,\omega_m)$ & no: $0$ is fixed & --- & two strata\\\bottomrule
\end{tabular}
\caption{Parasymplectic spaces and the two conditions of \cref{def:symplectic}: homogeneity under $\Dif(X,\omega)$ and the characteristics of $\mu_\omega$. The third row is an instance of \IZ{art.~9.26}; the last is
\IZ{art.~9.32}.}\label{tab:symplectic}
\end{table}
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\draw[hcsteal] (0,0) rectangle (3.2,2.2);
\foreach \y in {0.3,0.65,...,2.1} \draw[hcsrust,line width=0.6pt] (0.1,\y) .. controls (1.1,\y+0.18) and (2.1,\y-0.18) .. (3.1,\y);
\node[above] at (1.6,2.2) {$(X,\omega)$, $\ker\omega\neq0$};
\draw[->>,line width=0.6pt] (3.5,1.1)--node[above]{$\mu_\omega$}(4.7,1.1);
\draw[hcsink,line width=1pt] (5.1,0.2)--(5.1,2.0);
\foreach \y in {0.3,0.65,...,2.1} \fill[hcsrust] (5.1,\y) circle (1.2pt);
\node[right] at (5.2,1.1) {$O$};
\node[below,align=center] at (2.6,-0.1) {characteristics are collapsed};
\end{scope}
\begin{scope}[xshift=7.6cm]
\draw[hcsteal] (0,0) rectangle (2.2,2.2);
\foreach \i in {0.37,0.73,...,2.0} \foreach \j in {0.37,0.73,...,2.0} \fill[hcsteal] (\i,\j) circle (0.8pt);
\node[above] at (1.1,2.2) {$(X,\omega)$ symplectic};
\draw[->,line width=0.6pt] (2.5,1.1)--node[above]{$\mu_\omega$}node[below]{$\cong$}(3.7,1.1);
\draw[hcsink] (4.0,0) rectangle (6.2,2.2);
\foreach \i in {0.37,0.73,...,2.0} \foreach \j in {0.37,0.73,...,2.0} \fill[hcsteal] (4.0+\i,\j) circle (0.8pt);
\node[above] at (5.1,2.2) {$O\subset\Gs_\omega/\Gamma_\omega$};
\node[below,align=center] at (3.1,-0.1) {the space is its own orbit};
\end{scope}
\end{tikzpicture}
\caption{The universal moment map of a homogeneous parasymplectic space is a fibration onto a coadjoint orbit. Its fibres are unions of
characteristics; the space is symplectic when they are points.}\label{fig:characteristics}
\end{figure}
\exercisesheading
\begin{exercise}[label=exo:plane-orbit]{1}
Show that the plane $(\R^2,\dd x\wedge\dd y)$ is a single affine coadjoint orbit of its group of translations.
\end{exercise}
\begin{solution}
By \cref{ex:translations}, $\Gs=(\R^2)^*$, $\Gamma=0$, the coadjoint action is trivial, $\mu(x)=\Omega(x,\cdot)$ and $\theta(u)=\Omega(u,\cdot)$. The affine action is
$m\mapsto m+\Omega(u,\cdot)$, which is simply transitive on $(\R^2)^*$ because $\Omega$ is non-degenerate. So $O=(\R^2)^*$, both stabilisers are trivial, and
$\mu$ is the diffeomorphism $x\mapsto\Omega(x,\cdot)$. For the linear coadjoint action every orbit is a point: the cocycle is what makes the orbit
two-dimensional.
\end{solution}
\begin{exercise}[label=exo:zero-form]{2}
Let $M$ be a connected manifold with $\omega=0$. Compute $\Dif(M,\omega)$, the universal moment map and its characteristics.
\end{exercise}
\begin{solution}
Every diffeomorphism preserves $0$, so $\Dif(M,0)=\Dif(M)$, which is transitive. Since $K0=0$, the paths moment map vanishes, $\Gamma_\omega=0$, and
$\mu_\omega$ is constant. The unique characteristic is $M$, the orbit is a point, and the fibration of \cref{thm:homogeneous} is $M\to\ast$.
\end{solution}
\begin{exercise}[label=exo:cylinder]{2}
On the cylinder $X=\R\times S^1$ with $\omega=\dd r\wedge\dd\varphi$, compute the moment maps of \textup{(a)} the rotations $\varphi\mapsto\varphi+s$ and \textup{(b)} the
translations $r\mapsto r+s$.
\end{exercise}
\begin{solution}
(a) $\omega=\dd(r\,\dd\varphi)$ with $r\,\dd\varphi$ invariant, so by \cref{thm:exact} $\mu(r,\varphi)=r$ in the basis $\dd s$ of $\Gs$: the height. (b) The form
$-\varphi\,\dd r$ is not defined on $X$, and \cref{thm:exact} does not apply. By \eqref{eq:Psi}, for a path $p=(r(t),\varphi(t))$ with a continuous
determination of the angle, $\Psi(p)=\int_0^1\omega(\dot p,\partial_r)\,\dd t\;\dd s=-(\varphi(1)-\varphi(0))\,\dd s$. A loop winding once gives $-2\pi\,\dd s$, so
$\Gamma=2\pi\Z\,\dd s$, the action is not Hamiltonian, and the moment map is $\mu(r,\varphi)=-\varphi\in\R/2\pi\Z$: the angle is a moment map with values in
a circle.
\end{solution}
\begin{exercise}[label=exo:homogeneous]{3}
In the situation of \cref{thm:homogeneous}, prove that $\mu(X)$ is a $(\Gamma,\theta)$-orbit, that $\operatorname{St}(x_0)\subseteq\operatorname{St}(\mu_0)$, and that
$\mu\colon X\to O$ is a subduction when $O$ carries the pushforward diffeology of $G$.
\end{exercise}
\begin{solution}
Equivariance of $\mu$ for the affine action gives $\mu(g x_0)=\Ad_*^{\Gamma,\theta}(g)(\mu_0)$, that is, $\mu\circ\hat x_0=\hat\mu_0$. Since $\hat x_0$ is
surjective, $\mu(X)=\hat\mu_0(G)$ is the orbit of $\mu_0$, and $g x_0=x_0$ implies $\Ad_*^{\Gamma,\theta}(g)(\mu_0)=\mu_0$. The orbit map $\hat x_0$ is a
subduction by homogeneity, so $\mu$ is smooth into $O$ if and only if $\mu\circ\hat x_0=\hat\mu_0$ is, which holds by the definition of the pushforward
diffeology. A plot of $O$ lifts locally along $\hat\mu_0$ to a plot of $G$, whose image under $\hat x_0$ is a local lift along $\mu$; so $\mu$ is a
subduction.
\end{solution}
\begin{exercise}[label=exo:quasitori-symplectic]{4}
Prove \cref{prop:quasitori-symplectic}.
\end{exercise}
\begin{solution}
\emph{Homogeneity.} Translations preserve $\omega_\Omega$, so there is a smooth homomorphism $\rho\colon\R^n\to\Dif(T_\Gamma,\omega_\Omega)$. Let $P$ be a plot of
$T_\Gamma$ and $x_0=q(\tilde x_0)$. Locally $P=q\circ\tilde P$ with $\tilde P$ smooth in $\R^n$, and $r\mapsto\rho(\tilde P(r)-\tilde x_0)$ is a plot of
$\Dif(T_\Gamma,\omega_\Omega)$ whose image under the orbit map of $x_0$ is $P$. So the orbit map is a subduction.
\emph{Characteristics.} By \cref{prop:universal}, the moment map $\mu$ of the translations is $\rho^*_\Gamma\circ\mu_\omega$ up to a constant. By
\cref{prop:dual-torus}, $\mu$ is injective; hence $\mu_\omega$ is injective and its fibres are points. \emph{The orbit.} For $G=\R^n$ the coadjoint
action is trivial and $\theta(u)=[\Omega(u,\cdot)]$, so the affine action on $(\R^n)^*/\Omega(\Gamma,\cdot)$ is by translations and is transitive; $\mu$ is the
diffeomorphism of \cref{prop:dual-torus}.
\end{solution}
\part{One level up}
\chapter{Prequantisation}\label{ch:prequantum}
\chaptermark{Prequantisation}
\begin{chapabstract}
A prequantisation of a parasymplectic space is a principal bundle with connection whose curvature is the given form; its structure group
is a torus of periods $\R/P$, and $P$ need not be cyclic. In $\Hh$ it is a lift of $\omega\colon X\to\Omcl$ to the stack $\BTc$. We describe
that stack, bound the periods, compute the examples, and determine the automorphisms of a prequantum bundle that cover the identity.
\end{chapabstract}
\section{Tori of periods and bundles with connection}
Let $P\subsetneq\R$ be a subgroup. A proper subgroup of $\R$ contains no interval, so its plots for the subspace diffeology are locally
constant: $P$ is discrete as a diffeological group, countable or not, and $\R\to T_P=\R/P$ is a covering \IZ{art.~8.37}. The form $\dd t$ descends
to the canonical form $\theta\in\Om^1(T_P)$. For $P=\Z$ this is the circle; for $P=\Z+\alpha\Z$ it is the irrational torus.
\begin{definition}[\IZ{art.~8.37}]\label{def:connection}
Let $\pi\colon Y\to X$ be a principal $T_P$-bundle of diffeological spaces, with action $(\tau,y)\mapsto\tau\cdot y$ and orbit maps
$\hat y\colon T_P\to Y$. A \defn{connection form} is a $1$-form $\lambda$ on $Y$ which is \emph{invariant}, $\tau_Y^*\lambda=\lambda$ for all $\tau$, and
\emph{calibrated}, $\hat y^*\lambda=\theta$ for all $y$.
\end{definition}
\begin{lemma}\label{lem:connection}
Let $\lambda$ be a connection form on $\pi\colon Y\to X$, and $\Phi_T\colon T_P\times Y\to Y$ the action map.
\begin{enumerate}[label=\textup{(\roman*)}]
\item $\Phi_T^*\lambda=\pr_T^*\theta+\pr_Y^*\lambda$. For a plot $s$ of $Y$ and a plot $g$ of $T_P$ on the same domain, $(g\cdot s)^*\lambda=s^*\lambda+g^*\theta$.
\item There is a unique closed $2$-form $\omega$ on $X$, the \defn{curvature}, with $\pi^*\omega=\dd\lambda$.
\item For a smooth $\tau\colon X\to T_P$, the gauge transformation $y\mapsto\tau(\pi(y))\cdot y$ maps $\lambda$ to $\lambda+\pi^*\tau^*\theta$.
\end{enumerate}
\end{lemma}
\begin{proof}
(i) Both sides are $1$-forms on a product with the same restrictions to the slices: $\tau_Y^*\lambda=\lambda$ on $\{\tau\}\times Y$ and
$\hat y^*\lambda=\theta$ on $T_P\times\{y\}$. They coincide by \cref{lem:slices}. The second formula is the pullback of the first by $(g,s)$. (ii) By
(i), $\Phi_T^*\dd\lambda=\pr_Y^*\dd\lambda$, since $\dd\theta=0$. The action is principal, so $\dd\lambda$ descends by \cref{prop:basic}(i); the descended form is
closed because $\pi^*$ is injective. (iii) The gauge transformation is $\Phi_T\circ(\tau\circ\pi,\id_Y)$; pull back (i).
\end{proof}
The stack $\BTc$ is defined on Cartesian spaces by the groupoids
\[
\BTc(U)=\Bigl\{\ \text{objects } A\in\Om^1(U);\quad\text{morphisms } g\colon A\to A+g^*\theta,\ g\in\cinf(U,T_P)\ \Bigr\},
\]
the groupoid of connection forms on the trivial bundle $U\times T_P$ and gauge transformations \VolI{\S6.5}. There are maps
\begin{equation}\label{eq:tower}
\begin{tikzcd}[column sep=3em]
\Om^1 \arrow[r] \arrow[dr,"\dd"'] & \BTc \arrow[r] \arrow[d,"F"] & \B T_P\\
& \Omcl &
\end{tikzcd}
\end{equation}
where $F(A)=\dd A$ is the curvature, the horizontal maps send a form to the trivial bundle with that connection and a bundle with connection
to its underlying bundle, and the row is a fibre sequence.
\begin{proposition}\label{prop:BTconn}
For a diffeological space $X$, the groupoid $\Map(X,\BTc)$ is equivalent to the groupoid of principal $T_P$-bundles over $X$ with a connection
form and their connection-preserving isomorphisms. Under this equivalence, composition with $F$ is the curvature of \cref{lem:connection}.
\end{proposition}
\begin{proof}
As in \VolI{Theorem~7.5}, $X$ is the colimit in $\Hh$ of its plots and $\Map(X,\BTc)\simeq\lim_{(U\to X)}\BTc(U)$. Given $(Y,\lambda)$ and a plot
$P\colon U\to X$, the pullback $P^*Y$ is trivial \VolI{Lemma~7.4}; a section $s$ gives the object $A_s=s^*\lambda$, and by \cref{lem:connection}(i)
another section $g\cdot s$ gives $A_s+g^*\theta$, an isomorphic object. This defines a point of the limit. Conversely a point of the limit has an
underlying map $X\to\B T_P$, which is a principal bundle $Y$ \VolI{Theorem~7.5}, together with a connection form $\lambda_P$ on each $P^*Y$,
compatible with reparametrisation. For a plot $R$ of $Y$ let $P=\pi\circ R$; then $R$ is a section of $P^*Y$ and $\lambda(R)=R^*\lambda_P$ defines a
$1$-form on $Y$, invariant and calibrated because each $\lambda_P$ is. The two constructions are inverse, and $\dd A_s=s^*\dd\lambda=P^*\omega$.
\end{proof}
\section{Prequantum bundles}
\begin{definition}\label{def:prequantum}
A \defn{prequantisation} of a parasymplectic space $(X,\omega)$ with group of periods $P$ is a principal $T_P$-bundle with connection $(Y,\lambda)$
over $X$ with curvature $\omega$; equivalently, a lift
\[
\begin{tikzcd}[column sep=3em,row sep=2em]
& \BTc \arrow[d,"F"]\\
X \arrow[r,"\omega"'] \arrow[ur,dashed,"\nabla"] & \Omcl
\end{tikzcd}
\]
\end{definition}
\begin{theorem}[Integration bundles, \IZ{art.~8.42}; \VolI{Theorem~6.11}]\label{thm:integration2}
Let $(X,\omega)$ be connected and simply connected, with group of periods $P_\omega\neq\R$. Then $(X,\omega)$ has a prequantisation with structure
group $T_{P_\omega}=\R/P_\omega$.
\end{theorem}
The classical condition that the periods be integral, up to a common factor, is the condition that $P_\omega$ be cyclic, so that $T_{P_\omega}$ is a
circle. No such condition appears in the theorem: for $S^2\times S^2$ with incommensurable areas the structure group is an irrational torus
(\cref{ex:periods}), and the bundle is constructed in \cref{thm:S2S2}. Conversely the periods bound the structure group from below.
\begin{proposition}[Periods lie in $P$]\label{prop:periods-bound}
If $(X,\omega)$ has a prequantisation with structure group $T_P$, then for every smooth map $S$ from $T^2$ or $S^2$ to $X$ the period
$\int S^*\omega$ belongs to $P$.
\end{proposition}
\begin{proof}
For the torus, pull $(Y,\lambda)$ back along $\R^2\to T^2\xrightarrow{S}X$. Over $\R^2$ the bundle is trivial, with connection $A\in\Om^1(\R^2)$,
$\dd A=\tilde S^*\omega$. The translations $\tau_1,\tau_2$ by the basis vectors act on the pulled-back bundle; in the trivialisation they are gauge
transformations $g_i\colon\R^2\to T_P$ with $\tau_i^*A=A+g_i^*\theta$, and $g_i$ lifts to $\hat g_i\colon\R^2\to\R$. Stokes' formula on the unit square
(\cref{fig:square}) gives
\[
\int_{[0,1]^2}\dd A=\bigl(\hat g_1(e_2)-\hat g_1(0)\bigr)-\bigl(\hat g_2(e_1)-\hat g_2(0)\bigr).
\]
The two translations commute, so $g_2(x+e_1)+g_1(x)=g_1(x+e_2)+g_2(x)$ in $T_P$, and the right-hand side is the value at $0$ of a function
with values in $P$. The sphere is \cref{exo:sphere-periods}.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small,scale=1.0]
\begin{scope}
\fill[hcsgold!30] (0,0) rectangle (2.4,2.4);
\draw[hcsink,line width=0.9pt,->] (0,0)--(2.4,0); \draw[hcsink,line width=0.9pt,->] (2.4,0)--(2.4,2.4);
\draw[hcsink,line width=0.9pt,->] (2.4,2.4)--(0,2.4); \draw[hcsink,line width=0.9pt,->] (0,2.4)--(0,0);
\node at (0.65,1.75) {$\int\dd A$};
\draw[hcsrust,<->] (1.7,0.08)--(1.7,2.32);
\node[hcsrust,right] at (2.5,1.6) {$\tau_2$: $+\dd\hat g_2$};
\draw[hcsteal,<->] (0.08,0.6)--(2.32,0.6);
\node[hcsteal,right] at (2.5,0.6) {$\tau_1$: $+\dd\hat g_1$};
\node[below] at (1.2,-0.1) {a period is a mismatch of gauges};
\end{scope}
\begin{scope}[xshift=6.6cm,yshift=0.2cm]
\node (O1) at (0,2) {$\Om^1$}; \node (BC) at (2.4,2) {$\BTc$}; \node (BT) at (4.8,2) {$\B T_P$};
\node (O2) at (2.4,0) {$\Omcl$}; \node (X) at (0,0) {$X$};
\draw[->] (O1)--(BC); \draw[->] (BC)--(BT); \draw[->] (BC)--node[right]{$F$}(O2);
\draw[->] (X)--node[below]{$\omega$}(O2); \draw[->,dashed] (X)--node[above left,pos=0.6]{$\nabla$}(BC);
\draw[->,hcsrust,dashed] (X)--node[left]{$\alpha$}(O1);
\node[below,align=center] at (2.4,-0.45) {a primitive $\alpha$ is a prequantisation\\ with a trivialisation of the bundle};
\end{scope}
\end{tikzpicture}
\caption{Left: the proof of \cref{prop:periods-bound}. Right: the three ways of presenting a closed $2$-form, as a form, as a curvature, and
as an exact form.}\label{fig:square}
\end{figure}
\section{Examples}
\begin{example}[Exact forms]\label{ex:exact-prequantum}
If $\omega=\dd\alpha$, then for every $P$ the trivial bundle $Y=X\times T_P$ with $\lambda=\pr_X^*\alpha+\pr_T^*\theta$ is a prequantisation. Two primitives that
differ by $\dd h$ give isomorphic prequantisations (\cref{exo:exact-prequantum}).
\end{example}
\begin{example}[The Heisenberg bundle]\label{ex:heisenberg}
On $\R^2$ with $\omega=\dd x\wedge\dd y=\dd(x\,\dd y)$, the previous example with $P=0$ is $Y=\R^3$ with $\lambda=\dd z+x\,\dd y$. The group structure
$(x,y,z)(x',y',z')=(x+x',y+y',z+z'-xy')$ on $Y$ makes it the Heisenberg group $\Heis$; left multiplications preserve $\lambda$ and cover the
translations of the plane. The subgroup $N=\Z^3$ acts on the left, $\lambda$ descends to $N\backslash\Heis$, and $N\backslash\Heis\to\R^2/\Z^2$ is a prequantisation of the
torus of area $1$ with $P=\Z$. In \cref{ch:number-theory} $\Z$ is replaced by the ring of integers of a number field.
\end{example}
\begin{example}[The cone]\label{ex:cone-prequantum}
The form $\omega_m$ of the cone orbifold is exact, $\omega_m=\dd\alpha_m$ (\cref{exo:cone-moment}), so $Q_m\times T_P$ is a prequantisation for every $P$.
It is the quotient of the trivial bundle $\C\times T_P$ by $\Z_m$ acting on the first factor.
\end{example}
\section{Automorphisms}
An automorphism of a prequantum bundle $(Y,\lambda)$ is a diffeomorphism $\phi$ of $Y$ that commutes with the action of $T_P$ and satisfies
$\phi^*\lambda=\lambda$. It covers a diffeomorphism of $X$, which preserves $\omega$ because $\pi^*$ is injective. The group $\Aut(Y,\lambda)$ has the
functional diffeology.
\begin{theorem}[The Kostant--Souriau sequence]\label{thm:KS}
Let $(Y,\lambda)$ be a prequantisation of a connected parasymplectic space $(X,\omega)$. The sequence of diffeological groups
\[
1\longrightarrow T_P\longrightarrow\Aut(Y,\lambda)\longrightarrow\Dif(X,\omega)
\]
is exact, and $T_P$ is central. If $X=\R^{2n}$ with a constant symplectic form and $P=0$, the last map is surjective, and the preimage of the
group of translations is the Heisenberg group.
\end{theorem}
\begin{proof}
An automorphism covering the identity is a gauge transformation by some $\tau\colon X\to T_P$. By \cref{lem:connection}(iii) it preserves
$\lambda$ if and only if $\pi^*\tau^*\theta=0$, that is, $\tau^*\theta=0$. For a plot $Q$ of $X$, the map $\tau\circ Q$ lifts locally to a real function $f$ with
$\dd f=(\tau\circ Q)^*\theta=0$, so $\tau\circ Q$ is locally constant; since $X$ is connected, $\tau$ is constant. Constants are central because
automorphisms commute with the action of $T_P$. For $\R^{2n}$ with $\omega=\dd\alpha$ and $Y=\R^{2n}\times\R$, $\lambda=\dd z+\alpha$: if $f^*\omega=\omega$ then
$f^*\alpha-\alpha=\dd h$ for a function $h$, and $(v,z)\mapsto(f(v),z-h(v))$ is an automorphism covering $f$. For translations, with $\alpha=B(v,\dd v)$
and $B$ bilinear, these are the left multiplications of $\Heis_B$.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzcd}[column sep=2.6em,row sep=2.2em]
1 \arrow[r] & T_P \arrow[r] & \Aut(Y,\lambda) \arrow[r] & \Dif(X,\omega) & & \Hh/\BTc \arrow[d,"F_!"]\\
1 \arrow[r] & \R \arrow[r] \arrow[u,equal] & \Heis_B \arrow[r] \arrow[u,hook] & \R^{2n} \arrow[r] \arrow[u,hook] & 1 & \Hh/\Omcl
\end{tikzcd}
\caption{The Kostant--Souriau sequence of \cref{thm:KS} and, for $X=\R^{2n}$ and $P=0$, its restriction to the translations. Both groups
are automorphism groups in slices of $\Hh$, and the sequence is induced by the curvature map $F$.}\label{fig:KS}
\end{figure}
In the language of \cite{FRS1,FRS2}: $\Aut(Y,\lambda)$ is the automorphism group of $\nabla\colon X\to\BTc$ in the slice $\Hh/\BTc$, as $\Dif(X,\omega)$ is
the automorphism group of $\omega$ in the slice over $\Omcl$ (\cref{prop:slice}), and the sequence is induced by $F$. The kernel $T_P$ is the
group of automorphisms of the trivial flat bundle over a connected space.
\begin{proposition}[Characters]\label{prop:characters}
The smooth homomorphisms $T_P\to U(1)$ are $[t]\mapsto e^{2\pi ikt}$ with $k\in\R$, $kP\subseteq\Z$. If $P$ contains two elements with irrational
ratio, the only one is trivial.
\end{proposition}
\begin{proof}
A smooth homomorphism $T_P\to\R/\Z$ composed with $\R\to T_P$ lifts to a smooth homomorphism $\R\to\R$, $t\mapsto kt$, which maps $P$ into $\Z$. If
$a,b\in P$ and $ka,kb\in\Z$ with $k\neq0$ then $a/b\in\Q$.
\end{proof}
So a prequantum bundle with a dense group of periods has no associated Hermitian line bundle, and the usual passage from the principal
bundle to a space of sections is not available. The three presentations of a closed $2$-form are compared in \cref{tab:levels}.
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{2.9cm}p{3.2cm}p{3.3cm}p{3.4cm}@{}}\toprule
datum on $X$ & classifying object & automorphisms & exists when\\\midrule
closed $2$-form $\omega$ & $\Omcl$, a sheaf & $\Dif(X,\omega)$ & ---\\
prequantisation $\nabla$ & $\BTc$, a stack & $\Aut(Y,\lambda)$, an extension by $T_P$ & periods in $P$; \cref{thm:integration2}\\
primitive $\alpha$ & $\Om^1$, a sheaf & $\Dif(X,\alpha)$ & $\omega$ exact\\\bottomrule
\end{tabular}
\caption{Three levels of structure and their classifying objects.}\label{tab:levels}
\end{table}
\exercisesheading
\begin{exercise}[label=exo:exact-prequantum]{1}
Verify that $\lambda=\pr_X^*\alpha+\pr_T^*\theta$ is a connection form on $X\times T_P$ with curvature $\dd\alpha$, and that the prequantisations defined by
$\alpha$ and $\alpha+\dd h$ are isomorphic.
\end{exercise}
\begin{solution}
The action of $T_P$ is by translation of the second factor; $\theta$ is translation-invariant and $\pr_X$ is invariant, so $\lambda$ is invariant. The
orbit map of $(x,\tau)$ is $\sigma\mapsto(x,\sigma+\tau)$, which pulls $\lambda$ back to $\theta$. $\dd\lambda=\pr_X^*\dd\alpha$. The gauge transformation by
$\tau=[h]\colon X\to T_P$ maps $\lambda$ to $\lambda+\pr_X^*\dd h$ by \cref{lem:connection}(iii), since $[h]^*\theta=\dd h$.
\end{solution}
\begin{exercise}[label=exo:heis-holonomy]{2}
In the Heisenberg bundle $(\R^3,\dd z+x\,\dd y)$, compute the horizontal lift of the boundary of the rectangle $[x_0,x_0+a]\times[y_0,y_0+b]$,
traversed counter-clockwise from $(x_0,y_0,z_0)$.
\end{exercise}
\begin{solution}
A curve is horizontal if $\dot z=-x\dot y$. Along the bottom edge $\dot y=0$ and $z=z_0$. Along the right edge $x=x_0+a$ and $z$ decreases by
$(x_0+a)b$. Along the top edge $z$ is constant. Along the left edge $x=x_0$, $y$ decreases by $b$, and $z$ increases by $x_0b$. The lift ends at
$z_0-ab$: the holonomy is minus the area, as in the frontispiece, in accordance with $\int\dd\lambda=\int\omega$ and \cref{lem:connection}(ii).
\end{solution}
\begin{exercise}[label=exo:characters]{2}
Compute the smooth characters of $T_P$ for $P=\Z$, $P=\Z+\sqrt2\,\Z$ and $P=\Q$.
\end{exercise}
\begin{solution}
By \cref{prop:characters} the characters are indexed by $\set{k\in\R\mid kP\subseteq\Z}$. For $P=\Z$ this is $\Z$. For $P=\Z+\sqrt2\Z$, $k\in\Z$ and
$k\sqrt2\in\Z$ force $k=0$. For $P=\Q$, $k/n\in\Z$ for all $n$ forces $k=0$. In the last two cases the group $T_P$ has no non-trivial smooth
unitary character, although $\R/\Q$ has many discontinuous ones.
\end{solution}
\begin{exercise}[label=exo:sphere-periods]{3}
Prove \cref{prop:periods-bound} for the sphere.
\end{exercise}
\begin{solution}
Pull the bundle back to $S^2$ by $S$. Let $U_N,U_S$ be the complements of the south and north poles; they are diffeomorphic to $\R^2$, so the
bundle is trivial over each, with connections $A_N,A_S$, $\dd A_N=S^*\omega$, $\dd A_S=S^*\omega$. On $U_N\cap U_S$ the trivialisations differ by
$g\colon U_N\cap U_S\to T_P$ and $A_N=A_S+g^*\theta$ by \cref{lem:connection}(i). Stokes' formula on the two closed hemispheres, whose common boundary is
the equator $E$ with opposite orientations, gives $\int_{S^2}S^*\omega=\int_E(A_N-A_S)=\int_Eg^*\theta$. The map $g|_E\colon S^1\to\R/P$ lifts along the
covering $\R\to S^1$ to $\hat g\colon\R\to\R$ with $\hat g(t+1)-\hat g(t)\in P$, and $\int_Eg^*\theta=\hat g(1)-\hat g(0)\in P$.
\end{solution}
\begin{exercise}[label=exo:quantomorphisms]{4}
Let $X=\R^2$, $\omega=\dd x\wedge\dd y$, $(Y,\lambda)=(\R^3,\dd z+x\,\dd y)$. Determine the automorphisms of $(Y,\lambda)$ covering the linear symplectic maps
$A\in\SL_2(\R)$, and show that $A\mapsto\hat A$ can be chosen to be a homomorphism.
\end{exercise}
\begin{solution}
By the proof of \cref{thm:KS}, the lifts of $A$ are $(v,z)\mapsto(Av,z-h(v)+c)$ with $\dd h=A^*\alpha-\alpha$, $\alpha=x\,\dd y$. Put $\beta=\tfrac12(x\,\dd y-y\,\dd x)$,
which is invariant under $\SL_2(\R)$, and note $\alpha=\beta+\dd(\tfrac12xy)$. Then $A^*\alpha-\alpha=\dd\bigl(\tfrac12(xy)\circ A-\tfrac12xy\bigr)$, so
$h=q_A$ with $q_A(v)=\tfrac12\bigl((xy)(Av)-xy\bigr)$, a quadratic form. The choice $\hat A(v,z)=(Av,z-q_A(v))$ is a homomorphism: in the coordinate
$\zeta=z+\tfrac12xy$ it is $(v,\zeta)\mapsto(Av,\zeta)$, and $\lambda=\dd\zeta+\beta$. So $\SL_2(\R)$ acts on the Heisenberg bundle by automorphisms, and
$\Aut(Y,\lambda)$ contains the semidirect product of $\SL_2(\R)$ with the Heisenberg group.
\end{solution}
\chapter{Equivariance and the moment map}\label{ch:equivariant}
\chaptermark{Equivariance}
\begin{chapabstract}
When the action of a group lifts to a prequantum bundle, the moment map is the pullback of the connection form along the orbits upstairs.
It is equivariant, and it vanishes exactly when the bundle with its connection descends to the homotopy quotient. When the action does not
lift, it lifts for a central extension of the group, and the Souriau cocycle is the coadjoint action of the extension on its central
momentum.
\end{chapabstract}
\section{The moment map of an equivariant prequantum bundle}
Throughout, $(X,\omega)$ is a connected parasymplectic space with a prequantisation $(Y,\lambda)$, $\pi\colon Y\to X$, with group of periods $P$, and
$\rho\colon G\to\Dif(X,\omega)$ is a smooth action of a diffeological group.
\begin{definition}\label{def:equivariant}
An \defn{equivariant prequantisation} is a smooth action $\Phi\colon G\times Y\to Y$ by automorphisms of $(Y,\lambda)$ covering $\rho$; equivalently, a smooth
homomorphism $G\to\Aut(Y,\lambda)$ lifting $\rho$ through the sequence of \cref{thm:KS}.
\end{definition}
\begin{theorem}[A: the prequantum moment map]\label{thm:A}
Let $(Y,\lambda)$ be an equivariant prequantisation. For $x\in X$ choose $y\in\pi^{-1}(x)$ and put
\[
\mu(x)=\hat y^*\lambda\in\Om^1(G),\qquad\hat y\colon G\to Y,\ g\mapsto g\cdot y .
\]
\begin{enumerate}[label=\textup{(\roman*)}]
\item $\mu(x)$ is independent of $y$ and is left-invariant; $\mu\colon X\to\Gs$ is smooth.
\item $\mu(g\cdot x)=\Ad_*(g)\,\mu(x)$.
\item For every path $p$ in $X$, the paths moment map of \cref{thm:paths-moment} is $\Psi(p)=\mu(p(1))-\mu(p(0))$.
\end{enumerate}
Consequently the holonomy $\Gamma$ and the Souriau class $\sigma$ of the action vanish, and $\mu$ is an equivariant moment map in the sense of
\cref{thm:moment}.
\end{theorem}
\begin{proof}
(i) For $\tau\in T_P$, $\widehat{\tau y}=\tau_Y\circ\hat y$ because the two actions commute, and $\tau_Y^*\lambda=\lambda$. For $h\in G$,
$\hat y\circ L(h)=h_Y\circ\hat y$ and $h_Y^*\lambda=\lambda$, so $L(h)^*\mu(x)=\mu(x)$. Smoothness: over a plot of $X$ with Cartesian domain $U$ the bundle has a
section $s$, and $r\mapsto\mu(Q(r))$ is the family of restrictions to the slices $G\times\{r\}$ of the form $(\Phi\circ(\id\times s))^*\lambda$ on $G\times U$.
(ii) $\widehat{g y}=\hat y\circ R(g)$, and $gy$ lies over $gx$.
(iii) The pullback $p^*Y$ is a principal bundle over $\R$, hence trivial, so $p$ has a smooth lift $\tilde p\in\Paths(Y)$. Let
$\pi_*\colon\Paths(Y)\to\Paths(X)$ be induced by $\pi$; then $\pi_*\circ\hat{\tilde p}=\hat p$, where $\hat{\tilde p}(g)=g_Y\circ\tilde p$. By naturality of
$K$ and \eqref{eq:K},
\[
\Psi(p)=\hat{\tilde p}^{\,*}(\pi_*)^*K\omega=\hat{\tilde p}^{\,*}K(\pi^*\omega)=\hat{\tilde p}^{\,*}K(\dd\lambda)
=\hat{\tilde p}^{\,*}\bigl(\hat1^*\lambda-\hat0^*\lambda-\dd(K\lambda)\bigr).
\]
The function $K\lambda\circ\hat{\tilde p}$ is $g\mapsto\int_{g_Y\circ\tilde p}\lambda=\int_{\tilde p}g_Y^*\lambda=\int_{\tilde p}\lambda$, a constant, so the last
term vanishes. The composite $\hat1\circ\hat{\tilde p}$ is the orbit map of $\tilde p(1)$, which lies over $p(1)$; so the first term is $\mu(p(1))$,
and the second is $\mu(p(0))$. For a loop $\Psi=0$; hence $\Gamma=0$, $\psi(x,x')=\mu(x')-\mu(x)$, and $\theta=0$ by (ii).
\end{proof}
For the trivial bundle of an invariant primitive $\alpha$ (\cref{ex:exact-prequantum}), with $G$ acting on the first factor, $\mu(x)=\hat x^*\alpha$:
\cref{thm:A} contains \cref{thm:exact}. The classical formula $\langle\mu,\xi\rangle=\lambda(\xi_Y)$ for the moment map of a prequantised Hamiltonian
action of a Lie group, due to Kostant and Souriau \cite{Kostant,Souriau}, is the value of $\hat y^*\lambda$ at the identity.
\begin{proposition}[Characters and levels]\label{prop:levels}
The equivariant structures on $(Y,\lambda)$ covering $\rho$ form a torsor under the group $\Hom^\infty(G,T_P)$ of smooth characters, or are absent.
Twisting by a character $\chi$, $g\star y=\chi(g)\cdot(g\cdot y)$, changes the moment map to $\mu+\chi^*\theta$. For $G=S^1=\R/2\pi\Z$ the moment maps of
the equivariant structures are $\mu_0+c$ with $2\pi c\in P$.
\end{proposition}
\noindent The proof is \cref{exo:levels}. So the constant of \cref{thm:moment}(iii), which is arbitrary for the form $\omega$, is quantised for the
bundle: the admissible levels are $c\in\tfrac1{2\pi}P$. If the level is prescribed, the group of periods must contain $2\pi c$. This is the
origin of the integrality condition in the reduction of \cref{ch:reduction}.
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\fill[hcsmist] (0,0) rectangle (4.2,2.6);
\draw[hcsteal] (0,0) rectangle (4.2,2.6);
\draw[hcsrust,line width=1pt] (0,1.5)--(4.2,1.5);
\draw[hcsgold,line width=1.2pt] (2.6,0)--(2.6,2.6);
\node[hcsrust,above] at (1.2,1.5) {$\{g\}\times Y$};
\node[hcsgold!70!black,right] at (2.6,0.5) {$G\times\{y\}$};
\node[left] at (0,1.3) {$G$}; \node[below] at (2.1,0) {$Y$};
\node[below,align=left] at (2.1,-0.5) {on $\{g\}\times Y$:\quad $g_Y^*\lambda-\lambda=0$\quad (invariance)\\ on $G\times\{y\}$:\quad $\hat y^*\lambda=\mu(x)$\quad (moment)};
\end{scope}
\begin{scope}[xshift=6.3cm,yshift=1.3cm]
\node (A) at (0,1.1) {$X\hquot G^{\delta}$}; \node (B) at (2.6,1.1) {$X\hquot G$}; \node (C) at (5.0,1.1) {$X/G$};
\node (T) at (2.6,-0.7) {$\BTc$};
\draw[->] (A)--(B); \draw[->] (B)--(C);
\draw[->] (A)--node[below left]{invariance}(T);
\draw[->,dashed] (B)--node[right]{$\mu=0$}(T);
\draw[->,dashed] (C)--node[below right]{principal}(T);
\node[below,align=center] at (2.6,-1.3) {successive conditions for descent};
\end{scope}
\end{tikzpicture}
\caption{Left: the $1$-form $\Phi^*\lambda-\pr_Y^*\lambda$ on $G\times Y$ is determined by its restrictions to the two families of slices
(\cref{lem:slices}). Right: the corresponding factorisations of the prequantum bundle.}\label{fig:descent}
\end{figure}
\section{Descent to the homotopy quotient}
Let $G^\delta$ be the group $G$ with the discrete diffeology. The identity $G^\delta\to G$ induces $X\hquot G^\delta\to X\hquot G$, and there is the
projection $X\hquot G\to X/G$.
\begin{theorem}[B: descent]\label{thm:B}
\begin{enumerate}[label=\textup{(\roman*)}]
\item $\Map(X\hquot G^\delta,\BTc)$ is the groupoid of prequantum data $(Y,\lambda)$ with an action of the abstract group $G$ by automorphisms.
\item The groupoid of equivariant prequantum data is the fibre product
\[
\Map(X\hquot G,\B T_P)\times_{\Map(X\hquot G^\delta,\B T_P)}\Map(X\hquot G^\delta,\BTc),
\]
and its objects have the moment maps $\mu$ of \cref{thm:A}, which are equivariant smooth maps $X\to\Gs$.
\item $\Map(X\hquot G,\BTc)$ is the full subgroupoid of equivariant prequantum data with $\mu=0$.
\item If the action of $G$ on $X$ is principal and $\mu=0$, then $(Y,\lambda)$ is the pullback of a bundle with connection $(Y_0,\lambda_0)$ on $X/G$,
unique up to isomorphism, whose curvature $\omega_0$ satisfies $\pi_G^*\omega_0=\omega$.
\end{enumerate}
\end{theorem}
\begin{proof}
The homotopy quotient is the colimit of the simplicial object $G^{\bullet}\times X$, and $\BTc$ is $1$-truncated, so a map out of it is a descent
datum: an object over $X$, an isomorphism between its two pullbacks to $G\times X$, and a cocycle condition over $G\times G\times X$. By
\cref{prop:BTconn} the object is a pair $(Y,\lambda)$. An isomorphism $\pr_X^*Y\to a^*Y$ of principal bundles over $G\times X$ is a smooth map
$\Phi\colon G\times Y\to Y$ covering the action and commuting with $T_P$; the cocycle condition is that $\Phi$ be an action; and the isomorphism
preserves the connections if and only if
\begin{equation}\label{eq:descent}
\Phi^*\lambda=\pr_Y^*\lambda\quad\text{on }G\times Y .
\end{equation}
By \cref{cor:product-momenta}, \eqref{eq:descent} holds if and only if $g_Y^*\lambda=\lambda$ for all $g$ and $\hat y^*\lambda=0$ for all $y$, that is, if and only if
$\Phi$ is an equivariant prequantisation with $\mu=0$. This is (iii). For $G^\delta$ the plots of the first factor are locally constant, the
slices $G\times\{y\}$ contribute nothing, and smoothness in $g$ is no condition; this is (i). For (ii), the fibre product imposes that the
bundle isomorphism be smooth over $G\times X$ and preserve the connection on each slice $\{g\}\times X$. (iv) By \VolI{Theorem~7.2},
$X/G\simeq X\hquot G$, so (iii) is a map $X/G\to\BTc$, which is a bundle with connection by \cref{prop:BTconn}; its curvature pulls back to $\omega$
because $F$ is a map of stacks.
\end{proof}
Three conditions that are stated together in the classical theory are separate in the theorem. Invariance of the connection under each group element is
descent to $X\hquot G^\delta$. Smoothness of the lifted action is descent of the underlying bundle to $X\hquot G$. The vanishing of the
moment map is the remaining condition for the connection: it is the statement that the connection has no component along the group.
\section{The central extension}
Suppose only that each $\rho(g)$ lifts to an automorphism of $(Y,\lambda)$, and let
\[
\hat G=G\times_{\Dif(X,\omega)}\Aut(Y,\lambda)=\set{(g,\phi)\mid\phi\text{ covers }\rho(g)}
\]
with the subspace diffeology of the product.
\begin{theorem}[The prequantum extension]\label{thm:extension}
\begin{enumerate}[label=\textup{(\roman*)}]
\item $1\to T_P\xrightarrow{\,i\,}\hat G\to G\to1$ is a central extension of diffeological groups.
\item $\hat G$ acts on $(Y,\lambda)$ by automorphisms, so $(Y,\lambda)$ is an equivariant prequantisation for $\hat G$, with an equivariant moment map
$\hat\mu\colon X\to\hat{\mathcal G}^*$ by \cref{thm:A}.
\item $i^*\hat\mu(x)=\theta$ for every $x$: the moment map of the centre is the constant $1$.
\item The equivariant prequantisations for $G$ are the smooth homomorphic sections $s$ of $\hat G\to G$, and the moment map of $s$ is $s^*\circ\hat\mu$.
\end{enumerate}
\end{theorem}
\noindent The proof is \cref{exo:extension}. By part (iv) the obstruction to an equivariant prequantisation is the class of the extension: if $\hat G\to G$
has no homomorphic section there is no equivariant prequantisation, although every element of $G$ preserves the isomorphism class of the bundle.
\begin{example}[Translations and the Heisenberg group]\label{ex:heis-extension}
Let $X=\R^{2n}$ with a constant symplectic form $\Omega$, the antisymmetrisation of a bilinear form $B$, and $G=\R^{2n}$ acting by translations. By
\cref{thm:KS}, $\hat G$ is the Heisenberg group $\Heis_B$ acting on $Y=\Heis_B$ by left multiplication. The commutator of $(u,c)$ and $(v,c')$ is
$(0,-\Omega(u,v))$, while $G$ is abelian: there is no homomorphic section. The moment map of $\Heis_B$ is computed from the orbit map
$(a,c)\mapsto(a,c)(x,0)=(a+x,\,c-B(a,x))$:
\[
\hat\mu(x)=\lambda_{\Heis}+\Omega(x,\cdot),\qquad\lambda_{\Heis}=\dd c+B(a,\dd a),
\]
where $\lambda_{\Heis}$ is the left-invariant form dual to the centre. The coadjoint action on it is
$\Ad_*(u,c)\,\lambda_{\Heis}=\lambda_{\Heis}+\Omega(u,\cdot)$ (\cref{exo:heis-coadjoint}).
\end{example}
Comparing with \cref{ex:translations}: the non-equivariant moment map $\mu(x)=\Omega(x,\cdot)$ of the translations is the non-central part of the
equivariant moment map $\hat\mu$ of the Heisenberg group, and its Souriau cocycle $\theta(u)=\Omega(u,\cdot)$ is the coadjoint action of the extension on
the central momentum. The affine coadjoint orbit of \cref{exo:plane-orbit} is the linear coadjoint orbit of $\lambda_{\Heis}$ in $\hat{\mathcal G}^*$.
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{3.3cm}p{4.6cm}p{5.2cm}@{}}\toprule
obstruction & vanishes when & example where it is non-zero\\\midrule
holonomy $\Gamma\subset\Gs$ & the action is Hamiltonian & translations of a quasi-torus (\cref{prop:dual-torus})\\
Souriau class $\sigma$ & some moment map is equivariant & translations of the plane (\cref{ex:translations})\\
class of $\hat G\to G$ & the action lifts to $(Y,\lambda)$ & translations and $\Heis$ (\cref{ex:heis-extension})\\
moment map $\mu$ & $(Y,\lambda)$ descends to $X\hquot G$ & rotations of the plane (\cref{ex:rotations})\\\bottomrule
\end{tabular}
\caption{Four successive obstructions for a group acting on a prequantised space.}\label{tab:obstructions}
\end{table}
\exercisesheading
\begin{exercise}[label=exo:rot-levels]{1}
For the rotations of $\C$ and the trivial bundle $\C\times T_P$ with $\lambda=\alpha+\theta$, list the equivariant structures and their moment maps.
\end{exercise}
\begin{solution}
The action $e^{i\varphi}\cdot(z,t)=(e^{i\varphi}z,t)$ is an equivariant structure with $\mu_0(z)=\tfrac12\abs z^2$ (\cref{ex:rotations}). By
\cref{prop:levels} the others are $e^{i\varphi}\star(z,t)=(e^{i\varphi}z,\,t+c\varphi)$, defined when $2\pi c\in P$, with moment map $\tfrac12\abs z^2+c$. For
$P=0$ only $c=0$ occurs; for $P=2\pi\Z$ the levels are the integers; for $P=2\pi(\Z+\alpha\Z)$ they are the dense set $\Z+\alpha\Z$.
\end{solution}
\begin{exercise}[label=exo:heis-coadjoint]{2}
Verify the two formulas of \cref{ex:heis-extension}.
\end{exercise}
\begin{solution}
The form $\lambda=\dd z+B(v,\dd v)$ pulled back by $(a,c)\mapsto(a+x,c-B(a,x))$ is
$\dd c-B(\dd a,x)+B(a+x,\dd a)=\dd c+B(a,\dd a)+B(x,\dd a)-B(\dd a,x)=\lambda_{\Heis}+\Omega(x,\dd a)$. Right multiplication by $(u,c')$ is
$(a,c)\mapsto(a+u,\,c+c'-B(a,u))$, and pulls $\lambda_{\Heis}$ back to $\dd c-B(\dd a,u)+B(a+u,\dd a)=\lambda_{\Heis}+\Omega(u,\dd a)$.
\end{solution}
\begin{exercise}[label=exo:hopf-su2]{3}
Let $Y=S^3\subset\C^2$ with $\lambda=\operatorname{Im}(\bar z_1\dd z_1+\bar z_2\dd z_2)$ and the action of $U(1)$ by scalars. Show that $U(2)$ acts by
automorphisms, that the induced action on $S^2=Y/U(1)$ is that of $\mathrm{SO}(3)$, and that the extension $\hat G\to\mathrm{SO}(3)$ of
\cref{thm:extension} has no homomorphic section.
\end{exercise}
\begin{solution}
$\lambda$ is the restriction of the imaginary part of the Hermitian form $\langle z,\dd z\rangle$, which is $U(2)$-invariant, and $U(2)$ commutes with scalars.
The induced action on $\C P^1=S^2$ is by $PU(2)=U(2)/U(1)\cong\mathrm{SO}(3)$, and the kernel $U(1)$ is the structure group; by \cref{thm:KS} the
automorphisms covering a given rotation are a coset of $U(1)$, so $\hat G=U(2)$. A homomorphic section $\mathrm{SO}(3)\to U(2)$ would be a
two-dimensional unitary representation of $\mathrm{SO}(3)$ inducing the identity of $PU(2)$. The irreducible representations of
$\mathrm{SO}(3)$ have odd dimension, so a two-dimensional one is a sum of characters, hence trivial since $\mathrm{SO}(3)$ is perfect; this
contradicts the condition on $PU(2)$. So the Hopf bundle is an equivariant prequantisation for $SU(2)$ and for $U(2)$, and for no action of
$\mathrm{SO}(3)$.
\end{solution}
\begin{exercise}[label=exo:levels]{3}
Prove \cref{prop:levels}.
\end{exercise}
\begin{solution}
Let $\Phi,\Phi'$ be two equivariant structures covering $\rho$. For each $g$, $g'_Y\circ g_Y^{-1}$ is an automorphism covering the identity, hence the
action of a constant $\chi(g)\in T_P$ by \cref{thm:KS}. Since $T_P$ is central in $\Aut(Y,\lambda)$, $\chi$ is a homomorphism; it is smooth because
$\Phi$ and $\Phi'$ are. Conversely $g\star y=\chi(g)\cdot(g\cdot y)$ is an action by automorphisms. Its orbit map is $\Phi_T\circ(\chi,\hat y)$, and by
\cref{lem:connection}(i) it pulls $\lambda$ back to $\chi^*\theta+\hat y^*\lambda$. For $G=\R/2\pi\Z$, a smooth character to $\R/P$ lifts to $\varphi\mapsto c\varphi$ with
$2\pi c\in P$, and $\chi^*\theta=c\,\dd\varphi$.
\end{solution}
\begin{exercise}[label=exo:extension]{4}
Prove \cref{thm:extension}.
\end{exercise}
\begin{solution}
(i) The projection $\hat G\to G$ is a smooth homomorphism, surjective by hypothesis, with kernel the automorphisms covering the identity, which is
$T_P$ by \cref{thm:KS}, central in $\Aut(Y,\lambda)$ and hence in $\hat G$. (ii) The second projection $\hat G\to\Aut(Y,\lambda)$ is a smooth homomorphism
covering the action $\rho\circ\pr_1$ of $\hat G$ on $X$. (iii) The orbit map of $y$ restricted to the centre is the orbit map of the principal
action of $T_P$, and $\lambda$ is calibrated. (iv) A smooth homomorphic section $s$ is a smooth homomorphism $G\to\Aut(Y,\lambda)$ lifting $\rho$, and
conversely. The orbit maps satisfy $\hat y^{G}=\hat y^{\hat G}\circ s$, so the moment map is $s^*\hat\mu$.
\end{solution}
\chapter{Reduction}\label{ch:reduction}
\chaptermark{Reduction}
\begin{chapabstract}
The reduced space of an equivariantly prequantised space is the quotient of the zero level of the moment map. When the group acts principally
on the level set, the quotient is a parasymplectic space with a prequantum bundle of the same structure group, and no regularity of the level set is
required. Reduction at an irrational level produces prequantum bundles whose structure group is an irrational torus. For non-principal actions the
prequantum data are defined on the stack quotient, and reduction can be performed in stages.
\end{chapabstract}
\section{The reduction theorem}
Let $(Y,\lambda)$ be an equivariant prequantisation of $(X,\omega)$ for a diffeological group $G$, with moment map $\mu\colon X\to\Gs$ (\cref{thm:A}). Put
\[
Z=\mu^{-1}(0)\subseteq X,\qquad Y_Z=\pi^{-1}(Z)\subseteq Y,\qquad X_0=Z/G,\qquad Y_0=Y_Z/G,
\]
with subspace and quotient diffeologies. The subset $Z$ is invariant because $\mu$ is equivariant and the coadjoint action is linear. The space
$X_0$ is the \defn{reduced space}.
\begin{lemma}\label{lem:principal}
\begin{enumerate}[label=\textup{(\alph*)}]
\item If $G$ acts principally on $Z$ and $W\to Z$ is a smooth equivariant map of $G$-spaces, then $G$ acts principally on $W$.
\item If commuting actions of $H$ and $K$ on $W$ define a principal action of $H\times K$, then $K$ acts principally on $W/H$, with quotient
$W/(H\times K)$. Conversely, if $H$ acts principally on $W$ and $K$ acts principally on $W/H$, then $H\times K$ acts principally on $W$.
\item If $q\colon W\to B$ is a subduction and $A\subseteq W$ is saturated, $A=q^{-1}(q(A))$, then $q|_A\colon A\to q(A)$ is a subduction for the subspace
diffeologies.
\end{enumerate}
\end{lemma}
\noindent The proof is \cref{exo:principal}.
\begin{theorem}[C: reduction]\label{thm:reduction}
Suppose $G$ acts principally on $Z=\mu^{-1}(0)$. Then:
\begin{enumerate}[label=\textup{(\roman*)}]
\item there is a unique closed $2$-form $\omega_0$ on $X_0$ with $\pi_G^*\omega_0=\omega|_Z$;
\item $Y_0\to X_0$ is a principal $T_P$-bundle, and $\lambda|_{Y_Z}$ descends to a connection form $\lambda_0$ on $Y_0$ with curvature $\omega_0$;
\item $(Y_0,\lambda_0)$ is the bundle with connection on $Z/G\simeq Z\hquot G$ of \cref{thm:B}(iv).
\end{enumerate}
So $(X_0,\omega_0)$ is a parasymplectic space prequantised by $(Y_0,\lambda_0)$ with the same group of periods $P$.
\end{theorem}
\begin{proof}
\emph{The bundle.} The projection $Y_Z\to Z$ is equivariant, so $G$ acts principally on $Y_Z$ by \cref{lem:principal}(a). The torus $T_P$ acts
principally on $Y_Z$, the restriction of a principal bundle. The product $G\times T_P$ acts principally on $Y_Z$: if $(g,\tau)\cdot y=y$ then $g$ fixes
$\pi(y)$, so $g=1$ and then $\tau=1$; and if $r\mapsto(y_r,g_r\tau_ry_r)$ is a plot of $Y_Z\times Y_Z$ then $r\mapsto g_r$ is a plot of $G$ by principality on
$Z$, hence $r\mapsto\tau_ry_r$ is a plot, and $r\mapsto\tau_r$ is a plot of $T_P$. By \cref{lem:principal}(b), $T_P$ acts principally on $Y_0=Y_Z/G$ with quotient
$Y_Z/(G\times T_P)=(Y_Z/T_P)/G=Z/G$.
\emph{The connection.} Every $g_Y$ preserves $\lambda$, and for $y\in Y_Z$ the orbit pullback $\hat y^*\lambda=\mu(\pi(y))$ vanishes. By
\cref{cor:product-momenta}, $\Phi^*\lambda=\pr_Y^*\lambda$ on $G\times Y_Z$, and by \cref{prop:basic}(i) the form $\lambda|_{Y_Z}$ descends to a form $\lambda_0$ on $Y_0$.
It is invariant under $T_P$ because $\lambda$ is and the quotient map $q\colon Y_Z\to Y_0$ is equivariant. It is calibrated: the orbit map of $q(y)$ under
$T_P$ is $q\circ\hat y$, and $(q\circ\hat y)^*\lambda_0=\hat y^*\lambda=\theta$.
\emph{The curvature.} Let $\omega_0$ be the curvature of $\lambda_0$ (\cref{lem:connection}), so $\pi_0^*\omega_0=\dd\lambda_0$ with $\pi_0\colon Y_0\to X_0$. Then
\[
\pi^*\pi_G^*\omega_0=q^*\pi_0^*\omega_0=q^*\dd\lambda_0=\dd\lambda|_{Y_Z}=\pi^*(\omega|_Z),
\]
and $\pi^*$ is injective; so $\pi_G^*\omega_0=\omega|_Z$. Uniqueness holds because $\pi_G^*$ is injective. (iii) Both bundles pull back to $(Y_Z,\lambda)$ with
its descent datum, and descent data determine the descended object.
\end{proof}
Three features of the statement differ from the theorem of Marsden and Weinstein \cite{MarsdenWeinstein}. The level set is an arbitrary
subset with the subspace diffeology: $0$ need not be a regular value, and $Z$ need not be a manifold. The group is an arbitrary
diffeological group. And the hypothesis is the single condition that the action on $Z$ be principal, which for a Lie group acting on a
manifold $Z$ is the classical condition that the action be free and proper \VolI{\S7.1}.
\begin{corollary}[The exact case]\label{cor:exact-reduction}
Let $\alpha$ be an invariant $1$-form on $X$, $\omega=\dd\alpha$, $\mu(x)=\hat x^*\alpha$. If $G$ acts principally on $Z=\mu^{-1}(0)$, then $\alpha|_Z$ descends to a
$1$-form $\alpha_0$ on $Z/G$ and $\omega_0=\dd\alpha_0$.
\end{corollary}
\begin{figure}[t]
\centering
\begin{tikzcd}[column sep=3.6em,row sep=2.4em]
Y \arrow[d,"\pi"'] & Y_Z \arrow[l,hook'] \arrow[r,"q","/G"'] \arrow[d] & Y_0 \arrow[d,"\pi_0"] & \lambda & \lambda|_{Y_Z} \arrow[l,mapsto] \arrow[r,mapsfrom] & \lambda_0\\
X & Z=\mu^{-1}(0) \arrow[l,hook'] \arrow[r,"\pi_G","/G"'] & X_0 & \omega & \omega|_Z \arrow[l,mapsto] \arrow[r,mapsfrom] & \omega_0
\end{tikzcd}
\caption{Reduction of a prequantised space. Each column is a principal $T_P$-bundle with connection; the right-hand squares are pullbacks of
bundles with connection.}\label{fig:reduction}
\end{figure}
\section{Levels and periods}
Reduction at a non-zero level is reduction at zero for a twisted lift. By \cref{prop:levels}, a character $\chi\colon G\to T_P$ changes the moment
map to $\mu+\chi^*\theta$; so $\mu^{-1}(-\chi^*\theta)$ is the zero level of an equivariant prequantisation, and \cref{thm:reduction} applies to it. For the
circle the admissible levels are the $c$ with $2\pi c\in P$. If $\omega$ is exact, every $P$ is available for the bundle upstairs
(\cref{ex:exact-prequantum}), and the level determines the smallest one: \emph{reduction of an exact form at the level $c$ produces a
prequantum bundle whose group of periods is generated by $2\pi c$}.
\begin{example}[Projective space]\label{ex:CPn}
Let $X=\C^{n+1}$ with $\alpha=\tfrac12\sum(x_k\dd y_k-y_k\dd x_k)$, and let $S^1$ act by scalars, $\mu_0=\tfrac12\abs z^2$. Fix $c>0$, $P=2\pi c\Z$,
$Y=\C^{n+1}\times T_P$, $\lambda=\alpha+\theta$, with the lift $e^{i\varphi}\cdot(z,t)=(e^{i\varphi}z,\,t-c\varphi)$ and moment map $\tfrac12\abs z^2-c$. The zero level is the
sphere of radius $\sqrt{2c}$, on which $S^1$ acts principally, and $X_0=\C P^n$. Each orbit in $Y_Z$ intersects $\{t=0\}$ exactly once, so
$Y_0\cong S^{2n+1}$ with $\lambda_0=\alpha|_{S^{2n+1}}$: the Hopf bundle, with $\int_{\C P^1}\omega_0=2\pi c$.
\end{example}
\begin{theorem}[The prequantum bundle of $S^2\times S^2$]\label{thm:S2S2}
Let $c_1,c_2>0$, $P=2\pi(c_1\Z+c_2\Z)$, and let $T^2$ act on $X=\C^2\times\C^2$ by scalars on the two factors, lifted to $Y=X\times T_P$ by
$(\varphi_1,\varphi_2)\cdot(z,w,t)=(e^{i\varphi_1}z,\,e^{i\varphi_2}w,\,t-c_1\varphi_1-c_2\varphi_2)$. Let $K\subset\R^2$ be the line $c_1\varphi_1+c_2\varphi_2=0$ and $\bar K$ its
image in $T^2$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item The reduced space is $(S^2\times S^2,\ c_1\omega_1+c_2\omega_2)$ with $\int_{S^2}\omega_i=2\pi$.
\item The reduced prequantum bundle is $Y_0\cong(S^3\times S^3)/K$, the space of orbits of the linear flow of slope $-c_1/c_2$ on the tori
$T^2\cdot(z,w)$, with structure group $T^2/\bar K\cong T_P$.
\item If $c_1/c_2$ is rational, $\bar K$ is a circle, $Y_0$ is a compact $5$-manifold and $T_P$ is a circle.
\item If $c_1/c_2$ is irrational, $T_P$ is an irrational torus, $K\cong\R$ acts principally on $S^3\times S^3$, and $Y_0$ has the shape of
$S^3\times S^3$; its D-topology is not Hausdorff.
\end{enumerate}
\end{theorem}
\begin{proof}
The lift is defined on $T^2$ because $2\pi c_i\in P$, and it preserves $\lambda=\alpha_1+\alpha_2+\theta$. By \cref{prop:levels} the moment map is
$(\tfrac12\abs z^2-c_1,\ \tfrac12\abs w^2-c_2)$, with zero level $Z=S^3\times S^3$, on which $T^2$ acts freely and properly. This gives (i) by
\cref{thm:reduction} and \cref{ex:CPn}. (ii) The map $S^3\times S^3\to Y_0$, $(z,w)\mapsto[z,w,0]$, is a subduction: a plot of $Y_0$ lifts locally to
$S^3\times S^3\times\R$, and the rotation by $\varphi_1=t/c_1$ moves it into $\{t=0\}$. Two points of $\{t=0\}$ are identified if and only if they differ by
$(\varphi_1,\varphi_2)$ with $c_1\varphi_1+c_2\varphi_2\in P$, that is, by an element of $K+(2\pi\Z)^2$. The structure group acts through
$T^2/\bar K=\R^2/(K+(2\pi\Z)^2)$, which $(\varphi_1,\varphi_2)\mapsto c_1\varphi_1+c_2\varphi_2$ maps isomorphically to $\R/P$. (iii) is clear. (iv) The map $K\to T^2$ is
the irrational winding, an induction \IZ{Exercise~31}; so a plot of $T^2$ with values in $\bar K$ is a plot of $K$, and the action of $K$ on
$S^3\times S^3$, a restriction of the principal action of $T^2$, is principal. By \VolI{Theorem~5.4} the shape of $Y_0$ is the quotient of the shape
of $S^3\times S^3$ by that of $K\cong\R$, which is contractible. The D-topology is \cref{exo:nonhausdorff}.
\end{proof}
So the prequantum bundle of a product of spheres with incommensurable areas, which exists by \cref{thm:integration2}, has the explicit model
$(S^3\times S^3)/\R$: a diffeological space of dimension $5$ with the homotopy type of $S^3\times S^3$, fibred over $S^2\times S^2$ by irrational tori.
As the ratio $c_1/c_2$ varies, the manifolds of (iii) and the spaces of (iv) alternate densely.
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\fill[hcsmist] (0,0) rectangle (2.6,2.6);
\begin{scope}
\clip (0,0) rectangle (2.6,2.6);
\foreach \n in {-12,...,22}{
\pgfmathsetmacro{\c}{\n*0.6180339*0.42}
\draw[hcsteal,line width=0.4pt] (0,2.6+\c) -- (2.6,2.6+\c-2.6*0.6180339);}
\end{scope}
\draw[hcsink] (0,0) rectangle (2.6,2.6);
\node[below] at (1.3,0) {$\varphi_1$}; \node[left] at (0,1.3) {$\varphi_2$};
\node[above] at (1.3,2.6) {$\bar K\subset T^2$};
\draw[->>,line width=0.6pt] (2.9,1.3)--(3.9,1.3);
\draw[hcsrust,line width=1pt] (4.5,1.3) circle (0.55);
\foreach \k in {0,...,16}{\pgfmathsetmacro{\an}{\k*222.49} \fill[hcsink] (4.5,1.3)++(\an:0.55) circle (0.9pt);}
\node[above] at (4.5,1.95) {$T^2/\bar K\cong T_P$};
\end{scope}
\begin{scope}[xshift=6.4cm,yshift=0.1cm]
\draw[->,line width=0.5pt] (0,0)--(5.0,0) node[right]{$\tfrac12\abs z^2$};
\foreach \k in {0,...,4}{\draw[hcsteal,line width=1pt] (\k*1.1,-0.12)--(\k*1.1,0.12); \node[below,hcsteal] at (\k*1.1,-0.12) {\k};}
\node[above right,hcsteal] at (0,0.12) {$P=2\pi\Z$};
\draw[->,line width=0.5pt] (0,1.5)--(5.0,1.5) node[right]{$\tfrac12\abs z^2$};
\foreach \m in {0,...,4}{\foreach \n in {0,...,6}{
\pgfmathsetmacro{\v}{\m*1.1+\n*1.1*0.6180339}
\ifdim\v pt<4.7pt \draw[hcsrust,line width=0.6pt] (\v,1.4)--(\v,1.6);\fi}}
\node[above right,hcsrust] at (0,1.62) {$P=2\pi(\Z+\alpha\Z)$};
\node[below,align=center] at (2.5,-0.6) {admissible levels $c$, $2\pi c\in P$};
\end{scope}
\end{tikzpicture}
\caption{Left: the kernel of $T^2\to T_P$ in \cref{thm:S2S2} is a dense line; the structure group is its space of leaves. Right: the
levels at which a circle action can be reduced together with its prequantum bundle form the group $\tfrac1{2\pi}P$.}\label{fig:levels}
\end{figure}
\section{Non-principal actions}
When the action on $Z$ is not principal, \cref{thm:B}(iii) still applies to the $G$-space $Z$.
\begin{theorem}[Reduction to the stack]\label{thm:stack-reduction}
For every equivariant prequantisation, the restriction of $(Y,\lambda)$ to $Z=\mu^{-1}(0)$ is a map $\nabla_0\colon Z\hquot G\to\BTc$, and $\omega|_Z$ is a closed
$2$-form on $Z\hquot G$ in the sense of \eqref{eq:basic}, the curvature of $\nabla_0$.
\end{theorem}
\begin{proof}
The moment map of the $G$-space $Z$ with the restricted bundle is zero, so \cref{thm:B}(iii) gives $\nabla_0$. Composing with $F$ gives a map
$Z\hquot G\to\Omcl$ restricting to $\omega|_Z$.
\end{proof}
By \VolI{Theorem~7.8} the stack $Z\hquot G$ maps to the diffeological orbit space $Z/G$, and the question is which of the data descend
further. For the form there is a general answer when $Z$ is a manifold.
\begin{theorem}[Karshon--Watts \cite{KarshonWatts}]\label{thm:KW}
Let a Lie group $G$ act on a manifold $M$ so that its identity component acts properly. Then $\pi^*$ is an isomorphism from the diffeological
forms on $M/G$ onto the basic forms on $M$, that is, the invariant forms annihilated by the contractions with the generators of the action.
\end{theorem}
\begin{corollary}\label{cor:orbifold-reduction}
In the situation of \cref{thm:KW}, let $M=Z=\mu^{-1}(0)$ be a submanifold of a manifold $X$. Then $\omega|_Z$ descends to a closed $2$-form on the
diffeological space $Z/G$. The bundle $Y_Z/G\to Z/G$ has fibre $T_P/\chi_z(G_z)$ over the orbit of $z$, where $\chi_z\colon G_z\to T_P$ is the
character by which the stabiliser acts on the fibre of $Y$ over $z$.
\end{corollary}
\begin{proof}
$\omega|_Z$ is invariant, and $\iota_{\xi_Z}\omega|_Z=-\dd\langle\mu,\xi\rangle|_Z=0$, so it is basic. The stabiliser $G_z$ preserves the fibre $Y_z$ and commutes with
$T_P$, so it acts by translations through a homomorphism $\chi_z$, and the fibre of $Y_Z/G$ over $[z]$ is $Y_z/G_z$.
\end{proof}
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{3.0cm}p{3.5cm}p{3.2cm}p{3.4cm}@{}}\toprule
quotient of $Z$ & object & reduced $2$-form & reduced prequantum bundle\\\midrule
$Z\hquot G$ & stack & always (\cref{thm:stack-reduction}) & always\\
$Z/G$, action principal & diffeological space, $\simeq Z\hquot G$ & yes (\cref{thm:reduction}) & yes\\
$Z/G$, $Z$ manifold, proper & diffeological space & yes (\cref{cor:orbifold-reduction}) & where the characters $\chi_z$ are trivial\\\bottomrule
\end{tabular}
\caption{What descends to which quotient.}\label{tab:reduced}
\end{table}
For the circle acting on $\C^2$ with weights $(1,2)$ at a positive level, $Z=S^3$, $Z/G$ is the teardrop orbifold with one point of
structure group $\Z_2$, the reduced form exists by \cref{cor:orbifold-reduction}, and the reduced bundle is a principal bundle away from that
point. An example with $X$ of infinite dimension and singular reduced space is in \cite{IZred}.
\section{Reduction in stages}
\begin{theorem}[Stages]\label{thm:stages}
Let $G$ and $H$ act on $X$ by commuting actions, and let $(Y,\lambda)$ be an equivariant prequantisation for $G\times H$, with moment map
$(\mu_G,\mu_H)\colon X\to\Gs\times\Hs$ and zero levels $Z_G$, $Z_H$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item $\mu_H$ is $G$-invariant. The group $H$ acts on $X_G=Z_G/G$, and
\[
(Z_G\cap Z_H)/(G\times H)\;\cong\;\bigl((Z_G\cap Z_H)/G\bigr)/H
\]
as diffeological spaces, where $(Z_G\cap Z_H)/G$ is a subspace of $X_G$.
\item If $G$ acts principally on $Z_G$ and $H$ acts principally on $(Z_G\cap Z_H)/G$, then $G\times H$ acts principally on $Z_G\cap Z_H$, the reduced
space $X_G$ is prequantised and $H$-equivariant with moment map induced by $\mu_H$, and the reduction of $X_G$ by $H$ is the reduction of $X$ by
$G\times H$, with the same $2$-form and the same prequantum bundle.
\end{enumerate}
\end{theorem}
\noindent The proof is \cref{exo:stages}.
\exercisesheading
\begin{exercise}[label=exo:point]{1}
Reduce the plane $\C$ by the rotations at a level $c>0$, with $P=2\pi c\Z$.
\end{exercise}
\begin{solution}
With the lift of \cref{ex:CPn} for $n=0$, the zero level is the circle $\abs z^2=2c$, on which $S^1$ acts principally, and $X_0$ is a point. The
bundle $Y_Z=S^1\times T_P$ has the action $e^{i\varphi}\cdot(z,t)=(e^{i\varphi}z,t-c\varphi)$, and $Y_0\cong S^1$ by the slice $t=0$; under $T_P=\R/2\pi c\Z$ the
orbit of a point of $Y_0$ is all of $Y_0$. So $Y_0\to X_0$ is $T_P\to\ast$, the only principal bundle over a point, and $\omega_0=0$.
\end{solution}
\begin{exercise}[label=exo:rational]{2}
In \cref{thm:S2S2} let $c_1=p$ and $c_2=q$ be coprime positive integers. Describe $\bar K$, $T_P$ and $Y_0$.
\end{exercise}
\begin{solution}
$P=2\pi(p\Z+q\Z)=2\pi\Z$, so $T_P$ is the circle of length $2\pi$. The line $p\varphi_1+q\varphi_2=0$ is $\varphi=s(q,-p)$, and its image in $T^2$ is the circle
$s\in\R/2\pi\Z$, embedded because $p,q$ are coprime. So $Y_0=(S^3\times S^3)/S^1$ for the action $e^{is}\cdot(z,w)=(e^{iqs}z,e^{-ips}w)$, which is free;
$Y_0$ is a compact $5$-manifold, a circle bundle over $S^2\times S^2$ with Chern class $(p,q)$ in the basis dual to the two spheres, since the
curvature has the periods $2\pi p$ and $2\pi q$ on them.
\end{solution}
\begin{exercise}[label=exo:nonhausdorff]{3}
Show that for $c_1/c_2$ irrational the D-topology of $Y_0=(S^3\times S^3)/K$ is not Hausdorff, and determine the closure of a point.
\end{exercise}
\begin{solution}
The D-topology of a quotient is the quotient of the D-topology \IZ{art.~2.12}, here of the manifold topology of $S^3\times S^3$. The orbit of $(z,w)$
under $K$ is dense in the orbit under $T^2$, because $\bar K$ is dense in $T^2$. A saturated closed set containing $(z,w)$ therefore contains
$T^2\cdot(z,w)$, and conversely the $T^2$-orbit is closed and saturated. So the closure of the point $[z,w]\in Y_0$ is the fibre of
$Y_0\to S^2\times S^2$ through it, a copy of $T_P$, and two points of one fibre have no disjoint neighbourhoods. The quotient of $Y_0$ by the relation
of having the same closure is $S^2\times S^2$.
\end{solution}
\begin{exercise}[label=exo:principal]{3}
Prove \cref{lem:principal}.
\end{exercise}
\begin{solution}
(a) If $gw=w$ then $g$ fixes the image of $w$ in $Z$, so $g=1$. Let $r\mapsto(w_r,g_rw_r)$ be a plot of $W\times W$. Its image in $Z\times Z$ is a plot
$r\mapsto(z_r,g_rz_r)$, so $r\mapsto g_r$ is a plot of $G$, because the action map of $Z$ is an induction; then $r\mapsto(g_r,w_r)$ is a plot of $G\times W$.
(b) If $k[w]=[w]$ then $kw=hw$ for some $h$, so $(h^{-1},k)$ fixes $w$ and $k=1$. Let $r\mapsto([w_r],k_r[w_r])$ be a plot of $(W/H)^2$; locally it
lifts to a plot $r\mapsto(w_r,w'_r)$ of $W^2$ with $w'_r=h_rk_rw_r$, and $r\mapsto(h_r,k_r)$ is a plot of $H\times K$ by principality, so $r\mapsto k_r$ is a plot.
The quotient of $W/H$ by $K$ is $W/(H\times K)$ because a composite of subductions is a subduction. Conversely, if $(h,k)w=w$ then $k[w]=[w]$,
so $k=1$ and then $h=1$; and for a plot $r\mapsto(w_r,h_rk_rw_r)$ the projection to $(W/H)^2$ gives that $r\mapsto k_r$ is a plot, hence
$r\mapsto h_rw_r=k_r^{-1}w'_r$ is a plot, and $r\mapsto h_r$ is a plot.
(c) Let $Q$ be a plot of $B$ with values in $q(A)$. Locally $Q=q\circ\tilde Q$ with $\tilde Q$ a plot of $W$, and $\tilde Q$ takes its values in
$q^{-1}(q(A))=A$; so $\tilde Q$ is a plot of the subspace $A$.
\end{solution}
\begin{exercise}[label=exo:stages]{4}
Prove \cref{thm:stages}.
\end{exercise}
\begin{solution}
\emph{Momenta of a product.} A left-invariant $1$-form on $G\times H$ is determined by its restrictions to the slices (\cref{lem:slices}), which by
invariance are determined by the restrictions to $G\times\{1\}$ and $\{1\}\times H$; conversely $\pr_G^*\beta+\pr_H^*\gamma$ is left-invariant. So the
momenta of $G\times H$ are $\Gs\times\Hs$, and since the factors commute, $\Ad_*(g,1)$ is the identity on $\Hs$. Equivariance of the moment map
(\cref{thm:A}) gives $\mu_H(gx)=\mu_H(x)$.
(i) The action of $H$ preserves $Z_G$ and commutes with $G$, so it descends to $X_G$. The set $Z_G\cap Z_H$ is saturated for $Z_G\to X_G$ because
$\mu_H$ is $G$-invariant; by \cref{lem:principal}(c) its image in $X_G$, with the subspace diffeology, is the quotient $(Z_G\cap Z_H)/G$. The
displayed isomorphism holds because both sides are quotients of $Z_G\cap Z_H$ by the same equivalence relation and subductions compose.
(ii) By \cref{thm:reduction}, $X_G$ is prequantised by $Y_G=Y_{Z_G}/G$ with $\lambda_G$. The action of $H$ on $Y_{Z_G}$ commutes with $G$ and preserves
$\lambda$, so it descends to an action on $Y_G$ preserving $\lambda_G$. Its moment map at $[x]$ is the pullback of $\lambda_G$ by the orbit map
$q\circ\hat y^H$, which is $(\hat y^H)^*\lambda=\mu_H(x)$. So the zero level in $X_G$ is $(Z_G\cap Z_H)/G$. The restriction of the principal action
of $G$ to the invariant subspace $Z_G\cap Z_H$ is principal, and by \cref{lem:principal}(b) so is the action of $G\times H$. Both reductions are
therefore defined on the same space. The two reduced $2$-forms pull back to $\omega|_{Z_G\cap Z_H}$ and the two connection forms to
$\lambda|_{Y_{Z_G\cap Z_H}}$; pullback along a subduction is injective, so they coincide.
\end{solution}
\part{Applications}
\chapter{Number theory: periods, ideals, and Heisenberg quasi-nilmanifolds}\label{ch:number-theory}
\chaptermark{Number theory}
\begin{chapabstract}
Let $K\subset\R$ be a number field with ring of integers $\OK$. For fractional ideals $\fa,\fb$ the product $\R/\fa\times\R/\fb$ is a
two-dimensional symplectic quasi-torus. Its diffeomorphism type is the Steinitz class of $\fa\oplus\fb$, its symplectic type is the ideal
$\fa\fb$, which is its group of periods, its symplectic mapping class group is a Hilbert modular group, and its prequantum bundle is a quotient
of the Heisenberg group by an arithmetic subgroup, with structure group $\R/\fa\fb$.
\end{chapabstract}
\section{Symplectic rigidity}
Volume~I attached to an irrational number $\alpha$ the one-dimensional torus $\Tal$ and read the arithmetic of $\Z+\alpha\Z$ from its diffeology
\VolI{Chapter~9}. A one-dimensional space carries no non-zero $2$-form (\cref{ex:dim1}); the first symplectic examples are quotients of the
plane.
\begin{theorem}[Symplectic rigidity of quasi-tori]\label{thm:symp-rigidity}
Let $\Gamma,\Gamma'\subset\R^{2n}$ be dense subgroups and $\Omega,\Omega'$ non-degenerate alternating forms.
\begin{enumerate}[label=\textup{(\roman*)}]
\item $(T_\Gamma,\omega_\Omega)\cong(T_{\Gamma'},\omega_{\Omega'})$ in $\ParaSymp$ if and only if there is $A\in\GL_{2n}(\R)$ with $A\Gamma=\Gamma'$ and $A^*\Omega'=\Omega$.
\item $\Dif(T_\Gamma,\omega_\Omega)=\set{[x]\mapsto[Ax+b]\mid A\in\Sp(\Gamma,\Omega),\ b\in\R^{2n}}$, where $\Sp(\Gamma,\Omega)=\set{A\in\Sp(\Omega)\mid A\Gamma=\Gamma}$. Its identity
component is the group $T_\Gamma$ of translations, and its group of components is $\Sp(\Gamma,\Omega)$.
\item The group $\Omega(\Gamma\wedge\Gamma)\subset\R$ generated by the toric periods $\Omega(\gamma,\gamma')$ is an invariant of $(T_\Gamma,\omega_\Omega)$.
\end{enumerate}
\end{theorem}
\noindent The proof is \cref{exo:symp-rigidity}; it combines the linear rigidity of \VolI{Theorem~9.1} with \cref{prop:forms-quasitori}.
For a lattice $\Gamma$ in the plane the only invariant is the area of the torus. For a dense subgroup the form $\Omega$ restricted to $\Gamma$ is a
homomorphism $\Lambda^2\Gamma\to\R$ of a group of rank $\binom{\rk\Gamma}2$, and its image is a dense subgroup of $\R$ with its own arithmetic.
\section{Tori attached to ideals}
Fix a number field $K$ of degree $d\ge2$ with an embedding $K\subset\R$. A fractional ideal $\fa$ is a dense subgroup of $\R$ of rank $d$, and
$T_\fa=\R/\fa$ is a one-dimensional quasi-torus with $\End(T_\fa)=\OK$; two of them are diffeomorphic if and only if the ideals have the same
class in $\Cl(K)$ \VolI{Proposition~9.5, Theorem~10.2}. For two fractional ideals put
\[
X_{\fa,\fb}=T_\fa\times T_\fb=\R^2/(\fa\oplus\fb),\qquad\omega=\text{the image of }\dd x\wedge\dd y .
\]
\begin{theorem}[Steinitz class and periods]\label{thm:steinitz}
\begin{enumerate}[label=\textup{(\roman*)}]
\item $X_{\fa,\fb}\cong X_{\fa',\fb'}$ as diffeological spaces if and only if $[\fa\fb]=[\fa'\fb']$ in $\Cl(K)$.
\item The group of toric periods of $(X_{\fa,\fb},\omega)$ is the ideal $\fa\fb\subset\R$.
\item $(X_{\fa,\fb},\omega)\cong(X_{\fa',\fb'},\omega)$ in $\ParaSymp$ if and only if $\fa\fb=\fa'\fb'$.
\item The symplectic mapping class group $\pi_0\Dif(X_{\fa,\fb},\omega)$ is
\[
\SL(\fa\oplus\fb)=\Bigl\{\begin{pmatrix}a&b\\c&d\end{pmatrix}\ \Big|\ a,d\in\OK,\ b\in\fa\fb^{-1},\ c\in\fa^{-1}\fb,\ ad-bc=1\Bigr\},
\]
which is conjugate in $\SL_2(K)$ to the Hilbert modular group $\SL(\OK\oplus\fa\fb)$.
\end{enumerate}
\end{theorem}
\begin{proof}
Let $M=\fa\oplus\fb$ and $M'=\fa'\oplus\fb'$, dense subgroups of $\R^2$. A matrix $A\in\GL_2(\R)$ with $AM\subseteq M'$ has entries in $K$: its first
column maps $\fa$ into $\fa'$ and into $\fb'$, so $a\in\fa'\fa^{-1}$ and $c\in\fb'\fa^{-1}$, and similarly for the second column. Hence $A$ is
$K$-linear on $K^2$ and commutes with multiplication by $\OK$: it is a homomorphism of $\OK$-modules $M\to M'$.
(i) By \VolI{Theorem~9.1}, $X_{\fa,\fb}\cong X_{\fa',\fb'}$ if and only if $AM=M'$ for some $A\in\GL_2(\R)$, that is, if and only if $M\cong M'$ as
$\OK$-modules. By Steinitz's theorem \cite{Milnor} a finitely generated torsion-free module over a Dedekind domain is determined by its rank
and its Steinitz class, which for $\fa\oplus\fb$ is $[\fa\fb]$.
(ii) For $m=(x,y)$ and $m'=(x',y')$ in $M$, $\Omega(m,m')=xy'-x'y$, and these elements generate $\fa\fb$.
(iii) If the spaces are symplectomorphic the groups of periods coincide, by \cref{thm:symp-rigidity}(iii). Conversely let $\fa\fb=\fa'\fb'=\fc$. By
(i) there is $B\in\GL_2(K)$ with $B(\OK\oplus\fc)=M$. For $m,m'\in K^2$, $\Omega(Bm,Bm')=\det B\cdot\Omega(m,m')$, so by (ii) $\fa\fb=\det B\cdot\fc$, and
$\det B$ is a unit of $\OK$. Then $B\cdot\mathrm{diag}((\det B)^{-1},1)$ has determinant $1$ and maps $\OK\oplus\fc$ onto $M$. The same holds for $M'$, and
the composite $M\to\OK\oplus\fc\to M'$ has determinant $1$; apply \cref{thm:symp-rigidity}(i).
(iv) By \cref{thm:symp-rigidity}(ii) the group is $\set{A\in\SL_2(\R)\mid AM=M}$. The inclusions $a\fa\subseteq\fa$, $b\fb\subseteq\fa$, $c\fa\subseteq\fb$, $d\fb\subseteq\fb$
give the stated conditions, which are stable under inversion in $\SL_2$. Conjugation by the matrix of (iii) carries it to $\SL(\OK\oplus\fc)$.
\end{proof}
\begin{corollary}\label{cor:class-group-law}
$T_\fa\times T_\fb\cong T_{\OK}\times T_{\fa\fb}$, and $T_\fa\times T_{\fa^{-1}}\cong T_{\OK}\times T_{\OK}$. The diffeomorphism classes of the spaces $X_{\fa,\fb}$
are in bijection with $\Cl(K)$, and under this bijection the product of tori is the multiplication of ideal classes.
\end{corollary}
So the class group, which in \VolI{Theorem~10.2} acted on the set of tori with real multiplication, is here the set of diffeomorphism types
of their pairwise products, with its group law. The finer invariant of (iii) is not a class: it is the ideal itself, as a subgroup of
$\R$. Rescaling the form multiplies it: $(X_{\OK,\fc},\lambda\omega)\cong(X_{\OK,\lambda\fc},\omega)$ for $\lambda\in K$, $\lambda>0$.
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\draw[->,line width=0.4pt] (0,1.4)--(9.4,1.4);
\draw[->,line width=0.4pt] (0,0)--(9.4,0);
\foreach \a in {-12,...,12}{\foreach \b in {-4,...,4}{
\pgfmathsetmacro{\v}{\a+\b*3.16228}
\pgfmathparse{(\v>0 && \v<4.5) ? 1 : 0}
\ifnum\pgfmathresult=1 \draw[hcsteal,line width=0.5pt] (2*\v,1.28)--(2*\v,1.52);\fi}}
\foreach \a in {-12,-10,...,12}{\foreach \b in {-4,...,4}{
\pgfmathsetmacro{\v}{\a+\b*3.16228}
\pgfmathparse{(\v>0 && \v<4.5) ? 1 : 0}
\ifnum\pgfmathresult=1 \draw[hcsrust,line width=0.5pt] (2*\v,-0.12)--(2*\v,0.12);\fi}}
\node[left] at (0,1.4) {$\OK$}; \node[left] at (0,0) {$\fp$};
\foreach \k in {0,1,2,3,4} \node[below,hcsgrey,font=\scriptsize] at (2*\k,-0.15) {\k};
\node[below,align=center] at (4.6,-0.6) {$\OK=\Z[\sqrt{10}]$ and $\fp=(2,\sqrt{10})$ in the interval $(0,4.5)$, coefficients bounded by $12$ and $4$};
\end{scope}
\end{tikzpicture}
\caption{The groups of periods of $(X_{\OK,\OK},\omega)$ and of $(X_{\OK,\fp},\omega)$ for $K=\Q(\sqrt{10})$: two dense subgroups of $\R$, one of index $2$
in the other, and not related by any rescaling since $\fp$ is not principal.}\label{fig:periods}
\end{figure}
\section{Heisenberg quasi-nilmanifolds}
Let $\Heis=\R^3$ with $(x,y,z)(x',y',z')=(x+x',y+y',z+z'-xy')$ and $\lambda=\dd z+x\,\dd y$ (\cref{ex:heisenberg}), and for an integer $n\ge1$ let
$\Heis_n$ be the same with $-nxy'$ and $\lambda_n=\dd z+nx\,\dd y$. Put $\fc=\fa\fb$ and
\[
N_{\fa,\fb}=\set{(a,b,c)\mid a\in\fa,\ b\in\fb,\ c\in\fc},\qquad Y^{(n)}_{\fa,\fb}=N_{\fa,\fb}\backslash\Heis_n .
\]
The set $N_{\fa,\fb}$ is a subgroup of $\Heis_n$ because $n\,\fa\fb\subseteq\fc$. It is dense in $\Heis_n$, and $Y^{(n)}_{\fa,\fb}$ is a diffeological
space of dimension $3$: a \emph{Heisenberg quasi-nilmanifold}.
\begin{theorem}[Arithmetic prequantisation]\label{thm:heis-prequantum}
\begin{enumerate}[label=\textup{(\roman*)}]
\item $Y^{(n)}_{\fa,\fb}\to X_{\fa,\fb}$ is a principal $T_\fc$-bundle, $\lambda_n$ descends to a connection form, and the curvature is $n\omega$. For $n=1$
the structure group is the smallest possible: $\fc$ is the group of toric periods.
\item A translation of $X_{\fa,\fb}$ lifts to an automorphism of $(Y^{(n)}_{\fa,\fb},\lambda_n)$ if and only if it is a translation by a point of
$X_{\fa,\fb}[n]=\tfrac1n(\fa\oplus\fb)/(\fa\oplus\fb)\cong(\OK/n)^2$. The lifts form a central extension
\[
1\longrightarrow T_\fc\longrightarrow G_n\longrightarrow X_{\fa,\fb}[n]\longrightarrow1,
\]
whose commutator is the pairing $e_n(v,w)=n\,\Omega(\tilde v,\tilde w)\bmod\fc$ with values in $\tfrac1n\fc/\fc\cong\OK/n$; it is $\OK$-bilinear,
alternating and perfect.
\item Every $A\in\SL(\fa\oplus\fb)$ with $A\equiv1\bmod2$ lifts to an automorphism of $(Y^{(n)}_{\fa,\fb},\lambda_n)$.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) Let $Z_{\Heis}=\set{(0,0,z)}$ be the centre and $L=N_{\fa,\fb}Z_{\Heis}=\fa\times\fb\times\R$. Then $N_{\fa,\fb}$ is normal in $L$,
$L/N_{\fa,\fb}\cong\R/\fc$ by $(a,b,z)\mapsto[z]$, and $L\backslash\Heis_n=\R^2/(\fa\oplus\fb)$. By \cref{exo:tower}, $N\backslash\Heis_n\to L\backslash\Heis_n$ is a
principal $L/N$-bundle. Left multiplication by $(a,b,c)$ maps $(x,y,z)$ to $(a+x,b+y,c+z-nay)$, and
$\dd(z-nay)+n(a+x)\,\dd y=\lambda_n$: the form is left-invariant, and it descends to the quotient by the discrete group $N_{\fa,\fb}$. The centre
acts by translation of $z$, so the descended form is invariant and calibrated, and $\dd\lambda_n=n\,\dd x\wedge\dd y$. Minimality for $n=1$ is
\cref{prop:periods-bound} with \cref{thm:steinitz}(ii).
(ii) Left multiplication by $h\in\Heis_n$ descends to $N\backslash\Heis_n$ if and only if $h$ normalises $N$. Conjugation by $h=(v,z)$ maps $(m,c)$ to
$(m,c-n\Omega(v,m))$, so the normaliser is $\set{(v,z)\mid n\Omega(v,\fa\oplus\fb)\subseteq\fc}=\tfrac1n(\fa\oplus\fb)\times\R$; here $\Omega(v,\fa\oplus\fb)\subseteq\tfrac1n\fc$ if and only if
$v\in\tfrac1n(\fa\oplus\fb)$ because the ideals are invertible. These automorphisms preserve $\lambda_n$, commute with the centre and cover the
translations by $v$; the group they form is $G_n=\Norm(N)/N$. By \cref{thm:KS} every lift of a translation that has one is of this form.
A translation by $v\notin\tfrac1n(\fa\oplus\fb)$ has no lift: it changes the holonomy of the loop $t\mapsto[t\gamma]$, $\gamma\in\fa\oplus\fb$, by $n\Omega(v,\gamma)\bmod\fc$. The
commutator in $\Heis_n$ is $[(v,z),(w,z')]=(0,-n\Omega(v,w))$. Bilinearity over $\OK$ and the alternating property are clear, and the pairing is
perfect because $\Omega$ identifies $\tfrac1n\fa\oplus\tfrac1n\fb$ with the dual of $\fa\oplus\fb$ into $\tfrac1n\fc$.
(iii) In the coordinate $\zeta=z+\tfrac n2xy$ the group law is $\zeta+\zeta'-\tfrac n2\Omega(v,v')$ and $\lambda_n=\dd\zeta+\tfrac n2(x\,\dd y-y\,\dd x)$, both invariant
under $\SL_2(\R)$ acting on $v$ (\cref{exo:quantomorphisms}). So $\hat A(v,z)=(Av,z-nq_A(v))$, with
$q_A(x,y)=\tfrac12ac\,x^2+\tfrac12bd\,y^2+bc\,xy$, is an automorphism of $\Heis_n$ preserving $\lambda_n$. It preserves $N_{\fa,\fb}$ if
$q_A(\fa\oplus\fb)\subseteq\fc$. For $x\in\fa$, $y\in\fb$: $bc\,xy\in\fc$ always, and if $b\in2\fa\fb^{-1}$, $c\in2\fa^{-1}\fb$ then $\tfrac12ac\,x^2\in\fc$ and
$\tfrac12bd\,y^2\in\fc$.
\end{proof}
For $n=1$ part (ii) is the statement that no translation of $X_{\fa,\fb}$ other than the identity lifts: in the classical terminology the
polarisation is principal, for every pair of ideals. For general $n$ the group $G_n$ is the theta group of \cref{ch:crypto}, and $e_n$ is a
Weil pairing with values in the $n$-torsion of the torus of periods $T_\fc$, an $\OK$-module of rank one. The restriction to the congruence
subgroup in (iii) is the classical phenomenon of theta characteristics.
\begin{figure}[t]
\centering
\begin{tikzcd}[column sep=2.4em,row sep=2.0em]
\fc \arrow[r,hook] & \R \arrow[r,two heads] \arrow[d,hook] & T_\fc \arrow[d,hook] & & T_\fa\times T_\fb \arrow[r,"\cong"] \arrow[d,"\text{class}"'] & T_{\OK}\times T_{\fa\fb} \arrow[d,"\text{class}"]\\
N_{\fa,\fb} \arrow[r,hook] \arrow[u,two heads] \arrow[d,two heads] & \Heis \arrow[r,two heads] \arrow[d,two heads] & N_{\fa,\fb}\backslash\Heis \arrow[d,two heads] & & {[\fa]\cdot[\fb]} \arrow[r,equal] & {[\OK]\cdot[\fa\fb]}\\
\fa\oplus\fb \arrow[r,hook] & \R^2 \arrow[r,two heads] & X_{\fa,\fb} & & &
\end{tikzcd}
\caption{Left: the Heisenberg quasi-nilmanifold as a principal $T_\fc$-bundle over $X_{\fa,\fb}$, $\fc=\fa\fb$; rows are quotients by dense subgroups,
columns are central extensions. Right: the product of tori attached to ideals realises the multiplication of ideal classes
(\cref{cor:class-group-law}).}\label{fig:heis-tower}
\end{figure}
\begin{proposition}[Duality]\label{prop:duality}
The moment map of the translations identifies $X_{\fa,\fb}$ with $X_{\fb,\fa}$, by $[x,y]\mapsto[-y,x]$ in the coordinates dual to $(x,y)$.
\end{proposition}
\begin{proof}
\Cref{prop:dual-torus}: the holonomy $\Omega(\fa\oplus\fb,\cdot)$ is the set of linear forms $(x',y')\mapsto xy'-x'y$, with coefficients $(-y,x)\in\fb\oplus\fa$.
\end{proof}
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{4.4cm}p{4.0cm}p{4.6cm}@{}}\toprule
invariant of $(X_{\fa,\fb},\omega)$ & value & arithmetic\\\midrule
shape & $\B\Z^{2d}$ & degree $d=[K:\Q]$\\
diffeomorphism type & $[\fa\fb]\in\Cl(K)$ & Steinitz class\\
group of periods & $\fa\fb\subset\R$ & an ideal, not only its class\\
$\pi_0\Dif(X,\omega)$ & $\SL(\OK\oplus\fa\fb)$ & Hilbert modular group\\
prequantum bundle & $N_{\fa,\fb}\backslash\Heis$, group $T_{\fa\fb}$ & arithmetic subgroup of $\Heis$\\
lifts of translations to $n\omega$ & extension of $(\OK/n)^2$ by $T_{\fa\fb}$ & theta group, Weil pairing in $\OK/n$\\\bottomrule
\end{tabular}
\caption{The symplectic quasi-torus $X_{\fa,\fb}$ as an arithmetic object.}\label{tab:arith}
\end{table}
\exercisesheading
\begin{exercise}[label=exo:periods-sqrt2]{1}
For $K=\Q(\sqrt2)$ and $\fa=\fb=\OK$, compute the group of periods of $(X_{\OK,\OK},\omega)$, the shape of $X_{\OK,\OK}$, and the rank of $\Lambda^2\Gamma$.
\end{exercise}
\begin{solution}
$\Gamma=\Z[\sqrt2]^2$ has rank $4$, so the shape is $\B\Z^4$, the homotopy type of a $4$-torus, and $\Lambda^2\Gamma$ has rank $6$. The periods
$xy'-x'y$ with $x,y,x',y'\in\Z[\sqrt2]$ generate $\Z[\sqrt2]$, of rank $2$. So the period homomorphism $\Lambda^2\Gamma\to\R$ has a kernel of rank $4$: a
two-dimensional space with a closed $2$-form, the homotopy type of a $4$-torus, and two independent periods.
\end{solution}
\begin{exercise}[label=exo:steinitz-10]{2}
Let $K=\Q(\sqrt{10})$, $\fp=(2,\sqrt{10})$, $\fq=(3,1+\sqrt{10})$. Find $A\in\SL_2(K)$ with $A(\OK\oplus\fp\fq)=\fp\oplus\fq$, and deduce the symplectic type of
$X_{\fp,\fq}$.
\end{exercise}
\begin{solution}
The ideals have norms $2$ and $3$, so $\fp+\fq=\OK$; indeed $a=-2\in\fp$, $b=3\in\fq$, $a+b=1$. The map $(s,t)\mapsto(as-t,\ bs+t)$ has matrix
$A=\bigl(\begin{smallmatrix}-2&-1\\3&1\end{smallmatrix}\bigr)$ of determinant $1$. It maps $\OK\oplus\fp\fq$ into $\fp\oplus\fq$ because $\fp\fq\subseteq\fp\cap\fq$, and
onto: for $(x,y)\in\fp\oplus\fq$ take $s=x+y$ and $t=ay-bx\in\fp\fq$. The ideal $\fp\fq$ has norm $6$ and contains $4+\sqrt{10}$ of norm $6$, so
$\fp\fq=(4+\sqrt{10})$. By \cref{thm:steinitz}, $(X_{\fp,\fq},\omega)\cong(X_{\OK,(4+\sqrt{10})},\omega)\cong(X_{\OK,\OK},(4+\sqrt{10})\,\omega)$. Neither $\fp$ nor $\fq$ is
principal, since $x^2-10y^2=\pm2,\pm3$ have no solutions modulo $5$; their product is. The computation is verified in \texttt{checks.py}.
\end{solution}
\begin{exercise}[label=exo:hilbert-modular]{2}
For $K=\Q(\sqrt2)$ exhibit an element of infinite order in $\pi_0\Dif(X_{\OK,\OK},\omega)$ that is diagonal, and one that is not conjugate to a
diagonal element over $K$.
\end{exercise}
\begin{solution}
The group is $\SL_2(\Z[\sqrt2])$. With $\varepsilon=1+\sqrt2$, a unit, $\mathrm{diag}(\varepsilon,\varepsilon^{-1})$ acts on $T_{\OK}\times T_{\OK}$ by the unit $\varepsilon$ on one
factor and its inverse on the other; each factor is the hyperbolic symmetry of \VolI{Theorem~9.3}, and the product preserves $\omega$ because
the determinant is $1$. The matrix $\bigl(\begin{smallmatrix}1&1\\0&1\end{smallmatrix}\bigr)$ is unipotent, of infinite order, and not
diagonalisable. So the symplectic mapping class group contains hyperbolic and parabolic elements, as the modular group of an ordinary torus
does, and in addition the diagonal units, which have no analogue for a lattice.
\end{solution}
\begin{exercise}[label=exo:symp-rigidity]{3}
Prove \cref{thm:symp-rigidity}.
\end{exercise}
\begin{solution}
(i) Let $f$ be a diffeomorphism with $f^*\omega_{\Omega'}=\omega_\Omega$. By \VolI{Theorem~9.1}, $f$ lifts to $F(x)=Ax+b$ with $A\in\GL_{2n}(\R)$ and $A\Gamma=\Gamma'$.
Then $q^*f^*\omega_{\Omega'}=F^*q'^*\omega_{\Omega'}=F^*\Omega'=A^*\Omega'$, and $q^*\omega_\Omega=\Omega$; since $q^*$ is injective, $A^*\Omega'=\Omega$. The converse is the same
computation. (ii) Take $\Gamma'=\Gamma$, $\Omega'=\Omega$ in (i); translations preserve every $\omega_\Omega$. Let $r\mapsto f_r$ be a plot of $\Dif(T_\Gamma,\omega_\Omega)$, so that
$(r,x)\mapsto f_r(q(x))$ is smooth and lifts locally to $F_r(x)=A_rx+b_r$, smooth in $(r,x)$. For $\gamma\in\Gamma$, $A_r\gamma=F_r(x+\gamma)-F_r(x)$ is continuous in
$r$ with values in the countable set $\Gamma$, hence locally constant; as $\Gamma$ spans, $A_r$ is locally constant. So the linear part is constant
on components, and the translations, a quotient of $\R^{2n}$, are connected. (iii) If $A\Gamma=\Gamma'$ and $A^*\Omega'=\Omega$ then
$\Omega'(A\gamma,A\gamma')=\Omega(\gamma,\gamma')$.
\end{solution}
\begin{exercise}[label=exo:pairing-2]{3}
For $K=\Q(\sqrt2)$, $\fa=\fb=\OK$ and $n=2$, describe $X[2]$, the pairing $e_2$, and the number of its Lagrangian $\OK$-submodules.
\end{exercise}
\begin{solution}
$X[2]=(\OK/2)^2$ with $\OK/2=\mathbb F_2[\epsilon]/(\epsilon^2)$, $\epsilon=\sqrt2$; it has $16$ elements, and $e_2(v,w)=v_1w_2-v_2w_1\in\OK/2$. A
Lagrangian submodule is a submodule $L$ equal to its orthogonal; since the pairing is perfect over the ring $\OK/2$ of length $2$, $L$ has
$4$ elements. The free submodules generated by one element $v$ with a unit coordinate are isotropic and have $4$ elements: there are
$\abs{\mathbb P^1(\OK/2)}=6$ of them. The submodule $\epsilon X[2]$ has $4$ elements and is isotropic because $\epsilon^2=0$. A submodule with $4$
elements is either free of rank one or annihilated by $\epsilon$, and in the second case it is $\epsilon X[2]$, which has exactly $4$ elements. So
there are $7$ Lagrangian submodules. They are the analogues for $X_{\OK,\OK}$ of the Lagrangian kernels of \cref{thm:isotropic}, with the
additional condition of stability under $\OK$.
\end{solution}
\begin{exercise}[label=exo:tower]{4}
Let $N\subseteq L$ be subgroups of a diffeological group $H$, with $N$ normal in $L$. Prove that $N\backslash H\to L\backslash H$ is a principal bundle with
group $L/N$.
\end{exercise}
\begin{solution}
The group $L/N$ acts on $N\backslash H$ by $[l]\cdot Nh=Nlh$, well defined because $Nlnh=N(lnl^{-1})lh=Nlh$ for $n\in N$. The orbits are the fibres of
$N\backslash H\to L\backslash H$, and the action is free: $Nlh=Nh$ implies $l\in N$. Let $r\mapsto(Nh_r,Nh'_r)$ be a plot of pairs in the same fibre. The projection
$H\to N\backslash H$ is a subduction, so locally $h_r$ and $h'_r$ are plots of $H$, and $h'_rh_r^{-1}$ is a plot of $H$ with values in $L$, hence a
plot of the subgroup $L$. Its class in $L/N$ is the unique element carrying $Nh_r$ to $Nh'_r$, and it is a plot of $L/N$. So the action map
is an induction, the action is principal, and its quotient is $L\backslash H$ because subductions compose \VolI{Theorem~7.2, Corollary~7.3}.
\end{solution}
\chapter{Cryptography: pairings, isotropic kernels, symplectic lattices}\label{ch:crypto}
\chaptermark{Cryptography}
\begin{chapabstract}
Three objects of public-key cryptography are parts of the prequantum geometry of a torus. The theta group is the group of automorphisms of the
prequantum bundle over the translations, and the Weil pairing is its commutator. The isogenies that preserve a polarisation are the quotients
by isotropic subgroups, because those are the subgroups along which the prequantum bundle descends. And the Gram--Schmidt profile of a
symplectic basis of a lattice is symmetric, which applies to the NTRU bases of the signature scheme Falcon.
\end{chapabstract}
\section{The theta group and the Weil pairing}
A \defn{polarised torus} is a triple $(V,\Lam,\Omega)$: a real vector space of dimension $2n$, a lattice, and a non-degenerate alternating form with
$\Omega(\Lam,\Lam)\subseteq\Z$. Put $T=V/\Lam$ and
\[
\Lam^{\#}=\set{v\in V\mid\Omega(v,\Lam)\subseteq\Z}\supseteq\Lam .
\]
The polarisation is \emph{principal} if $\Lam^{\#}=\Lam$. Choose a bilinear form $B$ on $V$ with $B(v,w)-B(w,v)=\Omega(v,w)$ and $B(\Lam,\Lam)\subseteq\Z$, which
exists by the normal form of an integral alternating form, and let $\Heis_B=V\times\R$ with $(v,z)(v',z')=(v+v',z+z'-B(v,v'))$, $\lambda=\dd z+B(v,\dd v)$,
$N=\Lam\times\Z$. As in \cref{thm:heis-prequantum}, $Y=N\backslash\Heis_B\to T$ is a prequantisation of $(T,\omega_\Omega)$ with $P=\Z$: a circle bundle with connection of
curvature $\Omega$. Over $\C$, when $V$ has a complex structure compatible with $\Omega$, it is the unit circle bundle of the line bundle of the
polarisation.
\begin{theorem}[Theta group; Mumford \cite{Mumford}]\label{thm:theta}
\begin{enumerate}[label=\textup{(\roman*)}]
\item The translation of $T$ by $[v]$ lifts to an automorphism of $(Y,\lambda)$ if and only if $v\in\Lam^{\#}$.
\item The lifts of translations form the group $G(\Omega)=\Norm(N)/N$, a central extension
\[
1\longrightarrow\R/\Z\longrightarrow G(\Omega)\longrightarrow\Lam^{\#}/\Lam\longrightarrow1 .
\]
\item The commutator of two lifts is $e(v,w)=\Omega(\tilde v,\tilde w)\bmod\Z$, up to sign. The pairing $e$ on $\Lam^{\#}/\Lam$ is alternating and
non-degenerate.
\item If $\Omega$ is principal and $N\ge1$, then for the polarisation $N\Omega$ the group $(\Lam^{\#})_{N\Omega}/\Lam$ is the $N$-torsion subgroup
$T[N]=\tfrac1N\Lam/\Lam$, and $e_N(x,y)=N\,\Omega(\tilde x,\tilde y)\bmod\Z$ takes its values in $\tfrac1N\Z/\Z$.
\end{enumerate}
\end{theorem}
\begin{proof}
The argument of \cref{thm:heis-prequantum}(ii) applies with $\fa\oplus\fb$ replaced by $\Lam$ and $\fc$ by $\Z$: conjugation by $(v,z)$ maps $(m,c)\in N$ to
$(m,c-\Omega(v,m))$, the normaliser is $\Lam^{\#}\times\R$, left multiplications by its elements descend to automorphisms of $(Y,\lambda)$, any two lifts of one
translation differ by a constant by \cref{thm:KS}, and a translation by $v\notin\Lam^{\#}$ changes holonomies. The commutator in $\Heis_B$ is
$(0,-\Omega(v,w))$. If $\Omega(v,w)\in\Z$ for all $w\in\Lam^{\#}$ then $v\in(\Lam^{\#})^{\#}=\Lam$. For (iv), $N\Omega(v,\Lam)\subseteq\Z$ if and only if $Nv\in\Lam^{\#}=\Lam$.
\end{proof}
The group $G(N\Omega)$ is the theta group of the $N$-th power of a principal polarisation, and $e_N$ is the Weil pairing on the $N$-torsion points,
in its complex-analytic form. For an elliptic curve $\C/(\Z+\tau\Z)$ with $\Omega(1,\tau)=1$ it is
$e_N\bigl(\tfrac{a+b\tau}N,\tfrac{c+d\tau}N\bigr)=\tfrac{ad-bc}N\bmod\Z$. In the present terms the pairing is a holonomy: the translations by $x$ and $y$ commute
on $T$, their lifts to the prequantum bundle do not, and the defect is the integral of the curvature $N\Omega$ over the parallelogram spanned
by the lifts of $x$ and $y$ (\cref{fig:pairing}). Bilinearity and the alternating property are properties of area.
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\draw[hcsgrey,line width=0.3pt] (0,0) grid[step=0.8] (3.2,3.2);
\draw[hcsink,line width=0.8pt] (0,0) rectangle (3.2,3.2);
\fill[hcsgold,opacity=0.55] (0,0)--(1.6,0.8)--(2.4,2.4)--(0.8,1.6)--cycle;
\draw[hcsteal,line width=1pt,->] (0,0)--(1.6,0.8) node[below right]{$\tilde x$};
\draw[hcsrust,line width=1pt,->] (0,0)--(0.8,1.6) node[left]{$\tilde y$};
\node at (1.2,1.2) {$N\Omega$};
\node[below,align=center] at (1.6,-0.1) {$e_N(x,y)=N\cdot\text{area}\bmod\Z$};
\end{scope}
\begin{scope}[xshift=5.3cm,yshift=0.2cm]
\foreach \i in {0,1,2}{\foreach \j in {0,1,2}{\fill[hcsink] (\i*0.9,\j*0.9) circle (2pt);}}
\draw[hcsteal,line width=0.9pt] (0,0)--(1.8,0);
\draw[hcsrust,line width=0.9pt] (0,0)--(0,1.8);
\draw[hcsgold,line width=0.9pt] (0,0)--(1.8,1.8);
\draw[hcsplum,line width=0.9pt] (0,0)--(0.9,1.8); \draw[hcsplum,line width=0.9pt,dashed] (0.9,1.8) .. controls (1.5,2.3) and (2.2,1.5) .. (1.8,0.9); \draw[hcsplum,line width=0.9pt] (0,0)--(1.8,0.9);
\node[below,align=center] at (0.9,-0.3) {$T[3]=\mathbb F_3^2$:\\ $4$ Lagrangian lines};
\end{scope}
\begin{scope}[xshift=10.3cm,yshift=1.1cm]
\node[hcsnode] (T) at (0,0) {$T$};
\foreach \an/\c in {45/hcsteal,135/hcsrust,225/hcsgold,315/hcsplum}{
\node[draw=\c,circle,inner sep=1.5pt,font=\scriptsize] (K\an) at (\an:1.5) {$T/K$};
\draw[->,\c,line width=0.8pt] (T)--(K\an);}
\node[below,align=center] at (0,-1.6) {$p+1$ isogenies of degree $p$};
\end{scope}
\end{tikzpicture}
\caption{Left: the Weil pairing as the integral of the curvature over a parallelogram. Centre and right: for an elliptic curve and $p=3$,
the Lagrangian subgroups of $T[3]$ are its four lines, and each is the kernel of an isogeny along which the polarisation descends.}\label{fig:pairing}
\end{figure}
\section{Isotropic kernels}
Let $K\subseteq\Lam^{\#}/\Lam$ be a subgroup, $\Lam_K\subseteq\Lam^{\#}$ its preimage, and $f\colon T\to T'=V/\Lam_K$ the quotient map, an isogeny with kernel $K$.
\begin{theorem}[Descent of the polarisation]\label{thm:isotropic}
The following are equivalent:
\begin{enumerate}[label=\textup{(\alph*)}]
\item $K$ is isotropic for the pairing $e$;
\item $\Omega(\Lam_K,\Lam_K)\subseteq\Z$, that is, $(V,\Lam_K,\Omega)$ is a polarised torus;
\item there is a prequantisation $(Y',\lambda')$ of $(T',\omega_\Omega)$ with $f^*(Y',\lambda')\cong(Y,\lambda)$.
\end{enumerate}
In that case the descents $(Y',\lambda')$ of $(Y,\lambda)$ correspond to the homomorphic lifts $K\to G(\Omega)$, a torsor under $\Hom(K,\R/\Z)$; the
group $\Lam_K^{\#}/\Lam_K$ of the quotient is $K^\perp/K$, of order $\abs{\Lam^{\#}/\Lam}/\abs K^2$; and the quotient is principally polarised if and only if $K$ is
Lagrangian, $K=K^\perp$.
\end{theorem}
\begin{proof}
(a)$\iff$(b) by the definition of $e$. (a)$\Rightarrow$(c): the preimage $G_K$ of $K$ in $G(\Omega)$ is a central extension of the finite abelian group $K$ by
$\R/\Z$ with trivial commutator pairing, hence abelian, and it splits because $\R/\Z$ is divisible. A splitting is a group $\tilde K\cong K$ of
automorphisms of $(Y,\lambda)$ covering the translations by $K$. It acts freely on $Y$, commutes with the circle, and $Y'=Y/\tilde K\to T/K$ is a principal
circle bundle to which the invariant form $\lambda$ descends; its pullback to $T$ is $Y$. (c)$\Rightarrow$(a): the deck transformations of
$f^*Y'\to Y'$ are automorphisms of $(Y,\lambda)$ covering the translations by $K$ and forming a group isomorphic to $K$, so commutators of lifts of
elements of $K$ are trivial. Two splittings differ by a character of $K$. Finally $v\in\Lam_K^{\#}$ if and only if $\Omega(v,\Lam_K)\subseteq\Z$, that is,
$[v]\in K^\perp$; and $\abs{K^\perp}=\abs{\Lam^{\#}/\Lam}/\abs K$ because $e$ is non-degenerate.
\end{proof}
\begin{corollary}[$N$-isogenies]\label{cor:N-isogenies}
Let $(V,\Lam,\Omega)$ be principally polarised. The quotients $T\to T/K$ for which $N\Omega$ descends to a principal polarisation are those with
$K\subseteq T[N]$ Lagrangian for $e_N$; then $\abs K=N^n$. For $N=p$ prime their number is $\prod_{i=1}^n(p^i+1)$.
\end{corollary}
\noindent The count is \cref{exo:lagrangian-count}; the values $3,4,6$ for $n=1$ and $15,40$ for $n=2$, $p=2,3$ are confirmed by enumeration in
\texttt{checks.py}.
For $n=1$ every cyclic subgroup of order $N$ is Lagrangian, and the $p+1$ quotients are the edges of the isogeny graphs on which the
protocols of \cite{CSIDH} and their predecessors operate. For $n=2$ and $p=2$ the $15$ quotients are the Richelot isogenies. The
polynomial-time attacks on the SIDH protocol \cite{CastryckDecru,MainoMartindale,Robert} compute isogenies from products of elliptic curves, in
dimensions $2$, $4$ and $8$, whose kernels are maximal isotropic for a Weil pairing; isotropy is the condition under which the quotient is
again principally polarised. \Cref{thm:isotropic} is the statement over $\C$; over a finite field the same statement holds with
the algebraic theta group \cite{Mumford}. Its geometric form is that of \cref{thm:B}: a bundle with connection descends along a quotient
exactly when the group acts on it, and for a finite group of translations the obstruction is the commutator.
\section{Symplectic lattices}
Let $R_n$ be the $n\times n$ matrix with ones on the antidiagonal, and
\[
J=\begin{pmatrix}0&R_n\\-R_n&0\end{pmatrix},\qquad J\transp=-J=J^{-1} .
\]
For a basis $b_1,\dots,b_m$ of $\R^m$, written as the rows of a matrix $B$, let $b_1^*,\dots,b_m^*$ be its Gram--Schmidt orthogonalisation.
\begin{theorem}[Duality of the Gram--Schmidt profile]\label{thm:gso}
Let $B\in\GL_{2n}(\R)$ satisfy $BJB\transp=cJ$ with $c>0$. Then
\[
\norm{b_i^*}\cdot\norm{b^*_{2n+1-i}}=c\qquad(1\le i\le 2n).
\]
\end{theorem}
\begin{proof}
Replacing $B$ by $c^{-1/2}B$ we may take $c=1$. Then $B^{-\mathsf T}=JBJ\transp$. Row $i$ of $JB$ is $\pm b_{2n+1-i}$, so the dual basis is
$d_i=\pm b_{2n+1-i}J\transp$, and the dual basis in reversed order is $(\pm b_1J\transp,\dots,\pm b_{2n}J\transp)$: the image of the basis $B$ under an
orthogonal map and changes of sign, with the same Gram--Schmidt norms as $B$. By \cref{exo:reversed-dual} the reversed dual basis has
Gram--Schmidt norms $\norm{b^*_{2n}}^{-1},\dots,\norm{b_1^*}^{-1}$. Comparing, $\norm{b_j^*}=\norm{b^*_{2n+1-j}}^{-1}$.
\end{proof}
\begin{corollary}[NTRU bases; Gama--Howgrave-Graham--Nguyen \cite{GHN}]\label{cor:ntru}
Let $\mathcal R=\Z[x]/(x^n+1)$ and let $u=(g,-f)$, $u'=(G,-F)$ in $\mathcal R^2$ satisfy $fG-gF=q$. Then the basis
$u,xu,\dots,x^{n-1}u,u',xu',\dots,x^{n-1}u'$ of the NTRU lattice, written in coefficients, satisfies $BJB\transp=qJ$, and
$\norm{b_i^*}\,\norm{b^*_{2n+1-i}}=q$. The same holds for the public basis $\bigl(\begin{smallmatrix}1&h\\0&q\end{smallmatrix}\bigr)$.
\end{corollary}
\begin{proof}
The form $\omega_{\mathcal R}(v,w)=v_1w_2-v_2w_1$ on $\mathcal R^2$ is $\mathcal R$-bilinear and alternating. Its value on $(u,u')$ is $q$, and
its value on the public basis $(1,h)$, $(0,q)$ is also $q$. Let $\ell\colon\mathcal R\to\Z$ be the coefficient of $x^{n-1}$. For $0\le i,j<n$, $\ell(x^{i+j})=1$ if $i+j=n-1$ and $0$ otherwise, since
$x^{i+j}=-x^{i+j-n}$ for $i+j\ge n$ has degree at most $n-2$. So $\ell\circ\omega_{\mathcal R}$ has the matrix $J$ in the coefficient basis of $\mathcal R^2$, and
\[
\ell\,\omega_{\mathcal R}(x^iu,x^ju')=q\,\ell(x^{i+j}),\qquad\ell\,\omega_{\mathcal R}(x^iu,x^ju)=0 .
\]
That is $BJB\transp=qJ$; apply \cref{thm:gso}.
\end{proof}
So the second half of the Gram--Schmidt profile of an NTRU basis is determined by the first. The key generation of Falcon \cite{Falcon} must
bound $\max_i\norm{b_i^*}$ for the secret basis, and by the corollary it suffices to bound $\norm{b_i^*}$ and $q/\norm{b_i^*}$ for $i\le n$; the
symmetry is also the reason that the profile of such a basis is centred at $\sqrt q$ (\cref{fig:gso}). In the terms of this monograph, an
NTRU lattice is a polarised torus $(\R^{2n},\Lam,q^{-1}\ell\omega_{\mathcal R})$ whose polarisation is principal, the ring $\mathcal R$ acts on it by
endomorphisms, as $\OK$ does on $X_{\fa,\fb}$, and the symmetry of the profile is the self-duality $\Lam^{\#}=\Lam$ in metric form. The moduli of
principally polarised tori with a compatible metric is the Siegel orbifold $\Sp_{2n}(\Z)\backslash\Sp_{2n}(\R)/U(n)$, a diffeological orbifold by
the argument of \VolI{Theorem~10.6}; the isomorphism problem for symplectic lattices is the search problem on its stack.
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{axis}[width=10.5cm,height=5.2cm,xlabel={$i$},ylabel={$\log_2\norm{b_i^*}$},xmin=0.5,xmax=16.5,ymin=-1,ymax=9,
xtick={1,4,8,9,12,16},grid=major,grid style={hcsgrey!25},tick label style={font=\small},label style={font=\small},
legend style={font=\small,at={(0.5,-0.3)},anchor=north,legend columns=2,draw=none,fill=none,/tikz/every even column/.append style={column sep=1em}}]
\addplot[only marks,mark=*,mark size=1.8pt,hcsteal] coordinates {(1,8.399) (2,8.209) (3,7.778) (4,7.778) (5,7.377) (6,7.362) (7,7.334) (8,7.293) (9,0.712) (10,0.671) (11,0.643) (12,0.629) (13,0.228) (14,0.228) (15,-0.203) (16,-0.394)};
\addlegendentry{public NTRU basis, $n=8$, $q=257$}
\addplot[hcsrust,dashed,domain=0.5:16.5,samples=2] {4.0028};
\addlegendentry{$\tfrac12\log_2q$}
\draw[hcsgold,line width=0.6pt,<->] (axis cs:1,8.399)--(axis cs:16,-0.394);
\draw[hcsgold,line width=0.6pt,<->] (axis cs:4,7.778)--(axis cs:13,0.228);
\draw[hcsgold,line width=0.6pt,<->] (axis cs:8,7.293)--(axis cs:9,0.712);
\end{axis}
\end{tikzpicture}
\caption{The Gram--Schmidt profile of a symplectic basis is symmetric about $\tfrac12\log c$: the pairs $(i,2n+1-i)$ joined by arrows have
product $q$. Data computed in \texttt{checks.py}.}\label{fig:gso}
\end{figure}
\exercisesheading
\begin{exercise}[label=exo:weil-elliptic]{1}
For $\Lam=\Z+\tau\Z\subset\C$ with $\Omega(1,\tau)=1$, derive the formula for $e_N$ and check that $e_N(x,x)=0$ and that $e_N(x,\cdot)=0$ implies $x=0$.
\end{exercise}
\begin{solution}
$\Omega(a+b\tau,c+d\tau)=ad-bc$ by bilinearity, so $e_N\bigl(\tfrac{a+b\tau}N,\tfrac{c+d\tau}N\bigr)=N\cdot\tfrac{ad-bc}{N^2}=\tfrac{ad-bc}N\bmod\Z$. It vanishes on the
diagonal. If $ad-bc\equiv0\bmod N$ for all $(c,d)$, take $(c,d)=(0,1)$ and $(1,0)$: $a\equiv b\equiv0$.
\end{solution}
\begin{exercise}[label=exo:theta-2]{2}
For $T=\R^2/\Z^2$ with $\Omega=\dd x\wedge\dd y$ and $N=2$, write the lifts of the translations by $(\tfrac12,0)$ and $(0,\tfrac12)$ to the prequantum bundle of
$2\Omega$, and compute their commutator.
\end{exercise}
\begin{solution}
In $\Heis_2$, with law $z+z'-2xy'$, the lifts are the left multiplications by $h_1=(\tfrac12,0,0)$ and $h_2=(0,\tfrac12,0)$, which normalise
$N=\Z^3$. Then $h_1h_2=(\tfrac12,\tfrac12,-\tfrac12)$ and $h_2h_1=(\tfrac12,\tfrac12,0)$, so $h_1h_2=(0,0,-\tfrac12)\,h_2h_1$: the two lifts commute up to the
element $-\tfrac12\in\R/\Z$ of the centre, which acts on the associated line bundle by $-1$. The squares $h_1^2=(1,0,0)$ and $h_2^2=(0,1,0)$ lie in
$N$, so the lifts have order $2$ on $Y$ and generate, with the centre, the Heisenberg group of level $2$.
\end{solution}
\begin{exercise}[label=exo:lagrangian-count]{2}
Count the Lagrangian subspaces of a symplectic vector space of dimension $4$ over $\mathbb F_p$, and state the general formula.
\end{exercise}
\begin{solution}
Count ordered bases $(v,w)$ of Lagrangian planes: $v\neq0$ gives $p^4-1$ choices, and $w\in v^\perp\smallsetminus\langle v\rangle$ gives $p^3-p$. Each plane has
$(p^2-1)(p^2-p)$ ordered bases. The quotient is $\frac{(p^2-1)(p^2+1)\,p(p^2-1)}{(p^2-1)\,p(p-1)}=(p^2+1)(p+1)$: $15$ for $p=2$, $40$ for $p=3$. In dimension
$2n$ the same count, or induction through $v^\perp/\langle v\rangle$, gives $\prod_{i=1}^n(p^i+1)$.
\end{solution}
\begin{exercise}[label=exo:dual-isogeny]{3}
Let $K\subseteq T[N]$ be Lagrangian for $e_N$ and $f\colon T\to T'=T/K$. Show that $f(T[N])\subseteq T'[N]$ is Lagrangian for $e'_N$, and that the quotient of $T'$ by it
is $T$ again.
\end{exercise}
\begin{solution}
$T'=V/\Lam_K$ with the principal polarisation $\Omega'=N\Omega$, and $e'_N(x,y)=N\Omega'(\tilde x,\tilde y)=N^2\Omega(\tilde x,\tilde y)$ on $\tfrac1N\Lam_K/\Lam_K$. The image of $T[N]$ is
$K'=\tfrac1N\Lam/\Lam_K$, and for $\tilde x,\tilde y\in\tfrac1N\Lam$, $N^2\Omega(\tilde x,\tilde y)\in\Z$: $K'$ is isotropic. Its order is $[\tfrac1N\Lam:\Lam_K]=N^{2n}/N^n=N^n$, so it is
Lagrangian. The quotient $T'/K'=V/\tfrac1N\Lam$ is identified with $T=V/\Lam$ by multiplication by $N$, and the composite $T\to T'\to T$ is multiplication
by $N$: the second map is the dual isogeny.
\end{solution}
\begin{exercise}[label=exo:reversed-dual]{3}
Let $B$ have rows $b_1,\dots,b_m$ with Gram--Schmidt norms $d_1,\dots,d_m$. Show that the dual basis in reversed order has Gram--Schmidt norms
$d_m^{-1},\dots,d_1^{-1}$.
\end{exercise}
\begin{solution}
Gram--Schmidt orthogonalisation is the factorisation $B=LDQ$ with $L$ lower triangular with unit diagonal, $D=\mathrm{diag}(d_i)$ and $Q$
orthogonal, and it is unique. The dual basis is $B^{-\mathsf T}=L^{-\mathsf T}D^{-1}Q$, with $L^{-\mathsf T}$ upper unitriangular. Let $R$ be the
permutation matrix reversing the order. Then $RB^{-\mathsf T}=(RL^{-\mathsf T}R)(RD^{-1}R)(RQ)$, where $RL^{-\mathsf T}R$ is lower unitriangular,
$RD^{-1}R=\mathrm{diag}(d_m^{-1},\dots,d_1^{-1})$ and $RQ$ is orthogonal. By uniqueness this is the Gram--Schmidt factorisation of the reversed dual
basis.
\end{solution}
\begin{exercise}[label=exo:J-rows]{4}
Complete the proof of \cref{thm:gso}: show that $BJB\transp=J$ implies $B^{-\mathsf T}=JBJ\transp$, that row $i$ of $JB$ is $\pm b_{2n+1-i}$, and that the
operations used preserve Gram--Schmidt norms.
\end{exercise}
\begin{solution}
From $BJB\transp=J$, $B^{-1}=JB\transp J^{-1}$ and $B^{-\mathsf T}=J^{-\mathsf T}BJ\transp=JBJ\transp$, since $J^{-\mathsf T}=(-J)^{-1}=J$. For $i\le n$, row $i$ of $J$ has
its only non-zero entry, $1$, in column $n+(n+1-i)=2n+1-i$; for $i=n+k$ it has $-1$ in column $n+1-k=2n+1-i$. So row $i$ of $JB$ is
$\pm b_{2n+1-i}$. Multiplying all vectors of a basis on the right by an orthogonal matrix replaces $Q$ by $QJ\transp$ in the factorisation $LDQ$
and leaves $D$ unchanged. Changing the sign of a basis vector $b_i$ changes the sign of $b_i^*$ and of the coefficients $\mu_{ji}$,
$\mu_{ij}$, and leaves every norm unchanged. Hence the reversed dual basis $(\pm b_jJ\transp)_j$ has the Gram--Schmidt norms of $B$, which is what
the proof uses.
\end{solution}
\chapter{Machine learning: conservation laws of learning dynamics}\label{ch:ml}
\chaptermark{Machine learning}
\begin{chapabstract}
A symmetry of a loss function constrains the dynamics of training, and the form of the constraint depends on the dynamics. Noether's theorem
holds for every diffeological group of symmetries of an exact symplectic manifold. For a linear symmetry group stable under transposition,
the compact directions give conserved momenta of Hamiltonian and momentum dynamics, the non-compact directions give conserved quadratic
forms of gradient flow, and splitting integrators conserve the former exactly. The zero level of the gradient-flow invariants of a linear
network is a slice for its non-compact symmetry.
\end{chapabstract}
\section{Noether's theorem for diffeological groups}
\begin{theorem}[Noether]\label{thm:noether}
Let $M$ be a manifold with a $1$-form $\alpha$ such that $\omega=\dd\alpha$ is symplectic, and let $H_t$ be a smooth time-dependent Hamiltonian with vector
field $\iota_{X_t}\omega=-\dd H_t$. Let a diffeological group $G$ act smoothly on $M$, preserving $\alpha$ and every $H_t$. Then the moment map
$\mu\colon M\to\Gs$, $\mu(x)=\hat x^*\alpha$, of \cref{thm:exact} is constant along every integral curve of $X_t$.
\end{theorem}
\begin{proof}
Let $P\colon U\to G$ be a plot, $r\in U$, $\delta r$ a tangent vector at $r$, and $k_s=P(r+s\,\delta r)P(r)^{-1}$, a smooth path in $G$ with $k_0=1$. Let
$\eta$ be the vector field $\eta_y=\frac{\dd}{\dd s}\big|_0k_s\cdot y$ on $M$, and $f=\alpha(\eta)$. By the definition of the pullback,
\[
\mu(x)(P)_r(\delta r)=\alpha\Bigl(\tfrac{\dd}{\dd s}\big|_0P(r+s\,\delta r)\cdot x\Bigr)=f\bigl(P(r)\cdot x\bigr).
\]
Since $k_s^*\alpha=\alpha$ and $k_0=\id$, $\mathcal L_\eta\alpha=0$, so $\dd f=\dd\iota_\eta\alpha=-\iota_\eta\omega$; and since $H_t\circ k_s=H_t$, $\eta(H_t)=0$. Hence
$X_t(f)=-\omega(\eta,X_t)=-\dd H_t(\eta)=0$. Each $g\in G$ preserves $\omega$ and $H_t$, so it commutes with the flow, and $f(P(r)\cdot x(t))$ is the value of
$f$ along the integral curve through $P(r)\cdot x(0)$, which is constant.
\end{proof}
The classical statement is the case of a Lie group, where $\Gs$ is the dual of the Lie algebra. No such assumption is made in the theorem. For a
discrete group $\Gs=0$ and there is no conserved momentum: a permutation symmetry of the units of a network constrains gradient flow to
fixed-point sets \VolI{Proposition~11.2} and gives no conservation law. For a group of gauge transformations $\Gs$ is infinite-dimensional and
the theorem gives one conserved quantity for each momentum.
For learning, the relevant phase space is $M=T^*\Theta=\Theta\times\Theta^*$ for a parameter space $\Theta=\R^d$, with $\alpha=\langle p,\dd\theta\rangle$. A subgroup $G\subseteq\GL(\Theta)$ acts by
$g\cdot(\theta,p)=(g\theta,g^{-\mathsf T}p)$ and preserves $\alpha$; for a one-parameter subgroup $e^{sA}$ the momentum is
\begin{equation}\label{eq:mu-A}
\mu_A(\theta,p)=\langle p,A\theta\rangle .
\end{equation}
A Hamiltonian neural network \cite{Greydanus} is a parametrised family $H_w$ of Hamiltonians fitted to observed trajectories. If the
architecture makes every $H_w$ invariant under $G$, then by \cref{thm:noether} every predicted trajectory conserves every $\mu_A$, for
every value of the weights: the conservation law is a property of the hypothesis class and is independent of the quality of the fit.
\section{Two conservation laws for a symmetric loss}
Let $L\colon\Theta\to\R$ be a smooth loss, invariant under a group $G\subseteq\GL(\Theta)$: $L(g\theta)=L(\theta)$. Differentiating along $e^{sA}$,
\begin{equation}\label{eq:orth}
\langle\nabla L(\theta),A\theta\rangle=0\qquad\text{for all }A\in\fg .
\end{equation}
\begin{theorem}[Momentum and gradient flow]\label{thm:two-noether}
Let $A\in\fg$.
\begin{enumerate}[label=\textup{(\alph*)}]
\item \emph{Momentum dynamics.} If $A\transp=-A$, then along every solution of $\ddot\theta+\gamma\dot\theta=-\nabla L(\theta)$ the momentum $J_A=\langle\dot\theta,A\theta\rangle$ satisfies
$J_A(t)=e^{-\gamma t}J_A(0)$. It is conserved for $\gamma=0$.
\item \emph{Gradient flow.} If $A\transp=A$, then $Q_A(\theta)=\tfrac12\langle\theta,A\theta\rangle$ is constant along every solution of $\dot\theta=-\nabla L(\theta)$.
\item \emph{Gradient descent.} If $A\transp=A$ and $\theta^+=\theta-h\nabla L(\theta)$, then $Q_A(\theta^+)=Q_A(\theta)+\tfrac{h^2}2\langle\nabla L(\theta),A\nabla L(\theta)\rangle$.
\item If $A\transp=-A$, every solution of gradient flow satisfies $\langle\dot\theta,A\theta\rangle=0$: the velocity is orthogonal to the orbits of the compact
directions.
\end{enumerate}
\end{theorem}
\begin{proof}
(a) $\dot J_A=\langle\ddot\theta,A\theta\rangle+\langle\dot\theta,A\dot\theta\rangle=-\langle\nabla L,A\theta\rangle-\gamma\langle\dot\theta,A\theta\rangle+0=-\gamma J_A$ by \eqref{eq:orth} and antisymmetry. (b)
$\dot Q_A=\langle\dot\theta,A\theta\rangle=-\langle\nabla L,A\theta\rangle=0$, using symmetry in the first step. (c) Expand
$\tfrac12\langle\theta-h\nabla L,A(\theta-h\nabla L)\rangle$; the term of order $h$ is $-h\langle\nabla L,A\theta\rangle=0$. (d) is \eqref{eq:orth}.
\end{proof}
If $\fg$ is stable under transposition it decomposes as $\fg=\fk\oplus\fpp$ into antisymmetric and symmetric parts, the Cartan decomposition of a
reductive group. The two halves are compared in \cref{tab:cartan}. Part (a) is \cref{thm:noether} for the Hamiltonian
$\tfrac12\abs p^2+L(\theta)$ and the momentum \eqref{eq:mu-A}. Part (b) is not an instance of Noether's theorem: gradient flow is not Hamiltonian, and
the conserved quantity is quadratic in $\theta$ alone. Special cases of (b) and (c) are the balancedness of linear and homogeneous networks
\cite{Arora,DuHuLee} and the conservation laws catalogued in \cite{Kunin}.
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{3.3cm}p{4.6cm}p{5.1cm}@{}}\toprule
& compact: $\fk$, $A\transp=-A$ & non-compact: $\fpp$, $A\transp=A$\\\midrule
example & rotations of a layer & rescaling of a unit; $\GL_k$ between linear layers\\
momentum dynamics & $\langle\dot\theta,A\theta\rangle$ conserved, or decaying as $e^{-\gamma t}$ & ---\\
gradient flow & $\langle\dot\theta,A\theta\rangle=0$ identically & $\tfrac12\langle\theta,A\theta\rangle$ conserved\\
gradient descent, step $h$ & --- & drift $\tfrac{h^2}2\langle\nabla L,A\nabla L\rangle$ per step\\
geometric meaning & moment map of the cotangent lift & derivative of $\tfrac12\abs\theta^2$ along the orbit\\\bottomrule
\end{tabular}
\caption{The two halves of a reductive symmetry algebra and the corresponding conservation laws.}\label{tab:cartan}
\end{table}
\begin{example}[Three symmetric directions]\label{ex:symmetric-directions}
\textup{(i)} For a unit with positively homogeneous activation, the rescaling $(w_{\mathrm{in}},w_{\mathrm{out}})\mapsto(sw_{\mathrm{in}},s^{-1}w_{\mathrm{out}})$ preserves the
loss; $A$ is $+1$ on the incoming and $-1$ on the outgoing weights, and $Q_A=\tfrac12(\abs{w_{\mathrm{in}}}^2-\abs{w_{\mathrm{out}}}^2)$.
\textup{(ii)} For a linear network $W_2W_1$, the group $\GL_k$ acts by $(W_2g^{-1},gW_1)$, and the symmetric generators give the conserved matrix
$W_1W_1\transp-W_2\transp W_2$. \textup{(iii)} After a normalisation layer the loss is invariant under $\theta\mapsto s\theta$; $A=1$ and $Q_A=\tfrac12\abs\theta^2$: the norm is constant
under gradient flow, and by (c) its square increases by $h^2\abs{\nabla L}^2$ at each step of gradient descent.
\end{example}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{axis}[width=6.6cm,height=6.2cm,xmin=0,xmax=2.5,ymin=0,ymax=2.5,xlabel={$a$},ylabel={$w$},axis equal image,
tick label style={font=\small},label style={font=\small},title style={font=\small},title={gradient flow of $\tfrac12(aw-1)^2$}]
\pgfplotsinvokeforeach{0.2,0.6,1.2,2.0}{
\addplot[hcsteal,domain=0:2.5,samples=60,line width=0.5pt] {sqrt(x^2+2*#1)};
\addplot[hcsteal,domain={sqrt(2*#1)}:2.5,samples=60,line width=0.5pt] {sqrt(abs(x^2-2*#1))};}
\addplot[hcsgold,domain=0:2.5,samples=2,line width=0.9pt] {x};
\addplot[hcsrust,domain=0.4:2.5,samples=80,line width=1.1pt] {1/x};
\addplot[->,hcsink,line width=0.7pt,domain=0.25:0.62,samples=20] {sqrt(x^2+1.2)};
\addplot[->,hcsink,line width=0.7pt,domain=2.3:1.62,samples=20] {sqrt(x^2-1.2)};
\addplot[->,hcsink,line width=0.7pt,domain=0.3:0.8,samples=2] {x};
\node[hcsrust,font=\small] at (axis cs:2.05,0.68) {$aw=1$};
\node[hcsgold!70!black,font=\small] at (axis cs:2.05,2.25) {$Q=0$};
\end{axis}
\end{tikzpicture}\hspace{0.4cm}
\begin{tikzpicture}
\begin{axis}[width=7.2cm,height=6.2cm,xlabel={time},ylabel={angular momentum},xmin=0,xmax=20,ymin=0.7,ymax=1.35,
tick label style={font=\small},label style={font=\small},title style={font=\small},title={Kepler problem, step $h=0.05$},
legend style={font=\small,at={(0.03,0.97)},anchor=north west,draw=none,fill=none}]
\addplot[hcsrust,mark=*,mark size=1.5pt,line width=0.7pt] coordinates {(0.0,0.8000) (2.0,0.9676) (4.0,1.1017) (6.0,1.1158) (8.0,1.1218) (10.0,1.1260) (12.0,1.1301) (14.0,1.1352) (16.0,1.1444) (18.0,1.1809) (20.0,1.2981)};
\addlegendentry{explicit Euler}
\addplot[hcsteal,mark=square*,mark size=1.5pt,line width=0.7pt] coordinates {(0.0,0.8000) (2.0,0.8000) (4.0,0.8000) (6.0,0.8000) (8.0,0.8000) (10.0,0.8000) (12.0,0.8000) (14.0,0.8000) (16.0,0.8000) (18.0,0.8000) (20.0,0.8000)};
\addlegendentry{leapfrog}
\end{axis}
\end{tikzpicture}
\caption{Left: gradient flow of a two-parameter network moves along the hyperbolas $w^2-a^2=\mathrm{const}$ of \cref{thm:two-noether}(b) to
the curve of minima; the balanced line $Q=0$ is invariant. Right: \cref{thm:discrete-noether}; the leapfrog scheme conserves the angular
momentum to rounding error and explicit Euler does not. Data from \texttt{checks.py}.}\label{fig:conservation}
\end{figure}
\section{The balanced slice}
The function $Q\colon\Theta\to\fpp^*$, $Q(\theta)(A)=Q_A(\theta)$, is equivariant for the compact part of $G$, and
$\frac{\dd}{\dd s}\big|_0\tfrac12\abs{e^{sA}\theta}^2=2Q_A(\theta)$. So $Q(\theta)=0$ if and only if $\theta$ is a critical point of the norm on its orbit under the
non-compact directions. For a real reductive group the zeros of $Q$ are the vectors of minimal norm in the closed orbits, and each closed
orbit intersects $Q^{-1}(0)$ in one orbit of the maximal compact subgroup \cite{KempfNess,RichardsonSlodowy}. For the deep linear network the
identification of the invariants with a moment map, and the resulting decomposition of training into a flow along the fibres and a flow on the
balanced manifold, are in \cite{LindseyMenon}; quiver moduli as hypothesis spaces are in \cite{JeffreysLau}, and \cite{ZhaoSurvey} is a survey of
parameter symmetries. For linear networks the statement is
elementary.
\begin{theorem}[Balanced factorisations; compare \cite{LindseyMenon,ZhaoFlat}]\label{thm:balanced}
Let $\Theta=\R^{m\times k}\times\R^{k\times n}\ni(W_2,W_1)$ with $G=\GL_k$, and $Q(W_2,W_1)=W_1W_1\transp-W_2\transp W_2$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item $Q$ is constant along gradient flow of every loss of the form $\ell(W_2W_1)$; in particular the balanced set $Q^{-1}(0)$ is invariant.
\item The map $(W_2,W_1)\mapsto W_2W_1$ induces a bijection from $Q^{-1}(0)/\Ort(k)$ onto the set of $m\times n$ matrices of rank at most $k$.
\item The composite $Q^{-1}(0)/\Ort(k)\to\Theta/\GL_k$ is injective, and its image is the set of closed orbits.
\end{enumerate}
\end{theorem}
\noindent Parts (i) and (ii) are \cref{exo:balanced}; (iii) follows from (ii) and the theorem of \cite{RichardsonSlodowy}.
In \VolI{Theorem~11.1} the hypothesis space of a model had two diffeologies, the quotient $\Theta/G$ and the image in the space of functions.
For a linear network the quotient by $\GL_k$ is not Hausdorff, because of the non-closed orbits. A third description follows from \cref{thm:balanced}:
gradient flow from a balanced initialisation is a flow on $Q^{-1}(0)/\Ort(k)$, the quotient of a real algebraic set by a
compact group, whose points are exactly the hypotheses. The reduction from $\GL_k$ to $\Ort(k)$ is the passage from $\fg$ to $\fk$ in
\cref{tab:cartan}: the non-compact directions are fixed by the conservation law and the compact ones remain as a symmetry. By
\cref{thm:two-noether}(d) the flow is orthogonal to the orbits of $\Ort(k)$.
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{axis}[width=7.0cm,height=7.0cm,xmin=-2.2,xmax=2.2,ymin=-2.2,ymax=2.2,axis lines=middle,xlabel={$a$},ylabel={$w$},
axis equal image,ticks=none,label style={font=\small}]
\pgfplotsinvokeforeach{0.5,1.3}{
\addplot[hcsteal,domain=0.2:2.2,samples=70,line width=0.6pt] {#1/x};
\addplot[hcsteal,domain=-2.2:-0.2,samples=70,line width=0.6pt] {#1/x};
\addplot[hcsteal,domain=0.2:2.2,samples=70,line width=0.6pt,dashed] {-#1/x};
\addplot[hcsteal,domain=-2.2:-0.2,samples=70,line width=0.6pt,dashed] {-#1/x};}
\addplot[hcsgold,domain=-2.2:2.2,samples=2,line width=1pt] {x};
\addplot[hcsgold,domain=-2.2:2.2,samples=2,line width=1pt] {-x};
\addplot[hcsrust,domain=0:360,samples=90,line width=0.7pt] ({cos(x)},{sin(x)});
\addplot[only marks,mark=*,mark size=2pt,hcsrust] coordinates {(0.7071,0.7071) (-0.7071,-0.7071) (0.7071,-0.7071) (-0.7071,0.7071)};
\node[hcsgold!70!black,font=\small,fill=white,inner sep=1pt] at (axis cs:1.55,1.95) {$Q=0$};
\node[hcsteal,font=\small,fill=white,inner sep=1pt] at (axis cs:1.45,0.25) {$aw=\mathrm{const}$};
\node[hcsrust,font=\small,fill=white,inner sep=1pt] at (axis cs:-1.5,0.3) {$\abs\theta=1$};
\end{axis}
\end{tikzpicture}
\caption{The balanced slice for the scalar two-layer network. The orbits of the rescaling group are the hyperbolas $aw=\mathrm{const}$; on
each, the points of minimal norm are the points where the orbit is tangent to a circle, and they lie on $Q=0$, that is, $w=\pm a$. The
residual symmetry $\Ort(1)=\{\pm1\}$ exchanges the two points of each orbit.}\label{fig:kempf-ness}
\end{figure}
\section{Discrete conservation}
\begin{theorem}[Integrators]\label{thm:discrete-noether}
Let $H(q,p)=T(p)+V(q)$ on $\R^d\times\R^d$ with $V(gq)=V(q)$ and $T(g^{-\mathsf T}p)=T(p)$ for $g$ in a group $G\subseteq\GL_d$, and let $A\in\fg$.
\begin{enumerate}[label=\textup{(\alph*)}]
\item The maps $(q,p)\mapsto(q,p-h\nabla V(q))$ and $(q,p)\mapsto(q+h\nabla T(p),p)$ preserve $\mu_A=\langle p,Aq\rangle$. Hence so do symplectic Euler, the leapfrog
scheme and every composition of these two maps.
\item \emph{(Cooper \cite{Cooper})} The implicit midpoint rule $z^+=z+hf\bigl(\tfrac{z+z^+}2\bigr)$ for $\dot z=f(z)$ conserves every quadratic first
integral.
\item Explicit Euler changes $\mu_A$ by $-h^2\langle\nabla V(q),A\nabla T(p)\rangle$ at each step.
\end{enumerate}
\end{theorem}
\begin{proof}
Invariance gives $\langle\nabla V(q),Aq\rangle=0$ and $\langle p,A\nabla T(p)\rangle=0$. (a) The first map changes $\mu_A$ by $-h\langle\nabla V(q),Aq\rangle$ and the second by
$h\langle p,A\nabla T(p)\rangle$. (b) is \cref{exo:midpoint}. (c) $\langle p-h\nabla V,A(q+h\nabla T)\rangle=\mu_A+h\langle p,A\nabla T\rangle-h\langle\nabla V,Aq\rangle-h^2\langle\nabla V,A\nabla T\rangle$.
\end{proof}
Part (a) is the discrete form of \cref{thm:noether} for the integrators used in Hamiltonian Monte Carlo and in the rollout of Hamiltonian
networks: with an invariant potential and kinetic energy, every leapfrog trajectory stays on a level set of the moment map, exactly and for
every step size. For a posterior with a continuous symmetry, a sampler of this kind explores within one trajectory only the level set
$\mu^{-1}(c)$, and the refreshment of the momentum is the only mechanism that changes the level. The reduced dynamics is a Hamiltonian flow on
the reduced space $\mu^{-1}(c)/G_c$, which by \cref{thm:reduction} and \cref{cor:exact-reduction} is a parasymplectic diffeological space
whenever the action on the level set is principal, without any assumption that the level be regular.
\section{Acceleration}\label{sec:acceleration}
A conservation law by itself changes no convergence rate, as the two-parameter network already shows.
\begin{proposition}[Rate and sharpness]\label{prop:rate}
Let $L(a,w)=\tfrac12(aw-1)^2$, $m=aw$, $Q=\tfrac12(w^2-a^2)$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item Along gradient flow, $\dot m=-2\sqrt{Q^2+m^2}\,(m-1)$.
\item At a minimum the Hessian has the eigenvalues $0$ and $\lambda_Q=2\sqrt{Q^2+1}$.
\item Gradient descent linearised at the minimum multiplies the error in $m$ by $1-h\lambda_Q$ at each step. The contraction factors attained by the
stable steps $0<h<2/\lambda_Q$ form the interval $(-1,1)$ for every $Q$.
\end{enumerate}
\end{proposition}
\begin{proof}
With $\rho=m-1$, $\dot m=\dot aw+a\dot w=-\rho\,(a^2+w^2)$, and $(a^2+w^2)^2=(w^2-a^2)^2+4a^2w^2=4Q^2+4m^2$. At a minimum the Hessian is
$\nabla\rho\,\nabla\rho\transp$ with $\nabla\rho=(w,a)$, of norm squared $a^2+w^2$. (iii) follows from (ii).
\end{proof}
So for a single unit the level of $Q$ rescales the speed of the flow and the largest stable step by the same factor. A gain is available when
several blocks with different levels share one step size: the block with the largest $\lambda_Q$ bounds $h$, and every other block converges at
the rate $h\lambda_{Q'}$. The symmetry can be used in four ways to remove this mismatch, and the next three propositions make them explicit.
\begin{proposition}[The induced dynamics on the product]\label{prop:induced}
Let $(B,A)\in\R^{m\times r}\times\R^{r\times n}$ have rank $r$, $X=BA$, and let $G=\nabla\ell(X)$ for a loss $\ell(X)$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item Gradient descent on $(B,A)$ with step $\eta$ gives $X^+=X-\eta\,(BB\transp G+GA\transp A)+\eta^2\,GX\transp G$. On the balanced slice of \cref{thm:balanced},
$BB\transp=(XX\transp)^{1/2}$ and $A\transp A=(X\transp X)^{1/2}$.
\item The \emph{scaled} update $B^+=B-\eta\,GA\transp(AA\transp)^{-1}$, $A^+=A-\eta\,(B\transp B)^{-1}B\transp G$ commutes with the action of $\GL_r$, and
\[
X^+=X-\eta\,(P_cG+GP_r)+\eta^2\,GX^{\dagger}G,
\]
where $P_c$ and $P_r$ are the orthogonal projectors onto the column and row spaces of $X$ and $X^\dagger$ is the Moore--Penrose inverse.
\item Let $\ell(X)=\tfrac12\norm{X-M}^2$ with $M$ of rank $r$ and singular values $\sigma_1\ge\dots\ge\sigma_r$. Linearised at $X=M$, the component of the
error along the singular vectors $u_i,v_j$ is multiplied by $1-\eta(\sigma_i+\sigma_j)$ in case \textup{(i)} on the balanced slice, with $\sigma_i=0$ for $i>r$,
and by $1-2\eta$ or $1-\eta$ in case \textup{(ii)}.
\end{enumerate}
\end{proposition}
\noindent Parts (i) and (ii) are \cref{exo:induced}. For (iii), $G$ is the error $E$ to first order, the preconditioners are evaluated at $M$, and
$(MM\transp)^{1/2}$, $(M\transp M)^{1/2}$, $P_c$, $P_r$ are diagonal in the singular bases. In case (i) the stable steps satisfy $\eta<1/\sigma_1$ and the slowest
tangent direction contracts by $1-\eta\sigma_r$: the number of steps grows as the condition number $\sigma_1/\sigma_r$. In case (ii) the rates do not involve
the singular values. Part (i) on the balanced slice is the preconditioned end-to-end dynamics of \cite{Arora}; part (ii) is the scaled
gradient descent of \cite{TongMaChi}, where convergence at a rate independent of the condition number is proved for several low-rank
estimation problems. In the terms of this chapter, the update of (ii) is defined on the quotient $\Theta/\GL_r$: it is independent of the
level of $Q$. Low-rank adapters $W_0+BA$ have this symmetry, and so do the key--query and value--output pairs of an attention head, whose
output depends on the products only; the usual initialisation of an adapter, $B=0$ and $A$ random, lies at the level $Q=AA\transp$, far from the
balanced slice \cite{LoRAplus}.
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{semilogyaxis}[width=6.9cm,height=5.4cm,xlabel={iteration},ylabel={$\norm{BA-M}$},xmin=0,xmax=900,ymin=1e-16,ymax=2,
tick label style={font=\small},label style={font=\small},title style={font=\small},title={gradient descent, $\eta=0.4$}]
\addplot[hcsrust,mark=*,mark size=1.5pt,line width=0.7pt] coordinates {(0,5.938e-01) (100,1.450e-03) (200,3.654e-05) (300,9.273e-07) (400,2.354e-08) (500,5.975e-10) (600,1.517e-11) (700,3.850e-13) (800,9.766e-15) (900,3.002e-16)};
\end{semilogyaxis}
\end{tikzpicture}\hspace{0.3cm}
\begin{tikzpicture}
\begin{semilogyaxis}[width=6.9cm,height=5.4cm,xlabel={iteration},xmin=0,xmax=9,ymin=1e-16,ymax=2,
tick label style={font=\small},label style={font=\small},title style={font=\small},title={scaled update, $\eta=0.5$}]
\addplot[hcsteal,mark=square*,mark size=1.5pt,line width=0.7pt] coordinates {(0,5.938e-01) (1,1.045e-01) (2,1.527e-02) (3,1.866e-03) (4,4.691e-05) (5,3.286e-08) (6,1.616e-14) (7,1.665e-16) (8,1.594e-16)};
\end{semilogyaxis}
\end{tikzpicture}
\caption{Factorisation of a $2\times2$ matrix with singular values $1$ and $10^{-2}$ from the same initial point. The update that commutes with
$\GL_2$ reaches rounding error in $7$ iterations; gradient descent on the factors takes about $800$. Data from \texttt{checks.py}.}\label{fig:scaled}
\end{figure}
\begin{proposition}[Weight decay on scale-invariant weights]\label{prop:weight-decay}
Let $L(s\theta)=L(\theta)$ for $s>0$, and $\theta^+=(1-h\lambda)\theta-h\nabla L(\theta)$. Then
\[
\abs{\theta^+}^2=(1-h\lambda)^2\abs\theta^2+\frac{h^2\,\abs{\hat g}^2}{\abs\theta^2},\qquad\hat g=\nabla L(\theta/\abs\theta),
\]
the norm is stationary at $\abs\theta^4=h\abs{\hat g}^2/\lambda(2-h\lambda)$, and there the effective step size $h/\abs\theta^2$ on the unit sphere is
$\sqrt{h\lambda(2-h\lambda)}\,/\abs{\hat g}$, so that each step has angular length $\sqrt{h\lambda(2-h\lambda)}$.
\end{proposition}
\noindent The proof is \cref{exo:weight-decay}. The stationary effective step depends on $h$ and $\lambda$ through the product $h\lambda$ alone, to first order
\cite{vanLaarhoven}: the drift of \cref{thm:two-noether}(c) balances the decay, and the two hyperparameters act through their product.
\begin{proposition}[Horizontal projection]\label{prop:horizontal}
Let $A\in\fpp$ and let $\theta^+=\theta+u$ be any update. Then $Q_A(\theta^+)-Q_A(\theta)=\langle u,A\theta\rangle+\tfrac12\langle u,Au\rangle$. For $u=-h\nabla L(\theta)$ the first term vanishes.
For $u=-hD\nabla L(\theta)$ with a positive diagonal matrix $D$, as in adaptive methods, it is $-h\langle D\nabla L,A\theta\rangle$, of first order in $h$. For the
projected update
\[
u_\perp=u-\sum_j\frac{\langle u,A_j\theta\rangle}{\abs{A_j\theta}^2}\,A_j\theta ,
\]
over generators $A_j$ with mutually orthogonal $A_j\theta$, the first term vanishes again.
\end{proposition}
\begin{proof}
Expand $\tfrac12\langle\theta+u,A(\theta+u)\rangle$ with $A$ symmetric, and use \eqref{eq:orth}.
\end{proof}
For the sign update $u=-h\,\mathrm{sign}(\nabla L)$ on the two-parameter network, the invariant $Q$ changes over a unit of time by $0.31$ for
$h=10^{-2}$ and by $0.32$ for $h=10^{-3}$; with the projection the changes are $6.2\cdot10^{-3}$ and $6.2\cdot10^{-4}$ (\texttt{checks.py}). For the scale
symmetry, $A=1$, the projection removes the radial part of the update, which is the method of \cite{AdamP}.
The four uses are therefore: \emph{to choose the level} of $Q$ at initialisation, which by \cref{prop:induced}(i) is a choice of
preconditioner; \emph{to move along the orbit} during training, at no cost in loss, either back to the balanced slice or to the point of the
orbit with the largest gradient \cite{ZhaoTeleport}; \emph{to make the update equivariant}, so that it is defined on the quotient
(\cref{prop:induced}(ii), \cite{Absil}); and \emph{to project} a non-gradient update onto the directions orthogonal to the orbits
(\cref{prop:horizontal}). All four are instances of one geometric statement, \cref{thm:positions} of \cref{ch:structure}.
\exercisesheading
\begin{exercise}[label=exo:so2]{1}
Compute the momentum \eqref{eq:mu-A} for the rotations of $\Theta=\R^2$, and for the scalings.
\end{exercise}
\begin{solution}
For $A=\bigl(\begin{smallmatrix}0&-1\\1&0\end{smallmatrix}\bigr)$, $A\theta=(-\theta_2,\theta_1)$ and $\mu_A=p_2\theta_1-p_1\theta_2$, the angular momentum. For $A=1$, $\mu_A=\langle p,\theta\rangle$,
the generator of dilations. The first is antisymmetric and governed by \cref{thm:two-noether}(a); the second is symmetric, and under gradient
flow of a scale-invariant loss the conserved quantity is $\tfrac12\abs\theta^2$ by (b).
\end{solution}
\begin{exercise}[label=exo:hyperbola]{2}
For $L(a,w)=\tfrac12(aw-1)^2$ verify \cref{thm:two-noether}(b),(c) directly, and solve gradient flow on the balanced line.
\end{exercise}
\begin{solution}
The symmetry is $(a,w)\mapsto(s^{-1}a,sw)$, $A=\mathrm{diag}(-1,1)$, $Q=\tfrac12(w^2-a^2)$. With $\rho=aw-1$, $\dot a=-\rho w$, $\dot w=-\rho a$, so
$\frac{\dd}{\dd t}(w^2-a^2)=-2\rho aw+2\rho aw=0$. One step of gradient descent gives $w^{+2}-a^{+2}=(w^2-a^2)(1-h^2\rho^2)$, that is,
$Q^+=Q+\tfrac{h^2}2\rho^2(a^2-w^2)$, which is (c) with $\nabla L=\rho(w,a)$. On the line $a=w=s$ the flow is $\dot s=-(s^2-1)s$, with the stable equilibrium
$s=1$: the balanced solution of $aw=1$. In \texttt{checks.py} the drift of $Q$ over a fixed time is proportional to $h$, as (c) predicts.
\end{solution}
\begin{exercise}[label=exo:batchnorm]{2}
Let $L$ be invariant under $\theta\mapsto s\theta$, $s>0$. Show that under gradient descent $\abs{\theta_k}$ is non-decreasing and that the tangent of the angular step is
$h\abs{\nabla L(\theta_k/\abs{\theta_k})}/\abs{\theta_k}^2$.
\end{exercise}
\begin{solution}
By \cref{thm:two-noether}(c) with $A=1$, $\abs{\theta_{k+1}}^2=\abs{\theta_k}^2+h^2\abs{\nabla L(\theta_k)}^2$. Scale invariance gives
$\nabla L(s\theta)=s^{-1}\nabla L(\theta)$ and $\langle\nabla L,\theta\rangle=0$, so the step $h\nabla L(\theta_k)$ is tangent to the sphere of radius $\abs{\theta_k}$, of length
$h\abs{\nabla L(\theta_k/\abs{\theta_k})}/\abs{\theta_k}$, and the tangent of the angle it subtends is the stated quantity. The effective step size on the unit sphere is $h/\abs{\theta_k}^2$ and decreases
along training.
\end{solution}
\begin{exercise}[label=exo:relu]{3}
Let $f(x)=\sum_iv_i\,\sigma(\langle w_i,x\rangle)$ with $\sigma$ positively homogeneous of degree $1$. Derive the conserved quantities of gradient flow for a loss
depending on $f$ alone, at parameters where the loss is differentiable.
\end{exercise}
\begin{solution}
For each $i$ and $s>0$, $(w_i,v_i)\mapsto(sw_i,s^{-1}v_i)$ leaves $f$ unchanged. The generator is $A_i=\mathrm{diag}(+1\text{ on }w_i,\ -1\text{ on }v_i)$, a
symmetric matrix, and \eqref{eq:orth} holds wherever $L$ is differentiable. By \cref{thm:two-noether}(b),
$Q_i=\tfrac12(\abs{w_i}^2-v_i^2)$ is conserved for every unit. These are the balancedness conditions of \cite{DuHuLee}; the group is
$(\R_{>0})^k$, all of whose directions are non-compact, so no momentum of type (a) arises from it.
\end{solution}
\begin{exercise}[label=exo:midpoint]{3}
Prove \cref{thm:discrete-noether}(b).
\end{exercise}
\begin{solution}
Let $I(z)=\langle z,Cz\rangle+\langle c,z\rangle$ with $C$ symmetric be a first integral: $\langle2Cz+c,f(z)\rangle=0$ for all $z$. With $m=\tfrac12(z+z^+)$ and $z^+-z=hf(m)$,
\[
I(z^+)-I(z)=\langle z^+-z,\ C(z^++z)\rangle+\langle c,z^+-z\rangle=h\,\langle f(m),\,2Cm+c\rangle=0 .
\]
\end{solution}
\begin{exercise}[label=exo:balanced]{4}
Prove parts \textup{(i)} and \textup{(ii)} of \cref{thm:balanced}.
\end{exercise}
\begin{solution}
(i) The loss is invariant under $(W_2g^{-1},gW_1)$. For a symmetric $S$ the generator maps $(W_2,W_1)$ to $(-W_2S,SW_1)$, a symmetric
operator for the Frobenius inner product, and $Q_S=\tfrac12\tr(SW_1W_1\transp)-\tfrac12\tr(W_2SW_2\transp)=\tfrac12\tr\bigl(S(W_1W_1\transp-W_2\transp W_2)\bigr)$. By
\cref{thm:two-noether}(b) this is conserved for every $S$, so the matrix is conserved.
(ii) \emph{Surjectivity.} Let $M=U\Sigma V\transp$ be a singular value decomposition with $\Sigma$ of size $k\times k$. Then $W_2=U\Sigma^{1/2}$, $W_1=\Sigma^{1/2}V\transp$ is
balanced and $W_2W_1=M$. \emph{Injectivity.} Let $(W_2,W_1)$ and $(W_2',W_1')$ be balanced with the same product $M$. Then
$MM\transp=W_2(W_1W_1\transp)W_2\transp=(W_2W_2\transp)^2$, so $W_2W_2\transp=(MM\transp)^{1/2}=W_2'W_2'^{\mathsf T}$, and two $m\times k$ matrices with the same Gram matrix of
rows differ by an orthogonal matrix: $W_2'=W_2R$, $R\in\Ort(k)$. Put $D=RW_1'-W_1$. Then $W_2D=W_2'W_1'-W_2W_1=0$, so the columns of $D$ lie in
$\ker W_2=\ker W_2\transp W_2=\ker W_1W_1\transp$, the orthogonal complement of the column space of $W_1$; hence $W_1\transp D=0$. Balancedness of both pairs gives
$(RW_1')(RW_1')\transp=RW_2'^{\mathsf T}W_2'R\transp=W_2\transp W_2=W_1W_1\transp$, and taking traces,
$\tr(W_1W_1\transp)=\tr\bigl((W_1+D)(W_1+D)\transp\bigr)=\tr(W_1W_1\transp)+2\tr(W_1\transp D)+\tr(DD\transp)$. So $\tr(DD\transp)=0$, $D=0$, and
$(W_2',W_1')=(W_2R,R\transp W_1)$.
\end{solution}
\begin{exercise}[label=exo:weight-decay]{2}
Prove \cref{prop:weight-decay}, and compute the stationary norm and the angular step for $h=0.05$, $\lambda=0.1$, $\abs{\hat g}=1$.
\end{exercise}
\begin{solution}
Scale invariance gives $\langle\nabla L(\theta),\theta\rangle=0$ and $\nabla L(\theta)=\hat g/\abs\theta$, so the two terms of $\theta^+$ are orthogonal and
$\abs{\theta^+}^2=(1-h\lambda)^2\abs\theta^2+h^2\abs{\hat g}^2/\abs\theta^2$. The norm is stationary when $\bigl(1-(1-h\lambda)^2\bigr)\abs\theta^4=h^2\abs{\hat g}^2$, that is,
$\abs\theta^4=h\abs{\hat g}^2/\lambda(2-h\lambda)$. The step on the unit sphere is $h\abs{\nabla L(\theta)}/\abs\theta=h\abs{\hat g}/\abs\theta^2$; substituting, the effective
step size is $\sqrt{h\lambda(2-h\lambda)}/\abs{\hat g}$ and the angular length is $\sqrt{h\lambda(2-h\lambda)}$. For the given values $\abs\theta^4=0.2506$, $\abs\theta=0.7075$,
and the angular step is $0.0999$; the simulation in \texttt{checks.py} gives $\abs\theta^4=0.250627$.
\end{solution}
\begin{exercise}[label=exo:induced]{3}
Prove parts \textup{(i)} and \textup{(ii)} of \cref{prop:induced}.
\end{exercise}
\begin{solution}
The gradients of $\ell(BA)$ are $GA\transp$ and $B\transp G$. (i) $(B-\eta GA\transp)(A-\eta B\transp G)=X-\eta\,GA\transp A-\eta\,BB\transp G+\eta^2GA\transp B\transp G$. For a balanced pair,
$XX\transp=B(AA\transp)B\transp=B(B\transp B)B\transp=(BB\transp)^2$, and likewise $X\transp X=(A\transp A)^2$. (ii) Under $(B,A)\mapsto(Bg^{-1},gA)$ the product and $G$ are unchanged,
$GA\transp g\transp(gAA\transp g\transp)^{-1}=GA\transp(AA\transp)^{-1}g^{-1}$ and $(g^{-\mathsf T}B\transp Bg^{-1})^{-1}g^{-\mathsf T}B\transp G=g(B\transp B)^{-1}B\transp G$; so
$(B^+,A^+)\mapsto(B^+g^{-1},gA^+)$. The product is
\[
X-\eta\,B(B\transp B)^{-1}B\transp G-\eta\,GA\transp(AA\transp)^{-1}A+\eta^2\,GA\transp(AA\transp)^{-1}(B\transp B)^{-1}B\transp G .
\]
The matrices $P_c=B(B\transp B)^{-1}B\transp$ and $P_r=A\transp(AA\transp)^{-1}A$ are the orthogonal projectors onto the column space of $B$ and the row space of
$A$, which are those of $X$ because the rank is $r$. The matrix $X^\dagger=A\transp(AA\transp)^{-1}(B\transp B)^{-1}B\transp$ satisfies $XX^\dagger=P_c$, $X^\dagger X=P_r$,
$XX^\dagger X=X$ and $X^\dagger XX^\dagger=X^\dagger$, the four conditions that characterise the Moore--Penrose inverse.
\end{solution}
\chapter{Artificial intelligence: invariants, phases, and reachability}\label{ch:ai}
\chaptermark{Artificial intelligence}
\begin{chapabstract}
For an agent whose dynamics has a symmetry, the moment map is an invariant of every admissible trajectory, and it bounds the reachable set
for every controller. At zero momentum the motion of the agent along the symmetry directions is the holonomy of a connection on the bundle of
configurations over shapes. For the simplest two-body system the connection is flat, its holonomy is a rotation by an angle fixed by the ratio
of inertias, and when the ratio is irrational the universal first integral takes its values in an irrational torus.
\end{chapabstract}
\section{Momentum as a reachability invariant}
A controlled Hamiltonian system is a family $H_u$, $u\in\mathcal U$, of Hamiltonians on an exact symplectic manifold $(M,\dd\alpha)$; a control is a
piecewise smooth map $t\mapsto u(t)$, and the trajectory follows the Hamiltonian vector field of $H_{u(t)}$.
\begin{theorem}[Invariance of the reachable set]\label{thm:reachable}
Let a diffeological group $G$ act on $M$ preserving $\alpha$ and every $H_u$, with moment map $\mu\colon M\to\Gs$. Then for every control the
trajectory from $x$ stays in $\mu^{-1}(\mu(x))$. Consequently:
\begin{enumerate}[label=\textup{(\roman*)}]
\item a set $B\subseteq M$ with $\mu(x)\notin\mu(B)$ is unreachable from $x$ under every controller of the class;
\item the system induces a controlled system on the quotient $\mu^{-1}(c)/G_c$ of each level by the stabiliser of $c$, and when $G_c$ acts
principally on the level this quotient is a parasymplectic diffeological space.
\end{enumerate}
\end{theorem}
\begin{proof}
On each interval where the control is smooth, \cref{thm:noether} applies to the time-dependent Hamiltonian $H_{u(t)}$; $\mu$ is continuous
along the trajectory, so its value is the same on all intervals. (i) is immediate. (ii) The flows commute with $G$ and preserve the level, which
$G_c$ preserves by equivariance. For $c=0$ the quotient is the reduced space of \cref{cor:exact-reduction}; a level $c$ fixed by the
coadjoint action is brought to zero by \cref{prop:levels} when $c=-\chi^*\theta$ for a character $\chi$.
\end{proof}
Part (i) is a certificate of safety of the strongest kind: it is exact, it requires no simulation, and it holds for every policy,
learned or not, as long as the actuation preserves the symmetry. A free-floating robot whose actuators exert only internal forces cannot
change its angular momentum; a learned controller for it cannot reach a state of different momentum, whatever its training. Part (ii) is the
statement that planning and learning for such a system take place on the reduced space, of dimension smaller by twice the dimension of the
group at regular points.
\section{The geometric phase}
At a fixed momentum the remaining freedom of the agent is its shape, and the symmetry variables are determined by the history of the shape.
Let $Q$ be a configuration manifold with a free and proper action of $G=\R$ or $S^1$, generated by a vector field $\xi_Q$, and let $S=Q/G$ be the
\emph{shape space}. Let $g$ be a $G$-invariant Riemannian metric, the kinetic energy. The momentum of a velocity $\dot q$ is
$J(q,\dot q)=g(\dot q,\xi_Q(q))$, which is the moment map \eqref{eq:mu-A} of the cotangent lift under the Legendre transform. The
\defn{mechanical connection} is the $1$-form
\[
A=\frac{g(\cdot,\xi_Q)}{g(\xi_Q,\xi_Q)}\in\Om^1(Q) .
\]
\begin{theorem}[Holonomy of zero-momentum motion; \cite{MMR,Montgomery}]\label{thm:phase}
\begin{enumerate}[label=\textup{(\roman*)}]
\item $A$ is a connection form on the principal bundle $Q\to S$ in the sense of \cref{def:connection}, and a curve in $Q$ has zero momentum
if and only if it is horizontal for $A$. Every shape curve has a unique zero-momentum lift through each point of the fibre over its origin.
\item Let $F\in\Om^2(S)$ be the curvature. If a closed shape curve $c$ bounds a disc $D$, its zero-momentum lift ends at
$\exp(\Delta\,\xi)\cdot q(0)$ with $\Delta=-\int_DF$.
\item If $F=0$, the displacement of a loop depends only on its homotopy class, and the displacements form the image of a homomorphism
$\pi_1(S)\to G$.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) $A$ is invariant because $g$ and $\xi_Q$ are, and $A(\xi_Q)=1$, which is calibration. $J(q,\dot q)=0$ if and only if $A(\dot q)=0$. In a
local trivialisation $Q|_V\cong V\times G$ with fibre coordinate $\varphi$, $A=\dd\varphi+a$ with $a\in\Om^1(V)$, and the horizontal lift of $c$ solves
$\dot\varphi=-a(\dot c)$. (ii) Over the disc the bundle is trivial, $F=\dd a$, and $\Delta=\varphi(1)-\varphi(0)=-\oint_ca=-\int_D\dd a$. (iii) A flat connection has
locally constant horizontal sections, so the lift of a contractible loop closes, and concatenation of loops adds displacements.
\end{proof}
The theorem is the abelian case of the gauge theory of locomotion: a body that changes its shape cyclically, with no external force and no
momentum, is displaced by the holonomy of the cycle \cite{ShapereWilczek,Montgomery}. For a planner the consequence is a division of the
problem: the shape variables are controlled directly, and motion in the group direction is obtained from the area enclosed in shape space,
weighted by the curvature (\cref{fig:phase}). If the curvature does not vanish, every displacement is the holonomy of some loop
(\cref{exo:variable-beanie}).
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\draw[hcsteal,line width=0.5pt] (0,0) rectangle (3.4,2.6);
\fill[hcsgold!45] (0.7,0.6) .. controls (1.2,2.4) and (2.6,2.3) .. (2.8,1.3) .. controls (2.9,0.3) and (1.2,0.1) .. (0.7,0.6);
\draw[hcsink,line width=0.9pt,->] (0.7,0.6) .. controls (1.2,2.4) and (2.6,2.3) .. (2.8,1.3);
\draw[hcsink,line width=0.9pt] (2.8,1.3) .. controls (2.9,0.3) and (1.2,0.1) .. (0.7,0.6);
\node at (1.8,1.2) {$\int_DF$};
\node[below] at (1.7,0) {shape space $S$};
\draw[->,line width=0.6pt] (3.7,1.3)--node[above]{lift}(4.7,1.3);
\draw[hcsrust,line width=1pt] (5.4,0.3)--(5.4,2.3);
\fill[hcsink] (5.4,0.8) circle (1.4pt) node[left]{$q(0)$};
\fill[hcsink] (5.4,1.7) circle (1.4pt) node[left]{$q(1)$};
\draw[hcsgold,line width=1.2pt,<->] (5.55,0.8)--node[right]{$\Delta$}(5.55,1.7);
\node[below] at (5.4,0.25) {fibre $G$};
\end{scope}
\begin{scope}[xshift=8.3cm]
\fill[hcsmist] (0,0) rectangle (2.6,2.6);
\begin{scope}
\clip (0,0) rectangle (2.6,2.6);
\foreach \n in {-3,...,7}{
\pgfmathsetmacro{\c}{\n*0.52}
\draw[hcsteal!45,line width=0.4pt] (0,\c) -- (2.6,\c-2.6*0.6180339);}
\draw[hcsrust,line width=1.1pt,->] (0,2.2)--(2.6,2.2-2.6*0.6180339);
\end{scope}
\draw[hcsink] (0,0) rectangle (2.6,2.6);
\node[below] at (1.3,0) {joint angle $\psi$}; \node[left,align=right] at (0,1.3) {$\theta$};
\draw[hcsgold,line width=1.2pt,<->] (2.75,2.2)--node[right]{$2\pi\alpha$}(2.75,2.2-2.6*0.6180339);
\end{scope}
\end{tikzpicture}
\caption{Left: the displacement produced by a cycle of shape changes is minus the integral of the curvature over the enclosed region.
Right: for the two-body system of \cref{thm:beanie} the connection is flat and the zero-momentum motions are the leaves of a linear
foliation of the torus; one turn of the joint rotates the body by $-2\pi\alpha$.}\label{fig:phase}
\end{figure}
\section{A first integral with values in an irrational torus}
Two planar rigid bodies with moments of inertia $I_1,I_2$ are joined at their common centre of mass by a motor. The configuration is
$(\theta,\psi)\in T^2=(\R/2\pi\Z)^2$, where $\theta$ is the orientation of the first body and $\psi$ the joint angle; the kinetic energy is
$\tfrac12I_1\dot\theta^2+\tfrac12I_2(\dot\theta+\dot\psi)^2$, the rotations act on $\theta$, and the momentum is $J=I_1\dot\theta+I_2(\dot\theta+\dot\psi)$. With
\[
\alpha=\frac{I_2}{I_1+I_2}\in(0,1),
\]
the mechanical connection is $A=\dd\theta+\alpha\,\dd\psi$. The shape space is the circle of joint angles.
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\draw[hcsteal,line width=1pt,fill=hcsmist] (0,0) circle (1.3);
\draw[hcsgold,line width=1pt,fill=hcssand] (0,0) circle (0.65);
\fill (0,0) circle (1.3pt);
\draw[hcsteal,line width=1pt] (0,0)++(25:0.65)--(25:1.3);
\draw[hcsgold!70!black,line width=1pt] (0,0)--(95:0.65);
\draw[hcsgrey,dashed] (0,0)--(1.6,0);
\draw[->,hcsteal] (0:1.45) arc (0:25:1.45) node[right,pos=0.6]{$\theta$};
\draw[->,hcsgold!70!black] (25:0.42) arc (25:95:0.42); \node[hcsgold!70!black] at (60:0.27) {\scriptsize$\psi$};
\node[below,align=center] at (0,-1.45) {bodies $I_1$ (outer) and $I_2$ (inner),\\ joined by a motor};
\end{scope}
\begin{scope}[xshift=5.0cm]
\draw[hcsink] (0,0) circle (1.0);
\foreach \k in {0,...,4}{\fill[hcsrust] ({-144*\k}:1.0) circle (1.6pt);}
\node[below,align=center] at (0,-1.2) {$\alpha=\tfrac25$:\\ $5$ orientations};
\end{scope}
\begin{scope}[xshift=8.4cm]
\draw[hcsink] (0,0) circle (1.0);
\foreach \k in {0,...,33}{\pgfmathsetmacro{\an}{-222.4922*\k} \fill[hcsrust] (\an:1.0) circle (1.1pt);}
\node[below,align=center] at (0,-1.2) {$\alpha=\tfrac{\sqrt5-1}2$:\\ first $34$ of a dense set};
\end{scope}
\end{tikzpicture}
\caption{The two-body system and the orientations $\theta_0-2\pi k\alpha$ reachable at zero momentum with the joint returned to its initial angle.}\label{fig:beanie}
\end{figure}
\begin{theorem}[The two-body system]\label{thm:beanie}
Consider the zero-momentum motions of the system, the curves in $T^2$ with $\dd\theta+\alpha\,\dd\psi=0$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item The connection is flat. The set reachable from $(\theta_0,\psi_0)$ is the leaf $\set{(\theta_0-\alpha s,\psi_0+s)\mid s\in\R}$. The orientations reachable with the
joint returned to $\psi_0$ are $\theta_0-2\pi\alpha\Z$.
\item The map $c\colon T^2\to\R/2\pi(\Z+\alpha\Z)$, $c(\theta,\psi)=[\theta+\alpha\psi]$, is a smooth first integral and a subduction whose fibres are the reachable sets. It is
universal: every smooth map from $T^2$ to a diffeological space that is constant on zero-momentum curves factors uniquely and smoothly
through $c$.
\item If $\alpha=p/q$ in lowest terms, the reachable sets are circles, the target of $c$ is a circle, and the reachable orientations at a fixed joint
angle are $q$ points.
\item If $\alpha$ is irrational, the target of $c$ is the irrational torus $\Tal$; every reachable set is dense and, with the subspace diffeology,
diffeomorphic to $\R$; every first integral with values in a manifold is constant; and for each convergent $p_j/q_j$ of $\alpha$, every
orientation is reached within $3\pi/q_j$ by fewer than $q_j$ turns of the joint.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) $\dd A=0$. The lift of the shape curve $\psi_0+s$ is $\theta_0-\alpha s$, and one turn of the joint is $s=2\pi$. (ii) The linear map
$(\theta,\psi)\mapsto\theta+\alpha\psi$ from $\R^2$ to $\R$ is a subduction, it maps $(2\pi\Z)^2$ into $2\pi(\Z+\alpha\Z)$, and two points have the same image in the quotient if and only if
they lie on one leaf. So $c$ is a subduction with the leaves as fibres, and the universal property is that of a quotient diffeology. (iii) The
group $2\pi(\Z+\tfrac pq\Z)=\tfrac{2\pi}q\Z$ is discrete. (iv) The target is $\R/2\pi(\Z+\alpha\Z)\cong\Tal$. The leaf is the image of the irrational winding
$\R\to T^2$, which is an induction \IZ{Exercise~31}. A first integral $f\colon T^2\to N$ is continuous and constant on a dense leaf, hence constant on
$T^2$ when $N$ is Hausdorff. The bound is \cref{exo:approx}.
\end{proof}
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{4.3cm}p{4.0cm}p{4.7cm}@{}}\toprule
& $\alpha=p/q$ & $\alpha$ irrational\\\midrule
holonomy group & cyclic of order $q$ & $2\pi\alpha\Z$, dense in the circle\\
reachable set & a closed curve & a dense leaf, $\cong\R$\\
universal first integral & circle-valued & $\Tal$-valued\\
real-valued first integrals & functions on a circle & constants\\
exact controllability of $\theta$ & no & no\\
approximate controllability & no & yes, at a cost set by the convergents of $\alpha$\\\bottomrule
\end{tabular}
\caption{Zero-momentum reachability of the two-body system as a function of the inertia ratio.}\label{tab:beanie}
\end{table}
For an analysis based on real-valued invariants the irrational system has no conserved quantity on the zero-momentum level and its orbits
are dense, the usual indications of controllability. It is not controllable: each reachable set is a single leaf, of measure zero. The
invariant that separates the reachable sets exists, is smooth, and is unique up to diffeomorphisms of its target; its target is a
diffeological space that is not a manifold. This is the situation of \VolI{Theorem~12.4}: the smooth real functions on $\Tal$ are the constants,
and the structure of $\Tal$ is carried by its plots. Along a leaf, planning is elementary, since the leaf is a line and has a smooth planner
\VolI{Theorem~12.1}; between leaves no motion exists. By the last clause of (iv) the cost of approximate control is bounded in terms of the continued
fraction of the inertia ratio, the invariant that classifies $\Tal$ up to diffeomorphism \VolI{Corollary~9.2}.
\exercisesheading
\begin{exercise}[label=exo:equal-inertia]{1}
For $I_1=I_2$ compute the rotation of the first body produced by one turn of the joint at zero momentum, and the reachable orientations.
\end{exercise}
\begin{solution}
$\alpha=\tfrac12$, so one turn of the joint rotates the first body by $-\pi$ and the second by $+\pi$ relative to the frame: the system returns to its
shape with both bodies reversed. Two turns restore the configuration. The reachable orientations at a fixed joint angle are $\theta_0$ and
$\theta_0+\pi$, and $c=[\theta+\tfrac12\psi]\in\R/\pi\Z$ is a circle-valued first integral.
\end{solution}
\begin{exercise}[label=exo:flat-holonomy]{2}
For $\alpha=p/q$ in lowest terms, show that the leaf through $(\theta_0,\psi_0)$ closes after $q$ turns of the joint, and describe the leaf as a curve on the torus.
\end{exercise}
\begin{solution}
After $k$ turns the orientation is $\theta_0-2\pi kp/q$, equal to $\theta_0$ modulo $2\pi$ exactly when $q$ divides $k$, since $p$ and $q$ are coprime. The leaf
is the closed curve $s\mapsto(\theta_0-\tfrac pqs,\psi_0+s)$, $s\in[0,2\pi q]$, winding $q$ times in the direction of $\psi$ and $-p$ times in the direction of $\theta$: a torus knot
of type $(q,-p)$ when the torus is embedded in space. The orientations visited at the joint angle $\psi_0$ are the $q$ points $\theta_0-2\pi k/q$.
\end{solution}
\begin{exercise}[label=exo:variable-beanie]{3}
Suppose the second body can also change its moment of inertia, $I_2=I_2(r)$ with $r$ in an interval and $I_2'\neq0$. Show that every orientation is
reachable at zero momentum with the shape returned to its initial value.
\end{exercise}
\begin{solution}
The shape space is the cylinder of $(r,\psi)$ and $A=\dd\theta+\alpha(r)\,\dd\psi$ with $\alpha(r)=I_2(r)/(I_1+I_2(r))$, so $F=\alpha'(r)\,\dd r\wedge\dd\psi\neq0$. Consider the shape
loop: turn the joint once at $r_1$, change $r$ from $r_1$ to $r_2$, turn the joint once backwards, return to $r_1$. Changes of $r$ at fixed $\psi$
do not move $\theta$. The displacement is $-2\pi\alpha(r_1)+2\pi\alpha(r_2)$, a continuous function of $r_2$ vanishing at $r_2=r_1$ and not locally constant. So an
interval of rotations around $0$ is reachable by one such loop, and every rotation by repeating it. The loop is contractible in the cylinder and
its displacement is $-\int_DF$ over the annulus it bounds, in accordance with \cref{thm:phase}(ii).
\end{solution}
\begin{exercise}[label=exo:no-invariant]{3}
Let $\alpha$ be irrational. Show that the D-topology of the target of $c$ is trivial, and deduce directly that a first integral with values in a
space whose D-topology is Hausdorff is constant. Which smooth first integral is not constant?
\end{exercise}
\begin{solution}
The D-topology of $\R/2\pi(\Z+\alpha\Z)$ is the quotient topology, and a saturated open set of $\R$ is invariant under a dense group of translations, so it is
empty or $\R$. A first integral $f$ factors as $\bar f\circ c$ with $\bar f$ smooth, hence D-continuous; a continuous map from an indiscrete space to
a Hausdorff space is constant. The map $c$ itself is a non-constant smooth first integral, with values in $\Tal$, whose D-topology is not
Hausdorff.
\end{solution}
\begin{exercise}[label=exo:approx]{4}
Let $\alpha$ be irrational with convergents $p_j/q_j$. Prove that every point of $\R/\Z$ is within $\tfrac3{2q_j}$ of one of the points $k\alpha$,
$0\le k<q_j$, and deduce the last clause of \cref{thm:beanie}(iv).
\end{exercise}
\begin{solution}
The convergents satisfy $\abs{q_j\alpha-p_j}<1/q_{j+1}$ \cite{HardyWright}. For $0\le k<q_j$,
$\abs{k\alpha-kp_j/q_j}=\tfrac k{q_j}\abs{q_j\alpha-p_j}<1/q_{j+1}$. Since $p_j$ and $q_j$ are coprime, the points $kp_j/q_j\bmod1$, $0\le k<q_j$, are all the
multiples of $1/q_j$, and every point of the circle is within $\tfrac1{2q_j}$ of one of them. So every point is within
$\tfrac1{2q_j}+\tfrac1{q_{j+1}}\le\tfrac3{2q_j}$ of some $k\alpha$. In the system, $k$ turns of the joint rotate the body by $-2\pi k\alpha$; multiplying by $2\pi$, every
orientation is within $3\pi/q_j$ of one reached by fewer than $q_j$ turns.
\end{solution}
\chapter{System design: composition, ports, and reduction}\label{ch:systems}
\chaptermark{System design}
\begin{chapabstract}
Open physical systems are composed along shared ports, and the composite of energy-conserving systems should be energy-conserving. For
linear systems this is the theorem that Lagrangian and Dirac relations compose. For non-linear systems the composite of two correspondences
is a fibre product, which exists in $\Diff$ without transversality hypotheses. Port-Hamiltonian systems are closed under interconnection, and
the reduction of a symmetric component commutes with its interconnection to the rest of a design.
\end{chapabstract}
\section{Correspondences}
A design assembles components by identifying variables at their interfaces. In Hamiltonian terms an interface is a parasymplectic space of
port variables, and a component is a relation between its ports that is compatible with the forms.
\begin{definition}\label{def:correspondence}
An \defn{isotropic correspondence} from $(X,\omega)$ to $(X',\omega')$ is a diffeological space $L$ with smooth maps $s\colon L\to X$, $t\colon L\to X'$ such that
$s^*\omega=t^*\omega'$; equivalently a span $X\leftarrow L\to X'$ in the slice $\SmSet/\Omcl$; equivalently a smooth map $L\to X\times_\omega X'$ to the product
of \cref{prop:slice}; equivalently a smooth map $L\to\overline X\boxplus X'$ that pulls the form back to zero.
\end{definition}
\begin{theorem}[Composition]\label{thm:corr}
Isotropic correspondences compose by fibre product,
\[
(X'\xleftarrow{s'}L'\xrightarrow{t'}X'')\circ(X\xleftarrow{s}L\xrightarrow{t}X')=\bigl(X\xleftarrow{s\circ\pr}L\times_{X'}L'\xrightarrow{t'\circ\pr'}X''\bigr),
\]
and with this composition the parasymplectic spaces are the objects of a bicategory $\cat{Corr}$. The graph of a morphism of $\ParaSymp$ is a
correspondence, and composition of graphs is composition of maps. The sum $\boxplus$ is a symmetric monoidal structure on $\cat{Corr}$, and
correspondences $X\rel X'$ are the correspondences $\ast\rel\overline X\boxplus X'$.
\end{theorem}
\begin{proof}
The fibre product exists in $\Diff$ \VolI{Theorem~1.6}, and
$(s\circ\pr)^*\omega=\pr^*t^*\omega'=(t\circ\pr)^*\omega'=(s'\circ\pr')^*\omega'=(t'\circ\pr')^*\omega''$, because $t\circ\pr=s'\circ\pr'$ on the fibre product. Associativity and units hold up
to the canonical isomorphisms of iterated fibre products, as for spans in any category with pullbacks. For a morphism $f$ the graph is
$X\xleftarrow{\id}X\xrightarrow{f}X'$ (\cref{exo:graph}), and $X\times_{X'}X'\cong X$. The last statement is the last clause of \cref{def:correspondence}.
\end{proof}
In the category of manifolds the fibre product $L\times_{X'}L'$ exists only under a transversality condition, and the composition of
Lagrangian correspondences is for that reason only partially defined \cite{Weinstein}. In $\Diff$ the composite always exists; when
transversality fails it is a diffeological space that is not a manifold, with its forms, its plots and its homotopy type. The condition
of being \emph{Lagrangian}, isotropic of half dimension, is pointwise and is available when the tangent spaces are; the linear case is next.
\begin{figure}[t]
\centering
\begin{tikzcd}[column sep=2.2em,row sep=2.0em]
&& L\times_{X'}L' \arrow[dl,"\pr"'] \arrow[dr,"\pr'"] \arrow[dd,phantom,"\lrcorner"{rotate=-45},very near start] && & & Z \arrow[dl,hook'] \arrow[dr,"\pi_G"] &\\
& L \arrow[dl,"s"'] \arrow[dr,"t"] && L' \arrow[dl,"s'"'] \arrow[dr,"t'"] & & X && X_0\\
X \arrow[drr,"\omega"'] && X' \arrow[d,"\omega'"] && X'' \arrow[dll,"\omega''"] & & \Omcl \arrow[from=ul,"\omega"'] \arrow[from=ur,"\omega_0"] &\\
&& \Omcl && & & &
\end{tikzcd}
\caption{Left: composition of isotropic correspondences is composition of spans over $\Omcl$. Right: symplectic reduction is a
correspondence from a space to its reduced space.}\label{fig:spans}
\end{figure}
\section{Linear relations}
Let $V$ be a finite-dimensional real vector space with a non-degenerate bilinear form $\langle\ ,\ \rangle$, symmetric or antisymmetric, and $\overline V$ the same
space with the opposite form. A subspace $L$ is \defn{Lagrangian} if $L=L^\perp$. A \defn{Lagrangian relation} $V_1\rel V_2$ is a Lagrangian subspace of
$\overline V_1\oplus V_2$, and the composite of relations is $L_2\circ L_1=\set{(v_1,v_3)\mid\exists\,v_2:\ (v_1,v_2)\in L_1,\ (v_2,v_3)\in L_2}$.
\begin{theorem}[Lagrangian relations compose]\label{thm:lagrel}
\begin{enumerate}[label=\textup{(\roman*)}]
\item \emph{Reduction.} If $C\subseteq V$ is coisotropic, $C^\perp\subseteq C$, and $L\subseteq V$ is Lagrangian, then $L_C=(L\cap C+C^\perp)/C^\perp$ is Lagrangian in $C/C^\perp$.
\item The composite of two Lagrangian relations is a Lagrangian relation, with no hypothesis of transversality.
\end{enumerate}
The statement holds for forms of either symmetry type.
\end{theorem}
\begin{proof}
(i) The form of $V$ induces a non-degenerate form on $C/C^\perp$, for which $L_C$ is isotropic. Since $(L\cap C)^\perp=L^\perp+C^\perp=L+C^\perp$,
\[
\dim(L\cap C)=\dim V-\dim L-\dim C^\perp+\dim(L\cap C^\perp),
\]
and with $\dim L=\tfrac12\dim V$ and $\dim C=\dim V-\dim C^\perp$ this gives $\dim L_C=\dim(L\cap C)-\dim(L\cap C^\perp)=\tfrac12(\dim C-\dim C^\perp)$. An isotropic subspace
of half dimension is equal to its orthogonal. (ii) In $V=\overline V_1\oplus V_2\oplus\overline V_2\oplus V_3$ the subspace $L=L_1\oplus L_2$ is Lagrangian and
$C=V_1\oplus\Delta_{V_2}\oplus V_3$ is coisotropic with $C^\perp=0\oplus\Delta_{V_2}\oplus0$, because the diagonal of $V_2\oplus\overline V_2$ is Lagrangian. Then
$C/C^\perp=\overline V_1\oplus V_3$ and $L_C=L_2\circ L_1$.
\end{proof}
For antisymmetric forms this is the linear symplectic category \cite{GuilleminSternberg}. For the symmetric pairing
$\langle(f,e),(f',e')\rangle=e(f')+e'(f)$ on a space $F\oplus F^*$ of \emph{flows} and \emph{efforts}, a Lagrangian subspace is a \defn{Dirac structure}: the
constitutive relation of a lossless interconnection, on which the power $e(f)$ vanishes.
\begin{corollary}[Cervera--van der Schaft--Ba\~nos \cite{Cervera}]\label{cor:dirac}
The interconnection of two Dirac structures on $F_1\oplus F_2$ and on $F_2\oplus F_3$ through the shared port, with $f_2=-f_2'$ and $e_2=e_2'$, is a Dirac
structure on $F_1\oplus F_3$.
\end{corollary}
\noindent The proof is \cref{exo:dirac}. Kirchhoff's laws, ideal transformers and rigid kinematic constraints are Dirac structures, and the
corollary is the statement that a network of lossless interconnections is a lossless interconnection. In the passive linear case the
composition of circuits is of this kind \cite{BaezFong}; eliminating an internal node is a composition of relations, and no
non-degeneracy of the eliminated block is needed (\cref{exo:schur}).
\section{Port-Hamiltonian systems}
A \defn{port-Hamiltonian system} on a manifold $X$ with energy $H$ is
\begin{equation}\label{eq:pH}
\dot x=\bigl(J(x)-R(x)\bigr)\nabla H(x)+g(x)\,u,\qquad y=g(x)\transp\nabla H(x),
\end{equation}
with $J$ antisymmetric, $R$ symmetric positive semi-definite, input $u$ and output $y$ \cite{vdSJ}.
\begin{theorem}[Interconnection]\label{thm:pH}
\begin{enumerate}[label=\textup{(\roman*)}]
\item Along every trajectory of \eqref{eq:pH}, $\dot H=-\nabla H\transp R\,\nabla H+y\transp u\le y\transp u$.
\item The feedback interconnection $u_1=-y_2+e_1$, $u_2=y_1+e_2$ of two port-Hamiltonian systems is port-Hamiltonian on $X_1\times X_2$ with
\[
H=H_1+H_2,\quad J=\begin{pmatrix}J_1&-g_1g_2\transp\\ g_2g_1\transp&J_2\end{pmatrix},\quad R=\begin{pmatrix}R_1&0\\0&R_2\end{pmatrix},\quad g=\begin{pmatrix}g_1&0\\0&g_2\end{pmatrix}.
\]
\item Hence $H(x(t))-H(x(0))\le\int_0^t(y_1\transp e_1+y_2\transp e_2)\,\dd\tau$: the composite is passive with storage function $H_1+H_2$.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) $\dot H=\nabla H\transp\dot x=\nabla H\transp J\nabla H-\nabla H\transp R\nabla H+\nabla H\transp gu$, and the first term vanishes. (ii) Substituting,
$\dot x_1=(J_1-R_1)\nabla H_1-g_1g_2\transp\nabla H_2+g_1e_1$ and $\dot x_2=(J_2-R_2)\nabla H_2+g_2g_1\transp\nabla H_1+g_2e_2$; the off-diagonal blocks are negative transposes of
each other. (iii) Integrate (i) for the composite.
\end{proof}
The feedback law of (ii) is a Dirac structure on the port variables, $y_1\transp u_1+y_2\transp u_2=y_1\transp e_1+y_2\transp e_2$, and the theorem is the
non-linear, dissipative counterpart of \cref{cor:dirac}. The state space of a design assembled in this way is a product of the state
spaces of the components, cut down by the constraints of the interconnection and divided by its symmetries. By \VolI{Theorem~13.1} such
state spaces are diffeological spaces in general, and the two operations of cutting down and dividing are the two steps of reduction.
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{3.1cm}p{3.3cm}p{3.2cm}p{3.4cm}@{}}\toprule
setting & interface & component & composition\\\midrule
$\ParaSymp$ & space with closed $2$-form & form-preserving map & of maps\\
$\cat{Corr}$ & the same & isotropic span & fibre product (\cref{thm:corr})\\
linear symplectic & symplectic vector space & Lagrangian relation & of relations (\cref{thm:lagrel})\\
power ports & $F\oplus F^*$ & Dirac structure & shared port (\cref{cor:dirac})\\
port-Hamiltonian & inputs and outputs & system \eqref{eq:pH} & feedback (\cref{thm:pH})\\\bottomrule
\end{tabular}
\caption{Five compositional settings for open Hamiltonian systems.}\label{tab:composition}
\end{table}
\section{Reduction commutes with interconnection}
\begin{theorem}[Modular reduction]\label{thm:modular}
Let $(X_1,\omega_1)$ be equivariantly prequantised for a group $G$ acting principally on $Z_1=\mu_1^{-1}(0)$, with reduced space $(X_{1,0},\omega_{1,0})$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item The span $X_1\hookleftarrow Z_1\xrightarrow{\pi_G}X_{1,0}$ is an isotropic correspondence $\mathcal R\colon X_1\rel X_{1,0}$. For every isotropic
$L\to X_1$ the composite $\mathcal R\circ L=L\times_{X_1}Z_1\to X_{1,0}$ is isotropic.
\item For every parasymplectic space $(X_2,\omega_2)$, with $G$ acting on $X_1\boxplus X_2$ through the first factor,
\[
(Z_1\times X_2)/G\;\cong\;X_{1,0}\times X_2,\qquad\text{with reduced form }\omega_{1,0}\boxplus\omega_2 .
\]
A function $H_1+H_2+H_c$ on $X_1\times X_2$ with $H_1$ and the coupling $H_c$ invariant under $G$ descends to $X_{1,0}\times X_2$.
\item If a second group $H$ acts on $X_2$ in the same way, the reductions by $G$, by $H$ and by $G\times H$ are related as in \cref{thm:stages}, and
the reduced space is $X_{1,0}\times X_{2,0}$.
\end{enumerate}
\end{theorem}
\noindent The proof is \cref{exo:modular}. In design terms: a component with a symmetry can be replaced by its reduced model inside any larger
design whose coupling to it is invariant, and the result is the reduced model of the whole. The reduced component is an object of the same
kind, a parasymplectic diffeological space, also when it is singular. This is the Hamiltonian form of the lossless symmetry reduction of
\VolI{Theorem~13.3}, and the cases in which the quotient must be taken as a stack are listed in \cref{tab:reduced}.
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\node[hcsnode,minimum width=1.9cm,minimum height=0.9cm] (S1) at (0,1.2) {$\Sigma_1$: $H_1$};
\node[hcsnodeb,minimum width=1.9cm,minimum height=0.9cm] (S2) at (0,-0.6) {$\Sigma_2$: $H_2$};
\node[draw,circle,inner sep=1.5pt] (m1) at (-2.2,1.2) {$+$};
\node[draw,circle,inner sep=1.5pt] (m2) at (2.2,-0.6) {$+$};
\draw[->] (-3.0,1.2)--node[above]{$e_1$}(m1); \draw[->] (m1)--node[above]{$u_1$}(S1);
\draw[->] (S1)--node[above,pos=0.3]{$y_1$}(3.0,1.2);
\draw[->] (2.2,1.2)--(m2);
\draw[->] (3.0,-0.6)--node[above]{$e_2$}(m2); \draw[->] (m2)--node[above]{$u_2$}(S2);
\draw[->] (S2)--node[above,pos=0.3]{$y_2$}(-3.0,-0.6);
\draw[->] (-2.2,-0.6)--node[left]{$-$}(m1);
\node[below] at (0,-1.3) {$\dot H\le y_1\transp e_1+y_2\transp e_2$,\quad $H=H_1+H_2$};
\end{scope}
\begin{scope}[xshift=6.3cm,yshift=0.3cm]
\node (A) at (0,1.5) {$X_1\boxplus X_2$}; \node (B) at (3.0,1.5) {$X_{1,0}\boxplus X_2$};
\node (C) at (0,-0.5) {$X_1$}; \node (D) at (3.0,-0.5) {$X_{1,0}$};
\draw[->,dashed] (A)--node[above]{reduce}(B);
\draw[->,dashed] (C)--node[below]{reduce}(D);
\draw[->] (C)--node[left]{$\boxplus X_2$}(A); \draw[->] (D)--node[right]{$\boxplus X_2$}(B);
\end{scope}
\end{tikzpicture}
\caption{Left: the feedback interconnection of \cref{thm:pH}. Right: \cref{thm:modular}(ii); coupling and reduction commute.}\label{fig:interconnect}
\end{figure}
\exercisesheading
\begin{exercise}[label=exo:graph-compose]{1}
Show that for morphisms $f\colon X\to X'$ and $f'\colon X'\to X''$ of $\ParaSymp$ the composite of the graphs is the graph of $f'\circ f$.
\end{exercise}
\begin{solution}
The graph of $f$ is $L=X$ with $(s,t)=(\id,f)$, and that of $f'$ is $L'=X'$ with $(\id,f')$. The fibre product $L\times_{X'}L'=\set{(x,x')\mid f(x)=x'}$ is
identified with $X$ by the first projection, and under this identification the two legs are $\id$ and $f'\circ f$.
\end{solution}
\begin{exercise}[label=exo:schur]{2}
In $V=\R^4$ with coordinates $(q_1,q_2,p_1,p_2)$ and the standard symplectic form, let $\Lambda=\set{p=\nabla S(q)}$ with
$S=\tfrac12aq_1^2+bq_1q_2+\tfrac12cq_2^2$, and let $C=\set{p_1=0}$. Compute $\Lambda_C\subseteq\R^2$ for $a\neq0$ and for $a=0\neq b$.
\end{exercise}
\begin{solution}
$C^\perp$ is spanned by $\partial_{q_1}$, and $C/C^\perp=\R^2$ with coordinates $(q_2,p_2)$. On $\Lambda\cap C$: $p_1=aq_1+bq_2=0$ and $p_2=bq_1+cq_2$. If $a\neq0$ then
$q_1=-bq_2/a$ and $\Lambda_C=\set{p_2=(c-b^2/a)\,q_2}$, the graph of the Schur complement: the generating function of the reduced relation is $S$
with the internal variable eliminated. If $a=0$ and $b\neq0$ then $q_2=0$ and $p_2=bq_1$ is arbitrary: $\Lambda_C$ is the vertical line $\set{q_2=0}$. It is
Lagrangian, in accordance with \cref{thm:lagrel}(i), and it is not the graph of a function: elimination of an internal variable with a degenerate
block produces a constraint in place of a constitutive law.
\end{solution}
\begin{exercise}[label=exo:oscillators]{2}
Write a mass--spring system with force input and velocity output as a port-Hamiltonian system, and compute the feedback interconnection
of two of them.
\end{exercise}
\begin{solution}
$x=(q,p)$, $H=\tfrac1{2m}p^2+\tfrac k2q^2$, $J=\bigl(\begin{smallmatrix}0&1\\-1&0\end{smallmatrix}\bigr)$, $R=0$, $g=(0,1)\transp$: $\dot q=p/m$, $\dot p=-kq+u$, $y=p/m$, the
velocity, and $\dot H=yu$, force times velocity. For two such systems, $g_1g_2\transp$ is the matrix unit coupling the two momenta, and
\cref{thm:pH}(ii) gives $\dot p_1=-k_1q_1-p_2/m_2+e_1$, $\dot p_2=-k_2q_2+p_1/m_1+e_2$: a gyroscopic coupling. The total energy $H_1+H_2$ satisfies
$\dot H=y_1e_1+y_2e_2$ and is conserved for $e=0$.
\end{solution}
\begin{exercise}[label=exo:dirac]{3}
Deduce \cref{cor:dirac} from \cref{thm:lagrel}.
\end{exercise}
\begin{solution}
Let $W_i=F_i\oplus F_i^*$ with the symmetric pairing. The map $\sigma(f,e)=(-f,e)$ satisfies $\langle\sigma w,\sigma w'\rangle=-\langle w,w'\rangle$, so it is an isometry
$W_i\to\overline W_i$. A Dirac structure $D_A$ on $F_1\oplus F_2$ is a Lagrangian subspace of $W_1\oplus W_2$; applying $\sigma$ to the first factor makes it a
Lagrangian relation $W_1\rel W_2$, and similarly $D_B$ becomes a relation $W_2\rel W_3$ after applying $\sigma$ to its $W_2$-component. The composite
of the two relations identifies $(f_2,e_2)$ in the first with $\sigma(f_2',e_2')=(-f_2',e_2')$ in the second, which is the interconnection
constraint. By \cref{thm:lagrel}(ii) the composite is Lagrangian in $\overline W_1\oplus W_3$, and applying $\sigma$ to the first factor again gives a Dirac
structure on $F_1\oplus F_3$.
\end{solution}
\begin{exercise}[label=exo:modular]{4}
Prove \cref{thm:modular}.
\end{exercise}
\begin{solution}
(i) By \cref{thm:reduction}, $\pi_G^*\omega_{1,0}=\omega_1|_{Z_1}$, which is the isotropy of the span. The second statement is \cref{thm:corr} applied to
$\ast\rel X_1\rel X_{1,0}$. (ii) The map $\pi_G\times\id\colon Z_1\times X_2\to X_{1,0}\times X_2$ is a product of subductions, hence a subduction \VolI{Proposition~1.7},
and its fibres are the orbits of $G$; so it induces a diffeomorphism from $(Z_1\times X_2)/G$. The form $\omega_1|_{Z_1}\boxplus\omega_2$ is the pullback of
$\omega_{1,0}\boxplus\omega_2$, and pullback along a subduction is injective, so the latter is the reduced form. The functions $H_1|_{Z_1}$ and $H_c|_{Z_1\times X_2}$ are
invariant, hence constant on the fibres of a subduction, and descend to smooth functions; $H_2$ is a function of the second factor. (iii) Apply
(ii) twice, or \cref{thm:stages} to the commuting actions of $G$ and $H$ on $X_1\boxplus X_2$: the zero level is $Z_1\times Z_2$ and its quotient by
$G\times H$ is $X_{1,0}\times X_{2,0}$ by the same argument.
\end{solution}
\chapter{The general structure: descent along an atlas}\label{ch:structure}
\chaptermark{Descent along an atlas}
\begin{chapabstract}
The conservation laws of \cref{ch:ml}, the geometric phases of \cref{ch:ai} and the four uses of symmetry in \cref{sec:acceleration} are
one situation: an objective defined on a quotient, and a dynamics defined on an atlas of the quotient by means of a structure that does not
descend. We state it symplectically, as a condition on a Lagrangian submanifold, and metrically, as a connection whose exact part gives the
conserved quantities and whose non-closed part gives the phases. The part of the statement that uses no tangent structure holds in every
$\infty$-topos. With tangent structure it holds in a differentially cohesive $\infty$-topos, for every group object acting on a Riemannian
manifold, where the atlas of the quotient is the composite of a quotient by a formal group and a formally \'etale map. For the syntax of an
algebraic theory it is the theory of normal forms and of invariant definitions.
\end{chapabstract}
\section{Invariance as a Lagrangian condition}
Let a Lie group $G$ act on a manifold $\Theta$. The cotangent lift of the action preserves the canonical $1$-form $\alpha=\langle p,\dd\theta\rangle$ of $T^*\Theta$, and by
\cref{thm:exact} its moment map is $\mu(\theta,p)(\xi)=\langle p,\xi_\Theta(\theta)\rangle$, where $\xi_\Theta$ is the vector field generated by $\xi\in\fg$.
\begin{theorem}[Invariant functions and the zero level]\label{thm:lagrangian}
\begin{enumerate}[label=\textup{(\roman*)}]
\item A function $L\in\cinf(\Theta)$ is invariant under the identity component of $G$ if and only if the graph of $\dd L$ is contained in $\mu^{-1}(0)$.
\item If $G$ acts freely and properly on $\Theta$, with quotient $\pi\colon\Theta\to X$, then $\mu^{-1}(0)=\pi^*T^*X$, the action of $G$ on it is principal, and the
reduced space of \cref{cor:exact-reduction} is $T^*X$ with its canonical forms.
\item In that case, for $L=\ell\circ\pi$, the image of the graph of $\dd L$ under the reduction correspondence $\mathcal R\colon T^*\Theta\rel T^*X$ of \cref{thm:modular} is
the graph of $\dd\ell$.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) $\mu(\theta,\dd L_\theta)(\xi)=\dd L(\xi_\Theta)$ is the derivative of $L$ along the orbit; it vanishes for all $\xi$ if and only if $L$ is constant on the orbits
of the identity component. (ii) A covector at $\theta$ lies in $\mu^{-1}(0)$ if and only if it vanishes on the tangent space of the orbit, that is, if
and only if it is $\pi^*\beta$ for a unique $\beta\in T^*_{\pi(\theta)}X$. So $\mu^{-1}(0)=\pi^*T^*X$, and the map $(\theta,\pi^*\beta)\mapsto(\pi(\theta),\beta)$ is a principal
$G$-bundle over $T^*X$, the pullback of $\pi$; the action is principal also by \cref{lem:principal}(a). For a tangent vector $v$ at
$(\theta,\pi^*\beta)$, $\alpha(v)=\pi^*\beta(\dd\tau\,v)=\beta(\dd\pi\,\dd\tau\,v)$ with $\tau$ the projection to $\Theta$, which is the pullback of the canonical form of $T^*X$. (iii)
$\dd L=\pi^*\dd\ell$, so the graph of $\dd L$ lies in the zero level and its image is $\set{(x,\dd\ell_x)}$.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzcd}[column sep=3.0em,row sep=2.2em]
\mathrm{graph}(\dd L) \arrow[r,hook] \arrow[d,two heads] & \mu^{-1}(0)=\pi^*T^*X \arrow[r,hook] \arrow[d,two heads,"/G"] & T^*\Theta \arrow[d,"\tau"] \\
\mathrm{graph}(\dd\ell) \arrow[r,hook] & T^*X & \Theta \arrow[d,"\pi"]\\
& & X=\Theta/G
\end{tikzcd}
\caption{\Cref{thm:lagrangian}. An invariant objective is a Lagrangian submanifold of the zero level of the moment map of the cotangent lift,
and its reduction is the objective on the quotient.}\label{fig:lagrangian}
\end{figure}
The theorem contains no dynamics. For an optimisation algorithm one more datum is required, a rule that converts the covector $\dd L$ into a motion, and
on $\Theta$ that rule is a metric. If the metric is invariant under $G$ it descends with everything else. The phenomena of \cref{ch:ml} arise because
the Euclidean metric of the parameters is invariant under a compact subgroup only.
\section{The connection of a metric}
Let $\Theta\subseteq\R^d$ be open and invariant under a closed subgroup $G\subseteq\GL_d(\R)$ whose Lie algebra is stable under transposition, $\fg=\fk\oplus\fpp$, and let
$K=G\cap\Ort(d)$. For $A\in\fg$ let
\[
a_A=\langle A\theta,\dd\theta\rangle\in\Om^1(\Theta),
\]
the $1$-form dual to the generator $A\theta$ for the Euclidean metric.
\begin{theorem}[Exact part and non-closed part]\label{thm:metric-connection}
\begin{enumerate}[label=\textup{(\roman*)}]
\item A vector $v$ at $\theta$ is orthogonal to the orbit of $G$ if and only if $a_A(v)=0$ for all $A\in\fg$. The gradient of every $G$-invariant function is
orthogonal to the orbits.
\item For $A\in\fpp$ the form is exact: $a_A=\dd Q_A$ with $Q_A=\tfrac12\langle\theta,A\theta\rangle$.
\item For $A\in\fk$ the form is not closed unless $A=0$: $\dd a_A=-2\sum_{i<j}A_{ij}\,\dd\theta_i\wedge\dd\theta_j$.
\item Every curve orthogonal to the orbits lies in a level set of $Q\colon\Theta\to\fpp^*$. On the level set $Q^{-1}(0)$, which $K$ preserves, the orthogonal
complement of the $G$-orbits is the orthogonal complement of the $K$-orbits, the mechanical connection of \cref{thm:phase} for the group $K$.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) The tangent space of the orbit is $\fg\theta$, and $a_A(v)=\langle A\theta,v\rangle$; the second statement is \eqref{eq:orth}. (ii) $\dd\,\tfrac12\langle\theta,A\theta\rangle=\langle A\theta,\dd\theta\rangle$ for
symmetric $A$. (iii) $a_A=\sum_{i,j}A_{ij}\theta_j\,\dd\theta_i$ and $\dd a_A=\sum_{i,j}A_{ij}\,\dd\theta_j\wedge\dd\theta_i=\sum_{i<j}(A_{ji}-A_{ij})\,\dd\theta_i\wedge\dd\theta_j$. (iv) By (i) and (ii)
the functions $Q_A$ are constant along such a curve. The tangent space of a level set of $Q$ is $(\fpp\theta)^\perp$, and
$(\fg\theta)^\perp=(\fpp\theta)^\perp\cap(\fk\theta)^\perp$. Equivariance of $Q$ under $K$ gives the invariance of the zero level.
\end{proof}
So the conservation laws of gradient flow and the geometric phases are the two parts of one object. The symmetric directions give exact
forms, hence first integrals and a foliation by slices; the antisymmetric directions give forms that are not closed, and
where $\dd a_A$ is non-zero on pairs of vectors orthogonal to the orbits the connection has curvature, with a holonomy and no first integral
(\cref{prop:dc-conserved}). \Cref{thm:two-noether}(b) and (d) are parts (ii) and (i); the two-body system of \cref{thm:beanie} is the case of a closed
form that is not exact, where the first integral exists with values in a quotient of $\R$.
\begin{theorem}[Four positions]\label{thm:positions}
In the situation above, let $G$ act freely and properly on $\Theta$, $\pi\colon\Theta\to X$, and $L=\ell\circ\pi$.
\begin{enumerate}[label=\textup{(\alph*)}]
\item \emph{Gauge dependence.} $\dd\pi_\theta\bigl(\nabla L(\theta)\bigr)=C_\theta\,\dd\ell_x$, where $C_\theta=\dd\pi_\theta\circ\dd\pi_\theta\transp\colon T^*_xX\to T_xX$ is symmetric and positive
definite. It satisfies $C_{k\theta}=C_\theta$ for $k\in K$, and it depends on the point of the fibre otherwise.
\item \emph{A slice.} If $Q^{-1}(0)$ intersects each fibre in one orbit of $K$, then $C$ restricted to $Q^{-1}(0)$ is a cometric $C^{\mathrm{bal}}$ on $X$, and gradient
flow from a balanced point projects to $\dot x=-C^{\mathrm{bal}}\dd\ell$. For the linear network, $C^{\mathrm{bal}}(G)=(XX\transp)^{1/2}G+G(X\transp X)^{1/2}$.
\item \emph{An invariant metric.} For a $G$-invariant metric $g'$ on $\Theta$ the cometric $C'$ is constant on fibres, and the $g'$-gradient flow of $L$
projects to $\dot x=-C'\dd\ell$ from every initial point. For the linear network and
$g'=\tr(\dd B\,AA\transp\dd B\transp)+\tr(\dd A\transp B\transp B\,\dd A)$, $C'(G)=P_cG+GP_r$.
\item \emph{Projection.} Every update $u\in T_\theta\Theta$ is the sum of a part orthogonal to the orbit and a part tangent to it. Only the first has an
image in $T_xX$; the second changes $Q_A$ at first order by $\langle A\theta,u\rangle$ for $A\in\fpp$, and moves $\theta$ along its $K$-orbit for $A\in\fk$.
\end{enumerate}
\end{theorem}
\begin{proof}
(a) $\dd L=\dd\ell\circ\dd\pi$, so $\nabla L=\dd\pi\transp\dd\ell$ and $\dd\pi\,\nabla L=\dd\pi\,\dd\pi\transp\dd\ell$. Since $\pi\circ k=\pi$ and $k$ is orthogonal, $\dd\pi_{k\theta}=\dd\pi_\theta\circ k^{-1}$ and
$C_{k\theta}=C_\theta$. (b) follows from (a), from the invariance of the balanced set (\cref{thm:two-noether}(b)), and for the linear network from
\cref{prop:induced}(i) and \cref{thm:balanced}(ii). (c) For an invariant metric $\pi$ is a Riemannian submersion onto $X$ with the quotient metric,
and the gradient of $\ell\circ\pi$ is the horizontal lift of the gradient of $\ell$. The $g'$-gradients are $GA\transp(AA\transp)^{-1}$ and $(B\transp B)^{-1}B\transp G$, and the
formula is \cref{prop:induced}(ii) to first order in $\eta$. (d) is \cref{thm:metric-connection}(i),(ii).
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\begin{scope}
\fill[hcsmist] (0,0) rectangle (5.2,3.4);
\draw[hcsteal] (0,0) rectangle (5.2,3.4);
\foreach \x in {0.8,1.9,3.0,4.1} \draw[hcsgrey,line width=0.4pt] (\x,0)--(\x,3.4);
\draw[hcsgold,line width=1.1pt] (0,0.9) .. controls (1.8,0.75) and (3.4,1.05) .. (5.2,0.9);
\draw[hcsteal,line width=0.8pt,dashed] (0,2.5) .. controls (1.8,2.35) and (3.4,2.65) .. (5.2,2.5);
\node[hcsgold!70!black,right] at (5.2,0.9) {$Q=0$};
\node[hcsteal,right] at (5.2,2.5) {$Q=c$};
\node[hcsgrey,above] at (0.8,3.4) {orbit};
\draw[->,hcsink,line width=1pt] (1.9,0.86)--(2.6,0.9);
\draw[->,hcsink,line width=1pt] (1.9,2.46)--(3.4,2.52);
\draw[->,hcsrust,line width=0.9pt] (3.0,1.05)--(3.0,2.35);
\node[hcsrust,right] at (3.0,1.7) {(2)};
\node[hcsink,below] at (2.25,0.85) {(1)};
\node[hcsink,above] at (2.6,2.55) {(1)};
\draw[->,hcsplum,line width=0.9pt] (4.1,1.4)--(4.6,2.0);
\draw[->,hcsplum,line width=0.9pt,dashed] (4.1,1.4)--(4.6,1.42);
\node[hcsplum,right] at (4.55,1.75) {(4)};
\draw[->>,line width=0.6pt] (2.6,-0.15)--node[right]{$\pi$}(2.6,-0.85);
\draw[hcsink,line width=1pt] (0,-1.1)--(5.2,-1.1) node[right]{$X$};
\foreach \x in {0.8,1.9,3.0,4.1} \fill (\x,-1.1) circle (1.2pt);
\draw[->,hcsteal,line width=1pt] (1.9,-1.3)--(2.6,-1.3) node[midway,below]{(3)};
\end{scope}
\begin{scope}[xshift=7.6cm,yshift=0.5cm]
\node[align=left,text width=6.2cm] at (2.6,1.3) {(1) the level of $Q$ fixes the speed of the projected flow;\\[0.4ex]
(2) a move along the orbit changes the level and not the objective;\\[0.4ex]
(3) an invariant metric gives one flow on $X$ for all levels;\\[0.4ex]
(4) an update with a component along the orbit is projected.};
\end{scope}
\end{tikzpicture}
\caption{The four positions of \cref{thm:positions}. Fibres are orbits of the symmetry group, the curves are level sets of the invariants of
gradient flow, and the same objective on $X$ is descended at different speeds from different levels.}\label{fig:positions}
\end{figure}
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{2.6cm}p{3.6cm}p{3.5cm}p{3.3cm}@{}}\toprule
position & what is chosen & dynamics on $X$ & in the literature\\\midrule
(a) none & a point of the fibre, by the initialisation & $-C_\theta\,\dd\ell$, with $\theta$ moving in a level set & conservation laws \cite{Kunin,ZhaoSurvey}\\
(b) slice & the level $Q=0$ & $-C^{\mathrm{bal}}\dd\ell$ & \cite{Arora,LindseyMenon}\\
(b$'$) change of slice & a vertical move & $C$ changes, $\ell$ does not & teleportation \cite{ZhaoTeleport}\\
(c) invariant metric & $g'$ on $\Theta$ & $-C'\dd\ell$, for all levels & \cite{Absil,TongMaChi}\\
(d) projection & the orthogonal part of $u$ & image of $u_\perp$ & \cite{AdamP}\\\bottomrule
\end{tabular}
\caption{The uses of a parameter symmetry as positions with respect to the quotient map.}\label{tab:positions}
\end{table}
The statements of this section are classical in each of their parts: optimisation on quotient manifolds \cite{Absil}, the moment map and the
theorem of Kempf and Ness for the balanced set \cite{LindseyMenon}, and cotangent bundle reduction \cite{AbrahamMarsden}. Their placement in the present
volume is the following: \cref{thm:lagrangian} is \cref{cor:exact-reduction} for a cotangent bundle, position (b) is the reduction of
structure group of \cref{thm:balanced}, and position (d) is the connection of \cref{thm:phase}.
\section{The same structure in an \texorpdfstring{$\infty$}{infinity}-topos}
Three of the four positions use no metric. Let $\Hh$ be an $\infty$-topos and $p\colon\Theta\to X$ an effective epimorphism, an \emph{atlas} of $X$, with
\v{C}ech nerve $\check C(p)_n=\Theta\times_X\cdots\times_X\Theta$.
\begin{proposition}[Atlases]\label{prop:atlas}
\begin{enumerate}[label=\textup{(\roman*)}]
\item \emph{Descent.} $X$ is the colimit of $\check C(p)$, and $\Map(X,V)$ is the limit of $\Map(\check C(p)_\bullet,V)$ \cite{HTT}. For a $0$-truncated $V$ a map
$X\to V$ is a map $f\colon\Theta\to V$ whose two pullbacks to $\Theta\times_X\Theta$ coincide.
\item \emph{Invariant dynamics.} If $X=\Theta\hquot G$ and $u\colon\Theta\to\Theta$ is $G$-equivariant, then $u$ induces $\bar u\colon X\to X$ with $p\circ u\simeq\bar u\circ p$.
\item \emph{Slices.} If $s\colon S\to\Theta$ is a map such that $p\circ s$ is an effective epimorphism, then $X$ is the colimit of $\check C(p\circ s)$.
\item \emph{Invariants of a dynamics.} For an endomorphism $u$ of $\Theta$ let $\Theta_u$ be the coequaliser of $u$ and the identity. For a $0$-truncated $V$,
the maps $\Theta_u\to V$ are the maps $f\colon\Theta\to V$ with $f\circ u=f$.
\end{enumerate}
\end{proposition}
\begin{proof}
(i) Groupoid objects of an $\infty$-topos are effective, so an effective epimorphism is the colimit of its \v{C}ech nerve
\cite[Theorem~6.1.0.6]{HTT}; for $0$-truncated $V$ the limit is the equaliser of the first two terms. (ii) An equivariant map is a map of the
simplicial objects $G^\bullet\times\Theta$, and colimits are functorial. (iii) is (i) for $p\circ s$. (iv) is the universal property of the coequaliser, the
homotopy coherences being vacuous for a $0$-truncated target.
\end{proof}
Each part has appeared in this volume. Part (i) for $V=\Om^k$ is \eqref{eq:basic}, and for the $1$-truncated $V=\BTc$ it is \cref{thm:B}. Part
(ii) is position (c). Part (iii) with $S=Q^{-1}(0)$ is position (b): the \v{C}ech nerve of the slice is the action groupoid of the smaller
group $K$. Part (iv) for a flow in place of an endomorphism is the universal first integral of \cref{thm:beanie}(ii), whose target is the
irrational torus. The smooth statements of the previous section use one more datum, a splitting of the tangent map of $p$, which is the
connection. It is formulated in differential cohesion in \cref{sec:dc}.
\section{Differential cohesion}\label{sec:dc}
\Cref{thm:positions} was proved for a linear group acting freely and properly on an open subset of $\R^d$, by computation with matrices. Its
statements involve tangent vectors, and there are none in \cref{prop:atlas}. Two things are required for a general formulation: a tangent
functor that commutes with the formation of quotients, and a separation of the infinitesimal part of a symmetry from the rest. Both are part
of the structure of a differentially cohesive $\infty$-topos \cite{Schreiber,KhavkineSchreiber}.
\begin{definition}\label{def:dc}
A \defn{differentially cohesive $\infty$-topos with first-order infinitesimals} is an $\infty$-topos $\Hh$ with
\begin{enumerate}[label=\textup{(DC\arabic*)}]
\item an adjoint triple $\Re\dashv\Im\dashv\&$ of endofunctors, in which $\Im$ is an idempotent monad with unit $\eta$ and $\Re$ preserves finite products;
\item a $0$-truncated commutative ring object $R$ and a subobject $D\subseteq R$ containing $0$, with $\Re D\simeq\ast$, such that the functor $T=[D,-]$
preserves colimits;
\item the Kock--Lawvere property: $(a,b)\mapsto(d\mapsto a+bd)$ is an equivalence $R\times R\to[D,R]$.
\end{enumerate}
An object $A$ is \emph{coreduced} if $\eta_A$ is an equivalence, and a map $f\colon A\to B$ is \emph{formally \'etale} if the naturality square of $\eta$ is
a pullback, $A\simeq B\times_{\Im B}\Im A$. The projection $TA\to A$ is evaluation at $0$ and the zero section $A\to TA$ is restriction along $D\to\ast$. For a group
object $G$ with unit $e$, the kernel of $TG\to G$ is the group object $\fg=T_eG$, and the fibre of $\eta_G$ over the unit is the group object $\hat G$.
\end{definition}
The model, fixed from \cref{thm:dc-positions} on, is the $\infty$-topos of sheaves on the site of formal Cartesian spaces $\R^n\times\operatorname{Spec}W$,
with $W$ a Weil algebra and covers those of the factor $\R^n$. Here $R$ is the line, $D=\operatorname{Spec}\R[\varepsilon]/(\varepsilon^2)$,
$\Re(\R^n\times\operatorname{Spec}W)=\R^n$ and $(\Im A)(U)=A(\Re U)$. The functor $T$ is restriction along $U\mapsto U\times D$, under which the covers of $U$
and of $U\times D$ correspond, so $T$ has both adjoints. The $0$-truncated objects form the Cahiers topos \cite{Dubuc79,Kock}. Manifolds embed
fully faithfully, and $[D,M]$ is the tangent bundle of a manifold $M$. Smooth sets embed by a functor that preserves colimits and finite
products, and diffeological spaces embed through smooth sets. In the model $\eta_G$ is an effective epimorphism for every group object $G$,
since $\Re U$ is a retract of $U$ for every object $U$ of the site.
\begin{lemma}\label{lem:dc}
\begin{enumerate}[label=\textup{(\roman*)}]
\item $\Im$ and $T$ preserve limits and colimits.
\item $[D,\Im A]\simeq\Im A$ for every $A$: all tangent vectors of a coreduced object are zero.
\item Formally \'etale maps are stable under pullback, and every map between coreduced objects is formally \'etale.
\item If $f\colon A\to B$ is formally \'etale then $TA\simeq A\times_BTB$.
\end{enumerate}
\end{lemma}
\noindent The proof is \cref{exo:dc-lemma}.
\begin{proposition}[Tangent and infinitesimal shape of an atlas]\label{prop:dc-atlas}
Let $p\colon\Theta\to X$ be an effective epimorphism. Then $Tp$ and $\Im p$ are effective epimorphisms, with \v{C}ech nerves $T\check C(p)$ and $\Im\check C(p)$. For a
group object $G$ acting on $\Theta$,
\[
T(\Theta\hquot G)\simeq T\Theta\hquot TG,\qquad\Im(\Theta\hquot G)\simeq\Im\Theta\hquot\Im G .
\]
\end{proposition}
\begin{proof}
Both functors preserve colimits and limits (\cref{lem:dc}(i)), and the \v{C}ech nerve and the action groupoid are built from fibre products;
$TG$ and $\Im G$ are group objects because the functors preserve finite products.
\end{proof}
For a Lie group acting on a manifold, $T\Theta\hquot TG$ is the tangent stack of the quotient stack, and its sections are the vector fields on the
stack defined in \cite{Hepworth}.
\begin{theorem}[Infinitesimal and \'etale parts of a symmetry]\label{thm:dc-factorisation}
Let $G$ act on $\Theta$, $p\colon\Theta\to X=\Theta\hquot G$, and $\hat X=X\times_{\Im X}\Im\Theta$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item $p$ factors as $\Theta\xrightarrow{\;e\;}\hat X\xrightarrow{\;\varepsilon\;}X$ with $\Im e$ an equivalence and $\varepsilon$ formally \'etale, and the factorisation with these properties
is unique \cite{CherubiniRijke}.
\item $\varepsilon$ is a principal bundle for the coreduced group $\Im G$: $X\simeq\hat X\hquot\Im G$, $\hat X\simeq(\Theta\times\Im G)\hquot G$ and $\hat X\times_X\Theta\simeq\Im G\times\Theta$. If
$\eta_G$ is an effective epimorphism, then $\hat X\simeq\Theta\hquot\hat G$.
\item $T\hat X\simeq\hat X\times_XTX$. Hence the relative tangent map $T\Theta\to\Theta\times_XTX$ of $p$ is the relative tangent map of $e$.
\item $\Im\hat G\simeq\ast$ and $T_e\hat G\simeq\fg$.
\item $p$ is formally \'etale if and only if $\eta_G\times\id\colon G\times\Theta\to\Im G\times\Theta$ is an equivalence. This holds when $G$ is coreduced, and then $\fg\simeq\ast$.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) Let $e=(p,\eta_\Theta)$ and $\varepsilon=\pr_1$. Since $\Im$ preserves fibre products and is idempotent, $\Im\hat X\simeq\Im X\times_{\Im X}\Im\Theta\simeq\Im\Theta$, and $\Im e$ is the
identity under this equivalence. The map $\varepsilon$ is a pullback of $\Im p$, a map between coreduced objects, and is formally \'etale by
\cref{lem:dc}(iii). The $\Im$-equivalences and the formally \'etale maps are the two classes of an orthogonal factorisation system. (ii) and
(iii) are \cref{exo:dc-factorisation}. (iv) $\Im$ preserves finite products, so $\Im G$ is a group object and $\eta_G$ a homomorphism. $\Im\hat G$
is the fibre of $\Im\eta_G$, an equivalence. $T$ preserves fibres and $T\Im G\simeq\Im G$ by \cref{lem:dc}(ii), so
$T\hat G\simeq TG\times_{\Im G}\ast\simeq TG\times_G\hat G$, whose fibre over $e$ is $\fg$. (v) By uniqueness in (i), $p$ is formally \'etale if and only if $e$ is an
equivalence, which may be tested after pullback along the effective epimorphism $\hat X\times_X\Theta\to\hat X$. The pullback of $e$ is
$\Theta\times_X\Theta\simeq G\times\Theta\to\Im G\times\Theta$, the map $\eta_G\times\id$. If $G$ is coreduced, $TG\simeq[D,\Im G]\simeq\Im G\simeq G$ and the fibre of $TG\to G$ is a point.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzcd}[column sep=2.8em,row sep=2.6em]
\Theta \arrow[r,"e"] \arrow[d,"\eta"'] & \hat X \arrow[r,"\varepsilon"] \arrow[d,"\eta"'] \arrow[dr,phantom,"\lrcorner",very near start] & X \arrow[d,"\eta"]\\
\Im\Theta \arrow[r,"\simeq"'] & \Im\hat X \arrow[r,"\Im\varepsilon"'] & \Im X
\end{tikzcd}
\qquad\qquad
\begin{tikzcd}[column sep=2.8em,row sep=2.6em]
T\Theta \arrow[r,"Te"] \arrow[d] & T\hat X \arrow[r,"T\varepsilon"] \arrow[d] \arrow[dr,phantom,"\lrcorner",very near start] & TX \arrow[d]\\
\Theta \arrow[r,"e"'] & \hat X \arrow[r,"\varepsilon"'] & X
\end{tikzcd}
\caption{\Cref{thm:dc-factorisation}. The atlas of a quotient is the composite of a map inverted by $\Im$, the quotient by the formal group
$\hat G$, and a formally \'etale map, the quotient by the coreduced group $\Im G$, along which tangent objects are pulled back.}\label{fig:dc}
\end{figure}
So every statement about tangent vectors, vertical directions and connections for the atlas $p$ is a statement about $e\colon\Theta\to\hat X$, and
depends on $G$ through the formal group $\hat G$ only; the rest of the symmetry is in $\varepsilon$, along which there are no vertical tangent
directions. The object $\hat X$ is the formal completion of $X$ along $p$, and in derived algebraic geometry the maps $\Theta\to\hat X$ of this
kind are the Lie algebroids on $\Theta$ \cite{GaitsgoryRozenblyum}; here it is the action algebroid, whose anchor is the map $a$ of the next
proposition.
\begin{proposition}[The relative tangent sequence]\label{prop:dc-relative}
Let $G$ act on $\Theta$ with action map $\mathrm{act}$, $p\colon\Theta\to X=\Theta\hquot G$, and let $\fg$ act on $T\Theta$ by restriction of the action of $TG$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item The relative tangent map $q\colon T\Theta\to\Theta\times_XTX$ is an effective epimorphism, and $\Theta\times_XTX\simeq T\Theta\hquot\fg$.
\item The fibre of $q$ over the zero section is $\fg\times\Theta$, with the map $a\colon\fg\times\Theta\to T\Theta$, $a(\xi,\theta)=T\mathrm{act}(\xi,0_\theta)$, the \emph{infinitesimal action}.
\item If $\Theta$ is a manifold, $\fg$ acts by translations: $\xi\cdot v=v+a(\xi,\theta)$ for $v$ over $\theta$.
\item Let $\Theta$ be a manifold with a Riemannian metric $g$, and $H\subseteq T\Theta$ the subobject of the vectors $v$ over $\theta$ with $g(a(\xi,\theta),v)=0$ for all
$\xi$. If $G$ is a Lie group and the action is locally free, then $H$ is a vector bundle and $q$ restricts to an equivalence $H\to\Theta\times_XTX$: a
splitting of the relative tangent map, by the orthogonal complement of the orbits of \cref{thm:metric-connection}\textup{(i)}.
\end{enumerate}
\end{proposition}
\begin{proof}
(i) By \cref{prop:dc-atlas}, $T\Theta\times_{TX}T\Theta\simeq T(G\times\Theta)=TG\times T\Theta$, and the fibre product of $q$ with itself is the part of it over the diagonal
$\Theta\to\Theta\times_X\Theta\simeq G\times\Theta$, $\theta\mapsto(e,\theta)$, which is $\fg\times T\Theta$: the \v{C}ech nerve of $q$ is the action groupoid of $\fg$. The pullback of $q$ along
the effective epimorphism $\Theta\times_XT\Theta\to\Theta\times_XTX$ is the map $TG\times T\Theta\to G\times T\Theta$, which has a section, so $q$ is an effective epimorphism.
(ii) is the restriction of (i) to the zero section. (iii) In a chart, by the Kock--Lawvere property, a tangent vector of $G$ at $e$ acts as
$x\mapsto x+dF_1(x)$, and a tangent vector at $\theta$ is $d\mapsto\theta+dv$; the composite is $d\mapsto\theta+d\,(v+F_1(\theta))$ since $d^2=0$, and $F_1(\theta)=a(\xi,\theta)$. (iv) The map
$a$ is linear in $\xi$ and injective on fibres, with image a subbundle $E$. The action of $\fg$ on $T\Theta$ is free, its quotient is the vector bundle
$T\Theta/E$, and $H=E^\perp$ is a complement of $E$.
\end{proof}
So the pullback to $\Theta$ of the tangent object of the quotient is the quotient of the complex $\fg\times\Theta\to T\Theta$, for every group object and
without conditions on the action. A connection is a splitting of $q$. A metric gives the subobject $H$ in every case, and $H$ is a splitting when the action is locally free. The next
theorem is \cref{thm:positions} in this generality: the group is an arbitrary group object of the model, the action need be neither free nor
proper, and the quotient is a stack.
\begin{theorem}[Positions in differential cohesion]\label{thm:dc-positions}
Let $\Hh$ be the model, $\Theta$ a manifold with a Riemannian metric $g$, $G$ a group object of $\Hh$ acting on $\Theta$, $p\colon\Theta\to X=\Theta\hquot G$, and $L\colon\Theta\to R$.
\begin{enumerate}[label=\textup{(\alph*)}]
\item \emph{Objective and connection.} $L=\ell\circ p$ for a unique $\ell\colon X\to R$ if and only if $L\circ\mathrm{act}=L\circ\pr_\Theta$. In that case
$g\bigl(\nabla L(\theta),a(\xi,\theta)\bigr)=0$ on $\fg\times\Theta$: the gradient is a section of $H$.
\item \emph{Exact part.} For a point $\xi$ of $\fg$ let $a_\xi=g(a(\xi,-),-)$, a $1$-form on $\Theta$. If $a_\xi=\dd Q_\xi$, then $Q_\xi$ is constant along the gradient
flow of every invariant $L$.
\item \emph{Invariant metric.} If $g\bigl(T\mathrm{act}(0_h,v),T\mathrm{act}(0_h,w)\bigr)=g(v,w)$ on $G\times(T\Theta\times_\Theta T\Theta)$ and $L$ is invariant, then $\nabla L$ is equivariant, and
there is a section $\sigma$ of $TX\to X$ with $\sigma\circ p=Tp\circ\nabla L$.
\item \emph{\'Etale symmetry.} If $G$ is coreduced, then $\fg\simeq\ast$, parts \textup{(a)} and \textup{(b)} are empty, $T\Theta\simeq\Theta\times_XTX$, and a vector field on $\Theta$
induces a section of $TX\to X$ if and only if it is $G$-equivariant.
\item \emph{General symmetry.} The objects $a$, $H$, $a_\xi$ and $Q_\xi$ of \textup{(a)} and \textup{(b)} depend on $G$ through $\hat G$ only, and $X\simeq\hat X\hquot\Im G$
with $\Im G$ coreduced and $T\hat X\simeq\hat X\times_XTX$.
\end{enumerate}
\end{theorem}
\begin{proof}
(a) $R$ is $0$-truncated, so the first statement is \cref{prop:atlas}(i). The differential of $L$ is $\dd L=\pr_2\circ TL\colon T\Theta\to R\times R\to R$, by the
Kock--Lawvere property, and $g(\nabla L,v)=\dd L(v)$. Then
\[
\dd L\bigl(a(\xi,\theta)\bigr)=\pr_2T(L\circ\mathrm{act})(\xi,0_\theta)=\pr_2T(L\circ\pr_\Theta)(\xi,0_\theta)=\pr_2TL(0_\theta)=0 .
\]
(b) Along an integral curve of $-\nabla L$ the derivative of $Q_\xi$ is $-\dd Q_\xi(\nabla L)=-g(a(\xi,-),\nabla L)$, which vanishes by (a). (c) Write $h_*=T\mathrm{act}(0_h,-)$
for a generalised element $h$ of $G$. For $w$ over $h\theta$,
$g(h_*\nabla L(\theta),w)=g(\nabla L(\theta),h^{-1}_*w)=\dd(L\circ h^{-1})(w)=\dd L(w)=g(\nabla L(h\theta),w)$, so $h_*\nabla L(\theta)=\nabla L(h\theta)$ by the non-degeneracy of $g$. Let $G$
act on $T\Theta$ through the zero section $G\to TG$, a homomorphism. For $0$-truncated objects with an action of $G$, a map that commutes with the
actions is equivariant, by descent along $\ast\to\B G$; so $\nabla L$ induces $\Theta\hquot G\to T\Theta\hquot G$, and $\sigma$ is its composite with the map
$T\Theta\hquot G\to T\Theta\hquot TG\simeq TX$ induced by the zero section. The composite of $\sigma$ with $TX\to X$ is induced by the identity of $\Theta$. (d) By
\cref{thm:dc-factorisation}(v), $p$ and all the face maps of its \v{C}ech nerve are formally \'etale, so by \cref{lem:dc}(iv) the simplicial
object $T\check C(p)$ is the pullback of $TX$ along $\check C(p)\to X$. By descent \cite{HTT} the sections of $TX\to X$ are the sections of $T\Theta\to\Theta$ with
descent data. Since $TG\simeq G$, the descent isomorphism over $G\times\Theta$ is $(h,v)\mapsto(h,h_*v)$, and for the $0$-truncated objects $\Theta$ and $T\Theta$ a descent
datum for a section is the property of equivariance. (e) The fibre of $T\hat G\to\hat G$ over $e$ is $\fg$, and the rest is
\cref{thm:dc-factorisation}(ii),(iii).
\end{proof}
\begin{table}[t]\centering\small
\begin{tabular}{@{}p{3.3cm}p{1.75cm}p{0.9cm}p{2.4cm}p{4.05cm}@{}}\toprule
symmetry $G$ & coreduced & $\fg$ & $\hat X$ & the functions $Q_\xi$\\\midrule
permutations of units & yes & $0$ & $\Theta$ & none\\
$\Z+\alpha\Z$ acting on $\R$ & yes & $0$ & $\R$, with $X=\Tal$ & none\\
rescalings $(\R_{>0})^k$ & no & $\R^k$ & $\Theta\hquot\hat G$ & $\abs{w_{\mathrm{in}}}^2-\abs{w_{\mathrm{out}}}^2$ per unit\\
$\GL_k$, linear layers & no & $\mathfrak{gl}_k$ & $\Theta\hquot\hat G$ & $W_1W_1\transp-W_2\transp W_2$\\
$(\R_{>0})^k\rtimes S_k$ & no & $\R^k$ & as above & the same, permuted by $S_k$\\\bottomrule
\end{tabular}
\caption{Symmetries of a parameter space and the two parts of their atlases. For a coreduced group the Lie algebra is trivial and there is
no function $Q_\xi$; the functions $Q_\xi$ of a general group are those of its formal group.}\label{tab:dc}
\end{table}
The positions of \cref{thm:positions} are recovered as follows. For a locally free action of a Lie group the restriction of $g$ to $H$ is a
metric on the pullback $\Theta\times_XTX$ of the tangent stack. It is a descent datum when the maps induced by $G$ on $H$ are isometries, in particular
in position (c), and it depends on the point of the fibre in general, which is the gauge dependence of \cref{thm:positions}(a). The slice
of position (b) is a level set of the functions $Q_\xi$ of part (b) together with \cref{prop:atlas}(iii), and the projection of position (d)
is the splitting of \cref{prop:dc-relative}(iv).
Three consequences are recorded. First, the remark after \cref{thm:noether}, that a discrete symmetry gives no conserved quantity, is part
(d): the atlas of a discrete symmetry is formally \'etale. Second, the irrational torus is the quotient of $\R$ by the coreduced group
$\Z+\alpha\Z$, so $\R\to\Tal$ is a formally \'etale atlas, $T\Tal\simeq\Tal\times R$, and the vector fields on $\Tal$ are the constants (\cref{exo:tangent-Talpha}): the
tangent object of a space on which every real function is constant is a line bundle with a one-dimensional space of sections. Third, for
a network with rescaling and permutation symmetries the hypothesis space is reached in two steps, $\Theta\to\hat X\to X$. The first is the quotient by the
formal group of the rescalings; the conservation laws and the choice of preconditioner of \cref{sec:acceleration} are statements about it.
The second is the quotient by the coreduced group $\Im G$, of which the permutations are a subgroup, and a dynamics descends along it when
it is equivariant.
Two refinements follow: a description of all the conserved quantities, and of the vector fields with the same image under the relative
tangent map $q$.
\begin{proposition}[All conserved quantities; compare \cite{Marcotte}]\label{prop:dc-conserved}
In the situation of \cref{thm:dc-positions}, let $Q\colon\Theta\to R$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item $Q$ is constant along the gradient flow of every invariant $L$ if and only if $g(\nabla Q,\nabla L)=0$ for every invariant $L$.
\item If $G$ is a Lie group acting freely and properly, this holds if and only if $\dd Q$ vanishes on $H$, that is, if and only if
$\dd Q=g(a(\psi,-),-)$ for a smooth map $\psi\colon\Theta\to\fg$, which is then unique.
\item In the case \textup{(ii)} the conserved quantities are the first integrals of the distribution $H$. Near a point where the Lie algebra of
vector fields generated by the sections of $H$ has constant rank $r$, there are $\dim\Theta-r$ functionally independent ones and no more.
\end{enumerate}
\end{proposition}
\begin{proof}
(i) The derivative of $Q$ at time $0$ along the flow of $-\nabla L$ through $\theta$ is $-g(\nabla Q,\nabla L)(\theta)$. (ii) $X$ is a manifold and $p$ a submersion, so every
covector at $p(\theta)$ is the differential of a function $\ell$, and the gradients $\nabla(\ell\circ p)(\theta)=\dd p_\theta\transp\dd\ell$ span the orthogonal complement $H_\theta$ of the kernel of
$\dd p_\theta$. So the condition of (i) is $\nabla Q(\theta)\in H_\theta^\perp=a(\fg,\theta)$ for all $\theta$, and $\psi=a^{-1}\circ\nabla Q$ is smooth because $a$ is an isomorphism of $\fg\times\Theta$ onto a
subbundle. (iii) A function is a first integral of $H$ if and only if it is one of the involutive distribution generated by $H$, whose leaves
have dimension $r$ by the theorem of Frobenius.
\end{proof}
Part (iii) is the count of \cite{Marcotte}, made there for an arbitrary parametrisation in place of a quotient map, with the span of the
gradients of its components in the place of $H$, and with algorithms for the rank. The functions $Q_\xi$ of \cref{thm:dc-positions}(b) are the
conserved quantities with constant $\psi$. The others have two sources. A function of the $Q_\xi$ has a non-constant $\psi$. And a form $a_\xi$ that is
not closed may have an integrating factor: for the rotations of the punctured plane $a_A=r^2\,\dd\varphi$, the line field $H$ is involutive, $\psi=r^{-2}A$, and
the conserved quantity is the angle $\varphi$, with values in the circle (\cref{exo:dc-angle}). For the rotations of $\R^3\setminus\{0\}$ part (i) gives the
direction $\theta/\abs\theta$, with values in the sphere. So the curvature of the connection is the restriction of the forms $\dd a_\xi$ to pairs of vectors of
$H$, and it is this restriction, not $\dd a_\xi$, that excludes a first integral and produces a holonomy.
\begin{proposition}[Vector fields with the same image; compare \cite{Hepworth}]\label{prop:dc-sections}
In the model, let a Lie group $G$ act on a manifold $\Theta$ and $X=\Theta\hquot G$. The sections of $\Theta\times_XTX\to\Theta$ form the groupoid whose objects are the vector
fields on $\Theta$ and whose morphisms $u\to u'$ are the smooth maps $\psi\colon\Theta\to\fg$ with $u'=u+a(\psi,-)$. In particular $q\circ u\simeq q\circ u'$ if and only if
$u'-u=a(\psi,-)$ for some $\psi$.
\end{proposition}
\begin{proof}
By \cref{prop:dc-relative}(i), a section is a torsor $P\to\Theta$ for the group object $\fg\times\Theta$ over $\Theta$ with an equivariant map $P\to T\Theta$ over $\Theta$. An effective
epimorphism onto a manifold has sections over the members of an open cover, so $P$ is given by a \v{C}ech cocycle of smooth maps to the
vector space $\fg$, which is a coboundary by a partition of unity. For the trivial torsor an equivariant map is determined by the image $u$ of
the unit section, and an automorphism of the trivial torsor is the translation by a map $\psi$, which replaces $u$ by $u+a(\psi,-)$ by
\cref{prop:dc-relative}(iii).
\end{proof}
Hence the part of an update that is tangent to the orbits is isomorphic to zero as a section, and for a locally free action an update and
its projection to $H$ are isomorphic sections: this is position (d) of \cref{thm:positions}. For a compact Lie group the vector fields on the
stack $X$ are the equivariant vector fields on $\Theta$ with the equivariant maps $\psi$ as morphisms \cite{Hepworth}. These are the isomorphic vector
fields of \cite{KlajborGoderich}, and they form a Lie $2$-algebra \cite{BerwickEvansLerman}.
\emph{Scope.} \Cref{lem:dc,prop:dc-atlas,thm:dc-factorisation} and \cref{prop:dc-relative}(i),(ii) hold in every $\Hh$ that satisfies
\textup{(DC1)--(DC3)}. \Cref{prop:dc-relative}(iii),(iv) and \cref{thm:dc-positions,prop:dc-conserved,prop:dc-sections} are statements in the
model, in which manifolds, tangent bundles and Riemannian metrics are available. The properties of the model that are used are the
Kock--Lawvere property, the two adjoints of $T$ and the full embedding of manifolds \cite{Dubuc79,Kock,Schreiber}. The first-order computations
for the rescaling, rotation and translation actions are reproduced in exact arithmetic with dual numbers by \texttt{checks.py}.
\emph{Sources.} The parts of this section are in the literature, in other contexts. The factorisation of \cref{thm:dc-factorisation}(i) is
the factorisation system of a modality \cite{CherubiniRijke}. The unit $\eta$, along which $\hat X$ is a pullback, is the map whose base change
is the jet comonad of \cite{KhavkineSchreiber}. The map $\Theta\to\hat X$ is a formal moduli problem under $\Theta$, that is, a Lie algebroid in the sense of
\cite{GaitsgoryRozenblyum}. The tangent stack and its sections are those of \cite{Hepworth,BerwickEvansLerman}. The conserved quantities of
gradient flows are counted in \cite{Marcotte} and attached to symmetries in \cite{Kunin,ZhaoFlat,ZhaoSurvey}. They are combined in \cref{thm:dc-positions} and
\cref{tab:dc}: a parameter symmetry is separated into a formal group, to which the connection and the conserved quantities
belong, and a coreduced group, along which a dynamics descends when it is equivariant. This combination was not found in a search of the
literature on parameter symmetries of networks and on differential cohesion made in November 2026.
\section{Inductive theories}
The same structure is present in the syntax of a theory presented by generators and relations. Let $\Sigma$ be a finitary signature, $V$ a set of
variables, and $W=T_\Sigma(V)$ the set of terms: the free $\Sigma$-algebra on $V$, that is, the initial algebra of $Y\mapsto V+\Sigma Y$, defined by induction. Let
$E$ be a set of equations, $\approx$ the congruence on $W$ that it generates, and
\[
p\colon W\longrightarrow F=W/{\approx}
\]
the quotient, the free algebra of the theory $\mathbb T=(\Sigma,E)$. The finitely generated free algebras are the objects of the syntactic
site of $\mathbb T$, whose category of models is the category of $\mathbb T$-algebras. The map $p$ is an atlas of the semantic object $F$ by the
inductively defined object $W$.
\begin{proposition}[Descent of recursive definitions]\label{prop:folds}
Let $A$ be a $\Sigma$-algebra, $\rho\colon V\to A$ a valuation, and $f_\rho\colon W\to A$ the unique homomorphism extending $\rho$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item If $A$ satisfies $E$ then $f_\rho$ factors through $p$. If $V$ is infinite and $f_\rho$ factors through $p$ for every $\rho$, then $A$ satisfies $E$.
\item Let a group $\Gamma$ act on $V$, hence on $W$ by renaming, and on $A$ by automorphisms of $\Sigma$-algebras. If $\rho$ is equivariant then $f_\rho$ is
equivariant.
\end{enumerate}
\end{proposition}
\begin{proof}
(i) The kernel of $f_\rho$ is a congruence; if $A$ satisfies $E$ it contains every substitution instance of every equation, hence $\approx$.
Conversely an equation of $E$ in variables of $V$ is a pair $t\approx t'$, and $f_\rho(t)=f_\rho(t')$ for all $\rho$ is its validity in $A$. (ii) For
$\gamma\in\Gamma$ the map $\gamma_A^{-1}\circ f_\rho\circ\gamma_W$ is a homomorphism extending $\gamma_A^{-1}\circ\rho\circ\gamma_V=\rho$; by uniqueness it is $f_\rho$.
\end{proof}
So for an inductively defined object the descent condition of \cref{prop:atlas}(i) is checked one constructor at a time: the algebra must
satisfy the equations, and the factorisation follows from the uniqueness of the recursion. This is the counterpart of the fact that the gradient of each sample is orthogonal to
the orbits, so that no global verification is needed. In type theory the statement is the elimination rule of a quotient inductive
type.
A slice of $p$ is a choice of normal forms: a map $\mathrm{nf}\colon W\to W$ with $\mathrm{nf}(t)\approx t$ and $\mathrm{nf}(t)=\mathrm{nf}(t')$ whenever $t\approx t'$.
In sets a slice exists by choice. The obstruction is one of effectivity, as it was one of smoothness in \VolI{Theorem~11.4}.
\begin{theorem}[Computable slices]\label{thm:normal-forms}
Let $\Sigma$ and $V$ be countable and $E$ recursively enumerable. The quotient $p\colon W\to F$ has a computable slice if and only if the relation
$\approx$ is decidable. Consequently, for a finitely presented theory with unsolvable word problem, $p$ is an atlas with no computable slice.
\end{theorem}
\noindent The proof is \cref{exo:normal-forms}.
\begin{table}[t]\centering\small
\begin{tabular}{@{}p{4.1cm}p{9.0cm}@{}}\toprule
optimisation on a quotient & syntax of an inductive theory\\\midrule
atlas $\Theta\to\Theta\hquot G$ & terms $W\to F=W/{\approx}$; sites of one topos; coded models of one theory\\
invariant objective & function on terms that satisfies the equations; definable set (\cref{thm:galois-logic})\\
slice $Q=0$ & normal forms; normalisation by evaluation \cite{BergerSchwichtenberg}; indices in place of names\\
move along the orbit & rewriting to an equal term; extraction from an e-graph \cite{egg}; change of site \cite{Caramello}\\
invariant update & definition by the eliminator of the quotient (\cref{prop:folds}); nominal sets \cite{Pitts}\\
projection off the orbit & focused proof search, in which no step permutes inference rules \cite{Andreoli}\\
conserved quantity & invariant of the rewriting relation; the universal one is $F$\\
isotropy, no smooth slice & undecidable equality, no computable slice (\cref{thm:normal-forms})\\\bottomrule
\end{tabular}
\caption{The positions of \cref{thm:positions} for the atlas of a theory by its syntax.}\label{tab:logic}
\end{table}
For theories with relations and quantifiers the atlas is the space of models, and the quotient is the theory itself.
\begin{theorem}[Theories as quotients; \cite{JoyalTierney,ButzMoerdijk,LopezEscobar}]\label{thm:galois-logic}
\begin{enumerate}[label=\textup{(\roman*)}]
\item Every Grothendieck topos is equivalent to the topos of equivariant sheaves on a localic groupoid; if it has enough points, on a
topological groupoid of its points.
\item For a countable first-order language, a Borel set of structures on $\N$ is invariant under the permutations of $\N$ if and only if it is the set
of models of a sentence of $L_{\omega_1\omega}$.
\end{enumerate}
\end{theorem}
Part (i) is the statement that the classifying topos of a theory is $\Theta\hquot G$ for $\Theta$ a space of models and $G$ their isomorphisms; the
first-order case with its syntactic reconstruction is \cite{AwodeyForssell}. Part (ii) is \cref{prop:atlas}(i) for that atlas: a set of
models descends to the theory exactly when it is invariant. In the absence of a $2$-form the correspondence between symmetries and
invariants is therefore of Galois type, invariance against definability, where Noether's correspondence pairs a symmetry with a function.
The quantitative statements of \cref{sec:acceleration}, the preconditioner and the drift of order $h^2$, require a tangent structure on the
atlas. A syntactic site of a differential calculus has one; such a signature, the layers of a network, is the subject of \cref{ch:programs}. A bare algebraic theory has none, and there a cost on rewriting steps is an
additional datum.
\exercisesheading
\begin{exercise}[label=exo:scalar-lagrangian]{1}
Verify \cref{thm:lagrangian}(i) for $L(a,w)=\tfrac12(aw-1)^2$ and the rescaling group.
\end{exercise}
\begin{solution}
The generator is $A=\mathrm{diag}(-1,1)$, $A\theta=(-a,w)$, and $\mu_A(\theta,p)=-ap_a+wp_w$. On the graph of $\dd L$, $p=\rho\,(w,a)$ with $\rho=aw-1$, so
$\mu_A=-a\rho w+w\rho a=0$.
\end{solution}
\begin{exercise}[label=exo:forms-plane]{2}
Compute $a_A$ and $\dd a_A$ on $\R^2$ for the rescaling $A=\mathrm{diag}(-1,1)$ and for the rotation $A=\bigl(\begin{smallmatrix}0&-1\\1&0\end{smallmatrix}\bigr)$, and
describe the curves on which each vanishes.
\end{exercise}
\begin{solution}
Rescaling: $a_A=-a\,\dd a+w\,\dd w=\dd\,\tfrac12(w^2-a^2)$, closed, vanishing on the curves tangent to the hyperbolas $w^2-a^2=\mathrm{const}$. Rotation:
$A\theta=(-w,a)$, $a_A=-w\,\dd a+a\,\dd w=r^2\,\dd\varphi$ in polar coordinates, and $\dd a_A=2\,\dd a\wedge\dd w$, twice the area form. The form vanishes on radial curves.
No smooth function on the plane has the radial lines as its level sets, and the integral of $a_A$ around a closed curve is twice
the enclosed area.
\end{solution}
\begin{exercise}[label=exo:monoid]{2}
Let $W$ be the words in two letters $x,y$ and $\approx$ the congruence generated by $xy\approx yx$. Give a slice, a function that descends and one that
does not, and check \cref{prop:folds}(ii) for the exchange of the letters.
\end{exercise}
\begin{solution}
$F$ is the free commutative monoid $\N^2$. Sorting the letters, $\mathrm{nf}(t)=x^iy^j$, is a slice. The homomorphism to $(\N,+)$ with $\rho(x)=\rho(y)=1$,
the length, descends because $(\N,+)$ is commutative. The identity homomorphism to the monoid of words does not: $xy$ and $yx$ are different
words. The exchange of $x$ and $y$ acts on $W$, and $\rho$ is equivariant for the trivial action on $\N$, so the length is invariant under the
exchange; the valuation $\rho(x)=1$, $\rho(y)=2$ is not equivariant, and the weighted length is not invariant.
\end{solution}
\begin{exercise}[label=exo:dc-scalar]{2}
In the model of \cref{sec:dc}, let $\Theta=\R^2\setminus\{0\}\ni(w,v)$ with the Euclidean metric and $G=\R_{>0}$ acting by $s\cdot(w,v)=(sw,s^{-1}v)$. Compute $a$, $a_\xi$, $Q_\xi$, $H$
and $\Theta\times_XTX$. What changes for $G'=\R^\times$ acting by the same formula?
\end{exercise}
\begin{solution}
$\fg=R$ and $a(\xi,(w,v))=\xi\,(w,-v)$, so $a_\xi=\xi\,(w\,\dd w-v\,\dd v)=\dd Q_\xi$ with $Q_\xi=\tfrac\xi2(w^2-v^2)$, the invariant of \cref{thm:two-noether}(b). The map $a$
is injective on fibres since $(w,v)\neq0$, and $H=\{(\dot w,\dot v):w\dot w=v\dot v\}$ is a line bundle; by \cref{prop:dc-relative}(iv), $\Theta\times_XTX\simeq H$. The action is
free and not proper: the orbits of the points of the axes are not separated from the neighbouring hyperbolas, and $X$ is a non-Hausdorff
manifold of dimension one. No part of \cref{thm:dc-positions} is affected. For $G'=\R_{>0}\times\{\pm1\}$ the kernel of $TG'\to G'$ and the formal group are those
of $G$, so $a$, $Q_\xi$, $H$ and $\hat X$ are the same, and $\Im G'=\Im G\times\{\pm1\}$: the second map $\varepsilon$ is in addition a quotient by the sign, along which
tangent objects are pulled back, and there is no further conserved quantity.
\end{solution}
\begin{exercise}[label=exo:dc-angle]{2}
Determine all the quantities conserved by the gradient flows of the invariant functions for the rotations of $\Theta=\R^2\setminus\{0\}$, and for the rescalings
$(a,w)\mapsto(a/s,sw)$ of the quadrant $a,w>0$.
\end{exercise}
\begin{solution}
Both actions are free and proper, so \cref{prop:dc-conserved}(ii),(iii) apply, and $H$ is a line field, hence involutive, with $r=1$: there is one
independent conserved quantity. Rotations: $a_A=-y\,\dd x+x\,\dd y=r^2\,\dd\varphi$ is not closed, $H$ is the radial line field, and $\dd Q=\psi\,a_A$ holds for
$Q=F(\varphi)$ with $F$ periodic and $\psi=F'(\varphi)/r^2$. The conserved quantities are the functions of the angle, for instance $x/r$ and $y/r$, and the
universal one is $\theta/\abs\theta$ with values in the circle. Rescalings: $a_A=-a\,\dd a+w\,\dd w=\dd Q_A$ with $Q_A=\tfrac12(w^2-a^2)$, and the conserved quantities are the
functions $F(Q_A)$, with $\psi=F'(Q_A)$. In the first case no conserved quantity has constant $\psi$; in the second the generator is $Q_A$.
\end{solution}
\begin{exercise}[label=exo:cometrics]{3}
For $\pi(a,w)=aw$ on the quadrant $a,w>0$, compute the cometric $C_\theta$ of \cref{thm:positions}(a) for the Euclidean metric and for the invariant
metric $g'=(\dd a/a)^2+(\dd w/w)^2$, and the projected gradient flows of $\ell(m)$.
\end{exercise}
\begin{solution}
$\dd\pi=(w,a)$. Euclidean: $C_\theta=w^2+a^2=2\sqrt{Q^2+m^2}$, which depends on the level $Q$ of the fibre point, and $\dot m=-2\sqrt{Q^2+m^2}\,\ell'(m)$;
for $\ell=\tfrac12(m-1)^2$ this is \cref{prop:rate}(i). Invariant metric: the $g'$-gradient of $L$ is $(a^2\partial_aL,\ w^2\partial_wL)$, so
$\dot a=-a^2w\,\ell'$, $\dot w=-w^2a\,\ell'$ and $\dot m=-2m^2\,\ell'(m)$: the cometric is $C'=2m^2$, a function on $X$, and the projected flow is the same from
every point of a fibre. The metric $g'$ is invariant because $\dd a/a$ and $\dd w/w$ are invariant under $(a,w)\mapsto(a/s,sw)$.
\end{solution}
\begin{exercise}[label=exo:dc-lemma]{3}
Prove \cref{lem:dc}.
\end{exercise}
\begin{solution}
(i) $\Im$ has the left adjoint $\Re$ and the right adjoint $\&$. $T$ has the left adjoint $-\times D$ and preserves colimits by (DC2). (ii) For every
object $U$,
\[
\Map(U,[D,\Im A])\simeq\Map(U\times D,\Im A)\simeq\Map(\Re U\times\Re D,A)\simeq\Map(\Re U,A)\simeq\Map(U,\Im A),
\]
since $\Re$ preserves finite products and $\Re D\simeq\ast$. The composite is induced by the projection $U\times D\to U$, so the zero section $\Im A\to[D,\Im A]$ is an
equivalence. (iii) Let $f\colon A\to B$ be formally \'etale, $b\colon B'\to B$ and $A'=A\times_BB'$. Since $\Im$ preserves pullbacks,
\[
B'\times_{\Im B'}\Im A'\simeq B'\times_{\Im B'}(\Im B'\times_{\Im B}\Im A)\simeq B'\times_{\Im B}\Im A\simeq B'\times_B(B\times_{\Im B}\Im A)\simeq B'\times_BA=A'.
\]
For coreduced $A$ and $B$, $B\times_{\Im B}\Im A\simeq\Im A\simeq A$. (iv) $T$ preserves the pullback $A\simeq B\times_{\Im B}\Im A$, and by (ii) $T\Im A\simeq\Im A$ and $T\Im B\simeq\Im B$, compatibly
with the projections to the base. Hence $TA\simeq TB\times_{\Im B}\Im A\simeq TB\times_B(B\times_{\Im B}\Im A)\simeq TB\times_BA$.
\end{solution}
\begin{exercise}[label=exo:tangent-Talpha]{3}
In the model, let $\Gamma=\Z+\alpha\Z$ with $\alpha$ irrational act on $\R$ by translations. Prove that $\Gamma$ is coreduced, that $\R\hquot\Gamma$ is the irrational torus
$\Tal$, that $T\Tal\simeq\Tal\times R$, and that the sections of $T\Tal\to\Tal$ are the constants. Describe their flows.
\end{exercise}
\begin{solution}
$\Gamma$ is the coproduct of copies of the terminal object indexed by its elements, and $\Im$ preserves coproducts and the terminal object; so
$\Gamma$ is coreduced. The action is free, so the action groupoid is an equivalence relation and $\R\hquot\Gamma$ is the $0$-truncated quotient sheaf: a
section over $U$ is given locally by a smooth map to $\R$, up to locally constant maps to $\Gamma$. Two smooth maps $U\to\R$ whose difference has values
in the countable set $\Gamma$ differ by a locally constant map, so the quotient sheaf is concrete, and it is the diffeological quotient $\Tal$. By
\cref{prop:dc-atlas} and $T\Gamma\simeq\Gamma$, $T\Tal\simeq(\R\times R)\hquot\Gamma$ with $\gamma\cdot(x,v)=(x+\gamma,v)$, the derivative of a translation being the identity; hence
$T\Tal\simeq\Tal\times R$, in agreement with \cref{thm:dc-positions}(d). A section is a map $\Tal\to R$, that is, by \cref{prop:atlas}(i), a smooth function on
$\R$ invariant under the dense subgroup $\Gamma$, a constant $c$. The constant vector field $c$ on $\R$ is $\Gamma$-equivariant, its flow $x\mapsto x+tc$ is
equivariant, and by \cref{prop:atlas}(ii) it induces the translation by the class of $tc$ on $\Tal$.
\end{solution}
\begin{exercise}[label=exo:normal-forms]{4}
Prove \cref{thm:normal-forms}.
\end{exercise}
\begin{solution}
Fix a computable enumeration $t_0,t_1,\dots$ of $W$. If $\mathrm{nf}$ is a computable slice, then $t\approx t'$ if and only if $\mathrm{nf}(t)=\mathrm{nf}(t')$, and equality
of terms is decidable; so $\approx$ is decidable. Conversely let $\approx$ be decidable and let $\mathrm{nf}(t)$ be the first $t_k$ in the enumeration with
$t_k\approx t$. The search terminates because $t$ occurs in the enumeration, $\mathrm{nf}(t)\approx t$ by construction, and $t\approx t'$ implies that the same $t_k$ is
found for both. The hypothesis that $E$ is recursively enumerable makes $\approx$ recursively enumerable in general, so that decidability is the only
additional condition. For a finitely presented group or semigroup with unsolvable word problem $\approx$ is undecidable, and by the first part no
computable slice exists.
\end{solution}
\begin{exercise}[label=exo:dc-factorisation]{4}
Prove \cref{thm:dc-factorisation}\textup{(ii)} and \textup{(iii)}.
\end{exercise}
\begin{solution}
(ii) By \cref{prop:dc-atlas}, $\Im X\simeq\Im\Theta\hquot\Im G$, so $\Im p$ is a principal bundle for $\Im G$, and so is its pullback $\varepsilon$; hence $X\simeq\hat X\hquot\Im G$. The bundle $\Im p$ is
classified by the map $\Im X\to\B\Im G$, and $\varepsilon$ by the composite $X\to\Im X\to\B\Im G$, which by the naturality of $\eta$ is the composite of the classifying map
$X\to\B G$ of $p$ with $\B\eta_G$. So
\[
\hat X\simeq X\times_{\B\Im G}\ast\simeq(\Theta\hquot G)\times_{\B G}(\B G\times_{\B\Im G}\ast)\simeq(\Theta\hquot G)\times_{\B G}(\Im G\hquot G)\simeq(\Theta\times\Im G)\hquot G,
\]
where $G$ acts on $\Im G$ by translations through $\eta_G$. If $\eta_G$ is an effective epimorphism, this action is transitive with stabiliser
$\hat G$, so $\Im G\hquot G\simeq\B\hat G$ and $\hat X\simeq\Theta\hquot\hat G$. The object $\hat X\times_X\Theta$ is the pullback of the principal bundle $\Im p$ along the composite $\Theta\to\Im\Theta\to\Im X$, and
the pullback of $\Im p$ along itself is trivial:
\[
\hat X\times_X\Theta\simeq\Theta\times_{\Im\Theta}(\Im\Theta\times_{\Im X}\Im\Theta)\simeq\Theta\times_{\Im\Theta}(\Im G\times\Im\Theta)\simeq\Im G\times\Theta .
\]
(iii) The map $\varepsilon$ is formally \'etale by (i), so $T\hat X\simeq\hat X\times_XTX$ by \cref{lem:dc}(iv). Then $\Theta\times_{\hat X}T\hat X\simeq\Theta\times_{\hat X}(\hat X\times_XTX)\simeq\Theta\times_XTX$, and under this
equivalence the relative tangent map of $e$ is that of $p=\varepsilon\circ e$, since $T$ is a functor.
\end{solution}
\chapter{Semantics of differentiable programs}\label{ch:programs}
\chaptermark{Differentiable programs}
\def\dpSpecRows{deep linear \cite{Arora} & $32$ & 448 & 0 & 0 & 128 & 128\\
LeNet-300-100 \cite{LeCun98} & $1\times28\times28$ & 266\,610 & 400 & 0 & 0 & 400\\
LeNet-5 \cite{LeCun98} & $1\times32\times32$ & 61\,706 & 226 & 0 & 0 & 226\\
ResNet-20 \cite{ResNet} & $3\times32\times32$ & 269\,722 & 336 & 688 & 0 & 1\,024\\
Transformer layer \cite{Vaswani} & $16\times512$ & 3\,152\,384 & 2\,048 & 0 & 65\,536 & 67\,584\\}
\def\dpCheckRows{$\llbracket t\rrbracket$ against $\llbracket t'\rrbracket$, $t'\approx t$ & 0 & 0 & 0 & 0 & 0\\
tangent algebra against differences & $9.4\mathrm{e}{-10}$ & $1.6\mathrm{e}{-10}$ & $1.2\mathrm{e}{-9}$ & $4.0\mathrm{e}{-8}$ & $9.5\mathrm{e}{-7}$\\
reverse algebra against differences & $9.4\mathrm{e}{-10}$ & $1.6\mathrm{e}{-10}$ & $1.2\mathrm{e}{-9}$ & $4.0\mathrm{e}{-8}$ & $9.5\mathrm{e}{-7}$\\
transposition, \cref{thm:ad}(ii) & $1.4\mathrm{e}{-15}$ & $1.9\mathrm{e}{-16}$ & $1.9\mathrm{e}{-16}$ & $2.5\mathrm{e}{-15}$ & $1.3\mathrm{e}{-16}$\\
invariance under $G_t$ & $6.1\mathrm{e}{-16}$ & $6.2\mathrm{e}{-16}$ & $1.9\mathrm{e}{-15}$ & $1.1\mathrm{e}{-15}$ & $8.6\mathrm{e}{-16}$\\
invariance under permutations & 0 & $4.4\mathrm{e}{-16}$ & $1.8\mathrm{e}{-15}$ & $5.4\mathrm{e}{-16}$ & $7.6\mathrm{e}{-16}$\\
$\nabla L$ in $H$, \cref{thm:dc-positions}(a) & $1.2\mathrm{e}{-16}$ & $2.2\mathrm{e}{-17}$ & $3.0\mathrm{e}{-17}$ & $9.2\mathrm{e}{-17}$ & $6.2\mathrm{e}{-17}$\\
$T\llbracket t\rrbracket\,a(\xi,\theta)=0$ & $3.9\mathrm{e}{-16}$ & $1.1\mathrm{e}{-15}$ & $5.1\mathrm{e}{-16}$ & $8.1\mathrm{e}{-16}$ & $5.5\mathrm{e}{-16}$\\
$a_\xi(P_Hu)$ relative to $a_\xi(u)$ & $3.5\mathrm{e}{-12}$ & $3.2\mathrm{e}{-12}$ & $1.5\mathrm{e}{-12}$ & $9.2\mathrm{e}{-12}$ & $4.2\mathrm{e}{-11}$\\
$T\llbracket t\rrbracket\,u$ against $T\llbracket t\rrbracket\,P_Hu$ & $3.8\mathrm{e}{-16}$ & $1.5\mathrm{e}{-15}$ & $1.4\mathrm{e}{-15}$ & $1.9\mathrm{e}{-15}$ & $1.1\mathrm{e}{-15}$\\
$Q$ after the gauge move, relative & $5.9\mathrm{e}{-8}$ & $8.4\mathrm{e}{-8}$ & $4.1\mathrm{e}{-4}$ & $1.1\mathrm{e}{-4}$ & $5.2\mathrm{e}{-15}$\\
step at $g\theta$ against step at $\theta$: plain & $3.4\mathrm{e}{-1}$ & $1.6\mathrm{e}{0}$ & $8.0\mathrm{e}{-1}$ & $5.5\mathrm{e}{-2}$ & $6.5\mathrm{e}{-1}$\\
the same: invariant metric & $7.4\mathrm{e}{-9}$ & $2.1\mathrm{e}{-8}$ & $5.3\mathrm{e}{-4}$ & $1.4\mathrm{e}{-7}$ & $5.5\mathrm{e}{-14}$\\}
\def\dpDriftRows{deep linear & $5.3\mathrm{e}{-3}$ & 2.3 & $5.0\mathrm{e}{-1}$ & 1.0 & $1.3\mathrm{e}{-2}$ & 2.0\\
LeNet-300-100 & $5.3\mathrm{e}{-5}$ & 2.1 & $2.3\mathrm{e}{-2}$ & 1.0 & $3.4\mathrm{e}{-4}$ & 2.0\\
LeNet-5 & $1.3\mathrm{e}{-4}$ & 2.6 & $4.6\mathrm{e}{-3}$ & 1.0 & $3.9\mathrm{e}{-4}$ & 2.1\\
ResNet-20 & $2.1\mathrm{e}{-5}$ & 2.2 & $6.3\mathrm{e}{-3}$ & 1.0 & $5.8\mathrm{e}{-5}$ & 2.0\\
Transformer layer & $1.0\mathrm{e}{-3}$ & 2.2 & $8.5\mathrm{e}{-3}$ & 1.0 & $1.1\mathrm{e}{-3}$ & 2.2\\}
\def\dpTrainRows{reverse, SGD & 0.0980 & 0.0662 & 0.0087 & 0.0371 & 0.0631\\
the same, slope $0.2$ & 0.0980 & 0.0483 & 0.0089 & 0.0497 & 0.0561\\
on the slice ($\tau=1$) & 0.126 & 0.0187 & 0.0046 & 0.0191 & 0.0812\\
invariant metric ($\tau=1$, returned) & 0.126 & 0.0187 & 0.0046 & 0.0191 & 0.0812\\
projected, heavy ball & 0.122 & 0.0689 & 0.0222 & 0.0826 & 0.302\\
Adam & 0.409 & $3.2\mathrm{e}{-5}$ & $1.5\mathrm{e}{-4}$ & $3.4\mathrm{e}{-4}$ & 0.395\\
Adam, projected & 0.408 & $3.1\mathrm{e}{-5}$ & $1.5\mathrm{e}{-4}$ & $3.3\mathrm{e}{-4}$ & 0.395\\
feedback alignment & 0.189 & 0.522 & 0.0182 & 0.408 & 0.143\\
feedback alignment, projected & 0.593 & 0.523 & 0.0183 & 0.406 & 0.144\\
straight-through & 0.0980 & 0.0431 & 0.0107 & 0.0529 & 0.0655\\
tangent algebra, $8$ directions & 0.594 & 0.999 & 0.896 & 0.999 & 1.000\\}
\def\dpVertRows{reverse, SGD & $3.5\mathrm{e}{-16}$ & $3.4\mathrm{e}{-17}$ & $2.9\mathrm{e}{-16}$ & $2.5\mathrm{e}{-16}$ & $1.1\mathrm{e}{-16}$\\
Adam & $7.7\mathrm{e}{-1}$ & $1.5\mathrm{e}{-1}$ & $2.2\mathrm{e}{-1}$ & $9.9\mathrm{e}{-2}$ & $1.2\mathrm{e}{-1}$\\
Adam, projected & $1.8\mathrm{e}{-11}$ & $7.6\mathrm{e}{-13}$ & $2.4\mathrm{e}{-13}$ & $8.1\mathrm{e}{-13}$ & $5.1\mathrm{e}{-12}$\\
feedback alignment & $1.7\mathrm{e}{0}$ & $9.5\mathrm{e}{-2}$ & $1.8\mathrm{e}{-1}$ & $8.5\mathrm{e}{-2}$ & $4.3\mathrm{e}{-2}$\\
feedback alignment, projected & $1.9\mathrm{e}{-12}$ & $3.8\mathrm{e}{-13}$ & $2.6\mathrm{e}{-13}$ & $9.7\mathrm{e}{-13}$ & $1.4\mathrm{e}{-12}$\\
straight-through & $3.5\mathrm{e}{-16}$ & $6.7\mathrm{e}{-2}$ & $6.0\mathrm{e}{-2}$ & $8.3\mathrm{e}{-2}$ & $2.6\mathrm{e}{-2}$\\
tangent algebra & $1.1\mathrm{e}{0}$ & $6.2\mathrm{e}{-2}$ & $1.2\mathrm{e}{-1}$ & $9.5\mathrm{e}{-2}$ & $2.1\mathrm{e}{-1}$\\}
\def\dpStepsRow{steps & 60 & 60 & 60 & 12 & 18\\}
\def\dpBatchRow{batch & 64 & 32 & 128 & 8 & 4\\}
\def\dpTraceRow{traces of the step & 1 & 1 & 1 & 1 & 1\\}
\def\dpSecRow{seconds per step (SGD) & 0.002 & 0.009 & 0.105 & 0.663 & 0.344\\}
\def\dpGaugeA{\addplot[hcsrust,line width=0.9pt] coordinates {(1,1) (2,0.9082) (3,0.832) (4,0.7676) (5,0.7119) (6,0.6626) (7,0.6188) (8,0.5792) (9,0.5433) (10,0.5103) (11,0.4798) (12,0.4516) (13,0.4255) (14,0.4015) (15,0.3793) (16,0.3589) (17,0.3398) (18,0.3222) (19,0.3058) (20,0.2905) (21,0.2762) (22,0.263) (23,0.2505) (24,0.2389) (25,0.2281) (26,0.2179) (27,0.2084) (28,0.1994) (29,0.1909) (30,0.1829) (31,0.1754) (32,0.1685) (33,0.1619) (34,0.1556) (35,0.1497) (36,0.1441) (37,0.1389) (38,0.1339) (39,0.1292) (40,0.1247) (41,0.1204) (42,0.1163) (43,0.1124) (44,0.1086) (45,0.1051) (46,0.1017) (47,0.09845) (48,0.09541) (49,0.09252) (50,0.08974) (51,0.08709) (52,0.08455) (53,0.08214) (54,0.07982) (55,0.07759) (56,0.07544) (57,0.07339) (58,0.07146) (59,0.06962) (60,0.06785)};
\addplot[hcsrust,line width=0.9pt,dashed] coordinates {(1,1) (2,0.861) (3,0.7557) (4,0.6716) (5,0.6014) (6,0.5414) (7,0.4898) (8,0.4448) (9,0.4052) (10,0.3701) (11,0.3392) (12,0.3118) (13,0.2873) (14,0.2652) (15,0.2453) (16,0.2274) (17,0.2114) (18,0.1972) (19,0.1842) (20,0.1726) (21,0.1619) (22,0.1521) (23,0.1431) (24,0.1348) (25,0.1273) (26,0.1205) (27,0.1142) (28,0.1085) (29,0.1032) (30,0.09836) (31,0.09383) (32,0.08957) (33,0.08561) (34,0.08192) (35,0.07848) (36,0.07523) (37,0.07219) (38,0.06936) (39,0.06671) (40,0.06425) (41,0.06191) (42,0.05973) (43,0.05765) (44,0.0557) (45,0.05387) (46,0.05217) (47,0.05054) (48,0.04902) (49,0.04755) (50,0.04612) (51,0.04476) (52,0.04349) (53,0.04226) (54,0.04111) (55,0.04001) (56,0.03898) (57,0.03798) (58,0.03704) (59,0.03615) (60,0.0353)};
\addplot[hcsteal,line width=0.9pt] coordinates {(1,1) (2,0.791) (3,0.6369) (4,0.5193) (5,0.429) (6,0.3585) (7,0.3037) (8,0.2597) (9,0.2248) (10,0.1969) (11,0.1739) (12,0.1544) (13,0.138) (14,0.1242) (15,0.1128) (16,0.1031) (17,0.09464) (18,0.08744) (19,0.08115) (20,0.07564) (21,0.0708) (22,0.06658) (23,0.06278) (24,0.05942) (25,0.05634) (26,0.05354) (27,0.05097) (28,0.04863) (29,0.04649) (30,0.04451) (31,0.04267) (32,0.041) (33,0.03946) (34,0.03802) (35,0.03669) (36,0.03544) (37,0.0343) (38,0.03322) (39,0.0322) (40,0.03121) (41,0.0303) (42,0.02941) (43,0.02858) (44,0.02779) (45,0.02705) (46,0.02631) (47,0.02562) (48,0.02497) (49,0.02436) (50,0.02375) (51,0.02318) (52,0.02264) (53,0.02213) (54,0.02164) (55,0.02117) (56,0.02072) (57,0.0203) (58,0.01988) (59,0.01948) (60,0.0191)};
\addplot[hcsink,line width=0.9pt,dashed,mark=o,mark size=1.1pt,mark repeat=4] coordinates {(1,1) (2,0.791) (3,0.6369) (4,0.5193) (5,0.429) (6,0.3585) (7,0.3037) (8,0.2597) (9,0.2248) (10,0.1969) (11,0.1739) (12,0.1544) (13,0.138) (14,0.1242) (15,0.1128) (16,0.1031) (17,0.09464) (18,0.08744) (19,0.08115) (20,0.07564) (21,0.0708) (22,0.06658) (23,0.06278) (24,0.05942) (25,0.05634) (26,0.05354) (27,0.05097) (28,0.04863) (29,0.04649) (30,0.04451) (31,0.04267) (32,0.041) (33,0.03946) (34,0.03802) (35,0.03669) (36,0.03544) (37,0.0343) (38,0.03322) (39,0.0322) (40,0.03121) (41,0.0303) (42,0.02941) (43,0.02858) (44,0.02779) (45,0.02705) (46,0.02631) (47,0.02562) (48,0.02497) (49,0.02436) (50,0.02375) (51,0.02318) (52,0.02264) (53,0.02213) (54,0.02164) (55,0.02117) (56,0.02072) (57,0.0203) (58,0.01988) (59,0.01948) (60,0.0191)};}
\def\dpGaugeB{\addplot[hcsrust,line width=0.9pt] coordinates {(1,1) (2,0.5031) (3,0.4407) (4,0.3951) (5,0.3537) (6,0.3154) (7,0.2801) (8,0.248) (9,0.2193) (10,0.1936) (11,0.1709) (12,0.1508) (13,0.133) (14,0.1173) (15,0.1035) (16,0.09136) (17,0.08068) (18,0.0713)};
\addplot[hcsrust,line width=0.9pt,dashed] coordinates {(1,1) (2,0.4795) (3,0.4258) (4,0.3717) (5,0.3183) (6,0.2691) (7,0.2267) (8,0.1908) (9,0.1605) (10,0.1348) (11,0.1133) (12,0.09529) (13,0.08023) (14,0.06766) (15,0.05715) (16,0.04838) (17,0.04108) (18,0.03507)};
\addplot[hcsteal,line width=0.9pt] coordinates {(1,1) (2,0.5888) (3,0.4563) (4,0.3958) (5,0.3522) (6,0.3154) (7,0.2829) (8,0.2538) (9,0.2278) (10,0.2046) (11,0.1838) (12,0.1654) (13,0.1489) (14,0.1342) (15,0.1211) (16,0.1094) (17,0.09895) (18,0.08959)};
\addplot[hcsink,line width=0.9pt,dashed,mark=o,mark size=1.1pt,mark repeat=4] coordinates {(1,1) (2,0.5888) (3,0.4563) (4,0.3958) (5,0.3522) (6,0.3154) (7,0.2829) (8,0.2538) (9,0.2278) (10,0.2046) (11,0.1838) (12,0.1654) (13,0.1489) (14,0.1342) (15,0.1211) (16,0.1094) (17,0.09895) (18,0.08959)};}
\def\dpSwitch{\addplot[hcsgrey,line width=0.9pt] coordinates {(0.01667,1) (0.03333,0.7689) (0.05,0.6803) (0.06667,0.6294) (0.08333,0.5949) (0.1,0.5689) (0.1167,0.5478) (0.1333,0.5296) (0.15,0.5132) (0.1667,0.4979) (0.1833,0.4831) (0.2,0.4687) (0.2167,0.4542) (0.2333,0.4396) (0.25,0.4247) (0.2667,0.4096) (0.2833,0.3943) (0.3,0.3787) (0.3167,0.3629) (0.3333,0.3471) (0.35,0.3314) (0.3667,0.3251) (0.3833,0.3196) (0.4,0.3149) (0.4167,0.3108) (0.4333,0.3074) (0.45,0.3045) (0.4667,0.3022) (0.4833,0.3004) (0.5,0.2992) (0.5167,0.2984) (0.5333,0.2981) (0.55,0.2983) (0.5667,0.299) (0.5833,0.3002) (0.6,0.3019) (0.6167,0.3041) (0.6333,0.3068) (0.65,0.3101) (0.6667,0.3139) (0.6833,0.3182) (0.7,0.3114) (0.7167,0.3025) (0.7333,0.2925) (0.75,0.282) (0.7667,0.2716) (0.7833,0.2613) (0.8,0.2514) (0.8167,0.2419) (0.8333,0.233) (0.85,0.2246) (0.8667,0.2168) (0.8833,0.2094) (0.9,0.2026) (0.9167,0.1962) (0.9333,0.1902) (0.95,0.1846) (0.9667,0.1792) (0.9833,0.1742) (1,0.1694)}; \addlegendentry{deep linear}
\addplot[hcsteal,line width=0.9pt] coordinates {(0.01667,1) (0.03333,0.9082) (0.05,0.832) (0.06667,0.7676) (0.08333,0.7119) (0.1,0.6626) (0.1167,0.6188) (0.1333,0.5792) (0.15,0.5433) (0.1667,0.5103) (0.1833,0.4798) (0.2,0.4516) (0.2167,0.4255) (0.2333,0.4015) (0.25,0.3793) (0.2667,0.3589) (0.2833,0.3398) (0.3,0.3222) (0.3167,0.3058) (0.3333,0.2905) (0.35,0.2762) (0.3667,0.2743) (0.3833,0.2724) (0.4,0.2707) (0.4167,0.269) (0.4333,0.2675) (0.45,0.2661) (0.4667,0.2647) (0.4833,0.2634) (0.5,0.2622) (0.5167,0.261) (0.5333,0.2599) (0.55,0.2588) (0.5667,0.2577) (0.5833,0.2567) (0.6,0.2558) (0.6167,0.2549) (0.6333,0.254) (0.65,0.2532) (0.6667,0.2524) (0.6833,0.2515) (0.7,0.1166) (0.7167,0.03965) (0.7333,0.0129) (0.75,0.004503) (0.7667,0.001747) (0.7833,0.0007486) (0.8,0.0003443) (0.8167,0.0001706) (0.8333,9.024e-05) (0.85,5.038e-05) (0.8667,2.975e-05) (0.8833,1.842e-05) (0.9,1.193e-05) (0.9167,8.044e-06) (0.9333,5.625e-06) (0.95,4.073e-06) (0.9667,3.041e-06) (0.9833,2.333e-06) (1,1.837e-06)}; \addlegendentry{LeNet-300-100}
\addplot[hcsgold!80!black,line width=0.9pt] coordinates {(0.01667,1) (0.03333,0.02849) (0.05,0.02683) (0.06667,0.02569) (0.08333,0.02481) (0.1,0.02409) (0.1167,0.02345) (0.1333,0.02288) (0.15,0.02236) (0.1667,0.02187) (0.1833,0.0214) (0.2,0.02095) (0.2167,0.02051) (0.2333,0.02008) (0.25,0.01966) (0.2667,0.01926) (0.2833,0.01887) (0.3,0.0185) (0.3167,0.01814) (0.3333,0.01778) (0.35,0.01743) (0.3667,0.01739) (0.3833,0.01735) (0.4,0.0173) (0.4167,0.01726) (0.4333,0.01722) (0.45,0.01719) (0.4667,0.01716) (0.4833,0.01714) (0.5,0.01712) (0.5167,0.0171) (0.5333,0.01708) (0.55,0.01706) (0.5667,0.01704) (0.5833,0.01703) (0.6,0.01702) (0.6167,0.01701) (0.6333,0.01701) (0.65,0.017) (0.6667,0.017) (0.6833,0.01698) (0.7,0.009537) (0.7167,0.003722) (0.7333,0.001022) (0.75,0.0004648) (0.7667,0.000191) (0.7833,6.244e-05) (0.8,2.719e-05) (0.8167,1.345e-05) (0.8333,7.568e-06) (0.85,4.633e-06) (0.8667,2.953e-06) (0.8833,1.919e-06) (0.9,1.229e-06) (0.9167,7.89e-07) (0.9333,5.344e-07) (0.95,3.713e-07) (0.9667,2.904e-07) (0.9833,2.418e-07) (1,2.01e-07)}; \addlegendentry{LeNet-5}
\addplot[hcsrust,line width=0.9pt] coordinates {(0.08333,1) (0.1667,0.4816) (0.25,0.2454) (0.3333,0.1622) (0.4167,0.1215) (0.5,0.1159) (0.5833,0.1128) (0.6667,0.1112) (0.75,0.1105) (0.8333,0.04381) (0.9167,0.01415) (1,0.004548)}; \addlegendentry{ResNet-20}
\addplot[hcsplum,line width=0.9pt] coordinates {(0.05556,1) (0.1111,0.5031) (0.1667,0.4407) (0.2222,0.3951) (0.2778,0.3537) (0.3333,0.3154) (0.3889,0.2801) (0.4444,0.258) (0.5,0.2383) (0.5556,0.2203) (0.6111,0.2038) (0.6667,0.1888) (0.7222,0.175) (0.7778,0.1689) (0.8333,0.1611) (0.8889,0.1524) (0.9444,0.1435) (1,0.1345)}; \addlegendentry{Transformer layer}
}
\def\dpJacRows{deep linear & 32 & 8 & 16 & \texttt{R(1..3)} & $1.4\mathrm{e}{4}$ & $7.2\mathrm{e}{3}$ & $7.2\mathrm{e}{3}$ & 0.0644 & 0.146 & 0.157\\
LeNet-300-100 & 784 & 10 & 10 & \texttt{R(1..6)} & $2.1\mathrm{e}{8}$ & $2.7\mathrm{e}{6}$ & $2.7\mathrm{e}{6}$ & 4.3 & 0.634 & 0.408\\
LeNet-5 & 1\,024 & 10 & 10 & \texttt{R(1..12)} & $4.4\mathrm{e}{8}$ & $4.3\mathrm{e}{6}$ & $4.3\mathrm{e}{6}$ & 153 & 2.75 & 2.73\\
ResNet-20 & 6\,144 & 20 & 20 & \texttt{R(1..41)} & $5.1\mathrm{e}{11}$ & $1.7\mathrm{e}{9}$ & $1.7\mathrm{e}{9}$ & -- & 292 & 301\\
Transformer layer & 1\,024 & 1\,024 & 1\,024 & \texttt{R(1..8)} & $6.5\mathrm{e}{9}$ & $6.5\mathrm{e}{9}$ & $6.5\mathrm{e}{9}$ & 136 & 133 & 135\\
autoencoder & 784 & 30 & 784 & \texttt{F(8..14) $\cdot$ R(1..7)} & $2.2\mathrm{e}{9}$ & $2.2\mathrm{e}{9}$ & $1.0\mathrm{e}{8}$ & 37.9 & 42.4 & 3.97\\}
\def\dpModeRows{gradient, the transpose & 0.0761 & 0.841 & 43.9 & 205 & 12.4 & 11.8\\
Gauss--Newton direction, one linearisation & 0.303 & 12.7 & 914 & 6\,707 & 272 & 201\\
the same, the two folds inside the iteration & 0.294 & 13.2 & 994 & 7\,022 & 286 & 204\\
Hessian-vector product, tangent of the transpose & 0.0834 & 1.54 & 93.5 & 513 & 30.7 & 19\\
the same, transpose of the transpose & 0.0725 & 0.976 & 127 & 633 & 30.4 & 17.7\\
step, all branches evaluated & 1.7 & 6.37 & 111 & 659 & 255 & 79.4\\
step, branches selected at run time & 0.359 & 4.33 & 83.3 & 492 & 48.1 & 38.4\\
Gauss--Newton step & 0.465 & 17.7 & 976 & 7\,352 & 330 & 207\\}
\def\dpPairRow{pairing of the Gauss--Newton direction with the generators & $1.1\mathrm{e}{-14}$ & $1.4\mathrm{e}{-16}$ & $3.0\mathrm{e}{-15}$ & $2.2\mathrm{e}{-15}$ & $5.3\mathrm{e}{-16}$ & $5.9\mathrm{e}{-16}$\\}
\def\dpSharpRow{largest eigenvalue of the Hessian & 128 & 33.3 & 608 & 46.8 & 2\,040 & 68\,000\\}
\def\dpVelGrad{$2.2\mathrm{e}{-1}$ and $1.4\mathrm{e}{0}$}
\def\dpVelGN{$2.7\mathrm{e}{-9}$ and $3.1\mathrm{e}{-9}$}
\begin{chapabstract}
An architecture is a term of a signature of layers. The terms are an initial algebra, and three semantics are homomorphisms out of it: the
denotation, a parametrised map; its image under the tangent functor $T=[D,-]$ of \cref{sec:dc}; and the transposed tangent map. Forward and
reverse differentiation are the second and the third, by the uniqueness of homomorphisms. A fourth homomorphism assigns to a term the
symmetries of its parameter object, which are $2$-cells, and with them the atlas, the connection and the conserved quantities of
\cref{ch:structure}. A training step is then a position with respect to that atlas. The construction is executable: by a compiler to JAX the
specifications of five published networks become optimizers whose forward and backward passes are arguments of one traced program, and
every statement of the chapter that has a numerical form is measured on them. Derivatives that are composites of the two modes are
evaluated by a plan of least cost.
\end{chapabstract}
\section{Terms, the free category, and parametrised maps}
\begin{definition}[Signature of layers]\label{def:signature}
A \emph{shape} is a finite sequence of positive integers and a \emph{type} is a finite sequence of shapes. The signature $\Sigma$ has the
generators \texttt{Dense}$(n)$, \texttt{Conv}$(c,k)$, \texttt{Act}, \texttt{MaxPool}$(k)$, \texttt{GlobalAvgPool}, \texttt{Flatten},
\texttt{BatchNorm}, \texttt{LayerNorm}, \texttt{Attention}$(h)$, \texttt{Downsample}$(c)$ and \texttt{Id}, from one shape to one shape, the
diagonal \texttt{Copy} from $(s)$ to $(s,s)$, the sum \texttt{Add} from $(s,s)$ to $(s)$, and two constructors, composition $t\,;t'$ and tensor $t\otimes t'$. The
set $W$ of well-typed terms is the initial algebra of $\Sigma$. Let $\approx$ be the congruence generated by the associativity and unit laws of the two
constructors and the interchange law $(t\,;t')\otimes(s\,;s')\approx(t\otimes s)\,;(t'\otimes s')$, and $p\colon W\to F=W/{\approx}$ the quotient: $F$ is the set of morphisms of the free strict
monoidal category on $\Sigma$. The residual block is the derived term $\mathrm{Res}(t,s)=\texttt{Copy}\,;(t\otimes s)\,;\texttt{Add}$.
\end{definition}
\begin{definition}[Parametrised maps; \cite{FongSpivakTuyeras,Cruttwell}]\label{def:para}
Let $\Hh$ be the model of \cref{sec:dc}. A $1$-cell $A\to B$ of $\Para(\Hh)$ is a pair $(P,f)$ with $f\colon P\times A\to B$; the composite of $(P,f)$ and $(Q,g)$ is
$(P\times Q,\ (p,q,a)\mapsto g(q,f(p,a)))$, and the tensor is the product. A $2$-cell $(P,f)\Rightarrow(P',f')$ is a map $r\colon P\to P'$ with $f=f'\circ(r\times\id)$. The \emph{symmetry group}
$\Aut(P,f)$ is the group of invertible $2$-cells from $(P,f)$ to itself. For a subgroup $G$ the map $f$ is invariant, and for a $0$-truncated
$B$ it descends to $(P\hquot G)\times A\to B$ by \cref{prop:atlas}\textup{(i)}; the stack $P\hquot G$ is the \emph{hypothesis stack}.
\end{definition}
The generators \texttt{Act}, $x\mapsto\max(x,\alpha x)$ with $\alpha\le1$, and \texttt{MaxPool} are continuous and piecewise linear. A point $(\theta,x)$ is \emph{regular} for a
term if no argument of these generators lies on a locus of non-differentiability in the evaluation at $(\theta,x)$; the regular points are an
open set, invariant under all the group actions below, and dense for generic $x$. The statements about tangent maps are statements at
regular points.
\begin{theorem}[Compilation]\label{thm:compile}
Let a $1$-cell $(P_\sigma,\sem\sigma)$ of $\Para(\Hh)$ be given for every generator $\sigma$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item There is a unique assignment $t\mapsto(\Theta_t,\sem t)$ on $W$ that extends it and takes composition and tensor of terms to composition and tensor of
$1$-cells. It is the fold of \cref{prop:folds}.
\item If $t\approx t'$, the reassociation of the product of the parameter objects is an invertible $2$-cell $(\Theta_t,\sem t)\cong(\Theta_{t'},\sem{t'})$. Hence the
fold induces a homomorphism of bicategories from the free monoidal category $F$, with identity $2$-cells, to $\Para(\Hh)$.
\item The flattening $\mathrm{nf}\colon W\to W$ of nested compositions and tensors, with deletion of identities, is a computable slice of $p$ for the
associativity and unit laws, and with $\Theta_t$ the list of the parameter blocks of the generators of $t$ in order of occurrence,
$\Theta_{\mathrm{nf}(t)}=\Theta_t$ and $\sem{\mathrm{nf}(t)}=\sem t$.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) is initiality. (ii) By \cref{prop:folds}(i) it suffices that the target satisfies the equations of \cref{def:signature}, and
composition and tensor of $\Para(\Hh)$ are associative and unital up to the associativity and unit isomorphisms of the product of $\Hh$, which
are $2$-cells by definition. (iii) Flattening terminates, its result is equal for terms that differ by the two laws, and the order of
occurrence of the generators is preserved; this is \cref{thm:normal-forms} for a decidable congruence.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small,>=stealth]
\node[hcsnode,align=center] (w) at (0,0) {terms $W$\\ initial algebra};
\node[hcsnode,align=center] (f) at (0,-1.9) {$F=W/{\approx}$\\ free category};
\node[hcsnodeb,align=center] (d) at (4.6,0.9) {denotation\\ $\sem t\colon\Theta_t\times A\to B$};
\node[hcsnodeb,align=center] (t) at (4.6,-0.55) {tangent\\ $T\sem t$, dual numbers};
\node[hcsnodeb,align=center] (r) at (4.6,-2.0) {transpose\\ $\sem t^*$, cotangents};
\node[hcsnodeb,align=center] (s) at (4.6,-3.45) {symmetries\\ $G_t$, $a$, $H_t$, $Q$};
\node[hcsnoder,align=center] (u) at (9.6,-0.55) {step $U_c\colon\Theta_t\to\Theta_t$\\ $c$ a configuration};
\node[hcsnoder,align=center] (j) at (9.6,-2.75) {one traced program\\ $(c,\text{state},\text{batch})\mapsto\text{state}$};
\draw[->>] (w)--node[left]{$p$}(f);
\draw[->] (w.east)--(d.west);
\draw[->] (w.east)--(t.west);
\draw[->] (w.east)--(r.west);
\draw[->] (w.east)--(s.west);
\draw[->,dashed] (f.east)--(3.0,-1.9);
\draw[->] (d.east)--(u.west);
\draw[->] (t.east)--(u.west);
\draw[->] (r.east)--(u.west);
\draw[->] (s.east)--(u.west);
\draw[->] (u)--node[right]{JAX}(j);
\end{tikzpicture}
\caption{Four folds out of the initial algebra of terms. Each factors through the free category (\cref{thm:compile,thm:ad,thm:sym-fold}),
and a step of an optimizer is assembled from them and from a configuration read at run time (\cref{thm:step}).}\label{fig:folds}
\end{figure}
\section{Forward and reverse mode}
\begin{theorem}[Tangent and transpose]\label{thm:ad}
At regular points:
\begin{enumerate}[label=\textup{(\roman*)}]
\item $T\sem t$ is the value at $t$ of the fold with generators $T\sem\sigma$. Since $T$ preserves products and $TR^n\simeq R^n\times R^n$, it is a map of pairs of a value and a
tangent, the arithmetic of dual numbers.
\item Let $\sem t^*$ be the fold in which a generator is sent to the fibrewise transpose of $T\sem\sigma$, a composite to the composite in the opposite order,
\texttt{Copy} to the sum and \texttt{Add} to the diagonal. Then for all tangent vectors $(\dot\theta,\dot x)$ and all cotangent vectors $\bar y$,
\[
\bigl\langle T\sem t(\dot\theta,\dot x),\,\bar y\bigr\rangle=\bigl\langle(\dot\theta,\dot x),\,\sem t^*(\bar y)\bigr\rangle .
\]
\item For $\ell\colon B\to R$ and $L=\ell\circ\sem t(-,x)$, the gradient $\nabla L(\theta)$ is the component along $\Theta_t$ of $\sem t^*(\nabla\ell)$, and it is computed by one evaluation of each
generator and one of each transpose.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) $T$ is a functor that preserves finite products (\cref{lem:dc}(i)), so $t\mapsto T\sem t$ takes composition and tensor of terms to
composition and tensor; it is a homomorphism that agrees with the tangent fold on generators, and homomorphisms out of $W$ are unique. The
identification $TR^n\simeq R^n\times R^n$ is the Kock--Lawvere property. (ii) Transposition is a contravariant functor on linear maps of Euclidean spaces
that preserves products, the transpose of the diagonal is the sum, and the identity holds for generators by definition; both sides are
homomorphisms. (iii) is (ii) with $\bar y=\nabla\ell$ and the chain rule.
\end{proof}
Part (i) is forward-mode and part (iii) reverse-mode differentiation. The argument is that of \cite{Elliott}, and in axiomatic form of
reverse derivative categories \cite{RDC}; the lens form of (ii), with the parameter object, is in \cite{Cruttwell}. For a higher-order
language with algebraic data types, forward-mode differentiation is characterised in \cite{HuotStatonVakar} as the unique
structure-preserving macro for a choice of derivatives of the basic operations, and its correctness is proved by a gluing construction
over diffeological spaces, the category of Volume~I, with a sketch of the extension to a continuation-based method. Part (i) is that
characterisation for the first-order signature of \cref{def:signature}; in the present chapter the language is first-order and the
$2$-cells are added.
\section{Symmetries as \texorpdfstring{$2$}{2}-cells}
Three local patterns of a term give automorphisms of its denotation (\cref{tab:patterns}). In each, $L$ and $L'$ are linear generators,
\texttt{Dense} or \texttt{Conv}.
\begin{table}[t]\centering\small
\begin{tabular}{@{}p{4.6cm}p{1.9cm}p{3.9cm}p{3.3cm}@{}}\toprule
pattern in a composition & group & action & $Q$\\\midrule
$L\,;h_1;\dots;h_m;L'$, the $h_i$ among \texttt{Act}, pooling, \texttt{Flatten}, one of them \texttt{Act}; also with a normalisation for $L$ &
$(\R_{>0})^k\rtimes S_k$ & channel $j$ of $L$, weights and bias, times $s_j$; the weights of $L'$ on channel $j$ times $s_j^{-1}$ &
$\tfrac12\bigl(\abs{w^{\mathrm{in}}_j}^2+b_j^2-\abs{w^{\mathrm{out}}_j}^2\bigr)$\\[0.6ex]
$L\,;\texttt{BatchNorm}$, $L\,;\texttt{LayerNorm}$ & $(\R_{>0})^k$, $\R_{>0}$ & channel $c$ of $L$ times $s_c$; all of $L$ times $s$ & $\tfrac12\abs{W_c}^2$\\[0.6ex]
\texttt{Dense}\,;\texttt{Dense}; the pairs $(Q,K)$ and $(V,O)$ of each head of \texttt{Attention} & $\GL_k$ & $M_1\mapsto M_1g$, $M_2\mapsto g^{-1}M_2$ &
$\tfrac12\bigl(M_1\transp M_1-M_2M_2\transp\bigr)$\\\bottomrule
\end{tabular}
\caption{The symmetry families read off a term, with the functions $Q$ of their symmetric generators. For the pair $(Q,K)$ the matrix $M_2$ is
the transpose of the key projection.}\label{tab:patterns}
\end{table}
\begin{theorem}[The symmetry fold]\label{thm:sym-fold}
Let $t$ be a term and $G_t$ the group generated by the families of \cref{tab:patterns} at all their occurrences in $t$, with Lie algebra
$\fg_t$ and infinitesimal action $a$.
\begin{enumerate}[label=\textup{(\roman*)}]
\item $G_t\subseteq\Aut(\Theta_t,\sem t)$, for every value $\alpha\le1$ of the slope of \texttt{Act}. The assignment $t\mapsto(G_t,a)$ is defined by recursion on terms.
\item For every $\ell$ and every batch, $L=\ell\circ\sem t$ is $G_t$-invariant. Hence the output of the reverse fold is a section of $H_t=a(\fg_t)^\perp$, the functions
$Q$ of \cref{tab:patterns} are constant along gradient flow, and a step $\theta^+=\theta-h\nabla L$ changes $Q_A$ by $\tfrac{h^2}2\langle\nabla L,A\nabla L\rangle$.
\item $T\sem t\,(a(\xi,\theta),0)=0$ for $\xi\in\fg_t$. Two updates $u$, $u'$ with $u'-u=a(\psi,\theta)$ have the same image under $T\sem t$; in particular $u$ and its projection
$P_Hu$ to $H_t$.
\item The permutations $\prod S_k$ are coreduced: they have no generator and no function $Q$, and they are part of the formally \'etale map
$\varepsilon$ of \cref{thm:dc-factorisation}.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) In the first pattern every $h_i$ acts on each channel separately and commutes with multiplication by a positive number, so the factor
$s_j$ passes from $L$ to the input of $L'$, where it is cancelled; a permutation of the channels is cancelled in the same way. In the second,
a normalisation is invariant under positive rescaling of each of its channels, respectively of its whole input. In the third the pair
enters through the product $M_1M_2$; for the attention scores, $(xM_Q)(xM_K)\transp=xM_Qg\,g^{-1}M_K\transp x\transp$. An automorphism of a factor of a composite or of a tensor
is an automorphism of the whole, by the functoriality of whiskering in $\Para(\Hh)$, and the search for the patterns is a recursion on
subterms. (ii) Invariance follows from (i), and the three consequences are \cref{thm:dc-positions}(a),(b) and \cref{thm:two-noether}(c); the
generators of the first two patterns and the symmetric elements of $\mathfrak{gl}_k$ act by symmetric matrices. (iii) Differentiate
$\sem t(\exp(s\xi)\theta,x)=\sem t(\theta,x)$ at $s=0$; the second statement follows by linearity, and $u-P_Hu$ lies in $a(\fg_t,\theta)$, the orthogonal complement of $H_t$ at
$\theta$. (iv) A finite group is coreduced, and \cref{thm:dc-factorisation}(v) and \cref{thm:dc-positions}(d) apply.
\end{proof}
The group $G_t$ is a subgroup of $\Aut(\Theta_t,\sem t)$ and in general a proper one: the permutations of the heads of an attention layer and the
translations of the bias before a normalisation are further automorphisms. The hypothesis stack of the chapter is $X_t=\Theta_t\hquot G_t$.
\section{A training step as a position}
\begin{definition}[Configuration and step]\label{def:config}
Let $b(\theta)\in G_t$ be a \emph{balancing element}: $b(\theta)\theta$ lies on the slice $S_t$ defined by $Q=0$ for the first and third patterns and $\abs{W_c}=1$ for the
second. A \emph{configuration} $c$ consists of the slope $\alpha$; a gauge exponent $\tau\in[0,1]$ and a return flag $\rho\in[0,1]$; a backward algebra, the
transpose of \cref{thm:ad} or the tangent fold along random directions \cite{Baydin}, with weights for two substitutions in the
transpose, fixed random matrices in place of transposed weights \cite{Lillicrap} and the identity in place of the transpose of
\texttt{Act} \cite{BengioSTE}; a projection weight $\pi\in[0,1]$; and a rule, among gradient descent, heavy ball and Adam, with its constants and
the step $h$. The step $U_c$ is
\begin{align*}
\theta_\tau&=b(\theta)^\tau\theta, & u&=\text{rule}\bigl(\text{backward}_c(\theta_\tau)\bigr), & u'&=(1-\pi)\,u+\pi\,P_Hu,\\
\theta_\tau^+&=\theta_\tau-h\,u', & U_c(\theta)&=b(\theta)^{-\tau\rho}\,\theta_\tau^+ .
\end{align*}
\end{definition}
\begin{theorem}[Positions of the compiled step]\label{thm:step}
\begin{enumerate}[label=\textup{(\alph*)}]
\item \emph{Projection.} For $\pi=1$, every backward algebra and every rule, $Q_A(\theta_\tau^+)=Q_A(\theta_\tau)+\tfrac{h^2}2\langle u',Au'\rangle$ for the symmetric generators $A$, and
$T\sem t(u',0)=T\sem t(u,0)$: the conserved quantities are preserved to first order in $h$, and the first-order change of the function is that of the unprojected update.
\item \emph{Slice.} For $\tau=1$, $\rho=0$, the forward pass is evaluated on the slice, and $\sem t(\theta_\tau,-)=\sem t(\theta,-)$.
\item \emph{Invariant metric.} Let $\tau=\rho=1$, with the transpose as backward algebra and gradient descent as rule, and let the slice intersect
every orbit of $G_t$ in one orbit of the subgroup $K_t$ of the elements of $G_t$ that are orthogonal. Then $U_c(g\theta)=g\,U_c(\theta)$ for $g\in G_t$ at the points with trivial stabiliser, the step
descends to an endomorphism of $X_t$, and the functions $\sem t(U_c^n(\theta),-)$ depend only on the class of $\theta$ in $X_t$. They are the functions obtained in
position \textup{(b)}.
\item \emph{Run-time family.} \Cref{thm:compile,thm:ad,thm:sym-fold} hold for every configuration, and $(c,\theta)\mapsto U_c(\theta)$ is one map; the weights
$\tau$, $\rho$, $\pi$ and those of the substitutions interpolate between the positions.
\end{enumerate}
\end{theorem}
\begin{proof}
(a) $Q_A(\theta-hu')=Q_A(\theta)-h\langle A\theta,u'\rangle+\tfrac{h^2}2\langle u',Au'\rangle$ and $\langle A\theta,u'\rangle=a_A(u')=0$ on $H_t$; the second statement is \cref{thm:sym-fold}(iii). (b)
$b(\theta)\in G_t$ and \cref{thm:sym-fold}(i). (c) Let $\beta(\theta)=b(\theta)\theta$ and $E$ the Euclidean step, so that $U_c(\theta)=b(\theta)^{-1}E(\beta(\theta))$. By hypothesis
$\beta(g\theta)=k\,\beta(\theta)$ with $k\in K_t$, that is, $b(g\theta)\,g=k\,b(\theta)$, the stabiliser of $\theta$ being trivial. The elements of $K_t$ are isometries that preserve $L$, so $E$
commutes with them (\cref{thm:dc-positions}(c)), and
$U_c(g\theta)=b(g\theta)^{-1}E(k\beta(\theta))=b(g\theta)^{-1}k\,E(\beta(\theta))=g\,b(\theta)^{-1}E(\beta(\theta))$. The rest is \cref{prop:atlas}(ii) and \cref{thm:sym-fold}(i), and in position (b) the
point is $\beta(U_c^n(\theta))$ up to $K_t$. (d) The slope enters \cref{thm:sym-fold}(i) only through positive homogeneity, and the other entries of $c$ do not
enter the forward fold.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small,>=stealth]
\fill[hcsmist] (0,0) rectangle (7.0,3.8);
\draw[hcsteal] (0,0) rectangle (7.0,3.8);
\foreach \x in {1.9,4.9} \draw[hcsgrey,line width=0.4pt] (\x,0)--(\x,3.8);
\draw[hcsgold,line width=1.1pt] (0,1.0) .. controls (2.2,0.85) and (4.8,1.15) .. (7.0,1.0);
\node[hcsgold!70!black,right] at (7.0,1.0) {slice $S_t$};
\node[hcsgrey,above] at (1.9,3.8) {orbit of $G_t$};
\fill (1.9,3.1) circle (1.4pt) node[left]{$\theta$};
\fill (1.9,0.93) circle (1.4pt) node[below left]{$\theta_\tau$};
\draw[->,hcsplum,line width=0.9pt] (1.9,3.0)--(1.9,1.05);
\node[hcsplum,left] at (1.85,2.05) {$b(\theta)^\tau$};
\draw[->,hcsink,line width=1pt] (1.9,0.93)--(4.9,1.03);
\node[hcsink,below] at (3.4,0.92) {$-h\,P_Hu$};
\draw[->,hcsrust,line width=0.8pt,dashed] (1.9,0.93)--(4.9,2.05);
\node[hcsrust,above] at (3.2,1.55) {$-hu$};
\fill (4.9,1.03) circle (1.4pt);
\draw[->,hcsplum,line width=0.9pt] (4.9,1.13)--(4.9,3.0);
\node[hcsplum,right] at (4.95,2.5) {$b(\theta)^{-\tau\rho}$};
\fill (4.9,3.1) circle (1.4pt) node[right]{$U_c(\theta)$};
\draw[->>,line width=0.6pt] (3.5,-0.15)--node[right]{$p$}(3.5,-0.8);
\draw[hcsink,line width=1pt] (0,-1.0)--(7.0,-1.0) node[right]{$X_t$};
\fill (1.9,-1.0) circle (1.2pt); \fill (4.9,-1.0) circle (1.2pt);
\draw[->,hcsteal,line width=1pt] (1.95,-1.2)--(4.85,-1.2);
\node[align=left,text width=5.4cm] at (11.6,1.5) {$\tau=0$: the step is taken at $\theta$.\\[0.5ex] $\tau=1$, $\rho=0$: it is taken on the slice and
the point remains there.\\[0.5ex] $\tau=\rho=1$: it is taken on the slice and transported back, the step of an invariant metric.\\[0.5ex] $\pi=1$: the part of the update
along the orbit is removed; it has no image in $TX_t$.};
\end{tikzpicture}
\caption{The step $U_c$ of \cref{def:config}. The gauge move and its inverse are $2$-cells and leave the denotation unchanged; under the
projection an update is replaced by an isomorphic section in the sense of \cref{prop:dc-sections}.}\label{fig:step}
\end{figure}
\section{The compiler and its measurements}
\Cref{def:signature,def:config} are implemented in JAX \cite{JAX} in the package \texttt{dprog}, in the source of this volume. Terms are immutable
records; \texttt{nf} is the flattening of \cref{thm:compile}(iii); \texttt{fold} is the homomorphism out of the terms, applied to three
algebras, \texttt{Primal}, \texttt{Tangent} and \texttt{Reverse}, whose values on a generator are the JAX expression of the layer, its
\texttt{jvp} and its \texttt{vjp}; \texttt{families} is the recursion of \cref{thm:sym-fold}; in \texttt{Symmetry} are computed $a$, the forms $a_\xi$ by
linear transposition, the projection $P_H$ by conjugate gradients on the Gram operator of $a$, the functions $Q$, and the balancing
elements, in closed form for each family and by alternating sweeps over the families; the value of \texttt{compile} is the step $U_c$ as one
traced function of the state, the batch and the configuration. Selections between algebras and rules are \texttt{lax.switch} on entries of $c$,
and all weights are traced numbers, so a change of configuration is not a new compilation.
\begin{figure}[t]
\footnotesize
\begin{verbatim}
def basic_block(c, stride): # He et al., CIFAR-10, shortcut option A
body = Seq((Conv(c, 3, stride, bias=False), BatchNorm(), Act(),
Conv(c, 3, bias=False), BatchNorm()))
return Seq((Residual(body, Id() if stride == 1 else Downsample(c)), Act()))
def transformer_layer(d=512, heads=8, ff=2048): # Vaswani et al., encoder layer
return Seq((Residual(Attention(heads)), LayerNorm(),
Residual(Seq((Dense(ff), Act(), Dense(d)))), LayerNorm()))
model = compile(transformer_layer(), (16, 512), loss="mse") # one traced step
state = model.init(key)
cfg = default_cfg # every entry is read at run time
state, m = model.step(state, batch, cfg(lr=5e-4)) # transpose, SGD
state, m = model.step(state, batch, cfg(lr=5e-4, tau=1.0, ret=1.0)) # invariant metric
state, m = model.step(state, batch, cfg(lr=5e-4, fa=1.0, proj=1.0)) # feedback alignment
state, m = model.step(state, batch, cfg(lr=1e-4, rule=2, bmode=1)) # tangent algebra, Adam
assert model.traces == 1
\end{verbatim}
\caption{Two specifications and a compiled optimizer whose forward and backward passes are changed between steps.}\label{fig:listing}
\end{figure}
\begin{table}[t]\centering\small
\begin{tabular}{@{}lllrrrr@{}}\toprule
specification & input & parameters & rescaling & normalisation & $\GL_k$ & $\dim\fg_t$\\\midrule
\dpSpecRows
\bottomrule
\end{tabular}
\caption{Five published architectures as terms, with the dimension of the Lie algebra of the symmetries found by the fold of
\cref{thm:sym-fold}. The parameter counts follow from the published layer sizes.}\label{tab:specs}
\end{table}
The specifications are the deep linear network of \cite{Arora}, LeNet-300-100 and LeNet-5 \cite{LeCun98} with rectified activations,
ResNet-20 for CIFAR-10 \cite{ResNet} with batch normalisation \cite{BatchNorm} on batch statistics and the parameter-free shortcut, and
the encoder layer of the base Transformer \cite{Vaswani} with layer normalisation \cite{LayerNorm} (\cref{tab:specs}). No data set is
used: inputs are standard normal, and targets are produced by a fixed random network of the same architecture, labels for the classifiers
and outputs for the two regressions. Arithmetic is in double precision.
\begin{table}[t]\centering\footnotesize
\begin{tabular}{@{}p{5.1cm}lllll@{}}\toprule
quantity & deep linear & LeNet-300-100 & LeNet-5 & ResNet-20 & Transformer\\\midrule
\dpCheckRows
\bottomrule
\end{tabular}
\caption{Measured defects of the statements of this chapter, relative, one random point and batch of four per specification. Rows 1 to 4:
\cref{thm:compile}(iii) and \cref{thm:ad}, the differences being central with step $10^{-6}$ in a random unit direction. Rows 5 to 10:
\cref{thm:sym-fold}. Rows 11 to 13: \cref{thm:step}(b),(c); the last two rows compare the functions after one step from $\theta$ and from $g\theta$ for a
random $g\in G_t$.}\label{tab:checks}
\end{table}
The verification is in \cref{tab:checks}. The reverse and tangent algebras agree with central differences to the accuracy of the
differences, and with each other through the transposition identity to rounding. Invariance, the orthogonality of the gradient to the
generators, and the vanishing of $T\sem t$ on vertical vectors hold to rounding for all five terms. The balancing is exact when the families
do not share parameter blocks, as in the Transformer layer, and is otherwise limited by the twelve alternating sweeps; the equivariance of
the invariant-metric step has the same accuracy, against a defect of order one for the plain step.
\begin{table}[t]\centering\small
\begin{tabular}{@{}lllllll@{}}\toprule
& \multicolumn{2}{c}{transpose} & \multicolumn{2}{c}{feedback alignment} & \multicolumn{2}{c}{the same, projected}\\
specification & drift & ratio & drift & ratio & drift & ratio\\\midrule
\dpDriftRows
\bottomrule
\end{tabular}
\caption{Relative drift of the functions $Q$ over a fixed training time with step $h$, and its ratio to the drift with step $h/2$. A drift
of order $h^2$ per step gives the ratio $2$; a drift of order $h$ per step gives the ratio $1$.}\label{tab:drift}
\end{table}
\Cref{tab:drift} is \cref{thm:sym-fold}(ii) and \cref{thm:step}(a). For the transpose the drift is of second order per step. Feedback
alignment is not a gradient, its update has a component along the orbits, and the drift is of first order; after projection it is again of second
order.
\begin{table}[t]\centering\footnotesize
\begin{tabular}{@{}p{5.0cm}lllll@{}}\toprule
configuration & deep linear & LeNet-300-100 & LeNet-5 & ResNet-20 & Transformer\\\midrule
\multicolumn{6}{@{}l}{\emph{final loss, relative to the initial loss}}\\
\dpTrainRows
\midrule
\multicolumn{6}{@{}l}{\emph{pairing of the update with the generators, $\abs{(a_\xi(u))_\xi}/\abs u$, mean over the steps}}\\
\dpVertRows
\midrule
\dpBatchRow
\dpStepsRow
\dpTraceRow
\bottomrule
\end{tabular}
\caption{Each specification compiled once and trained under eleven configurations given at run time. Within a column the
transpose, feedback alignment and straight-through have one step size, the heavy ball a tenth of it, Adam its own, and the tangent algebra
the first multiplied by four times the ratio of the number of directions to the number of parameters; the values are in \texttt{demo.py}.}\label{tab:train}
\end{table}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{axis}[name=A,width=7.3cm,height=5.6cm,ymode=log,xlabel={step},ylabel={loss / initial loss},title={LeNet-300-100},
tick label style={font=\small},label style={font=\small},title style={font=\small}]
\dpGaugeA
\end{axis}
\begin{axis}[at={(A.east)},anchor=west,xshift=1.3cm,width=7.3cm,height=5.6cm,ymode=log,xlabel={step},title={Transformer layer},
tick label style={font=\small},label style={font=\small},title style={font=\small},
legend style={font=\footnotesize,at={(0.03,0.03)},anchor=south west,draw=none,fill=none,cells={anchor=west}}]
\dpGaugeB
\legend{{plain, from $\theta$},{plain, from $g\theta$},{invariant, from $\theta$},{invariant, from $g\theta$}}
\end{axis}
\end{tikzpicture}
\caption{The same function at two points $\theta$ and $g\theta$ of a fibre. Under plain gradient descent the two losses separate; in the
invariant-metric configuration they coincide (\cref{thm:step}(c)).}\label{fig:gauge}
\end{figure}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{axis}[width=11.5cm,height=5.6cm,ymode=log,xmin=0,xmax=1,xlabel={fraction of the run},ylabel={loss / initial loss},
tick label style={font=\small},label style={font=\small},
legend style={font=\footnotesize,at={(1.03,0.98)},anchor=north west,draw=none,fill=none,cells={anchor=west}}]
\dpSwitch
\draw[hcsgrey,dashed] (axis cs:0.3333,1e-9)--(axis cs:0.3333,10);
\draw[hcsgrey,dashed] (axis cs:0.6667,1e-9)--(axis cs:0.6667,10);
\end{axis}
\end{tikzpicture}
\caption{The configuration is changed twice during training, without a new trace: transpose with gradient descent, then feedback
alignment with projection, then Adam with projection.}\label{fig:switch}
\end{figure}
Four observations on \cref{tab:train} and \cref{fig:gauge,fig:switch}. First, the rows of the slice and of the invariant metric are equal:
the two configurations differ by a gauge transformation at every step (\cref{thm:step}(c)), and the loss is a function on $X_t$. Second,
the update of Adam pairs with the generators at about a tenth of its norm or more, since the rule is not equivariant, and the removal of
that part changes the final loss by a few percent at most, in agreement with \cref{thm:sym-fold}(iii) to first order. Third, the same holds for
feedback alignment except on the deep linear network, where the projected run is slower: the alignment of the forward weights with the
feedback weights is a motion along the orbits of $\GL_k$, and it is removed by the projection. Fourth, the tangent algebra with eight random
directions gives an unbiased estimate of the gradient whose variance is proportional to the number of parameters, and in these runs it
reduces the loss of the network with $448$ parameters by two fifths, that of LeNet-5 by a tenth, and that of the three others by a
thousandth or less.
\section{Composition of the two modes}\label{sec:modes}
The tangent and the transpose are two homomorphisms. A derivative of a term, its Jacobian, a product with it, a second derivative, is a
composite of both, and the composites with one value differ in cost. The choice among them is a choice of a term in a fibre of a quotient
map, as in \cref{ch:structure}: the value is a function on the classes, the cost is a function on the terms. In the compiler the choice is
made by a cost model, and by measurement where the model is indifferent.
\begin{definition}[Linearisation and plans]\label{def:plans}
The \emph{linearisation fold} sends a term to a triple $(y,\mathrm{push},\mathrm{pull})$ at a point: one evaluation of the denotation, the
linear map $T\sem t$ at the point, and its transpose, obtained by transposition of the linear map. Let $t=\ell_1;\dots;\ell_n$ be a composition of links
with interfaces of dimensions $d_0,\dots,d_n$, linear maps $L_i$ after linearisation, and costs $c_i$ of one application of a link, of its push or
of its pull, and let $C_{ij}=c_{i+1}+\dots+c_j$. An \emph{accumulation plan} is a binary tree whose leaves are segments $(i,j]$ marked $\mathrm F$, the pushes of
the $d_i$ basis vectors, or $\mathrm R$, the pulls of the $d_j$ basis covectors, and whose nodes are matrix products.
\end{definition}
\begin{theorem}[Accumulation plans]\label{thm:plans}
\begin{enumerate}[label=\textup{(\roman*)}]
\item Every plan has the value $L_n\cdots L_1$.
\item In the cost model $\mathrm F(i,j]\mapsto d_iC_{ij}$, $\mathrm R(i,j]\mapsto d_jC_{ij}$, product $\mapsto\mu\,d_jd_kd_i$, a plan of least cost is found by dynamic programming over the
segments, in $O(n^3)$ operations.
\item A product $\bar y\transp L_n\cdots L_1$ with one covector costs at least $C_{0n}$, and the reverse sweep attains it; a product $L_n\cdots L_1v$ with one vector
costs at least $C_{0n}$, and the forward sweep attains it. The transpose is optimal for the gradient of a loss and the tangent for a
directional derivative.
\item If $d_k\le\min(d_0,d_n)$ for an interior $k$, the plan $\mathrm F(k,n]\cdot\mathrm R(0,k]$ costs $d_k\,C_{0n}+\mu\,d_nd_kd_0$, and the cheaper pure plan costs
$\min(d_0,d_n)\,C_{0n}$.
\end{enumerate}
\end{theorem}
\begin{proof}
(i) By \cref{thm:ad} a leaf is the matrix of the composite of its links, computed by columns or by rows, and the matrix product is
associative. (ii) The least cost $b(i,j)$ of a segment satisfies
$b(i,j)=\min\bigl(d_iC_{ij},\,d_jC_{ij},\,\min_{i<k<j}b(i,k)+b(k,j)+\mu\,d_jd_kd_i\bigr)$. (iii) Every link is applied at least once, and each sweep
applies every link once. (iv) The reverse sweep of the first $k$ links has $d_k$ seeds, the forward sweep of the others has $d_k$ seeds, and
one product remains.
\end{proof}
The links are the factors of the top-level composition of the normal form. Inside a link, and for a term with shared subterms, the same
question is the elimination problem on the graph of the generators, which is NP-complete \cite{Naumann}; the general theory is in
\cite{GriewankWalther}.
\begin{proposition}[Composites on one linearisation]\label{prop:gn}
Let $J$ be the parameter part of the push at $(\theta,x)$ for a batch $x$, and $H_\ell$ the Hessian of the loss in the outputs, positive semidefinite
with $\nabla\ell$ in its range, as for the two losses of this chapter.
\begin{enumerate}[label=\textup{(\roman*)}]
\item $J\transp H_\ell J=\mathrm{pull}\circ H_\ell\circ\mathrm{push}$. The gradient is one pull, and $K$ iterations of conjugate gradients for $(J\transp H_\ell J+\lambda)\,d=\nabla L$ use one evaluation of
the denotation, $K$ pushes and $K+1$ pulls.
\item The Hessian-vector product is the tangent of the reverse fold, and it is also the transpose of the reverse fold paired with the
vector.
\item The iterates of \textup{(i)} lie in $H_t$: the Gauss--Newton direction is a section of $H_t$, without projection.
\item For $\lambda\to0$ and the limit $d$ of the iteration, $H_\ell Jd$ is the same at $\theta$ and at $g\theta$ for $g\in G_t$. For positive definite $H_\ell$ the first-order
change of the outputs on the batch is a function on $X_t$.
\end{enumerate}
\end{proposition}
\begin{proof}
(i) and (ii) are the definitions, the equality of pull and transposed push, and the symmetry of second derivatives. (iii) $J\,a(\xi,\theta)=0$ by
\cref{thm:sym-fold}(iii), so the symmetric operator $M=J\transp H_\ell J+\lambda$ maps $a(\fg_t,\theta)$ to itself and its orthogonal complement $H_t$ to itself;
$\nabla L$ is in $H_t$, and the iterates are in the span of the vectors $M^m\nabla L$. (iv) The action of $g$ is linear and $\sem t(g\theta,x)=\sem t(\theta,x)$, so
$J(g\theta)\circ g=J(\theta)$, and $J(g\theta)$ and $J(\theta)$ have the same range. With $A=H_\ell^{1/2}J$ and $\nabla\ell=H_\ell^{1/2}r$, the limit $d$ is the solution of least norm of
$A\transp A\,d=A\transp r$, so $Ad$ is the orthogonal projection of $r$ to the range of $A$, which is the same at $\theta$ and $g\theta$, and $H_\ell Jd=H_\ell^{1/2}Ad$.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small,>=stealth,x=0.82cm,y=0.0032cm]
\foreach \i/\d in {0/784,1/1000,2/1000,3/500,4/500,5/250,6/250,8/250,9/250,10/500,11/500,12/1000,13/1000,14/784}
\fill[hcsmist,draw=hcsteal] (\i-0.3,0) rectangle (\i+0.3,\d);
\fill[hcsgold!60,draw=hcsgold!70!black] (7-0.3,0) rectangle (7+0.3,30);
\node[hcsgold!60!black,above] at (7,60) {$30$};
\node[above] at (0,784) {$784$}; \node[above] at (14,784) {$784$}; \node[above] at (1.5,1000) {$1000$}; \node[above] at (12.5,1000) {$1000$};
\draw[hcsrust,line width=1pt,<-] (-0.3,-110)--(7,-110);
\node[hcsrust,below] at (3.4,-130) {$\mathrm R(1..7)$: $30$ pulls};
\draw[hcsteal,line width=1pt,->] (7,-110)--(14.3,-110);
\node[hcsteal,below] at (10.6,-130) {$\mathrm F(8..14)$: $30$ pushes};
\node[below] at (7,-290) {one product of a $784\times30$ and a $30\times784$ matrix};
\end{tikzpicture}
\caption{The interface dimensions of the fourteen links of the deep autoencoder and the plan of least cost for its Jacobian: reverse on
the encoder, forward on the decoder (\cref{thm:plans}(iv)).}\label{fig:plan}
\end{figure}
\begin{table}[t]\centering\footnotesize\setlength{\tabcolsep}{3.6pt}
\begin{tabular}{@{}lrrrllllrrr@{}}\toprule
& \multicolumn{3}{c}{dimensions} & & \multicolumn{3}{c}{cost in the model} & \multicolumn{3}{c}{milliseconds}\\
specification & $d_0$ & least & $d_n$ & least-cost plan & $\mathrm F$ & $\mathrm R$ & plan & $\mathrm F$ & $\mathrm R$ & plan\\\midrule
\dpJacRows
\bottomrule
\end{tabular}
\caption{Accumulation of the Jacobian of the denotation in its input, for one example (two for ResNet-20, whose normalisation couples the
examples; an input of $2\times512$ for the Transformer layer). The three plans agree to rounding where they are evaluated; the forward plan of
ResNet-20 is not evaluated.}\label{tab:jac}
\end{table}
\begin{table}[t]\centering\footnotesize\setlength{\tabcolsep}{4pt}
\begin{tabular}{@{}p{5.9cm}rrrrrr@{}}\toprule
milliseconds & linear & LeNet-300 & LeNet-5 & ResNet-20 & Transf. & autoenc.\\\midrule
\dpModeRows
\midrule
\dpPairRow
\dpSharpRow
\bottomrule
\end{tabular}
\caption{Composites of the two modes, medians of five evaluations on two processor cores, with the batches of \cref{tab:train} and $32$
examples for the autoencoder. The Gauss--Newton direction has $K=10$ iterations.}\label{tab:modes}
\end{table}
The package contains the linearisation fold, the dynamic programme of \cref{thm:plans}(ii), the evaluation of plans, the Gauss--Newton
direction as a third backward algebra of the step, selected at run time like the others, and both composites for the Hessian-vector
product. A sixth specification is used here, the deep autoencoder $784$-$1000$-$500$-$250$-$30$ and back of \cite{HintonSalakhutdinov}, with the
activation of the signature and a linear code layer; its bottleneck has the symmetry $\GL_{30}$ of the third pattern.
Three measurements (\cref{tab:jac,tab:modes}). First, for the autoencoder the plan of least cost is the mixed plan of \cref{fig:plan}; in the
model the factor over the pure plans is $21$ and the measured factor is about ten, the matrix product being cheaper per multiplication than
a sweep. For the classifiers the plan is the reverse sweep, and the forward sweep is slower by factors of about ten and fifty for the two LeNets; for the
Transformer layer, of constant width, there is no difference in the model or in the measurement. Second, the step with branches selected at run time,
in which the gauge move, its inverse and the substituted transpose are evaluated only when their weights are positive, is $1.3$ to $5.3$
times faster than the step of \cref{tab:train}, in which they were always evaluated; the values are equal to rounding. Third, two
choices are not separated by the model. The Gauss--Newton direction on one linearisation and the same iteration with both folds inside it
take the same time within ten percent: the evaluations of the denotation inside the iteration do not depend on the iterate. The two
composites for the Hessian-vector product differ by up to a factor $1.6$, in either direction, and the choice between them is made by
measurement (\texttt{tune}).
The Gauss--Newton direction pairs with the generators at rounding level, as in \cref{prop:gn}(iii). For \cref{prop:gn}(iv), on batches of
four with $400$ iterations and damping $10^{-10}$ of the largest eigenvalue, the defect of $H_\ell Jd$ between $\theta$ and a random $g\theta$ is \dpVelGN\ for
the deep linear network and LeNet-300-100, against \dpVelGrad\ for the gradient in place of $d$. One step of length one in this direction
reduces the loss of the five specifications without batch normalisation and increases that of ResNet-20 at the damping used.
\emph{Sources.} Parametrised maps and their $2$-cells are those of \cite{FongSpivakTuyeras,Cruttwell}, the two modes of
differentiation as homomorphisms are in \cite{Elliott,RDC}, and forward mode as the unique structure-preserving macro, with semantics in
diffeological spaces, is in \cite{HuotStatonVakar}. The symmetries of \cref{tab:patterns} are known separately
\cite{Kunin,ZhaoSurvey,DuHuLee}. They are combined here with \cref{sec:dc}: the symmetries are the $2$-cells of the free construction, a
backward pass is a position with respect to the atlas they define, and the configurations are one family of algebras over the same terms.
The accumulation of Jacobians by mixed plans and its complexity are in \cite{GriewankWalther,Naumann}, the Hessian-vector product by
composition of the modes in \cite{Pearlmutter}, and the Gauss--Newton direction by conjugate gradients in \cite{Martens}; parts (iii) and (iv)
of \cref{prop:gn} relate it to the symmetries.
\exercisesheading
\begin{exercise}[label=exo:term]{1}
Write LeNet-300-100 as a term, compute its type and its number of parameters, and give the normal form of
\[(\texttt{Flatten}\,;(\texttt{Dense}(300)\,;\texttt{Id}))\,;((\texttt{Act}\,;\texttt{Dense}(100))\,;(\texttt{Act}\,;\texttt{Dense}(10))).\]
\end{exercise}
\begin{solution}
The term is $\texttt{Flatten}\,;\texttt{Dense}(300)\,;\texttt{Act}\,;\texttt{Dense}(100)\,;\texttt{Act}\,;\texttt{Dense}(10)$, from the type $((1,28,28))$ to $((10))$, through the shapes
$(784)$, $(300)$, $(300)$, $(100)$, $(100)$. The parameter blocks have $784\cdot300+300$, $300\cdot100+100$ and $100\cdot10+10$ entries, in total $266\,610$. The given
term differs from it by the associativity and unit laws, so its normal form is the flat composition above, with the same three blocks in
the same order.
\end{solution}
\begin{exercise}[label=exo:residual]{2}
Compute the tangent and the transpose of the residual block $\mathrm{Res}(t,\texttt{Id})$ from those of $t$.
\end{exercise}
\begin{solution}
$\sem{\mathrm{Res}(t,\texttt{Id})}(\theta,x)=\sem t(\theta,x)+x$. The tangent fold gives $(\dot\theta,\dot x)\mapsto T\sem t(\dot\theta,\dot x)+\dot x$: the pair is copied by the diagonal and the tangents are added by the sum. In
the transpose the order is reversed and the two structural generators are exchanged (\cref{thm:ad}(ii)): a cotangent $\bar y$ is copied by the
transpose of the sum, the two copies are transported by $\sem t^*$ and by the identity, and the results are added by the transpose of the diagonal:
$\bar\theta=\sem t^*_\Theta(\bar y)$ and $\bar x=\sem t^*_A(\bar y)+\bar y$.
\end{solution}
\begin{exercise}[label=exo:act-homogeneous]{2}
For the term $\texttt{Dense}(k)\,;\texttt{Act}\,;\texttt{Dense}(m)$ verify the invariance of \cref{thm:sym-fold}(i) directly, and show that it fails when
\texttt{Act} is replaced by $x\mapsto\log(1+e^x)$.
\end{exercise}
\begin{solution}
$y=\phi(xW_1+b_1)W_2+b_2$ with $\phi(z)=\max(z,\alpha z)$ applied to each coordinate. For a positive diagonal matrix $s$, $\phi(zs)=\phi(z)s$, so
$\phi(xW_1s+b_1s)\,s^{-1}W_2=\phi(xW_1+b_1)W_2$. For $\phi=\log(1+e^z)$ and one hidden unit with $x=0$, $b_1=0$: $\phi(0)=\log2$ before and after the rescaling, and the output
changes from $w_2\log2$ to $s^{-1}w_2\log2$. No positively homogeneous function of degree one on $\R$ other than $\max(c_+z,c_-z)$ and $\min(c_+z,c_-z)$ exists, and it
is smooth only when it is linear: the symmetry and the locus of non-differentiability come together.
\end{solution}
\begin{exercise}[label=exo:plan-small]{2}
A chain has two links of cost $10^4$ each and dimensions $(d_0,d_1,d_2)=(1000,10,1000)$. Compute the costs of the three plans for its Jacobian
with $\mu=1$, and of the product of the Jacobian with five vectors.
\end{exercise}
\begin{solution}
$\mathrm F(0,2]$ costs $1000\cdot2\cdot10^4=2\cdot10^7$ and $\mathrm R(0,2]$ the same. The mixed plan $\mathrm F(1,2]\cdot\mathrm R(0,1]$ costs $10\cdot10^4+10\cdot10^4+1000\cdot10\cdot1000=1.02\cdot10^7$, of which the matrix product is all
but two percent: the sweeps are cheaper by a factor $100$, and the product is the remaining cost. For five vectors the forward sweep costs
$5\cdot2\cdot10^4=10^5$ and no Jacobian is formed: with seeds of small rank at one end the pure sweep from that end is optimal, as in
\cref{thm:plans}(iii).
\end{solution}
\begin{exercise}[label=exo:scaleinv]{3}
Let $L(W)$ be invariant under $W\mapsto sW$, $s>0$. Prove that $\nabla L(sW)=s^{-1}\nabla L(W)$ and $\langle W,\nabla L(W)\rangle=0$, that a step of gradient descent increases $\abs W^2$ by
$h^2\abs{\nabla L}^2$, and that the step of \cref{thm:step}(c) is $W^+=W-h\,\abs W^2\,\nabla L(W)$.
\end{exercise}
\begin{solution}
Differentiating $L(sW)=L(W)$ in $W$ gives $s\,\nabla L(sW)=\nabla L(W)$, and in $s$ at $s=1$ gives $\langle W,\nabla L(W)\rangle=0$, which is \cref{thm:dc-positions}(a) for the generator
$A=\id$. Then $\abs{W-h\nabla L}^2=\abs W^2+h^2\abs{\nabla L}^2$, the drift of \cref{thm:sym-fold}(ii) for $Q=\tfrac12\abs W^2$. The balancing element is $b=1/\abs W$, the point on the
slice is $W/\abs W$, the Euclidean step there is $W/\abs W-h\,\nabla L(W/\abs W)=W/\abs W-h\abs W\,\nabla L(W)$, and its transport by $b^{-1}=\abs W$ is $W-h\abs W^2\nabla L(W)$. This is the gradient
step for the invariant metric $\abs{\dd W}^2/\abs W^2$.
\end{solution}
\begin{exercise}[label=exo:geomean]{3}
For $M_1\in\R^{m\times k}$ and $M_2\in\R^{k\times n}$ of rank $k$, let $A=M_1\transp M_1$ and $B=M_2M_2\transp$. Prove that there is a unique symmetric positive definite $g$ such
that $(M_1g,\,g^{-1}M_2)$ is balanced, and that $g^2=A^{-1/2}\bigl(A^{1/2}BA^{1/2}\bigr)^{1/2}A^{-1/2}$.
\end{exercise}
\begin{solution}
The pair $(M_1g,g^{-1}M_2)$ is balanced when $gAg=g^{-1}Bg^{-1}$, that is, $PAP=B$ with $P=g^2$. Put $Y=A^{1/2}PA^{1/2}$; then $PAP=B$ is $Y^2=A^{1/2}BA^{1/2}$. The right-hand
side is symmetric positive definite and has a unique symmetric positive definite square root, so $Y$ and $P=A^{-1/2}YA^{-1/2}$ are determined, and $g$ is the
positive square root of $P$. The matrix $P$ is the geometric mean of $A^{-1}$ and $B$. This is the balancing element used by the compiler for the third
pattern, and the uniqueness is the hypothesis of \cref{thm:step}(c) for $K_t=\Ort(k)$.
\end{solution}
\begin{exercise}[label=exo:fa-drift]{4}
Let $u$ be an update direction with $a_A(u)=\langle A\theta,u\rangle\neq0$ for a symmetric generator $A$ at some point of a trajectory. Prove that over a fixed training time
the drift of $Q_A$ under $\theta^+=\theta-hu$ does not tend to $0$ with $h$ in general, and that it is $O(h)$ after projection, as in \cref{tab:drift}.
\end{exercise}
\begin{solution}
One step changes $Q_A$ by $-h\,a_A(u)+\tfrac{h^2}2\langle u,Au\rangle$. Over $n=T/h$ steps the first terms sum to $-h\sum_ia_A(u_i)$, a Riemann sum for $-\int_0^Ta_A(u(\theta(s)))\,\dd s$ along the
limiting trajectory $\dot\theta=-u(\theta)$, which is non-zero unless the integral vanishes; this is the ratio $1$ of the table. After projection $a_A(u')=0$ at every
step by \cref{thm:step}(a), and the drift is $\tfrac{h^2}2\sum_i\langle u'_i,Au'_i\rangle\le\tfrac h2\,T\,\lVert A\rVert\,\sup\abs{u'}^2$, of order $h$: the ratio $2$. For the transpose $u=\nabla L$ lies in $H_t$ without
projection (\cref{thm:sym-fold}(ii)), with the same bound.
\end{solution}
\begin{exercise}[label=exo:equivariance]{4}
Prove \cref{thm:step}(c) for a single \texttt{Dense}\,;\texttt{Dense} pair without the hypothesis on the slice, by proving the hypothesis.
\end{exercise}
\begin{solution}
Let $\theta=(M_1,M_2)$ of rank $k$ and $h\cdot\theta=(M_1h,h^{-1}M_2)$ for $h\in\GL_k$. The balanced points of the orbit are the points $(M_1g,g^{-1}M_2)$ with $g\transp(M_1\transp M_1)g=g^{-1}(M_2M_2\transp)g^{-\mathsf T}$. If $g$ is
a solution then so is $gk$ for $k\in\Ort(k)$, and by the polar decomposition $g=pk$ every solution is of this form with $p$ symmetric positive
definite, which is unique by \cref{exo:geomean}. So the slice intersects the orbit in one orbit of $K_t=\Ort(k)$, which is the hypothesis. For $h\in\GL_k$
the balancing element of $h\cdot\theta$ is the symmetric positive definite $p'$ with $hp'=b(\theta)k$ for some $k\in\Ort(k)$, by the same uniqueness applied to the orbit,
so $\beta(h\cdot\theta)$ is the image of $\beta(\theta)$ under the element $k$ of $K_t$, the stabilisers are trivial because $M_1$ has rank $k$, and the computation in the proof
of \cref{thm:step} applies. The Euclidean step commutes with $\Ort(k)$
because the action of $\Ort(k)$ on pairs is orthogonal and the loss is invariant.
\end{solution}
\begin{exercise}[label=exo:gn-horizontal]{4}
Prove that the direction of a damped Newton iteration, $(\nabla^2L+\lambda)\,d=\nabla L$ solved by conjugate gradients, is not a section of $H_t$ in general, in
contrast with \cref{prop:gn}(iii).
\end{exercise}
\begin{solution}
Differentiating $\langle\nabla L(\theta),A\theta\rangle=0$ in the direction $u$ gives $\langle\nabla^2L\,u,A\theta\rangle+\langle\nabla L,Au\rangle=0$, so $\nabla^2L\,(A\theta)=-A\transp\nabla L$ for every generator $A$: the Hessian maps the vertical
vector $A\theta$ to $-A\transp\nabla L$, which vanishes only when $A\transp\nabla L=0$. So the vertical space is not invariant under
$\nabla^2L+\lambda$, its orthogonal complement is not invariant either, and the second iterate, a combination of $\nabla L$ and $\nabla^2L\,\nabla L$, pairs with $A\theta$ through
$\langle\nabla^2L\,\nabla L,A\theta\rangle=-\langle\nabla L,A\nabla L\rangle$. For the rescaling generator this is $\abs{\nabla_{\mathrm{out}}L}^2-\abs{\nabla_{\mathrm{in}}L}^2$, the drift coefficient of \cref{thm:sym-fold}(ii), non-zero in general. The
Gauss--Newton operator differs from the Hessian by the term in the second derivative of the denotation, and it is that term that does not
vanish on vertical vectors.
\end{solution}
\chapter{Coda}\label{ch:coda}
\section{The argument in one page}
A closed $2$-form on a diffeological space is a map to the sheaf $\Omcl$, and the symplectic diffeology of \cite{IZ} is the study of the
slice over that sheaf (\cref{prop:slice}). The moment map of \cite{IZ} is defined for every group of automorphisms by transgression along
orbits (\cref{thm:paths-moment,thm:moment}); for an invariant primitive it is the component along the group of the difference of the two
pullbacks to $G\times X$, that is, the obstruction to descent to the homotopy quotient (\cref{prop:basic}). A homogeneous space is fibred by its
moment map over a coadjoint orbit, whose diffeology is a coimage (\cref{thm:homogeneous,rem:coimage}), and non-degeneracy is the
injectivity of the universal moment map (\cref{thm:coadjoint}).
One level up, $\Omcl$ is replaced by the stack $\BTc$ of bundles with connection for a torus of periods. The same three statements hold with the
connection form $\lambda$ in the place of the primitive: the moment map is the pullback of $\lambda$ along orbits and is equivariant (\cref{thm:A}); it
vanishes exactly when the bundle descends to $X\hquot G$ (\cref{thm:B}); and on the zero level of a principal action everything descends to
the quotient (\cref{thm:reduction}). The proofs use one lemma, on $1$-forms on a product (\cref{lem:slices}), and the description of
principal actions of \VolI{Theorem~7.2}. No dimension, regularity or compactness enters, and the structure group may be an irrational torus
(\cref{thm:S2S2}).
The applications use these statements at three levels of generality. For quasi-tori everything is explicit, and the invariants are
arithmetic: ideals as groups of periods, Hilbert modular groups, Heisenberg quasi-nilmanifolds, the Weil pairing as a commutator
(\cref{thm:steinitz,thm:heis-prequantum,thm:theta,thm:isotropic}). For manifolds with symmetry the statements are conservation laws and
their discrete and reduced forms (\cref{thm:noether,thm:two-noether,thm:discrete-noether,thm:reachable}). And for composition the relevant
fact is the existence of fibre products and quotients in $\Diff$ (\cref{thm:corr,thm:modular}). In each chapter the content is concentrated in one example whose quotient
is not a manifold: the torus of periods $\R/\fa\fb$, the prequantum bundle $(S^3\times S^3)/\R$, the parameter quotient
$\Theta/\GL_k$, the leaf space of the two-body system, the composite of non-transverse relations.
What these have in common is stated in \cref{ch:structure}. An objective on a quotient is a Lagrangian submanifold of the zero level of a moment map
(\cref{thm:lagrangian}); a dynamics on an atlas of the quotient is defined by a metric, whose exact part gives the conserved quantities and whose
non-closed part gives the phases (\cref{thm:metric-connection}); and the uses of a symmetry in optimisation are four positions with respect to
the quotient map (\cref{thm:positions}, \cref{sec:acceleration}). The part that uses no metric holds for every atlas in an $\infty$-topos and, for the
syntax of a theory, is the theory of normal forms (\cref{prop:atlas,thm:normal-forms}). In a differentially cohesive $\infty$-topos the atlas of
a quotient is the composite of the quotient by a formal group, in which the tangent directions, the connection and the conserved quantities
are located, and a formally \'etale map; the four positions hold there for every group object acting on a Riemannian manifold
(\cref{thm:dc-factorisation,thm:dc-positions}). The terms of an architecture are an initial algebra whose homomorphisms are the
denotation, the two modes of differentiation and the symmetries; they are realised by a compiler to JAX, with the positions as run-time
configurations of one optimizer (\cref{thm:compile,thm:ad,thm:sym-fold,thm:step}). Composites of the two modes are evaluated by plans of
least cost, and the Gauss--Newton direction is a section of the connection (\cref{thm:plans,prop:gn}).
\begin{figure}[t]
\centering
\begin{tikzpicture}[font=\small]
\node[hcsnode,align=center] (a) at (0,0) {closed $2$-form\\ $\omega\colon X\to\Omcl$};
\node[hcsnode,align=center] (b) at (4.9,0) {prequantisation\\ $\nabla\colon X\to\BTc$};
\node[hcsnodeb,align=center] (c) at (10.0,0) {equivariant $(Y,\lambda)$\\ $\mu=\hat y^*\lambda$ \ (A)};
\node[hcsnodeb,align=center] (d) at (10.0,-1.9) {$\mu=0$:\\ $X\hquot G\to\BTc$ \ (B)};
\node[hcsnoder,align=center] (e) at (4.9,-1.9) {principal on $\mu^{-1}(0)$:\\ $(X_0,\omega_0,Y_0,\lambda_0)$ \ (C)};
\node[hcsnoder,align=center] (f) at (0,-1.9) {compose, reduce\\ in stages};
\draw[->] (a)--node[above,font=\scriptsize]{periods in $P$}(b);
\draw[->] (b)--node[above,font=\scriptsize]{lift of $G$}(c);
\draw[->] (c)--node[right,font=\scriptsize]{level set}(d);
\draw[->] (d)--(e);
\draw[->] (e)--(f);
\end{tikzpicture}
\caption{The sequence of structures of Part~II and the three theorems.}\label{fig:summary}
\end{figure}
\section{Open questions}
\begin{enumerate}[label=\arabic*.]
\item \emph{Prequantisation of non-simply-connected spaces.} \Cref{thm:integration2} assumes $\pi_1(X)=0$, and the general case is left open in
\IZ{art.~8.42}. \Cref{thm:heis-prequantum} is an example with $\pi_1=\Z^{2d}$. Determine the set of lifts of $\omega\colon X\to\Omcl$ to $\BTc$ for a
diffeological space $X$ in terms of $P_\omega$, the toric periods and $\Hom(\pi_1(X),T_P)$.
\item \emph{Quantisation without line bundles.} By \cref{prop:characters} a torus of periods with dense $P$ has no unitary character. Which
representations of $T_P$ on diffeological vector spaces produce a space of sections of a prequantum $T_P$-bundle on which $\Aut(Y,\lambda)$ acts
and which for cyclic $P$ is the classical prequantum Hilbert space?
\item \emph{Symplectic spaces that are not homogeneous.} Transitivity of $\Dif(X,\omega)$ is required in \cref{def:symplectic} and fails for the cone
orbifold. Formulate non-degeneracy for orbifolds and quasifolds so that the reduced spaces of \cref{cor:orbifold-reduction} satisfy it.
\item \emph{Shifted structures.} The pair $(Z\hquot G,\omega|_Z)$ of \cref{thm:stack-reduction} is a stack with a closed $2$-form. Compare it with the
$0$-shifted symplectic structure on the corresponding derived quotient, and extend \cref{thm:A,thm:B} to bundle gerbes with connection and
closed $3$-forms.
\item \emph{Theta functions for real multiplication.} The pairing $e_n$ of \cref{thm:heis-prequantum} has values in $\OK/n$. Construct the
representation of the group $G_n$ that corresponds to the space of theta functions of level $n$, and relate it to the real multiplication
programme of \cite{Manin}.
\item \emph{Stochastic dynamics.} \Cref{thm:two-noether}(c) gives the drift of the gradient-flow invariants for full-batch descent. Compute
the stationary distribution of $Q$ under stochastic gradient descent in terms of the covariance of the gradient noise restricted to the
directions $A\nabla L$.
\item \emph{Diophantine controllability.} For the system of \cref{thm:beanie} the cost of approximate control is governed by the continued
fraction of the inertia ratio. Classify the mechanical systems with flat mechanical connection whose leaf space is a quasifold, and bound
the control cost by the Diophantine type of the holonomy group.
\item \emph{Metrics on tangent stacks.} In \cref{thm:dc-positions} the parameter space is a Riemannian manifold, and the cometric of
\cref{thm:positions}(a) is defined on $\Theta\times_XTX$ for a locally free action. Define it for the complex $\fg\times\Theta\to T\Theta$ of \cref{prop:dc-relative} when the rank of the
infinitesimal action varies and when $\Theta$ is a microlinear object in place of a manifold, prove the statement of Kempf and Ness for the level
set $Q^{-1}(0)$ in that generality, and determine which syntactic sites have an object $D$ that satisfies \textup{(DC2)}, so that the quantitative
statements of \cref{sec:acceleration} have analogues for inductive theories.
\item \emph{Programs with recursion and higher order.} The signature of \cref{def:signature} is first-order and has no iteration. Extend
\cref{thm:sym-fold,thm:step} to terms with weight sharing, iteration and recursion, where a parameter block occurs several times and the
symmetry group of a composite is smaller than the product of those of its factors, and to the higher-order language of
\cite{HuotStatonVakar}, with $2$-cells in the gluing construction.
\end{enumerate}
\section{Formalisation}
The statements of this volume fall into the three strata of \VolI{Chapter~14}, by the infrastructure required (\cref{tab:formal2}). Stratum
A requires sets, plots, real analysis and linear algebra. Stratum B requires sheaves and stacks on the site of Cartesian spaces. Stratum C
requires the $\infty$-topos $\Hh$, and in practice the cohesive homotopy type theory of \cite{Shulman}, in which the homotopy quotient and the
classifying types are primitive; \cref{sec:dc} requires in addition a modality $\Im$ with the properties of \cref{def:dc}, and the theory of
formally \'etale maps for a modality is developed in homotopy type theory in \cite{CherubiniRijke}.
\begin{table}[h]\centering\small
\begin{tabular}{@{}p{1.6cm}p{4.3cm}p{7.2cm}@{}}\toprule
stratum & requires & statements\\\midrule
A & plots, forms, linear algebra & \cref{lem:slices,prop:forms-quasitori,thm:exact,prop:dual-torus}; \cref{thm:A,thm:reduction,thm:stages};
\cref{thm:symp-rigidity,thm:steinitz,thm:heis-prequantum}; \cref{thm:theta,thm:isotropic,thm:gso}; \cref{thm:two-noether,thm:balanced,thm:discrete-noether};
\cref{prop:rate,prop:induced,prop:weight-decay,prop:horizontal}; \cref{thm:beanie,thm:lagrel,thm:pH,thm:modular};
\cref{thm:lagrangian,thm:metric-connection,thm:positions,prop:folds,thm:normal-forms}; \cref{thm:compile,thm:ad,thm:sym-fold,thm:step,thm:plans,prop:gn}\\
B & sheaves, stacks on $\Cart$ & \cref{prop:slice,prop:basic,prop:BTconn,thm:KS,thm:corr}\\
C & $\Hh$, homotopy quotients, the modality $\Im$ & \cref{thm:B,thm:stack-reduction,prop:atlas}; the shape statement of \cref{thm:S2S2};
\cref{lem:dc,prop:dc-atlas,thm:dc-factorisation,prop:dc-relative,thm:dc-positions,prop:dc-conserved,prop:dc-sections}\\\bottomrule
\end{tabular}
\caption{Strata for formalisation. The quoted theorems that would be assumed or formalised separately are \cref{thm:K,thm:moment,thm:homogeneous,thm:coadjoint}
from \cite{IZ}, \cref{thm:integration2,thm:KW,thm:galois-logic}, Steinitz's theorem, and the theorem of Richardson and Slodowy.}\label{tab:formal2}
\end{table}
Most of the volume lies in stratum A: \cref{thm:A,thm:reduction} are statements about plots and forms whose proofs are finite computations
with \cref{lem:slices}, and the application chapters are linear algebra over $\R$, over number rings and over finite fields. The
numerical claims of the examples are reproduced by \texttt{checks.py}, and the measurements of \cref{ch:programs} by the test-suite of the package \texttt{dprog}. In a
proof assistant the terms of \cref{def:signature} are an inductive type and the four folds are definitions by recursion, so that
\cref{thm:compile,thm:ad} are statements about a recursor and the compiler is a target of extraction.
\appendix
\chapter{A dictionary}\label{ch:dictionary}
In the first table the vocabulary of Chapters~7--9 of \cite{IZ} is set beside the categorical vocabulary used here; the book is cited by
article in the left column. Notation is listed in the second table.
{\small
\begin{longtable}{@{}p{4.9cm}p{5.6cm}p{2.9cm}@{}}
\toprule
\cite{IZ} & here & where\\\midrule\endhead
closed $2$-form (9.1) & map $X\to\Omcl$; object of $\SmSet/\Omcl$ & \cref{prop:slice}\\
$\Dif(X,\omega)$ (9.14) & automorphism group in the slice & \cref{prop:slice}\\
chain-homotopy operator $K$ (6.83) & transgression to $\Paths(X)$ & \cref{thm:K}\\
momenta $\Gs$ (7.12) & left-invariant maps $G\to\Om^1$ & \cref{def:momenta}\\
paths moment map $\Psi$ (9.1) & transgression of $\omega$ along $G\times[0,1]\to X$ & \cref{thm:paths-moment}\\
holonomy $\Gamma$ (9.7) & obstruction to a $\Gs$-valued moment map & \cref{thm:moment}\\
moment map, exact case (9.11) & component along $G$ of $a^*\alpha-\pr^*\alpha$ & \cref{prop:basic}\\
Souriau cocycle $\theta$ (9.10) & coadjoint action of the prequantum extension & \cref{ex:heis-extension}\\
$(\Gamma,\theta)$-coadjoint orbit (7.16, 9.18) & coimage of the affine orbit map & \cref{rem:coimage}\\
homogeneous symplectic space (9.19) & $\mu_\omega$ injective, $\Dif(X,\omega)$ transitive & \cref{def:symplectic}\\
torus $T=\R/\Gamma$, form $\theta$ (8.37) & torus of periods $T_P$ & \cref{def:connection}\\
connection form on a $T$-bundle (8.37) & map $X\to\BTc$ & \cref{prop:BTconn}\\
integration bundle (8.42) & lift of $\omega$ through $F\colon\BTc\to\Omcl$ & \cref{thm:integration2}\\
symplectic irrational torus (9.30) & $(T_\Gamma,\omega_\Omega)$; $X_{\fa,\fb}$ & \cref{thm:steinitz}\\
--- & equivariant prequantisation; $\mu=\hat y^*\lambda$ & \cref{thm:A}\\
--- & descent to $X\hquot G$ & \cref{thm:B}\\
--- & reduced space and bundle & \cref{thm:reduction}\\
\bottomrule
\end{longtable}}
\section*{Notation}
{\small
\begin{longtable}{@{}p{3.4cm}p{10.0cm}@{}}
\toprule
symbol & meaning\\\midrule\endhead
$\Diff$, $\SmSet$, $\Hh$ & diffeological spaces, sheaves on $\Cart$, smooth $\infty$-groupoids\\
$\Om^k$, $\Omcl$ & sheaf of $k$-forms; sheaf of closed $2$-forms\\
$\ParaSymp$, $\cat{Corr}$ & parasymplectic spaces with form-preserving maps; with isotropic correspondences\\
$X\times_\omega X'$, $\boxplus$, $\overline X$ & product over $\Omcl$; monoidal sum; opposite form\\
$\Gs$, $\Ad_*$ & momenta of $G$; coadjoint action\\
$\Psi$, $\psi$, $\mu$, $\theta$, $\sigma$ & paths, two-points and one-point moment maps; Souriau cocycle and class\\
$T_P=\R/P$, $\theta$ & torus of periods and its canonical $1$-form\\
$\BTc$, $F$ & stack of $T_P$-bundles with connection; curvature map\\
$(Y,\lambda)$, $\Aut(Y,\lambda)$ & prequantum bundle; its automorphism group\\
$\hat x$, $\hat y$, $\hat p$ & orbit maps of a point of $X$, of $Y$, of a path\\
$X\hquot G$, $X/G$ & homotopy quotient in $\Hh$; diffeological quotient\\
$Z$, $X_0$, $Y_0$ & zero level of $\mu$; reduced space; reduced bundle\\
$T_\Gamma$, $\omega_\Omega$ & quasi-torus $\R^n/\Gamma$; the form induced by a constant form $\Omega$\\
$X_{\fa,\fb}$, $\Heis_B$, $N_{\fa,\fb}$ & $\R/\fa\times\R/\fb$; Heisenberg group; its arithmetic subgroup\\
$\Lam^{\#}$, $e$, $e_N$ & symplectic dual lattice; commutator pairing; Weil pairing\\
$b_i^*$, $J$, $R_n$ & Gram--Schmidt vectors; antidiagonal symplectic matrix; reversal matrix\\
$\fk$, $\fpp$, $Q_A$, $\mu_A$ & antisymmetric and symmetric parts of $\fg$; gradient-flow invariant; momentum\\
$a_A$, $C_\theta$ & the $1$-form $\langle A\theta,\dd\theta\rangle$; the cometric induced on the quotient from a point of the fibre\\
$\Re$, $\Im$, $\&$; $D$, $T$ & reduction, infinitesimal shape and infinitesimal flat modalities; first-order infinitesimals; tangent functor $[D,-]$\\
$\hat X$, $\hat G$, $a$, $H$ & formal completion of a quotient along its atlas; formal group of $G$; infinitesimal action; its orthogonal complement\\
$W$, $F$, $\mathrm{nf}$ & terms of a signature; free algebra of a theory; a choice of normal forms\\
$\sem t$, $\sem t^*$, $G_t$, $U_c$ & denotation of a term; transposed tangent map; symmetries read off the term; step in the configuration $c$\\
\VolI{\dots}, \IZ{\dots} & references to Volume~I \cite{DHC} and to \cite{IZ}\\
\bottomrule
\end{longtable}}
\backmatter
\begin{thebibliography}{99}
\addcontentsline{toc}{chapter}{Bibliography}
\small
\bibitem{IZ} P. Iglesias-Zemmour, \emph{Diffeology}, Mathematical Surveys and Monographs 185, American Mathematical Society, Providence, 2013.
\bibitem{DHC} \emph{Diffeology in Higher Categories: concrete sheaves, cohesive shape, and stacks behind Iglesias-Zemmour's Diffeology}, Volume~I of this series, Higher Categorical Semantics, 2026.
\bibitem{AbrahamMarsden} R. Abraham and J. E. Marsden, \emph{Foundations of Mechanics}, 2nd ed., Benjamin/Cummings, 1978.
\bibitem{Absil} P.-A. Absil, R. Mahony and R. Sepulchre, \emph{Optimization Algorithms on Matrix Manifolds}, Princeton University Press, 2008.
\bibitem{Andreoli} J.-M. Andreoli, Logic programming with focusing proofs in linear logic, \emph{J. Logic Comput.} 2 (1992), 297--347.
\bibitem{Arora} S. Arora, N. Cohen and E. Hazan, On the optimization of deep networks: implicit acceleration by overparameterization, \emph{Proc. ICML} 2018, PMLR 80, 244--253.
\bibitem{AwodeyForssell} S. Awodey and H. Forssell, First-order logical duality, \emph{Ann. Pure Appl. Logic} 164 (2013), 319--348.
\bibitem{LayerNorm} J. L. Ba, J. R. Kiros and G. E. Hinton, Layer normalization, arXiv:1607.06450.
\bibitem{BaezFong} J. C. Baez and B. Fong, A compositional framework for passive linear networks, \emph{Theory Appl. Categ.} 33 (2018), 1158--1222.
\bibitem{Baydin} A. G. Baydin, B. A. Pearlmutter, D. Syme, F. Wood and P. Torr, Gradients without backpropagation, arXiv:2202.08587.
\bibitem{BengioSTE} Y. Bengio, N. L\'eonard and A. Courville, Estimating or propagating gradients through stochastic neurons for conditional computation, arXiv:1308.3432.
\bibitem{BergerSchwichtenberg} U. Berger and H. Schwichtenberg, An inverse of the evaluation functional for typed $\lambda$-calculus, in \emph{Proc. LICS} 1991, IEEE, 203--211.
\bibitem{BerwickEvansLerman} D. Berwick-Evans and E. Lerman, Lie 2-algebras of vector fields, \emph{Pacific J. Math.} 309 (2020), no.~1, doi:10.2140/pjm.2020.309.1; arXiv:1609.03944.
\bibitem{JAX} J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne and Q. Zhang, \emph{JAX: composable transformations of Python+NumPy programs}, software; version 0.12.1 is used here.
\bibitem{ButzMoerdijk} C. Butz and I. Moerdijk, Representing topoi by topological groupoids, \emph{J. Pure Appl. Algebra} 130 (1998), 223--235.
\bibitem{Caramello} O. Caramello, \emph{Theories, Sites, Toposes}, Oxford University Press, 2017.
\bibitem{CastryckDecru} W. Castryck and T. Decru, An efficient key recovery attack on SIDH, in \emph{EUROCRYPT 2023}, LNCS 14008, Springer, 2023, 423--447.
\bibitem{CSIDH} W. Castryck, T. Lange, C. Martindale, L. Panny and J. Renes, CSIDH: an efficient post-quantum commutative group action, in \emph{ASIACRYPT 2018}, LNCS 11274, Springer, 2018, 395--427.
\bibitem{Cervera} J. Cervera, A. J. van der Schaft and A. Ba\~nos, Interconnection of port-Hamiltonian systems and composition of Dirac structures, \emph{Automatica} 43 (2007), 212--225.
\bibitem{CherubiniRijke} F. Cherubini and E. Rijke, Modal descent, \emph{Math. Structures Comput. Sci.} 31 (2021), 363--391; arXiv:2003.09713.
\bibitem{RDC} R. Cockett, G. Cruttwell, J. Gallagher, J.-S. P. Lemay, B. MacAdam, G. Plotkin and D. Pronk, Reverse derivative categories, arXiv:1910.07065.
\bibitem{Cooper} G. J. Cooper, Stability of Runge--Kutta methods for trajectory problems, \emph{IMA J. Numer. Anal.} 7 (1987), 1--13.
\bibitem{Cruttwell} G. S. H. Cruttwell, B. Gavranovi\'c, N. Ghani, P. Wilson and F. Zanasi, Categorical foundations of gradient-based learning, arXiv:2103.01931.
\bibitem{DuHuLee} S. S. Du, W. Hu and J. D. Lee, Algorithmic regularization in learning deep homogeneous models: layers are automatically balanced, in \emph{Advances in Neural Information Processing Systems} 31 (2018).
\bibitem{Dubuc79} E. J. Dubuc, Sur les mod\`eles de la g\'eom\'etrie diff\'erentielle synth\'etique, \emph{Cahiers Topologie G\'eom. Diff\'erentielle} 20 (1979), 231--279; numdam:CTGDC\_1979\_\_20\_3\_231\_0.
\bibitem{Elliott} C. Elliott, The simple essence of automatic differentiation, arXiv:1804.00746.
\bibitem{FRS2} D. Fiorenza, C. L. Rogers and U. Schreiber, $L_\infty$-algebras of local observables from higher prequantum bundles, \emph{Homology Homotopy Appl.} 16 (2014), 107--142.
\bibitem{FRS1} D. Fiorenza, C. L. Rogers and U. Schreiber, Higher $U(1)$-gerbe connections in geometric prequantization, \emph{Rev. Math. Phys.} 28 (2016), 1650012.
\bibitem{FongSpivakTuyeras} B. Fong, D. I. Spivak and R. Tuy\'eras, Backprop as functor: a compositional perspective on supervised learning, arXiv:1711.10455.
\bibitem{Falcon} P.-A. Fouque, J. Hoffstein, P. Kirchner, V. Lyubashevsky, T. Pornin, T. Prest, T. Ricosset, G. Seiler, W. Whyte and Z. Zhang, \emph{Falcon: Fast-Fourier lattice-based compact signatures over NTRU}, specification v1.2, submission to the NIST post-quantum cryptography standardisation process, 2020.
\bibitem{GaitsgoryRozenblyum} D. Gaitsgory and N. Rozenblyum, \emph{A Study in Derived Algebraic Geometry, Volume II: Deformations, Lie Theory and Formal Geometry}, Mathematical Surveys and Monographs 221, American Mathematical Society, 2017.
\bibitem{GHN} N. Gama, N. Howgrave-Graham and P. Q. Nguyen, Symplectic lattice reduction and NTRU, in \emph{EUROCRYPT 2006}, LNCS 4004, Springer, 2006, 233--253.
\bibitem{Greydanus} S. Greydanus, M. Dzamba and J. Yosinski, Hamiltonian neural networks, in \emph{Advances in Neural Information Processing Systems} 32 (2019).
\bibitem{GriewankWalther} A. Griewank and A. Walther, \emph{Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation}, 2nd ed., SIAM, 2008.
\bibitem{GuilleminSternberg} V. Guillemin and S. Sternberg, Some problems in integral geometry and some related problems in micro-local analysis, \emph{Amer. J. Math.} 101 (1979), 915--955.
\bibitem{HardyWright} G. H. Hardy and E. M. Wright, \emph{An Introduction to the Theory of Numbers}, 6th ed., Oxford University Press, 2008.
\bibitem{LoRAplus} S. Hayou, N. Ghosh and B. Yu, LoRA+: efficient low rank adaptation of large models, in \emph{Proc. ICML} 2024.
\bibitem{ResNet} K. He, X. Zhang, S. Ren and J. Sun, Deep residual learning for image recognition, arXiv:1512.03385.
\bibitem{AdamP} B. Heo, S. Chun, S. J. Oh, D. Han, S. Yun, G. Kim, Y. Uh and J.-W. Ha, AdamP: slowing down the slowdown for momentum optimizers on scale-invariant weights, in \emph{Proc. ICLR} 2021.
\bibitem{Hepworth} R. Hepworth, Vector fields and flows on differentiable stacks, \emph{Theory Appl. Categ.} 22 (2009), 542--587; arXiv:0810.0979.
\bibitem{HintonSalakhutdinov} G. E. Hinton and R. R. Salakhutdinov, Reducing the dimensionality of data with neural networks, \emph{Science} 313 (2006), 504--507; doi:10.1126/science.1127647.
\bibitem{HuotStatonVakar} M. Huot, S. Staton and M. V\'ak\'ar, Correctness of automatic differentiation via diffeologies and categorical gluing, arXiv:2001.02209.
\bibitem{IZred} P. Iglesias-Zemmour, Example of singular reduction in symplectic diffeology, \emph{Proc. Amer. Math. Soc.} 144 (2016), 1309--1324.
\bibitem{IZmoment} P. Iglesias-Zemmour, The moment maps in diffeology, \emph{Mem. Amer. Math. Soc.} 207 (2010), no.~972.
\bibitem{BatchNorm} S. Ioffe and C. Szegedy, Batch normalization: accelerating deep network training by reducing internal covariate shift, arXiv:1502.03167.
\bibitem{JeffreysLau} G. Jeffreys and S.-C. Lau, K\"ahler geometry of quiver varieties and machine learning, preprint.
\bibitem{JoyalTierney} A. Joyal and M. Tierney, An extension of the Galois theory of Grothendieck, \emph{Mem. Amer. Math. Soc.} 51 (1984), no.~309.
\bibitem{KarshonWatts} Y. Karshon and J. Watts, Basic forms and orbit spaces: a diffeological approach, \emph{SIGMA} 12 (2016), 026.
\bibitem{KempfNess} G. Kempf and L. Ness, The length of vectors in representation spaces, in \emph{Algebraic Geometry (Copenhagen 1978)}, Lecture Notes in Math. 732, Springer, 1979, 233--243.
\bibitem{KhavkineSchreiber} I. Khavkine and U. Schreiber, Synthetic geometry of differential equations: I. Jets and comonad structure, arXiv:1701.06238.
\bibitem{KlajborGoderich} S. Klajbor-Goderich, Nonlinear stability of relative equilibria and isomorphic vector fields, \emph{SIGMA} 14 (2018), 021; arXiv:1707.02828.
\bibitem{Kock} A. Kock, \emph{Synthetic Differential Geometry}, 2nd ed., London Mathematical Society Lecture Note Series 333, Cambridge University Press, 2006; doi:10.1017/CBO9780511550812.
\bibitem{Kostant} B. Kostant, Quantization and unitary representations, in \emph{Lectures in Modern Analysis and Applications III}, Lecture Notes in Math. 170, Springer, 1970, 87--208.
\bibitem{Kunin} D. Kunin, J. Sagastuy-Brena, S. Ganguli, D. L. K. Yamins and H. Tanaka, Neural mechanics: symmetry and broken conservation laws in deep learning dynamics, in \emph{Proc. ICLR} 2021.
\bibitem{vanLaarhoven} T. van Laarhoven, L2 regularization versus batch and weight normalization, preprint, arXiv:1706.05350.
\bibitem{LeCun98} Y. LeCun, L. Bottou, Y. Bengio and P. Haffner, Gradient-based learning applied to document recognition, \emph{Proc. IEEE} 86 (1998), 2278--2324.
\bibitem{Lillicrap} T. P. Lillicrap, D. Cownden, D. B. Tweed and C. J. Akerman, Random feedback weights support learning in deep neural networks, arXiv:1411.0247.
\bibitem{LindseyMenon} K. Lindsey and G. Menon, Regularization implies balancedness in the deep linear network, preprint, arXiv:2511.01137.
\bibitem{LopezEscobar} E. G. K. Lopez-Escobar, An interpolation theorem for denumerably long formulas, \emph{Fund. Math.} 57 (1965), 253--272.
\bibitem{HTT} J. Lurie, \emph{Higher Topos Theory}, Annals of Mathematics Studies 170, Princeton University Press, 2009.
\bibitem{MainoMartindale} L. Maino, C. Martindale, L. Panny, G. Pope and B. Wesolowski, A direct key recovery attack on SIDH, in \emph{EUROCRYPT 2023}, LNCS 14008, Springer, 2023, 448--471.
\bibitem{Manin} Yu. I. Manin, Real multiplication and noncommutative geometry, in \emph{The Legacy of Niels Henrik Abel}, Springer, 2004, 685--727.
\bibitem{Marcotte} S. Marcotte, R. Gribonval and G. Peyr\'e, Abide by the law and follow the flow: conservation laws for gradient flows, in \emph{Advances in Neural Information Processing Systems} 36 (2023); arXiv:2307.00144.
\bibitem{MarsdenWeinstein} J. E. Marsden and A. Weinstein, Reduction of symplectic manifolds with symmetry, \emph{Rep. Math. Phys.} 5 (1974), 121--130.
\bibitem{MMR} J. E. Marsden, R. Montgomery and T. Ratiu, Reduction, symmetry, and phases in mechanics, \emph{Mem. Amer. Math. Soc.} 88 (1990), no.~436.
\bibitem{Martens} J. Martens, Deep learning via Hessian-free optimization, in \emph{Proceedings of the 27th International Conference on Machine Learning}, 2010.
\bibitem{Milnor} J. Milnor, \emph{Introduction to Algebraic K-Theory}, Annals of Mathematics Studies 72, Princeton University Press, 1971.
\bibitem{Montgomery} R. Montgomery, Gauge theory of the falling cat, in \emph{Dynamics and Control of Mechanical Systems}, Fields Inst. Commun. 1, Amer. Math. Soc., 1993, 193--218.
\bibitem{Mumford} D. Mumford, On the equations defining abelian varieties I, \emph{Invent. Math.} 1 (1966), 287--354.
\bibitem{Naumann} U. Naumann, Optimal Jacobian accumulation is NP-complete, \emph{Math. Program.} 112 (2008), 427--441; doi:10.1007/s10107-006-0042-z.
\bibitem{Pearlmutter} B. A. Pearlmutter, Fast exact multiplication by the Hessian, \emph{Neural Comput.} 6 (1994), 147--160.
\bibitem{Pitts} A. M. Pitts, \emph{Nominal Sets: Names and Symmetry in Computer Science}, Cambridge University Press, 2013.
\bibitem{RichardsonSlodowy} R. W. Richardson and P. J. Slodowy, Minimum vectors for real reductive algebraic groups, \emph{J. London Math. Soc.} 42 (1990), 409--429.
\bibitem{Robert} D. Robert, Breaking SIDH in polynomial time, in \emph{EUROCRYPT 2023}, LNCS 14008, Springer, 2023, 472--503.
\bibitem{vdSJ} A. van der Schaft and D. Jeltsema, Port-Hamiltonian systems theory: an introductory overview, \emph{Found. Trends Syst. Control} 1 (2014), 173--378.
\bibitem{Schreiber} U. Schreiber, Differential cohomology in a cohesive $\infty$-topos, arXiv:1310.7930.
\bibitem{ShapereWilczek} A. Shapere and F. Wilczek, Geometry of self-propulsion at low Reynolds number, \emph{J. Fluid Mech.} 198 (1989), 557--585.
\bibitem{Shulman} M. Shulman, Brouwer's fixed-point theorem in real-cohesive homotopy type theory, \emph{Math. Structures Comput. Sci.} 28 (2018), 856--941.
\bibitem{Souriau} J.-M. Souriau, \emph{Structure des syst\`emes dynamiques}, Dunod, Paris, 1970.
\bibitem{TongMaChi} T. Tong, C. Ma and Y. Chi, Accelerating ill-conditioned low-rank matrix estimation via scaled gradient descent, \emph{J. Mach. Learn. Res.} 22 (2021), no.~150.
\bibitem{Vaswani} A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, {\L}. Kaiser and I. Polosukhin, Attention is all you need, arXiv:1706.03762.
\bibitem{Weinstein} A. Weinstein, The symplectic ``category'', in \emph{Differential Geometric Methods in Mathematical Physics}, Lecture Notes in Math. 905, Springer, 1982, 45--51.
\bibitem{egg} M. Willsey, C. Nandi, Y. R. Wang, O. Flatt, Z. Tatlock and P. Panchekha, egg: fast and extensible equality saturation, \emph{Proc. ACM Program. Lang.} 5 (2021), POPL, article 23.
\bibitem{ZhaoFlat} B. Zhao, I. Ganev, R. Walters, R. Yu and N. Dehmamy, Symmetries, flat minima, and the conserved quantities of gradient flow, in \emph{Proc. ICLR} 2023, arXiv:2210.17216.
\bibitem{ZhaoTeleport} B. Zhao, N. Dehmamy, R. Walters and R. Yu, Symmetry teleportation for accelerated optimization, in \emph{Advances in Neural Information Processing Systems} 35 (2022).
\bibitem{ZhaoSurvey} B. Zhao, R. Walters and R. Yu, Symmetry in neural network parameter spaces, preprint, arXiv:2506.13018.
\end{thebibliography}
\end{document}