Algebraic and Differential Topology in Machine Learning and AI: Obstructions, Invariants, and Counts
A neural network is a continuous map, usually piecewise linear, and the classical theorems of algebraic and differential topology say what continuous maps can and cannot do. This paper collects their consequences for learning systems under three headings and pairs each qualitative statement with a computed one. It is the companion of the volume Algebraic and Differential Topology in Higher Categories, a treatment of two monographs of L. S. Pontryagin, and it uses that volume's first part (homology, Sperner's lemma, the Lefschetz number) and its rotation groups.
Format. Two-column paper, 9 pages, 14 numbered statements with status tags (classical, literature, reformulation, observation), 9 figures, a summary table, 30 references, and a companion script with 25 computational checks.
The organizing idea
Topological statements about networks hold for every choice of weights, because they are statements about functors. An obstruction is a diagram that a functor forbids, an invariant is the functor's value, and a count is that value when it is an integer which the geometry must realize as a number of points. The simplest obstruction is the one behind Brouwer's theorem. A retraction $r$ of the ball onto its boundary would make the top row compose to the identity, and homology would then factor the identity of $\mathbb Z$ through zero:
$$\begin{CD} S^{n-1} @>>> D^n @>{r}>> S^{n-1} \\ @V{H_{n-1}}VV @V{H_{n-1}}VV @VV{H_{n-1}}V \\ \mathbb Z @>>> 0 @>>> \mathbb Z \end{CD}$$
The other obstructions in the paper have the same shape, with the fundamental group, the degree or the Euler characteristic in place of $H_{n-1}$.
Results: qualitative statement, then its quantitative form
| Topic | Qualitative | Quantitative (recomputed by the script) |
|---|---|---|
| Bottleneck | no continuous injective code of $S^n$ in $\mathbb R^n$ (Borsuk-Ulam) | worst-case reconstruction error at least $1$ for every encoder and decoder, attained by projection; collisions located for $200$ and $40$ random encoders |
| Rotations | no continuous quaternion or Euler-angle target on a non-contractible loop, since $\pi_1(\mathrm{SO}(3))=\mathbb Z/2$; a six-dimensional code is continuous | along a full turn in $2000$ steps: jumps $2.0000$ and $3.1416$ against steps of $0.004$; Gram-Schmidt decoder with Lipschitz constant at most $1.40$ |
| Meshes | no global frame field unless $\chi=0$; among spheres only for $n=1,3,7$ | index sums $2,2,0,1,0$ on five triangulated surfaces; the quaternion frame on $S^3$ orthonormal to $10^{-15}$ |
| Pieces | a closed curve of $N$ linear pieces winds fewer than $N/2$ times | $z\mapsto z^3$ sampled at $5,7,12$ points winds $-2,3,3$ times |
| Depth | composition multiplies degree | depth $L$ gives degree $2^L$ with $4\cdot2^L$ pieces for $L\le6$; one hidden layer needs more than $2^L-2$ units |
| Width | with an injective activation, $n$ units per layer cannot enclose a bounded region; $n+1$ rectifier units can | $30$ networks of depth four: both regions connected and unbounded; a three-unit island with value $1$ inside and at most $-2.46$ outside |
| Hodge diffusion | converges to real homology, and is blind to torsion | kernels equal to Betti numbers on six complexes; gap $1.5858$, $99$ layers for $10^{-11}$; projective plane and disc agree over $\mathbb R$ and differ over $\mathbb F_2$ |
| Rips complexes | spheres of higher dimension at large scales are artefacts of the construction | For twelve equally spaced points, $S^1$ occurs at scales one through three sample spacings, a wedge of three $S^2$ at four, and $S^5$ at five. |
| Persistence | diagrams are stable; the number of their points is not | bottleneck distance at most the perturbation in $60$ trials, with equality attained; the number of points changed in $35$ |
| Decision regions | small regions of the $n$-cube meet $n+1$ at a time (Lebesgue) | $13$ to $18$ triple points for prototype classifiers of the square; $143$ to $174$ quadruple points in the cube |
| Sperner walk | a fixed point is found by following a path | $13, 25, 50, 97$ steps on grids of side $16, 32, 64, 128$ |
| Attractors | fixed points have total index $1-d$ on a circle, $0$ on a torus, $2$ on a sphere | $5,7,6,9,8$ fixed points with index sums $3,1,0,-1,-2$ for $d=-2,0,1,2,3$; four zeros on a torus |
| Normalized outputs | the degree changes only when the output passes through zero | degree $1\to0$ at bias $1.2930$, where the smallest output norm is $10^{-4}$ |
| Odd networks | An odd network $\mathbb R^{n+1}\to\mathbb R^n$ has a zero on every origin-centred sphere. If all zeros of a smooth scalar output on a circle are simple, their number is $2$ modulo $4$. | A sign scan found $2$ crossings in $193$ of $200$ networks and $6$ in the other $7$. A bias of $10$ makes the last network's output positive. |
Reading the table
- Obstructions are worst-case statements. The bottleneck bound and the rotation jump concern the supremum of an error. The mean can be small; what the theorems exclude is the absence of a failure, which can only be moved and made thin.
- Coefficients are a choice of what is visible. A simplicial network built from real boundary matrices converges to harmonic forms, which carry the real homology and nothing else. Torsion, such as the $\mathbb Z/2$ of the projective plane, needs other coefficients, and integral homology needs integer row operations, which are not differentiable.
- Depth and width enter differently. Degree is multiplicative under composition and the number of linear pieces is only additive within a layer; this is depth separation with a homotopy invariant in place of an oscillation count. Width enters through invertibility: a layer that is a homeomorphism cannot change the topology of a decision region.
What is and is not claimed
No new theorem. The theorems are classical, and several of the applications are in the literature cited (the rotation codes, gauge-equivariant convolution, Hodge Laplacians, the Vietoris-Rips complexes of the circle, stability of persistence, narrow networks). The statements tagged observation or reformulation are elementary and may be in the literature in other words: the constant in the bottleneck bound, the piece count for winding, the depth statement for degree, and the remark on coefficients.
Limits. The data are idealized as exactly a sphere, a rotation group or a circle. The models are small and exact, with complexes of at most a few hundred simplices, and no trained network was examined. The narrow-network theorem is proved for activations that are homeomorphisms of the line; for the rectifier only a weaker cited statement survives. The complexity statement about Sperner walks is for fixed-point problems given by circuits. The second monograph of the source, on framed manifolds and the first stable stems, has no application here beyond the rotation groups, and none was forced.
Files
algebraic-and-differential-topology-in-machine-learning-and-ai.pdf— the paper (9 pages, two columns).algebraic-and-differential-topology-in-machine-learning-and-ai.tex— complete LaTeX source as a single file, figures included as TikZ (pdflatex, three passes).verify-topology-learning.py— 25 checks, Python standard library only, about ten seconds; exits 0 if and only if all pass.
Status and authorship
Contribution. A synthesis: classical topology applied to network architectures, with each qualitative statement paired with a computed one and every number reproducible.
Limitations. As above. In addition, the references were assembled from memory except for three whose details were checked online on 19 November 2026 (Zhou et al. on rotation representations, Adamaszek and Adams on the Vietoris-Rips complexes of the circle, and the 2024 position paper on topological deep learning), and nothing has been independently refereed. The script's checks are instances, not proofs. Corrections are welcome.
AI assistance. The text was drafted and typeset with a large language model (Anthropic's Claude) under the direction of the submitting author, who is responsible for it. Generative AI assisted with drafting, literature recall, mathematical consistency checks, computation, figures and typesetting.