Complete flattened LaTeX source
\documentclass[10pt,twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[sc]{mathpazo}
\usepackage[scaled=0.9]{helvet}
\usepackage[letterpaper,margin=0.78in,columnsep=0.3in]{geometry}
\usepackage{amsmath,amssymb,amsthm,mathtools}
\usepackage{microtype}
\usepackage{xcolor}
\definecolor{accent}{HTML}{7A1F2B}
\definecolor{ink2}{HTML}{55595F}
\definecolor{fwd}{HTML}{1F4E79}
\definecolor{bwd}{HTML}{5B3A7A}
\usepackage{tikz,tikz-cd}
\usetikzlibrary{arrows.meta,positioning}
\usepackage{booktabs,array}
\usepackage{enumitem}
\usepackage[font=small,labelfont={bf,sf}]{caption}
\usepackage[colorlinks=true,linkcolor=accent,citecolor=accent,urlcolor=accent,
pdftitle={Algebraic and Differential Topology in Machine Learning and AI: Obstructions, Invariants, and Counts},
pdfauthor={Anonymous},
pdfsubject={Topological obstructions, invariants and counting results for neural networks},
pdfkeywords={algebraic topology, machine learning, neural networks, Borsuk-Ulam theorem, persistent homology, Hodge Laplacian, topological degree}]{hyperref}
\usepackage[nameinlink,capitalise,noabbrev]{cleveref}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newcommand{\stag}[2]{{\footnotesize\sffamily\upshape\color{#1}[#2]}\enspace\ignorespaces}
\newcommand{\Scl}[1][]{\stag{ink2}{classical\if\relax\detokenize{#1}\relax\else; #1\fi}}
\newcommand{\Sli}[1][]{\stag{fwd}{literature\if\relax\detokenize{#1}\relax\else; #1\fi}}
\newcommand{\Srf}[1][]{\stag{accent}{reformulation\if\relax\detokenize{#1}\relax\else; cf.\ #1\fi}}
\newcommand{\Sob}{\stag{accent}{observation}}
\newcommand{\Spg}{\stag{bwd}{programme}}
\newcommand{\chk}[1]{{\footnotesize\sffamily\upshape\color{accent}[#1]}}
\newcommand{\cat}[1]{\mathsf{#1}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\one}{\mathbf{1}}
\newcommand{\T}{\mathsf{T}}
\newcommand{\Lap}{\Delta}
\newcommand{\pd}{\partial}
\newcommand{\KL}[2]{D(#1\,\Vert\,#2)}
\newcommand{\Var}{\operatorname{Var}}
\newcommand{\relu}{\operatorname{relu}}
\newcommand{\SO}{\mathrm{SO}}
\newcommand{\RP}{\mathbb{RP}}
\newcommand{\Fp}{\mathbb{F}}
\newcommand{\lk}{\operatorname{lk}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\id}{\mathrm{id}}
\newcommand{\sinc}{\operatorname{sinc}}
\newcommand{\term}[1]{\textbf{\itshape #1}}
\setlength{\parskip}{0pt}
\frenchspacing
\raggedbottom
\title{\textbf{Algebraic and Differential Topology\\ in Machine Learning and AI:\\[2pt] Obstructions, Invariants, and Counts}}
\author{Anonymous}
\date{Higher Categorical Semantics \quad$\cdot$\quad Version 1.0, 19 November 2026}
\begin{document}
\twocolumn[
\maketitle
\begin{center}\begin{minipage}{0.86\textwidth}\small
\textbf{Abstract.} A neural network is a continuous map, usually piecewise linear, and the classical theorems of
algebraic and differential topology are statements about what continuous maps can and cannot do. We organize
their consequences for machine learning under three headings, pairing each qualitative statement with a computed
one. \emph{Obstructions}: by the Borsuk--Ulam theorem an autoencoder for data on an $n$-sphere with an
$n$-dimensional bottleneck has worst-case reconstruction error at least the radius, and this is attained; a
network output that names a rotation by a unit quaternion jumps by $2$ somewhere on every non-contractible loop
of rotations, because $\pi_1(\SO(3))=\Z/2$, while a six-dimensional code does not; every tangent feature field on a
sphere-like mesh has singularities of total index $2$; and a closed piecewise linear curve with $N$ pieces winds
fewer than $N/2$ times, while composition multiplies degrees, so that depth $L$ reaches degree $2^L$ with a
fixed number of pieces per layer; and a network no wider than its input, with an injective activation, cannot
enclose a bounded class.
\emph{Invariants}: diffusion with the Hodge Laplacian of a complex converges to a space whose dimension is a
Betti number, at the rate of the spectral gap, and with real coefficients it cannot tell the projective plane
from a disc; the Vietoris--Rips complex of twelve points on a circle is a circle up to a third of a turn, then
three $2$-spheres, then a $5$-sphere; and persistence diagrams move by at most the size of a perturbation, which
the count of their points does not. \emph{Counts}: a classifier of the $n$-cube with small decision regions has points where $n+1$ of them meet ($13$ to $18$ triple points for random prototype classifiers of the square);
the fixed points of an attractor network on a circle or a torus have total index $1-d$ and $0$; the degree of
a normalized output changes only when the output passes through zero. A scalar odd network on an origin-centred
circle has $2,6,10,\dots$ zeros if all of them are simple. All numerical statements are recomputed
by a companion script with $25$ checks. No new theorem is claimed.
\end{minipage}\end{center}
\vspace{1.2em}
]
\section{Introduction}
The companion volume \cite{ADTHC} retells two monographs of Pontryagin: one on the homology of polyhedra, ending
with the fixed point theorem of Lefschetz and Hopf, and one on the classification of maps of spheres by framed
manifolds. This paper collects what those theories say about learning systems. The connection is direct. A
feed-forward network is a continuous map; with rectifier activations it is piecewise linear, a simplicial map
after subdivision \cite{ABMM18}. Data are assumed to lie near a manifold or a polyhedron
\cite{Car09,EdHa10}. Latent codes, rotation heads, feature fields on meshes and recurrent attractors are maps to
and from spaces whose topology is known. Theorems about continuous maps then become statements about
architectures, and they have a particular character: they hold for every choice of weights.
We sort the consequences by the kind of statement.
\emph{Obstructions} say that something cannot be done continuously: a manifold cannot be coded in too few
dimensions, a rotation cannot be named by four numbers, a sphere cannot be combed, a narrow network cannot
enclose a region \cite{ZBLYL19,CWKW19,FdH18,Joh19}.
\emph{Invariants} are what a functor computes. Simplicial and Hodge-theoretic networks
\cite{EDS20,BFW21,Lim20,PBB24} compute homology with real coefficients; persistent homology
\cite{CEH07,NSW08} computes it across scales, where the complexes themselves have topology of their own
\cite{AdAd17}.
\emph{Counts} are forced numbers: of points where classes meet, of fixed points of a recurrent map, of preimages
of a value.
\paragraph{What is and is not claimed.} Every statement carries a status tag: classical, literature,
reformulation, observation or programme. The theorems are classical, and several of the applications are in the
literature cited; where a formulation or a constant seems not to be standard we say ``observation''. Tags such as
\chk{O4} name checks in the companion script \texttt{verify-topology-learning.py} (\cref{app:checks}), which uses
only the Python standard library, exact arithmetic for homology, and a fixed seed. The checks are instances and
not proofs. The models are small and exact; no trained network appears. The references were assembled from
memory, except \cite{ZBLYL19,AdAd17,PBB24}, which were checked online on 19 November 2026.
\section{Setting}\label{sec:setting}
A \term{network} is a continuous map $f_w\colon\R^a\to\R^b$ depending continuously on weights $w$. Data lie on a
compact subset $M\subset\R^a$. A \term{code} for $M$ in dimension $m$ is a continuous \emph{encoder} $e\colon M\to\R^m$;
a \term{decoder} is any map $d\colon\R^m\to\R^a$, and the \term{worst-case error} of the pair is
$\sup_{x\in M}|d(e(x))-x|$. A \term{representation} of a space $Y$ in $\R^m$ is a continuous map $g\colon\R^m\supseteq
D\to Y$ onto $Y$; it is \term{continuous} in the sense of \cite{ZBLYL19} if it has a continuous right inverse
$Y\to D$, so that a target in $Y$ can be turned into a continuous regression target.
The tools are the functors of \cite{ADTHC}: homology $H_*$, which sends a continuous map to a homomorphism and a
homotopy to an equality; the degree of a map between spheres; the fundamental group; and the Lefschetz number
$L(f)=\sum_k(-1)^k\tr(f_*\mid H_k)$. An obstruction is a diagram that such a functor forbids. The simplest is the
one that proves Brouwer's theorem \cite[Thm.~4.2]{ADTHC}:
\[\begin{tikzcd}[column sep=small]
S^{n-1}\arrow[r,hook]\arrow[rr,bend right=28,"\id"'] & D^n\arrow[r,"r"] & S^{n-1} &[-0.6em]\leadsto&[-0.6em]
\Z\arrow[r]\arrow[rr,bend right=28,"\id"'] & 0\arrow[r] & \Z
\end{tikzcd}\]
A retraction of the ball onto its boundary would factor the identity of $\Z$ through $0$.
\section{Obstructions}\label{sec:obstructions}
\subsection{Bottlenecks}
\begin{theorem}[Bottleneck bound]\label{thm:bottleneck}
\Srf[Borsuk--Ulam \cite{Mat03}] Let $M$ be the unit sphere $S^n\subset\R^{n+1}$, $e\colon S^n\to\R^n$ continuous and
$d\colon\R^n\to\R^{n+1}$ arbitrary. Then
\[ \sup_{x\in S^n}|d(e(x))-x|\ \ge\ 1, \]
and equality holds for $e$ the projection to the first $n$ coordinates and $d$ the inclusion.
\end{theorem}
\begin{proof}
By the Borsuk--Ulam theorem there is $x$ with $e(x)=e(-x)$. Let $y$ be the common reconstruction. Then
$|y-x|+|y+x|\ge|2x|=2$, so one of the two errors is at least $1$. For the projection the error is
$|x_{n+1}|\le1$.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{scope}[shift={(1.5,2.0)}]
\draw[ink2,thick] (0,0) circle (1.25);
\draw[ink2,densely dotted] (-1,-0.75)--(-1,0.75);
\fill[ink2] (-1,-0.75) circle (0.9pt); \fill[ink2] (-1,0.75) circle (0.9pt);
\draw[ink2,densely dotted] (-0.5,-1.146)--(-0.5,1.146);
\fill[ink2] (-0.5,-1.146) circle (0.9pt); \fill[ink2] (-0.5,1.146) circle (0.9pt);
\draw[ink2,densely dotted] (0.5,-1.146)--(0.5,1.146);
\fill[ink2] (0.5,-1.146) circle (0.9pt); \fill[ink2] (0.5,1.146) circle (0.9pt);
\draw[ink2,densely dotted] (1,-0.75)--(1,0.75);
\fill[ink2] (1,-0.75) circle (0.9pt); \fill[ink2] (1,0.75) circle (0.9pt);
\draw[accent,thick] (0,-1.25)--(0,1.25);
\fill[accent] (0,1.25) circle (1.6pt) node[above,inner sep=2pt]{\scriptsize $x$}; \fill[accent] (0,-1.25) circle (1.6pt) node[below,inner sep=2pt]{\scriptsize $-x$};
\fill[bwd] (0,0.28) circle (1.6pt) node[right,inner sep=2pt]{\scriptsize $y$};
\draw[ink2,-{Stealth[length=3pt]}] (-1.35,-1.87)--(1.5,-1.87);
\node[right,inner sep=1pt] at (1.52,-1.87) {\scriptsize $\R$};
\fill[ink2] (-1,-1.87) circle (1.1pt);
\fill[ink2] (-0.5,-1.87) circle (1.1pt);
\fill[accent] (0,-1.87) circle (1.1pt);
\fill[ink2] (0.5,-1.87) circle (1.1pt);
\fill[ink2] (1,-1.87) circle (1.1pt);
\node[left,inner sep=1pt] at (-1.37,-1.87) {\scriptsize $e$};
\node at (0,-2.33) {\scriptsize (a)};
\end{scope}
\begin{scope}[shift={(4.3,0.75)}]
\draw[ink2] (0,2.7)--(0,0)--(3.6,0);
\draw[ink2] (0,0)--(0,-0.07) node[below,inner sep=1.5pt]{\scriptsize $0$};
\draw[ink2] (3.6,0)--(3.6,-0.07) node[below,inner sep=1.5pt]{\scriptsize $\pi$};
\node[below] at (1.8,-0.38) {\scriptsize $\theta$};
\draw[thick,fwd] plot coordinates {(0,1.488) (0.03,1.496) (0.06,1.499) (0.09,1.499) (0.12,1.494) (0.15,1.486) (0.18,1.474) (0.21,1.459) (0.24,1.44) (0.27,1.417) (0.3,1.392) (0.33,1.364) (0.36,1.333) (0.39,1.3) (0.42,1.264) (0.45,1.227) (0.48,1.188) (0.51,1.148) (0.54,1.107) (0.57,1.066) (0.6,1.024) (0.63,0.982) (0.66,0.941) (0.69,0.901) (0.72,0.861) (0.75,0.823) (0.78,0.787) (0.81,0.753) (0.84,0.721) (0.87,0.692) (0.9,0.665) (0.93,0.642) (0.96,0.622) (0.99,0.606) (1.02,0.594) (1.05,0.585) (1.08,0.581) (1.11,0.581) (1.14,0.585) (1.17,0.594) (1.2,0.607) (1.23,0.625) (1.26,0.647) (1.29,0.673) (1.32,0.704) (1.35,0.739) (1.38,0.778) (1.41,0.821) (1.44,0.868) (1.47,0.919) (1.5,0.973) (1.53,1.03) (1.56,1.09) (1.59,1.152) (1.62,1.217) (1.65,1.284) (1.68,1.352) (1.71,1.422) (1.74,1.492) (1.77,1.563) (1.8,1.635) (1.83,1.706) (1.86,1.777) (1.89,1.846) (1.92,1.915) (1.95,1.982) (1.98,2.047) (2.01,2.109) (2.04,2.169) (2.07,2.226) (2.1,2.28) (2.13,2.33) (2.16,2.376) (2.19,2.418) (2.22,2.456) (2.25,2.489) (2.28,2.518) (2.31,2.541) (2.34,2.56) (2.37,2.574) (2.4,2.582) (2.43,2.586) (2.46,2.584) (2.49,2.577) (2.52,2.565) (2.55,2.547) (2.58,2.525) (2.61,2.498) (2.64,2.467) (2.67,2.431) (2.7,2.39) (2.73,2.346) (2.76,2.297) (2.79,2.246) (2.82,2.191) (2.85,2.133) (2.88,2.072) (2.91,2.01) (2.94,1.945) (2.97,1.879) (3,1.811) (3.03,1.743) (3.06,1.674) (3.09,1.606) (3.12,1.537) (3.15,1.47) (3.18,1.403) (3.21,1.338) (3.24,1.274) (3.27,1.213) (3.3,1.153) (3.33,1.097) (3.36,1.044) (3.39,0.993) (3.42,0.947) (3.45,0.904) (3.48,0.865) (3.51,0.83) (3.54,0.799) (3.57,0.772) (3.6,0.75)};
\draw[thick,bwd,densely dashed] plot coordinates {(0,0.75) (0.03,0.733) (0.06,0.72) (0.09,0.711) (0.12,0.707) (0.15,0.708) (0.18,0.712) (0.21,0.722) (0.24,0.735) (0.27,0.752) (0.3,0.773) (0.33,0.798) (0.36,0.826) (0.39,0.857) (0.42,0.892) (0.45,0.928) (0.48,0.967) (0.51,1.009) (0.54,1.051) (0.57,1.095) (0.6,1.14) (0.63,1.186) (0.66,1.232) (0.69,1.278) (0.72,1.324) (0.75,1.369) (0.78,1.413) (0.81,1.455) (0.84,1.496) (0.87,1.535) (0.9,1.571) (0.93,1.605) (0.96,1.636) (0.99,1.664) (1.02,1.688) (1.05,1.709) (1.08,1.726) (1.11,1.74) (1.14,1.749) (1.17,1.754) (1.2,1.755) (1.23,1.751) (1.26,1.744) (1.29,1.732) (1.32,1.716) (1.35,1.695) (1.38,1.671) (1.41,1.643) (1.44,1.61) (1.47,1.574) (1.5,1.535) (1.53,1.492) (1.56,1.446) (1.59,1.397) (1.62,1.345) (1.65,1.291) (1.68,1.236) (1.71,1.178) (1.74,1.119) (1.77,1.059) (1.8,0.999) (1.83,0.938) (1.86,0.876) (1.89,0.816) (1.92,0.755) (1.95,0.696) (1.98,0.638) (2.01,0.582) (2.04,0.528) (2.07,0.476) (2.1,0.427) (2.13,0.38) (2.16,0.337) (2.19,0.297) (2.22,0.26) (2.25,0.227) (2.28,0.198) (2.31,0.174) (2.34,0.153) (2.37,0.137) (2.4,0.125) (2.43,0.117) (2.46,0.114) (2.49,0.116) (2.52,0.122) (2.55,0.132) (2.58,0.147) (2.61,0.165) (2.64,0.188) (2.67,0.215) (2.7,0.245) (2.73,0.279) (2.76,0.316) (2.79,0.356) (2.82,0.399) (2.85,0.444) (2.88,0.492) (2.91,0.542) (2.94,0.593) (2.97,0.645) (3,0.698) (3.03,0.752) (3.06,0.807) (3.09,0.861) (3.12,0.914) (3.15,0.968) (3.18,1.02) (3.21,1.07) (3.24,1.119) (3.27,1.166) (3.3,1.211) (3.33,1.253) (3.36,1.293) (3.39,1.329) (3.42,1.363) (3.45,1.393) (3.48,1.419) (3.51,1.442) (3.54,1.461) (3.57,1.477) (3.6,1.488)};
\fill[accent] (0.56,1.08) circle (2pt);
\fill[accent] (1.652,1.288) circle (2pt);
\fill[accent] (3.283,1.186) circle (2pt);
\draw[thick,fwd] (0.1,2.93)--(0.5,2.93) node[right,inner sep=2pt,black]{\scriptsize $e(\theta)$};
\draw[thick,bwd,densely dashed] (1.75,2.93)--(2.15,2.93) node[right,inner sep=2pt,black]{\scriptsize $e(\theta+\pi)$};
\node at (1.8,-0.83) {\scriptsize (b)};
\end{scope}
\end{tikzpicture}
\caption{The bottleneck bound for the circle. (a)~The fibres of the projection code; the fibre through the poles is an antipodal pair, and whatever point $y$ the decoder returns for it is at distance at least $1$ from one of the two. (b)~A random trigonometric encoder $e$ and its antipodal translate on a half-turn: since $e(\theta)-e(\theta+\pi)$ changes sign, the graphs cross (3 times here), and at a crossing the code identifies $x$ and $-x$.}\label{fig:bottleneck}
\end{figure}
\noindent For $n=1$ the collision was located for $200$ random trigonometric encoders, and for $n=2$ for $40$
random cubic encoders, to rounding (\cref{fig:bottleneck}). \chk{O1, O2} For each of $100$ random encoders of the
circle, some fibre of the code, taken to one percent of its range, is contained in no disc of radius less than
$1.0000$: no decoder can do better than error $1$ there. \chk{O3} The theorem is about the worst case. The mean error can be made small, by a code that is
injective except near one point; the bound says that the failure cannot be removed, only moved and made thin.
For a general closed $n$-manifold the qualitative statement survives: by Brouwer's invariance of domain, the
companion of the invariance of dimension \cite[Thm.~4.3]{ADTHC}, it has no continuous injective code in $\R^n$.
The constant is special to round spheres.
This is the topological reason for latent spaces that are themselves spheres, tori or groups
\cite{DFdC18,FdH18}.
\subsection{Rotations}
Let $\rho\colon S^3\to\SO(3)$ send a unit quaternion $q$ to the rotation $v\mapsto qvq^{-1}$. It is onto, and
$\rho(q)=\rho(-q)$.
\begin{theorem}[Naming a rotation]\label{thm:rotation}
\Sli[\cite{ZBLYL19}; \cite{ADTHC}, Thm.~10.1] \emph{(a)} $\rho$ has no continuous right inverse: for every choice
of a quaternion $s(R)$ with $\rho(s(R))=R$ there is, on every non-contractible loop of rotations, a point where
$s$ jumps by $|q-(-q)|=2$. \emph{(b)} More generally a family of rotations $X\to\SO(3)$ has a continuous
quaternion target if and only if it induces the zero map $\pi_1(X)\to\pi_1(\SO(3))=\Z/2$. \emph{(c)} There is no
continuous representation of $\SO(3)$ in $\R^m$ for $m\le4$. \emph{(d)} Two columns of the rotation matrix, with
Gram--Schmidt orthogonalization as decoder, give a continuous representation in $\R^6$.
\end{theorem}
\begin{proof}
(a), (b): $\rho$ is the universal covering, and a map lifts through a covering exactly when it kills the
fundamental group; a full turn about an axis lifts to a path from $q$ to $-q$. (c) is proved in \cite{ZBLYL19}
from the fact that $\SO(3)$, which is real projective $3$-space, does not embed in $\R^4$. (d) The two columns
determine the third by the cross product.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{scope}[shift={(0,0)}]
\draw[ink2] (0,2.3)--(0,0)--(3.25,0);
\draw[ink2] (0,0)--(0,-0.07) node[below,inner sep=1.5pt]{\scriptsize $0$};
\draw[ink2] (1.625,0)--(1.625,-0.07) node[below,inner sep=1.5pt]{\scriptsize $\pi$};
\draw[ink2] (3.25,0)--(3.25,-0.07) node[below,inner sep=1.5pt]{\scriptsize $2\pi$};
\draw[ink2] (0,0.085)--(-0.07,0.085) node[left,inner sep=1.5pt]{\scriptsize $-1$};
\draw[ink2] (0,1.15)--(-0.07,1.15) node[left,inner sep=1.5pt]{\scriptsize $0$};
\draw[ink2] (0,2.215)--(-0.07,2.215) node[left,inner sep=1.5pt]{\scriptsize $1$};
\node[below] at (1.625,-0.38) {\scriptsize angle of the turn};
\draw[ink2,very thin] (0,1.15)--(3.25,1.15);
\draw[thick,fwd] plot coordinates {(0,2.215) (0.016,2.215) (0.033,2.214) (0.049,2.214) (0.065,2.213) (0.081,2.212) (0.098,2.21) (0.114,2.208) (0.13,2.206) (0.146,2.204) (0.163,2.202) (0.179,2.199) (0.195,2.196) (0.211,2.193) (0.228,2.189) (0.244,2.185) (0.26,2.181) (0.276,2.177) (0.292,2.173) (0.309,2.168) (0.325,2.163) (0.341,2.157) (0.357,2.152) (0.374,2.146) (0.39,2.14) (0.406,2.134) (0.422,2.127) (0.439,2.12) (0.455,2.113) (0.471,2.106) (0.487,2.099) (0.504,2.091) (0.52,2.083) (0.536,2.075) (0.553,2.067) (0.569,2.058) (0.585,2.049) (0.601,2.04) (0.617,2.031) (0.634,2.021) (0.65,2.011) (0.666,2.002) (0.683,1.991) (0.699,1.981) (0.715,1.97) (0.731,1.96) (0.747,1.949) (0.764,1.938) (0.78,1.926) (0.796,1.915) (0.813,1.903) (0.829,1.891) (0.845,1.879) (0.861,1.867) (0.877,1.854) (0.894,1.842) (0.91,1.829) (0.926,1.816) (0.943,1.803) (0.959,1.789) (0.975,1.776) (0.991,1.762) (1.008,1.749) (1.024,1.735) (1.04,1.721) (1.056,1.706) (1.073,1.692) (1.089,1.678) (1.105,1.663) (1.121,1.648) (1.137,1.633) (1.154,1.618) (1.17,1.603) (1.186,1.588) (1.203,1.573) (1.219,1.557) (1.235,1.542) (1.251,1.526) (1.267,1.511) (1.284,1.495) (1.3,1.479) (1.316,1.463) (1.333,1.447) (1.349,1.431) (1.365,1.415) (1.381,1.399) (1.397,1.382) (1.414,1.366) (1.43,1.35) (1.446,1.333) (1.463,1.317) (1.479,1.3) (1.495,1.283) (1.511,1.267) (1.528,1.25) (1.544,1.234) (1.56,1.217) (1.576,1.2) (1.592,1.183) (1.609,1.167) (1.625,1.15)};
\draw[thick,fwd] plot coordinates {(1.625,1.15) (1.641,1.167) (1.658,1.183) (1.674,1.2) (1.69,1.217) (1.706,1.234) (1.722,1.25) (1.739,1.267) (1.755,1.283) (1.771,1.3) (1.787,1.317) (1.804,1.333) (1.82,1.35) (1.836,1.366) (1.853,1.382) (1.869,1.399) (1.885,1.415) (1.901,1.431) (1.917,1.447) (1.934,1.463) (1.95,1.479) (1.966,1.495) (1.982,1.511) (1.999,1.526) (2.015,1.542) (2.031,1.557) (2.047,1.573) (2.064,1.588) (2.08,1.603) (2.096,1.618) (2.113,1.633) (2.129,1.648) (2.145,1.663) (2.161,1.678) (2.177,1.692) (2.194,1.706) (2.21,1.721) (2.226,1.735) (2.243,1.749) (2.259,1.762) (2.275,1.776) (2.291,1.789) (2.307,1.803) (2.324,1.816) (2.34,1.829) (2.356,1.842) (2.373,1.854) (2.389,1.867) (2.405,1.879) (2.421,1.891) (2.438,1.903) (2.454,1.915) (2.47,1.926) (2.486,1.938) (2.502,1.949) (2.519,1.96) (2.535,1.97) (2.551,1.981) (2.567,1.991) (2.584,2.002) (2.6,2.011) (2.616,2.021) (2.632,2.031) (2.649,2.04) (2.665,2.049) (2.681,2.058) (2.698,2.067) (2.714,2.075) (2.73,2.083) (2.746,2.091) (2.762,2.099) (2.779,2.106) (2.795,2.113) (2.811,2.12) (2.828,2.127) (2.844,2.134) (2.86,2.14) (2.876,2.146) (2.893,2.152) (2.909,2.157) (2.925,2.163) (2.941,2.168) (2.958,2.173) (2.974,2.177) (2.99,2.181) (3.006,2.185) (3.022,2.189) (3.039,2.193) (3.055,2.196) (3.071,2.199) (3.087,2.202) (3.104,2.204) (3.12,2.206) (3.136,2.208) (3.152,2.21) (3.169,2.212) (3.185,2.213) (3.201,2.214) (3.218,2.214) (3.234,2.215) (3.25,2.215)};
\draw[thick,bwd] plot coordinates {(0,1.15) (0.016,1.155) (0.033,1.16) (0.049,1.165) (0.065,1.17) (0.081,1.175) (0.098,1.18) (0.114,1.185) (0.13,1.19) (0.146,1.195) (0.163,1.2) (0.179,1.205) (0.195,1.21) (0.211,1.215) (0.228,1.22) (0.244,1.225) (0.26,1.23) (0.276,1.235) (0.292,1.24) (0.309,1.245) (0.325,1.25) (0.341,1.255) (0.357,1.259) (0.374,1.264) (0.39,1.269) (0.406,1.273) (0.422,1.278) (0.439,1.283) (0.455,1.287) (0.471,1.292) (0.487,1.296) (0.504,1.301) (0.52,1.305) (0.536,1.31) (0.553,1.314) (0.569,1.319) (0.585,1.323) (0.601,1.327) (0.617,1.331) (0.634,1.336) (0.65,1.34) (0.666,1.344) (0.683,1.348) (0.699,1.352) (0.715,1.356) (0.731,1.36) (0.747,1.363) (0.764,1.367) (0.78,1.371) (0.796,1.375) (0.813,1.378) (0.829,1.382) (0.845,1.385) (0.861,1.389) (0.877,1.392) (0.894,1.395) (0.91,1.399) (0.926,1.402) (0.943,1.405) (0.959,1.408) (0.975,1.411) (0.991,1.414) (1.008,1.417) (1.024,1.42) (1.04,1.422) (1.056,1.425) (1.073,1.428) (1.089,1.43) (1.105,1.433) (1.121,1.435) (1.137,1.438) (1.154,1.44) (1.17,1.442) (1.186,1.444) (1.203,1.446) (1.219,1.448) (1.235,1.45) (1.251,1.452) (1.267,1.454) (1.284,1.455) (1.3,1.457) (1.316,1.458) (1.333,1.46) (1.349,1.461) (1.365,1.463) (1.381,1.464) (1.397,1.465) (1.414,1.466) (1.43,1.467) (1.446,1.468) (1.463,1.469) (1.479,1.469) (1.495,1.47) (1.511,1.471) (1.528,1.471) (1.544,1.472) (1.56,1.472) (1.576,1.472) (1.592,1.473) (1.609,1.473) (1.625,1.473)};
\draw[thick,bwd] plot coordinates {(1.625,0.827) (1.641,0.827) (1.658,0.827) (1.674,0.828) (1.69,0.828) (1.706,0.828) (1.722,0.829) (1.739,0.829) (1.755,0.83) (1.771,0.831) (1.787,0.831) (1.804,0.832) (1.82,0.833) (1.836,0.834) (1.853,0.835) (1.869,0.836) (1.885,0.837) (1.901,0.839) (1.917,0.84) (1.934,0.842) (1.95,0.843) (1.966,0.845) (1.982,0.846) (1.999,0.848) (2.015,0.85) (2.031,0.852) (2.047,0.854) (2.064,0.856) (2.08,0.858) (2.096,0.86) (2.113,0.862) (2.129,0.865) (2.145,0.867) (2.161,0.87) (2.177,0.872) (2.194,0.875) (2.21,0.878) (2.226,0.88) (2.243,0.883) (2.259,0.886) (2.275,0.889) (2.291,0.892) (2.307,0.895) (2.324,0.898) (2.34,0.901) (2.356,0.905) (2.373,0.908) (2.389,0.911) (2.405,0.915) (2.421,0.918) (2.438,0.922) (2.454,0.925) (2.47,0.929) (2.486,0.933) (2.502,0.937) (2.519,0.94) (2.535,0.944) (2.551,0.948) (2.567,0.952) (2.584,0.956) (2.6,0.96) (2.616,0.964) (2.632,0.969) (2.649,0.973) (2.665,0.977) (2.681,0.981) (2.698,0.986) (2.714,0.99) (2.73,0.995) (2.746,0.999) (2.762,1.004) (2.779,1.008) (2.795,1.013) (2.811,1.017) (2.828,1.022) (2.844,1.027) (2.86,1.031) (2.876,1.036) (2.893,1.041) (2.909,1.045) (2.925,1.05) (2.941,1.055) (2.958,1.06) (2.974,1.065) (2.99,1.07) (3.006,1.075) (3.022,1.08) (3.039,1.085) (3.055,1.09) (3.071,1.095) (3.087,1.1) (3.104,1.105) (3.12,1.11) (3.136,1.115) (3.152,1.12) (3.169,1.125) (3.185,1.13) (3.201,1.135) (3.218,1.14) (3.234,1.145) (3.25,1.15)};
\draw[thick,bwd,densely dashed] plot coordinates {(0,1.15) (0.016,1.142) (0.033,1.133) (0.049,1.125) (0.065,1.116) (0.081,1.108) (0.098,1.099) (0.114,1.091) (0.13,1.083) (0.146,1.074) (0.163,1.066) (0.179,1.058) (0.195,1.049) (0.211,1.041) (0.228,1.033) (0.244,1.024) (0.26,1.016) (0.276,1.008) (0.292,1) (0.309,0.992) (0.325,0.984) (0.341,0.976) (0.357,0.968) (0.374,0.96) (0.39,0.952) (0.406,0.944) (0.422,0.936) (0.439,0.929) (0.455,0.921) (0.471,0.913) (0.487,0.906) (0.504,0.898) (0.52,0.891) (0.536,0.884) (0.553,0.876) (0.569,0.869) (0.585,0.862) (0.601,0.855) (0.617,0.848) (0.634,0.841) (0.65,0.834) (0.666,0.827) (0.683,0.82) (0.699,0.814) (0.715,0.807) (0.731,0.801) (0.747,0.794) (0.764,0.788) (0.78,0.782) (0.796,0.776) (0.813,0.77) (0.829,0.764) (0.845,0.758) (0.861,0.752) (0.877,0.747) (0.894,0.741) (0.91,0.736) (0.926,0.73) (0.943,0.725) (0.959,0.72) (0.975,0.715) (0.991,0.71) (1.008,0.705) (1.024,0.7) (1.04,0.696) (1.056,0.691) (1.073,0.687) (1.089,0.683) (1.105,0.679) (1.121,0.675) (1.137,0.671) (1.154,0.667) (1.17,0.663) (1.186,0.66) (1.203,0.656) (1.219,0.653) (1.235,0.65) (1.251,0.647) (1.267,0.644) (1.284,0.641) (1.3,0.639) (1.316,0.636) (1.333,0.634) (1.349,0.631) (1.365,0.629) (1.381,0.627) (1.397,0.625) (1.414,0.623) (1.43,0.622) (1.446,0.62) (1.463,0.619) (1.479,0.618) (1.495,0.616) (1.511,0.615) (1.528,0.615) (1.544,0.614) (1.56,0.613) (1.576,0.613) (1.592,0.612) (1.609,0.612) (1.625,0.612)};
\draw[thick,bwd,densely dashed] plot coordinates {(1.625,1.688) (1.641,1.688) (1.658,1.688) (1.674,1.687) (1.69,1.687) (1.706,1.686) (1.722,1.685) (1.739,1.685) (1.755,1.684) (1.771,1.682) (1.787,1.681) (1.804,1.68) (1.82,1.678) (1.836,1.677) (1.853,1.675) (1.869,1.673) (1.885,1.671) (1.901,1.669) (1.917,1.666) (1.934,1.664) (1.95,1.661) (1.966,1.659) (1.982,1.656) (1.999,1.653) (2.015,1.65) (2.031,1.647) (2.047,1.644) (2.064,1.64) (2.08,1.637) (2.096,1.633) (2.113,1.629) (2.129,1.625) (2.145,1.621) (2.161,1.617) (2.177,1.613) (2.194,1.609) (2.21,1.604) (2.226,1.6) (2.243,1.595) (2.259,1.59) (2.275,1.585) (2.291,1.58) (2.307,1.575) (2.324,1.57) (2.34,1.564) (2.356,1.559) (2.373,1.553) (2.389,1.548) (2.405,1.542) (2.421,1.536) (2.438,1.53) (2.454,1.524) (2.47,1.518) (2.486,1.512) (2.502,1.506) (2.519,1.499) (2.535,1.493) (2.551,1.486) (2.567,1.48) (2.584,1.473) (2.6,1.466) (2.616,1.459) (2.632,1.452) (2.649,1.445) (2.665,1.438) (2.681,1.431) (2.698,1.424) (2.714,1.416) (2.73,1.409) (2.746,1.402) (2.762,1.394) (2.779,1.387) (2.795,1.379) (2.811,1.371) (2.828,1.364) (2.844,1.356) (2.86,1.348) (2.876,1.34) (2.893,1.332) (2.909,1.324) (2.925,1.316) (2.941,1.308) (2.958,1.3) (2.974,1.292) (2.99,1.284) (3.006,1.276) (3.022,1.267) (3.039,1.259) (3.055,1.251) (3.071,1.242) (3.087,1.234) (3.104,1.226) (3.12,1.217) (3.136,1.209) (3.152,1.201) (3.169,1.192) (3.185,1.184) (3.201,1.175) (3.218,1.167) (3.234,1.158) (3.25,1.15)};
\draw[thick,bwd,dash dot] plot coordinates {(0,1.15) (0.016,1.164) (0.033,1.177) (0.049,1.191) (0.065,1.204) (0.081,1.218) (0.098,1.231) (0.114,1.244) (0.13,1.258) (0.146,1.271) (0.163,1.285) (0.179,1.298) (0.195,1.311) (0.211,1.324) (0.228,1.338) (0.244,1.351) (0.26,1.364) (0.276,1.377) (0.292,1.39) (0.309,1.403) (0.325,1.416) (0.341,1.429) (0.357,1.441) (0.374,1.454) (0.39,1.467) (0.406,1.479) (0.422,1.492) (0.439,1.504) (0.455,1.516) (0.471,1.529) (0.487,1.541) (0.504,1.553) (0.52,1.565) (0.536,1.576) (0.553,1.588) (0.569,1.6) (0.585,1.611) (0.601,1.622) (0.617,1.634) (0.634,1.645) (0.65,1.656) (0.666,1.667) (0.683,1.677) (0.699,1.688) (0.715,1.699) (0.731,1.709) (0.747,1.719) (0.764,1.729) (0.78,1.739) (0.796,1.749) (0.813,1.758) (0.829,1.768) (0.845,1.777) (0.861,1.786) (0.877,1.795) (0.894,1.804) (0.91,1.813) (0.926,1.822) (0.943,1.83) (0.959,1.838) (0.975,1.846) (0.991,1.854) (1.008,1.862) (1.024,1.869) (1.04,1.877) (1.056,1.884) (1.073,1.891) (1.089,1.897) (1.105,1.904) (1.121,1.91) (1.137,1.917) (1.154,1.923) (1.17,1.929) (1.186,1.934) (1.203,1.94) (1.219,1.945) (1.235,1.95) (1.251,1.955) (1.267,1.96) (1.284,1.964) (1.3,1.968) (1.316,1.972) (1.333,1.976) (1.349,1.98) (1.365,1.983) (1.381,1.987) (1.397,1.99) (1.414,1.993) (1.43,1.995) (1.446,1.998) (1.463,2) (1.479,2.002) (1.495,2.004) (1.511,2.005) (1.528,2.007) (1.544,2.008) (1.56,2.009) (1.576,2.01) (1.592,2.01) (1.609,2.01) (1.625,2.011)};
\draw[thick,bwd,dash dot] plot coordinates {(1.625,0.289) (1.641,0.29) (1.658,0.29) (1.674,0.29) (1.69,0.291) (1.706,0.292) (1.722,0.293) (1.739,0.295) (1.755,0.296) (1.771,0.298) (1.787,0.3) (1.804,0.302) (1.82,0.305) (1.836,0.307) (1.853,0.31) (1.869,0.313) (1.885,0.317) (1.901,0.32) (1.917,0.324) (1.934,0.328) (1.95,0.332) (1.966,0.336) (1.982,0.34) (1.999,0.345) (2.015,0.35) (2.031,0.355) (2.047,0.36) (2.064,0.366) (2.08,0.371) (2.096,0.377) (2.113,0.383) (2.129,0.39) (2.145,0.396) (2.161,0.403) (2.177,0.409) (2.194,0.416) (2.21,0.423) (2.226,0.431) (2.243,0.438) (2.259,0.446) (2.275,0.454) (2.291,0.462) (2.307,0.47) (2.324,0.478) (2.34,0.487) (2.356,0.496) (2.373,0.505) (2.389,0.514) (2.405,0.523) (2.421,0.532) (2.438,0.542) (2.454,0.551) (2.47,0.561) (2.486,0.571) (2.502,0.581) (2.519,0.591) (2.535,0.601) (2.551,0.612) (2.567,0.623) (2.584,0.633) (2.6,0.644) (2.616,0.655) (2.632,0.666) (2.649,0.678) (2.665,0.689) (2.681,0.7) (2.698,0.712) (2.714,0.724) (2.73,0.735) (2.746,0.747) (2.762,0.759) (2.779,0.771) (2.795,0.784) (2.811,0.796) (2.828,0.808) (2.844,0.821) (2.86,0.833) (2.876,0.846) (2.893,0.859) (2.909,0.871) (2.925,0.884) (2.941,0.897) (2.958,0.91) (2.974,0.923) (2.99,0.936) (3.006,0.949) (3.022,0.962) (3.039,0.976) (3.055,0.989) (3.071,1.002) (3.087,1.015) (3.104,1.029) (3.12,1.042) (3.136,1.056) (3.152,1.069) (3.169,1.082) (3.185,1.096) (3.201,1.109) (3.218,1.123) (3.234,1.136) (3.25,1.15)};
\draw[accent,densely dotted] (1.625,0)--(1.625,2.3);
\node[above,inner sep=1pt] at (1.625,2.35) {\scriptsize quaternion, $w\ge0$};
\end{scope}
\begin{scope}[shift={(4,0)}]
\draw[ink2] (0,2.3)--(0,0)--(3.25,0);
\draw[ink2] (0,0)--(0,-0.07) node[below,inner sep=1.5pt]{\scriptsize $0$};
\draw[ink2] (1.625,0)--(1.625,-0.07) node[below,inner sep=1.5pt]{\scriptsize $\pi$};
\draw[ink2] (3.25,0)--(3.25,-0.07) node[below,inner sep=1.5pt]{\scriptsize $2\pi$};
\draw[ink2] (0,0.085)--(-0.07,0.085) node[left,inner sep=1.5pt]{\scriptsize };
\draw[ink2] (0,1.15)--(-0.07,1.15) node[left,inner sep=1.5pt]{\scriptsize };
\draw[ink2] (0,2.215)--(-0.07,2.215) node[left,inner sep=1.5pt]{\scriptsize };
\node[below] at (1.625,-0.38) {\scriptsize angle of the turn};
\draw[ink2,very thin] (0,1.15)--(3.25,1.15);
\draw[thick,fwd] plot coordinates {(0,2.215) (0.02,2.214) (0.041,2.212) (0.061,2.208) (0.081,2.203) (0.102,2.196) (0.122,2.188) (0.142,2.179) (0.163,2.167) (0.183,2.155) (0.203,2.141) (0.223,2.126) (0.244,2.109) (0.264,2.092) (0.284,2.072) (0.305,2.052) (0.325,2.03) (0.345,2.007) (0.366,1.983) (0.386,1.958) (0.406,1.932) (0.427,1.904) (0.447,1.876) (0.467,1.846) (0.487,1.816) (0.508,1.785) (0.528,1.753) (0.548,1.72) (0.569,1.687) (0.589,1.653) (0.609,1.618) (0.63,1.582) (0.65,1.547) (0.67,1.51) (0.691,1.474) (0.711,1.436) (0.731,1.399) (0.752,1.361) (0.772,1.324) (0.792,1.286) (0.813,1.248) (0.833,1.21) (0.853,1.172) (0.873,1.134) (0.894,1.097) (0.914,1.059) (0.934,1.022) (0.955,0.985) (0.975,0.949) (0.995,0.913) (1.016,0.878) (1.036,0.843) (1.056,0.809) (1.077,0.775) (1.097,0.743) (1.117,0.711) (1.137,0.679) (1.158,0.649) (1.178,0.62) (1.198,0.591) (1.219,0.564) (1.239,0.538) (1.259,0.512) (1.28,0.488) (1.3,0.465) (1.32,0.444) (1.341,0.423) (1.361,0.404) (1.381,0.386) (1.402,0.37) (1.422,0.354) (1.442,0.341) (1.463,0.328) (1.483,0.317) (1.503,0.307) (1.523,0.299) (1.544,0.293) (1.564,0.287) (1.584,0.284) (1.605,0.282) (1.625,0.281) (1.645,0.282) (1.666,0.284) (1.686,0.287) (1.706,0.293) (1.727,0.299) (1.747,0.307) (1.767,0.317) (1.787,0.328) (1.808,0.341) (1.828,0.354) (1.848,0.37) (1.869,0.386) (1.889,0.404) (1.909,0.423) (1.93,0.444) (1.95,0.465) (1.97,0.488) (1.991,0.512) (2.011,0.538) (2.031,0.564) (2.052,0.591) (2.072,0.62) (2.092,0.649) (2.113,0.679) (2.133,0.711) (2.153,0.743) (2.173,0.775) (2.194,0.809) (2.214,0.843) (2.234,0.878) (2.255,0.913) (2.275,0.949) (2.295,0.985) (2.316,1.022) (2.336,1.059) (2.356,1.097) (2.377,1.134) (2.397,1.172) (2.417,1.21) (2.438,1.248) (2.458,1.286) (2.478,1.324) (2.498,1.361) (2.519,1.399) (2.539,1.436) (2.559,1.474) (2.58,1.51) (2.6,1.547) (2.62,1.582) (2.641,1.618) (2.661,1.653) (2.681,1.687) (2.702,1.72) (2.722,1.753) (2.742,1.785) (2.762,1.816) (2.783,1.846) (2.803,1.876) (2.823,1.904) (2.844,1.932) (2.864,1.958) (2.884,1.983) (2.905,2.007) (2.925,2.03) (2.945,2.052) (2.966,2.072) (2.986,2.092) (3.006,2.109) (3.027,2.126) (3.047,2.141) (3.067,2.155) (3.087,2.167) (3.108,2.179) (3.128,2.188) (3.148,2.196) (3.169,2.203) (3.189,2.208) (3.209,2.212) (3.23,2.214) (3.25,2.215)};
\draw[thick,fwd,densely dashed] plot coordinates {(0,1.15) (0.02,1.184) (0.041,1.217) (0.061,1.25) (0.081,1.283) (0.102,1.315) (0.122,1.346) (0.142,1.377) (0.163,1.408) (0.183,1.438) (0.203,1.467) (0.223,1.495) (0.244,1.523) (0.264,1.55) (0.284,1.576) (0.305,1.601) (0.325,1.625) (0.345,1.648) (0.366,1.67) (0.386,1.691) (0.406,1.711) (0.427,1.73) (0.447,1.747) (0.467,1.764) (0.487,1.779) (0.508,1.793) (0.528,1.806) (0.548,1.817) (0.569,1.828) (0.589,1.837) (0.609,1.844) (0.63,1.851) (0.65,1.856) (0.67,1.859) (0.691,1.862) (0.711,1.863) (0.731,1.862) (0.752,1.861) (0.772,1.858) (0.792,1.853) (0.813,1.848) (0.833,1.84) (0.853,1.832) (0.873,1.822) (0.894,1.811) (0.914,1.799) (0.934,1.786) (0.955,1.771) (0.975,1.755) (0.995,1.738) (1.016,1.72) (1.036,1.7) (1.056,1.68) (1.077,1.658) (1.097,1.636) (1.117,1.612) (1.137,1.587) (1.158,1.562) (1.178,1.535) (1.198,1.508) (1.219,1.48) (1.239,1.451) (1.259,1.422) (1.28,1.392) (1.3,1.361) (1.32,1.33) (1.341,1.298) (1.361,1.265) (1.381,1.232) (1.402,1.199) (1.422,1.166) (1.442,1.132) (1.463,1.098) (1.483,1.064) (1.503,1.029) (1.523,0.995) (1.544,0.961) (1.564,0.926) (1.584,0.892) (1.605,0.858) (1.625,0.824) (1.645,0.79) (1.666,0.757) (1.686,0.724) (1.706,0.691) (1.727,0.659) (1.747,0.628) (1.767,0.597) (1.787,0.566) (1.808,0.536) (1.828,0.507) (1.848,0.479) (1.869,0.451) (1.889,0.424) (1.909,0.398) (1.93,0.373) (1.95,0.349) (1.97,0.326) (1.991,0.304) (2.011,0.283) (2.031,0.263) (2.052,0.245) (2.072,0.227) (2.092,0.21) (2.113,0.195) (2.133,0.181) (2.153,0.168) (2.173,0.157) (2.194,0.146) (2.214,0.137) (2.234,0.13) (2.255,0.123) (2.275,0.118) (2.295,0.115) (2.316,0.112) (2.336,0.111) (2.356,0.112) (2.377,0.113) (2.397,0.116) (2.417,0.121) (2.438,0.127) (2.458,0.134) (2.478,0.142) (2.498,0.152) (2.519,0.163) (2.539,0.175) (2.559,0.188) (2.58,0.203) (2.6,0.219) (2.62,0.236) (2.641,0.254) (2.661,0.274) (2.681,0.294) (2.702,0.316) (2.722,0.338) (2.742,0.362) (2.762,0.387) (2.783,0.412) (2.803,0.439) (2.823,0.466) (2.844,0.494) (2.864,0.523) (2.884,0.552) (2.905,0.582) (2.925,0.613) (2.945,0.644) (2.966,0.676) (2.986,0.709) (3.006,0.742) (3.027,0.775) (3.047,0.808) (3.067,0.842) (3.087,0.876) (3.108,0.91) (3.128,0.945) (3.148,0.979) (3.169,1.013) (3.189,1.048) (3.209,1.082) (3.23,1.116) (3.25,1.15)};
\draw[thick,fwd,dash dot] plot coordinates {(0,1.15) (0.02,1.171) (0.041,1.193) (0.061,1.215) (0.081,1.237) (0.102,1.26) (0.122,1.283) (0.142,1.306) (0.163,1.329) (0.183,1.352) (0.203,1.376) (0.223,1.399) (0.244,1.423) (0.264,1.446) (0.284,1.469) (0.305,1.493) (0.325,1.516) (0.345,1.539) (0.366,1.562) (0.386,1.584) (0.406,1.607) (0.427,1.629) (0.447,1.65) (0.467,1.672) (0.487,1.693) (0.508,1.713) (0.528,1.733) (0.548,1.753) (0.569,1.772) (0.589,1.79) (0.609,1.808) (0.63,1.825) (0.65,1.842) (0.67,1.858) (0.691,1.873) (0.711,1.887) (0.731,1.901) (0.752,1.914) (0.772,1.926) (0.792,1.938) (0.813,1.949) (0.833,1.958) (0.853,1.967) (0.873,1.976) (0.894,1.983) (0.914,1.989) (0.934,1.995) (0.955,1.999) (0.975,2.003) (0.995,2.006) (1.016,2.007) (1.036,2.008) (1.056,2.008) (1.077,2.007) (1.097,2.006) (1.117,2.003) (1.137,1.999) (1.158,1.995) (1.178,1.989) (1.198,1.983) (1.219,1.975) (1.239,1.967) (1.259,1.958) (1.28,1.949) (1.3,1.938) (1.32,1.926) (1.341,1.914) (1.361,1.901) (1.381,1.887) (1.402,1.873) (1.422,1.858) (1.442,1.842) (1.463,1.825) (1.483,1.808) (1.503,1.79) (1.523,1.771) (1.544,1.752) (1.564,1.733) (1.584,1.713) (1.605,1.692) (1.625,1.672) (1.645,1.65) (1.666,1.629) (1.686,1.607) (1.706,1.584) (1.727,1.562) (1.747,1.539) (1.767,1.516) (1.787,1.493) (1.808,1.469) (1.828,1.446) (1.848,1.422) (1.869,1.399) (1.889,1.376) (1.909,1.352) (1.93,1.329) (1.95,1.306) (1.97,1.283) (1.991,1.26) (2.011,1.237) (2.031,1.215) (2.052,1.193) (2.072,1.171) (2.092,1.15) (2.113,1.129) (2.133,1.108) (2.153,1.088) (2.173,1.069) (2.194,1.05) (2.214,1.032) (2.234,1.014) (2.255,0.996) (2.275,0.98) (2.295,0.964) (2.316,0.949) (2.336,0.934) (2.356,0.92) (2.377,0.907) (2.397,0.895) (2.417,0.884) (2.438,0.873) (2.458,0.863) (2.478,0.854) (2.498,0.846) (2.519,0.839) (2.539,0.832) (2.559,0.827) (2.58,0.822) (2.6,0.819) (2.62,0.816) (2.641,0.814) (2.661,0.813) (2.681,0.813) (2.702,0.814) (2.722,0.816) (2.742,0.819) (2.762,0.822) (2.783,0.827) (2.803,0.832) (2.823,0.839) (2.844,0.846) (2.864,0.854) (2.884,0.863) (2.905,0.873) (2.925,0.884) (2.945,0.895) (2.966,0.907) (2.986,0.92) (3.006,0.934) (3.027,0.949) (3.047,0.964) (3.067,0.98) (3.087,0.997) (3.108,1.014) (3.128,1.032) (3.148,1.05) (3.169,1.069) (3.189,1.089) (3.209,1.109) (3.23,1.129) (3.25,1.15)};
\draw[thick,bwd] plot coordinates {(0,1.15) (0.02,1.116) (0.041,1.082) (0.061,1.048) (0.081,1.013) (0.102,0.979) (0.122,0.945) (0.142,0.91) (0.163,0.876) (0.183,0.842) (0.203,0.808) (0.223,0.775) (0.244,0.742) (0.264,0.709) (0.284,0.676) (0.305,0.644) (0.325,0.613) (0.345,0.582) (0.366,0.552) (0.386,0.523) (0.406,0.494) (0.427,0.466) (0.447,0.439) (0.467,0.412) (0.487,0.387) (0.508,0.362) (0.528,0.338) (0.548,0.316) (0.569,0.294) (0.589,0.274) (0.609,0.254) (0.63,0.236) (0.65,0.219) (0.67,0.203) (0.691,0.188) (0.711,0.175) (0.731,0.163) (0.752,0.152) (0.772,0.142) (0.792,0.134) (0.813,0.127) (0.833,0.121) (0.853,0.116) (0.873,0.113) (0.894,0.112) (0.914,0.111) (0.934,0.112) (0.955,0.115) (0.975,0.118) (0.995,0.123) (1.016,0.13) (1.036,0.137) (1.056,0.146) (1.077,0.157) (1.097,0.168) (1.117,0.181) (1.137,0.195) (1.158,0.21) (1.178,0.227) (1.198,0.245) (1.219,0.263) (1.239,0.283) (1.259,0.304) (1.28,0.326) (1.3,0.349) (1.32,0.373) (1.341,0.398) (1.361,0.424) (1.381,0.451) (1.402,0.479) (1.422,0.507) (1.442,0.536) (1.463,0.566) (1.483,0.597) (1.503,0.628) (1.523,0.659) (1.544,0.691) (1.564,0.724) (1.584,0.757) (1.605,0.79) (1.625,0.824) (1.645,0.858) (1.666,0.892) (1.686,0.926) (1.706,0.961) (1.727,0.995) (1.747,1.029) (1.767,1.064) (1.787,1.098) (1.808,1.132) (1.828,1.166) (1.848,1.199) (1.869,1.232) (1.889,1.265) (1.909,1.298) (1.93,1.33) (1.95,1.361) (1.97,1.392) (1.991,1.422) (2.011,1.451) (2.031,1.48) (2.052,1.508) (2.072,1.535) (2.092,1.562) (2.113,1.587) (2.133,1.612) (2.153,1.636) (2.173,1.658) (2.194,1.68) (2.214,1.7) (2.234,1.72) (2.255,1.738) (2.275,1.755) (2.295,1.771) (2.316,1.786) (2.336,1.799) (2.356,1.811) (2.377,1.822) (2.397,1.832) (2.417,1.84) (2.438,1.848) (2.458,1.853) (2.478,1.858) (2.498,1.861) (2.519,1.862) (2.539,1.863) (2.559,1.862) (2.58,1.859) (2.6,1.856) (2.62,1.851) (2.641,1.844) (2.661,1.837) (2.681,1.828) (2.702,1.817) (2.722,1.806) (2.742,1.793) (2.762,1.779) (2.783,1.764) (2.803,1.747) (2.823,1.73) (2.844,1.711) (2.864,1.691) (2.884,1.67) (2.905,1.648) (2.925,1.625) (2.945,1.601) (2.966,1.576) (2.986,1.55) (3.006,1.523) (3.027,1.495) (3.047,1.467) (3.067,1.438) (3.087,1.408) (3.108,1.377) (3.128,1.346) (3.148,1.315) (3.169,1.283) (3.189,1.25) (3.209,1.217) (3.23,1.184) (3.25,1.15)};
\draw[thick,bwd,densely dashed] plot coordinates {(0,2.215) (0.02,2.214) (0.041,2.212) (0.061,2.209) (0.081,2.205) (0.102,2.2) (0.122,2.193) (0.142,2.185) (0.163,2.176) (0.183,2.166) (0.203,2.154) (0.223,2.142) (0.244,2.128) (0.264,2.114) (0.284,2.098) (0.305,2.081) (0.325,2.063) (0.345,2.045) (0.366,2.025) (0.386,2.004) (0.406,1.982) (0.427,1.96) (0.447,1.937) (0.467,1.913) (0.487,1.888) (0.508,1.862) (0.528,1.836) (0.548,1.809) (0.569,1.782) (0.589,1.754) (0.609,1.725) (0.63,1.696) (0.65,1.667) (0.67,1.637) (0.691,1.607) (0.711,1.576) (0.731,1.546) (0.752,1.515) (0.772,1.484) (0.792,1.453) (0.813,1.422) (0.833,1.39) (0.853,1.359) (0.873,1.328) (0.894,1.298) (0.914,1.267) (0.934,1.236) (0.955,1.206) (0.975,1.177) (0.995,1.147) (1.016,1.118) (1.036,1.09) (1.056,1.062) (1.077,1.034) (1.097,1.007) (1.117,0.981) (1.137,0.955) (1.158,0.931) (1.178,0.907) (1.198,0.883) (1.219,0.861) (1.239,0.839) (1.259,0.818) (1.28,0.799) (1.3,0.78) (1.32,0.762) (1.341,0.745) (1.361,0.73) (1.381,0.715) (1.402,0.701) (1.422,0.689) (1.442,0.677) (1.463,0.667) (1.483,0.658) (1.503,0.65) (1.523,0.644) (1.544,0.638) (1.564,0.634) (1.584,0.631) (1.605,0.629) (1.625,0.628) (1.645,0.629) (1.666,0.631) (1.686,0.634) (1.706,0.638) (1.727,0.644) (1.747,0.65) (1.767,0.658) (1.787,0.667) (1.808,0.677) (1.828,0.689) (1.848,0.701) (1.869,0.715) (1.889,0.73) (1.909,0.745) (1.93,0.762) (1.95,0.78) (1.97,0.799) (1.991,0.818) (2.011,0.839) (2.031,0.861) (2.052,0.883) (2.072,0.907) (2.092,0.931) (2.113,0.955) (2.133,0.981) (2.153,1.007) (2.173,1.034) (2.194,1.062) (2.214,1.09) (2.234,1.118) (2.255,1.147) (2.275,1.177) (2.295,1.206) (2.316,1.236) (2.336,1.267) (2.356,1.298) (2.377,1.328) (2.397,1.359) (2.417,1.39) (2.438,1.422) (2.458,1.453) (2.478,1.484) (2.498,1.515) (2.519,1.546) (2.539,1.576) (2.559,1.607) (2.58,1.637) (2.6,1.667) (2.62,1.696) (2.641,1.725) (2.661,1.754) (2.681,1.782) (2.702,1.809) (2.722,1.836) (2.742,1.862) (2.762,1.888) (2.783,1.913) (2.803,1.937) (2.823,1.96) (2.844,1.982) (2.864,2.004) (2.884,2.025) (2.905,2.045) (2.925,2.063) (2.945,2.081) (2.966,2.098) (2.986,2.114) (3.006,2.128) (3.027,2.142) (3.047,2.154) (3.067,2.166) (3.087,2.176) (3.108,2.185) (3.128,2.193) (3.148,2.2) (3.169,2.205) (3.189,2.209) (3.209,2.212) (3.23,2.214) (3.25,2.215)};
\draw[thick,bwd,dash dot] plot coordinates {(0,1.15) (0.02,1.162) (0.041,1.174) (0.061,1.185) (0.081,1.195) (0.102,1.205) (0.122,1.213) (0.142,1.221) (0.163,1.228) (0.183,1.235) (0.203,1.24) (0.223,1.245) (0.244,1.249) (0.264,1.252) (0.284,1.255) (0.305,1.256) (0.325,1.257) (0.345,1.256) (0.366,1.255) (0.386,1.254) (0.406,1.251) (0.427,1.247) (0.447,1.243) (0.467,1.238) (0.487,1.232) (0.508,1.225) (0.528,1.218) (0.548,1.209) (0.569,1.2) (0.589,1.19) (0.609,1.18) (0.63,1.169) (0.65,1.157) (0.67,1.144) (0.691,1.131) (0.711,1.117) (0.731,1.102) (0.752,1.087) (0.772,1.071) (0.792,1.055) (0.813,1.038) (0.833,1.021) (0.853,1.003) (0.873,0.985) (0.894,0.966) (0.914,0.947) (0.934,0.928) (0.955,0.908) (0.975,0.888) (0.995,0.868) (1.016,0.847) (1.036,0.826) (1.056,0.806) (1.077,0.785) (1.097,0.763) (1.117,0.742) (1.137,0.721) (1.158,0.7) (1.178,0.678) (1.198,0.657) (1.219,0.636) (1.239,0.615) (1.259,0.594) (1.28,0.574) (1.3,0.553) (1.32,0.533) (1.341,0.513) (1.361,0.494) (1.381,0.475) (1.402,0.456) (1.422,0.437) (1.442,0.419) (1.463,0.402) (1.483,0.385) (1.503,0.368) (1.523,0.352) (1.544,0.337) (1.564,0.322) (1.584,0.307) (1.605,0.294) (1.625,0.281) (1.645,0.268) (1.666,0.257) (1.686,0.246) (1.706,0.236) (1.727,0.226) (1.747,0.217) (1.767,0.209) (1.787,0.202) (1.808,0.196) (1.828,0.19) (1.848,0.186) (1.869,0.182) (1.889,0.179) (1.909,0.176) (1.93,0.175) (1.95,0.174) (1.97,0.174) (1.991,0.175) (2.011,0.177) (2.031,0.18) (2.052,0.183) (2.072,0.188) (2.092,0.193) (2.113,0.199) (2.133,0.206) (2.153,0.213) (2.173,0.221) (2.194,0.231) (2.214,0.24) (2.234,0.251) (2.255,0.262) (2.275,0.274) (2.295,0.287) (2.316,0.3) (2.336,0.314) (2.356,0.329) (2.377,0.344) (2.397,0.36) (2.417,0.376) (2.438,0.393) (2.458,0.41) (2.478,0.428) (2.498,0.446) (2.519,0.465) (2.539,0.484) (2.559,0.503) (2.58,0.523) (2.6,0.543) (2.62,0.563) (2.641,0.584) (2.661,0.604) (2.681,0.625) (2.702,0.646) (2.722,0.667) (2.742,0.689) (2.762,0.71) (2.783,0.731) (2.803,0.752) (2.823,0.773) (2.844,0.795) (2.864,0.815) (2.884,0.836) (2.905,0.857) (2.925,0.877) (2.945,0.897) (2.966,0.917) (2.986,0.937) (3.006,0.956) (3.027,0.975) (3.047,0.993) (3.067,1.011) (3.087,1.029) (3.108,1.046) (3.128,1.063) (3.148,1.079) (3.169,1.094) (3.189,1.109) (3.209,1.123) (3.23,1.137) (3.25,1.15)};
\node[above,inner sep=1pt] at (1.625,2.35) {\scriptsize six-dimensional code};
\end{scope}
\end{tikzpicture}
\caption{Two codes for the rotations about a fixed axis, through one full turn. Left: the four components of the unit quaternion with non-negative real part. At the half-turn the real part vanishes and the three others change sign, a jump of length $2.0000$. Right: the six components of the first two columns of the rotation matrix, which return to their initial values without a jump.}\label{fig:rotation}
\end{figure}
\noindent Along a full turn in $2000$ steps (\cref{fig:rotation}) the rotation matrix moves by at most $0.0044$ per step and the
six-dimensional code by $0.0040$, while the quaternion with non-negative real part jumps by $2.0000$ and the
Euler angles of a turn about the second axis by $3.1416$. \chk{O4} For $200$ random rotations the Gram--Schmidt
decoder recovers the matrix to $10^{-12}$, and it moves by at most $1.40$ times a perturbation of the code.
\chk{O5} Statement (b) is the usable form: a data set of poses that contains a loop equivalent to a full turn has
no continuous quaternion labelling, whatever the convention; a data set confined to a ball of rotations has one.
A loss that identifies $q$ with $-q$ repairs the target but not the output layer, which still has to choose.
\subsection{Combing a mesh}
A convolution on a surface compares feature vectors at neighbouring points, which requires a frame at each point
in which to express them. A frame field is a framing in the sense of \cite[Ch.~8]{ADTHC}.
\begin{theorem}[Hairy ball, on meshes]\label{thm:hairy}
\Scl[Poincar\'e--Hopf; \cite{Ban67}] The zeros of a tangent vector field on a closed surface, counted with index,
number $\chi$. On a triangulated surface with a generic function $h$ on the vertices, define the index of a
vertex as $1-\frac12\#\{\text{sign changes of }h(w)-h(v)\text{ round the link}\}$; the indices add up to $\chi$.
\end{theorem}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\draw[ink2] (1,0.78)--(0.325,0.39)--(0.325,-0.39)--(1,-0.78)--(1.675,-0.39)--(1.675,0.39)--cycle;
\draw[ink2,very thin] (1,0)--(1,0.78);
\draw[ink2,very thin] (1,0)--(0.325,0.39);
\draw[ink2,very thin] (1,0)--(0.325,-0.39);
\draw[ink2,very thin] (1,0)--(1,-0.78);
\draw[ink2,very thin] (1,0)--(1.675,-0.39);
\draw[ink2,very thin] (1,0)--(1.675,0.39);
\draw[bwd,fill=white] (1,0.78) circle (2.1pt);
\draw[bwd,fill=white] (0.325,0.39) circle (2.1pt);
\draw[bwd,fill=white] (0.325,-0.39) circle (2.1pt);
\draw[bwd,fill=white] (1,-0.78) circle (2.1pt);
\draw[bwd,fill=white] (1.675,-0.39) circle (2.1pt);
\draw[bwd,fill=white] (1.675,0.39) circle (2.1pt);
\fill[accent] (1,0) circle (2.1pt);
\node[anchor=base] at (1,-1.2) {\scriptsize maximum};
\node[anchor=base] at (1,-1.52) {\scriptsize $0$ changes};
\node[anchor=base] at (1,-1.84) {\scriptsize index $1$};
\draw[ink2] (2.98,0.78)--(2.305,0.39)--(2.305,-0.39)--(2.98,-0.78)--(3.655,-0.39)--(3.655,0.39)--cycle;
\draw[ink2,very thin] (2.98,0)--(2.98,0.78);
\draw[ink2,very thin] (2.98,0)--(2.305,0.39);
\draw[ink2,very thin] (2.98,0)--(2.305,-0.39);
\draw[ink2,very thin] (2.98,0)--(2.98,-0.78);
\draw[ink2,very thin] (2.98,0)--(3.655,-0.39);
\draw[ink2,very thin] (2.98,0)--(3.655,0.39);
\fill[bwd] (2.98,0.78) circle (2.1pt);
\fill[bwd] (2.305,0.39) circle (2.1pt);
\fill[bwd] (2.305,-0.39) circle (2.1pt);
\draw[bwd,fill=white] (2.98,-0.78) circle (2.1pt);
\draw[bwd,fill=white] (3.655,-0.39) circle (2.1pt);
\draw[bwd,fill=white] (3.655,0.39) circle (2.1pt);
\fill[accent] (2.98,0) circle (2.1pt);
\node[anchor=base] at (2.98,-1.2) {\scriptsize regular};
\node[anchor=base] at (2.98,-1.52) {\scriptsize $2$ changes};
\node[anchor=base] at (2.98,-1.84) {\scriptsize index $0$};
\draw[ink2] (4.96,0.78)--(4.285,0.39)--(4.285,-0.39)--(4.96,-0.78)--(5.635,-0.39)--(5.635,0.39)--cycle;
\draw[ink2,very thin] (4.96,0)--(4.96,0.78);
\draw[ink2,very thin] (4.96,0)--(4.285,0.39);
\draw[ink2,very thin] (4.96,0)--(4.285,-0.39);
\draw[ink2,very thin] (4.96,0)--(4.96,-0.78);
\draw[ink2,very thin] (4.96,0)--(5.635,-0.39);
\draw[ink2,very thin] (4.96,0)--(5.635,0.39);
\fill[bwd] (4.96,0.78) circle (2.1pt);
\fill[bwd] (4.285,0.39) circle (2.1pt);
\draw[bwd,fill=white] (4.285,-0.39) circle (2.1pt);
\fill[bwd] (4.96,-0.78) circle (2.1pt);
\draw[bwd,fill=white] (5.635,-0.39) circle (2.1pt);
\draw[bwd,fill=white] (5.635,0.39) circle (2.1pt);
\fill[accent] (4.96,0) circle (2.1pt);
\node[anchor=base] at (4.96,-1.2) {\scriptsize saddle};
\node[anchor=base] at (4.96,-1.52) {\scriptsize $4$ changes};
\node[anchor=base] at (4.96,-1.84) {\scriptsize index $-1$};
\draw[ink2] (6.94,0.78)--(6.265,0.39)--(6.265,-0.39)--(6.94,-0.78)--(7.615,-0.39)--(7.615,0.39)--cycle;
\draw[ink2,very thin] (6.94,0)--(6.94,0.78);
\draw[ink2,very thin] (6.94,0)--(6.265,0.39);
\draw[ink2,very thin] (6.94,0)--(6.265,-0.39);
\draw[ink2,very thin] (6.94,0)--(6.94,-0.78);
\draw[ink2,very thin] (6.94,0)--(7.615,-0.39);
\draw[ink2,very thin] (6.94,0)--(7.615,0.39);
\fill[bwd] (6.94,0.78) circle (2.1pt);
\draw[bwd,fill=white] (6.265,0.39) circle (2.1pt);
\fill[bwd] (6.265,-0.39) circle (2.1pt);
\draw[bwd,fill=white] (6.94,-0.78) circle (2.1pt);
\fill[bwd] (7.615,-0.39) circle (2.1pt);
\draw[bwd,fill=white] (7.615,0.39) circle (2.1pt);
\fill[accent] (6.94,0) circle (2.1pt);
\node[anchor=base] at (6.94,-1.2) {\scriptsize monkey saddle};
\node[anchor=base] at (6.94,-1.52) {\scriptsize $6$ changes};
\node[anchor=base] at (6.94,-1.84) {\scriptsize index $-2$};
\end{tikzpicture}
\caption{The index of a vertex for a function on a mesh. Filled neighbours are higher than the centre, open ones lower; the index is one minus half the number of changes round the link. A minimum has the same link as a maximum with the marks exchanged, and index $1$.}\label{fig:index}
\end{figure}
\noindent The rule is drawn in \cref{fig:index}. The sums are $2,2,0,1,0$ for a tetrahedron, an icosahedron, the seven-vertex torus, the six-vertex
projective plane and a Klein bottle, for $100$ random functions each. \chk{O6} So a global frame field exists on a
closed orientable surface only when $\chi=0$, and on a sphere every choice of frames is singular with total
index $2$. This is the obstruction that gauge-equivariant convolution is designed around \cite{CWKW19}: since no
frame can be chosen, the layers must be equivariant for changes of frame.
In higher dimensions the same question has a sharp answer. A sphere $S^n$ with $n$ even has $\chi=2$ and not
even one tangent field without zeros; and $S^n$ has a global frame exactly for $n=1,3,7$, a theorem of the same
family as the Hopf invariant one problem \cite[Rem.~9.7]{ADTHC}. On $S^3$ the frame is explicit: at a unit
quaternion $q$ the vectors $qi$, $qj$, $qk$ are orthonormal and tangent. \chk{O11} This is why a latent space or
an output space that is a circle, a torus or the group of unit quaternions needs no gauge, and why constructions
that push a fixed noise distribution through the group multiplication are available there \cite{FdH18}, while
on $S^2$ they are not.
\subsection{Pieces and degree}
\begin{theorem}[Capacity for winding]\label{thm:pieces}
\Sob \emph{(a)} A continuous piecewise linear function of one variable with $k$ breakpoints is the sum of an
affine function and $k$ rectifier units. \emph{(b)} A closed piecewise linear curve in the punctured plane with $N$
segments has winding number of absolute value less than $N/2$. \emph{(c)} The polygon through the images of $N$
equally spaced points under $z\mapsto z^d$ winds $d'$ times, where $d'\equiv d\pmod N$ and $|d'|<N/2$.
\end{theorem}
\begin{proof}
(a) To the leftmost affine piece add one unit $c_i\relu(x-x_i)$ per breakpoint $x_i$, with $c_i$ the change of
slope. (b) A segment missing the
origin subtends an angle less than $\pi$. (c) Consecutive vertices differ by the angle $2\pi d/N$, taken in
$(-\pi,\pi)$.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\draw[ink2,thin] (1.9,0) circle (1.42);
\draw[fwd,thick,-{Stealth[length=4pt]}] (1.9,1.42)--(2.351,0.033);
\draw[fwd,thick] (2.351,0.033)--(2.735,-1.149);
\draw[fwd,thick,-{Stealth[length=4pt]}] (2.735,-1.149)--(1.555,-0.291);
\draw[fwd,thick] (1.555,-0.291)--(0.549,0.439);
\draw[fwd,thick,-{Stealth[length=4pt]}] (0.549,0.439)--(2.008,0.439);
\draw[fwd,thick] (2.008,0.439)--(3.251,0.439);
\draw[fwd,thick,-{Stealth[length=4pt]}] (3.251,0.439)--(2.071,-0.419);
\draw[fwd,thick] (2.071,-0.419)--(1.065,-1.149);
\draw[fwd,thick,-{Stealth[length=4pt]}] (1.065,-1.149)--(1.516,0.238);
\draw[fwd,thick] (1.516,0.238)--(1.9,1.42);
\fill[bwd] (1.9,1.42) circle (1.5pt);
\node at (1.9,1.64) {\scriptsize $0$};
\fill[bwd] (2.735,-1.149) circle (1.5pt);
\node at (2.864,-1.327) {\scriptsize $1$};
\fill[bwd] (0.549,0.439) circle (1.5pt);
\node at (0.34,0.507) {\scriptsize $2$};
\fill[bwd] (3.251,0.439) circle (1.5pt);
\node at (3.46,0.507) {\scriptsize $3$};
\fill[bwd] (1.065,-1.149) circle (1.5pt);
\node at (0.936,-1.327) {\scriptsize $4$};
\fill[accent] (1.9,0) circle (1.3pt);
\node at (1.9,-2.04) {\scriptsize $N=5$: winding $-2$};
\draw[ink2,thin] (6,0) circle (1.42);
\draw[fwd,thick,-{Stealth[length=4pt]}] (6,1.42)--(5.667,-0.038);
\draw[fwd,thick] (5.667,-0.038)--(5.384,-1.279);
\draw[fwd,thick,-{Stealth[length=4pt]}] (5.384,-1.279)--(6.316,-0.11);
\draw[fwd,thick] (6.316,-0.11)--(7.11,0.885);
\draw[fwd,thick,-{Stealth[length=4pt]}] (7.11,0.885)--(5.763,0.237);
\draw[fwd,thick] (5.763,0.237)--(4.616,-0.316);
\draw[fwd,thick,-{Stealth[length=4pt]}] (4.616,-0.316)--(6.111,-0.316);
\draw[fwd,thick] (6.111,-0.316)--(7.384,-0.316);
\draw[fwd,thick,-{Stealth[length=4pt]}] (7.384,-0.316)--(6.037,0.333);
\draw[fwd,thick] (6.037,0.333)--(4.89,0.885);
\draw[fwd,thick,-{Stealth[length=4pt]}] (4.89,0.885)--(5.822,-0.284);
\draw[fwd,thick] (5.822,-0.284)--(6.616,-1.279);
\draw[fwd,thick,-{Stealth[length=4pt]}] (6.616,-1.279)--(6.283,0.178);
\draw[fwd,thick] (6.283,0.178)--(6,1.42);
\fill[bwd] (6,1.42) circle (1.5pt);
\node at (6,1.64) {\scriptsize $0$};
\fill[bwd] (5.384,-1.279) circle (1.5pt);
\node at (5.288,-1.478) {\scriptsize $1$};
\fill[bwd] (7.11,0.885) circle (1.5pt);
\node at (7.282,1.023) {\scriptsize $2$};
\fill[bwd] (4.616,-0.316) circle (1.5pt);
\node at (4.401,-0.365) {\scriptsize $3$};
\fill[bwd] (7.384,-0.316) circle (1.5pt);
\node at (7.599,-0.365) {\scriptsize $4$};
\fill[bwd] (4.89,0.885) circle (1.5pt);
\node at (4.718,1.023) {\scriptsize $5$};
\fill[bwd] (6.616,-1.279) circle (1.5pt);
\node at (6.712,-1.478) {\scriptsize $6$};
\fill[accent] (6,0) circle (1.3pt);
\node at (6,-2.04) {\scriptsize $N=7$: winding $3$};
\end{tikzpicture}
\caption{The map $z\mapsto z^3$ of the circle sampled at $N$ equally spaced points and joined by segments; the numbers give the order of the samples. With seven pieces each step is $\frac37$ of a turn forwards and the polygon winds $3$ times. With five, each step of $\frac35$ of a turn is drawn as the shorter arc, $\frac25$ of a turn backwards, and the polygon winds $-2$ times.}\label{fig:polygons}
\end{figure}
\noindent Part (a) was confirmed on $50$ random functions with six breakpoints. \chk{O7} The polygons for $d=3$ wind $-2$, $3$, $3$ times for $N=5,7,12$ (\cref{fig:polygons}), and for $(d,N)=(5,8)$ and
$(7,10)$ they wind $-3$ times. \chk{O8} A network whose output curve has $N$ linear pieces therefore cannot
represent a map of the circle of degree $d$ unless $N\ge2|d|+1$: too few pieces alias the degree exactly as too
few samples alias a frequency. This is the simplicial approximation theorem \cite[Thm.~3.2]{ADTHC} with its
hypothesis made visible: sampling a map at the vertices of a subdivision always gives a piecewise linear map,
and that map is in the right homotopy class only when the subdivision is fine enough for the star condition.
\begin{proposition}[Depth multiplies degree]\label{prop:depth}
\Srf[\cite{Tel16}] Let $F$ be the map of the plane that is linear on each of the eight cones over the half-sides
of the square $[-1,1]^2$ and doubles the perimeter coordinate on its boundary. Then $F^L$ maps the boundary to
itself with degree $2^L$ and with $4\cdot2^L$ linear pieces. A network with one hidden layer of $k$ rectifier
units maps the boundary to a curve of at most $2k+4$ pieces, hence of degree less than $k+2$.
\end{proposition}
\begin{proof}
Degree is multiplicative under composition \cite[Prop.~5.4]{ADTHC}. The breaking line of a unit meets the
boundary of the square in at most two points, and the square has four corners; now apply
\cref{thm:pieces}\emph{(b)}.
\end{proof}
\noindent The windings are $2,4,\dots,64$ and the pieces $8,16,\dots,256$ for $L=1,\dots,6$. \chk{O9} Each layer
is a fixed continuous piecewise linear map, hence a rectifier network of fixed size \cite{ABMM18}. So a
network of depth $L$ and bounded width reaches degree $2^L$, with a number of pieces within a factor $2$ of the
least that \cref{thm:pieces} allows, while one hidden layer needs more than $2^L-2$ units. This is the
depth-separation phenomenon \cite{Tel16} with the count of oscillations replaced by a homotopy invariant:
degrees multiply under composition and pieces only add within a layer.
\subsection{Width}
\begin{theorem}[Narrow networks]\label{thm:narrow}
\Sli[\cite{Joh19,HaSe17}] Let $f\colon\R^n\to\R$ be a network whose hidden layers all have $n$ units, with invertible
weight matrices, a non-zero output layer, and an activation that is continuous, strictly increasing and onto
$\R$, such as the leaky rectifier. Then each decision region $\{f>0\}$, $\{f<0\}$ is homeomorphic to $\R^n$ and unbounded. In particular
$f$ cannot separate a bounded class from a class that surrounds it. With one hidden layer of $n+1$ rectifier
units a bounded decision region exists.
\end{theorem}
\begin{proof}
Each hidden layer is a homeomorphism of $\R^n$, so their composite $h$ is one, and $\{f>0\}=h^{-1}(H)$ for an
open half-space $H$. If it were bounded its closure would be compact, and so would the image of the closure
under $h$, which contains $H$. For the last statement let $a_0,\dots,a_n$ be the vertices of a regular simplex centred at the
origin and $f(x)=1-\sum_i\relu(a_i\cdot x)$. Every $x\ne0$ has $a_i\cdot x>0$ for some $i$, and by compactness
$\sum_i\relu(a_i\cdot x)\ge c|x|$ with $c>0$; so $\{f>0\}$ is bounded, and it contains the origin.
\end{proof}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{scope}
\clip (0,0) rectangle (3.3,3.3);
\fill[fwd!16] (-20.35,-20.35)--(1.445,1.821)--(1.459,1.837)--(2.195,2.429)--(2.194,2.428)--(1.897,1.884)--(1.897,1.883)--(1.921,1.903)--(1.972,1.945)--(1.976,1.944)--(17.881,-7.904)--(17.933,-7.942)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(23.65,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--(-20.35,-20.35)--cycle;
\draw[fwd,thick] (-20.35,-20.35)--(1.445,1.821)--(1.459,1.837)--(2.195,2.429)--(2.194,2.428)--(1.897,1.884)--(1.897,1.883)--(1.921,1.903)--(1.972,1.945)--(1.976,1.944)--(17.881,-7.904)--(17.933,-7.942)--(23.65,-20.35);
\end{scope}
\draw[ink2] (0,0) rectangle (3.3,3.3);
\node at (1.65,-0.28) {\scriptsize two units per layer};
\begin{scope}
\clip (4.3,0) rectangle (7.6,3.3);
\draw[ink2,densely dotted] (1,1.65)--(10.9,1.65);
\draw[ink2,densely dotted] (8.425,-2.637)--(3.475,5.937);
\draw[ink2,densely dotted] (8.425,5.937)--(3.475,-2.637);
\draw[fwd,thick,fill=fwd!16] (6.585,1.65)--(6.268,2.2)--(5.632,2.2)--(5.315,1.65)--(5.632,1.1)--(6.268,1.1)--cycle;
\end{scope}
\draw[ink2] (4.3,0) rectangle (7.6,3.3);
\node at (5.95,-0.28) {\scriptsize three units, one layer};
\end{tikzpicture}
\caption{Decision regions on the square $[-3,3]^2$. Left: a network of depth three with two leaky rectifier units per layer; the positive region (shaded) is the image of a half-plane under a piecewise linear homeomorphism: it bends where units switch, and it has no holes and no end. Right: $1-\sum_i\relu(a_i\cdot x)$ with three units; the dotted lines are where the units switch, and the positive region is a bounded hexagon.}\label{fig:narrow}
\end{figure}
\noindent For $30$ random networks of depth four on the plane, with two leaky rectifier units per layer, two points
of the same region were joined inside it by the preimage of a segment, the preimages of rays left every
bounded set, and both classes were present on circles of radius $10$, $100$ and $1000$ times the distance of
the decision boundary from the origin. The three-unit function above is positive at the origin and at most
$-2.46$ on the circle of radius $4$ (\cref{fig:narrow}). \chk{O10} The argument uses only that the layers are
homeomorphisms: topology can change only where a layer folds, as the rectifier does, or changes dimension
\cite{NZL20}. For the rectifier itself and for other activations that are limits of injective ones a related
statement holds, with unbounded level sets \cite{Joh19}; and width $n+1$ is also the threshold for approximating
arbitrary continuous functions \cite{HaSe17}.
\section{Invariants}\label{sec:invariants}
\subsection{Hodge Laplacians}
Let $K$ be a simplicial complex with boundary matrices $\pd_k$. The \term{Hodge Laplacian} on $k$-chains is
$L_k=\pd_k^{\T}\pd_k+\pd_{k+1}\pd_{k+1}^{\T}$; for $k=0$ it is the graph Laplacian. Networks on complexes pass
messages along $\pd_k$ and $\pd_{k+1}^{\T}$ \cite{EDS20,BFW21}.
\begin{theorem}[Hodge]\label{thm:hodge}
\Scl[\cite{Eck44,Lim20}] \emph{(a)} $\ker L_k\cong H_k(K;\R)$. \emph{(b)} The iteration $X\mapsto X-\tau L_kX$ with
$0<\tau\le1/\lambda_{\max}$ converges to the orthogonal projection of $X$ on $\ker L_k$, the error contracting by
$1-\tau\lambda_{\min}^+$ per layer, where $\lambda_{\min}^+$ is the smallest non-zero eigenvalue.
\end{theorem}
\noindent The kernels have dimensions $(1,0,1)$, $(1,2,1)$, $(1,0,0)$, $(1,1,0)$, $(1,1,0)$, $(1,0,0)$ for the
sphere, torus, projective plane, Klein bottle, M\"obius band and disc, which are the Betti numbers computed
independently by Smith normal form. \chk{V1} On the edges of the seven-vertex torus $\lambda_{\min}^+=1.5858$ and
$\lambda_{\max}=7$; after $99$ layers four random inputs have converged to $10^{-11}$, and their limits span a
space of dimension $2$. \chk{V3} Statement (b) is the oversmoothing of graph networks one dimension up, with a
difference: the limit is not a constant but a harmonic form, and it carries exactly the homology.
\begin{proposition}[Coefficients are a choice of what is visible]\label{prop:torsion}
\Sob The limit in \cref{thm:hodge}\emph{(b)} depends only on the real homology of $K$. The projective plane and
the disc have the same harmonic spaces in every degree, although $H_1$ of the projective plane is $\Z/2$. Over
the field $\Fp_2$ the Betti numbers are $(1,1,1)$ and $(1,0,0)$. Conversely the Klein bottle and the torus agree
over $\Fp_2$, with $(1,2,1)$, and differ over $\R$.
\end{proposition}
\noindent The Betti numbers quoted are recomputed by the script. \chk{V2} Integral homology sees both distinctions at once and is computed by integer row and column
operations \cite[Ch.~2]{ADTHC}, which are not differentiable. An architecture built from real boundary matrices
has made the choice of the first column of the table below.
\begin{center}\small
\begin{tabular}{lccc}
\toprule
& over $\R$ & over $\Fp_2$ & over $\Z$\\
\midrule
disc & $1,0,0$ & $1,0,0$ & $\Z,0,0$\\
projective plane & $1,0,0$ & $1,1,1$ & $\Z,\Z/2,0$\\
torus & $1,2,1$ & $1,2,1$ & $\Z,\Z^2,\Z$\\
Klein bottle & $1,1,0$ & $1,2,1$ & $\Z,\Z\oplus\Z/2,0$\\
\bottomrule
\end{tabular}
\end{center}
\subsection{Complexes built from samples}
Topological data analysis replaces a point cloud by the \term{Vietoris--Rips complex} at scale $r$, whose
simplices are the sets of points of diameter at most $r$, and reads off homology as $r$ varies
\cite{Car09,EdHa10}. For small $r$ and dense samples this recovers the homology of the underlying manifold
\cite{NSW08}. For large $r$ it does not, and what it produces instead is known for the circle.
\begin{theorem}[Rips complexes of a circle]\label{thm:rips}
\Sli[\cite{Ada13,AdAd17}] As the scale increases, the Vietoris--Rips complex of the circle has the homotopy type of
$S^1$, then $S^3$, then $S^5$, and so on, the type $S^{2l+1}$ occurring for scales between $\frac l{2l+1}$ and
$\frac{l+1}{2l+3}$ of a turn, until it is contractible. For $n$ equally spaced points and scale $k$ steps the same
holds with $k/n$ in place of the scale, and at the transition $k/n=\frac l{2l+1}$ the complex is a wedge of
$n-2k-1$ spheres of dimension $2l$.
\end{theorem}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\draw[ink2,very thin,fill=fwd!22] (1,0) rectangle (1.92,0.42);
\node at (1.46,0.21) {\scriptsize $1$};
\draw[ink2,very thin,fill=fwd!22] (1,0.42) rectangle (1.92,0.84);
\node at (1.46,0.63) {\scriptsize $1$};
\draw[ink2,very thin,fill=white] (1,0.84) rectangle (1.92,1.26);
\draw[ink2,very thin,fill=white] (1,1.26) rectangle (1.92,1.68);
\draw[ink2,very thin,fill=white] (1,1.68) rectangle (1.92,2.1);
\draw[ink2,very thin,fill=white] (1,2.1) rectangle (1.92,2.52);
\node at (1.46,-0.22) {\scriptsize $1$};
\draw[ink2,very thin,fill=fwd!22] (1.92,0) rectangle (2.84,0.42);
\node at (2.38,0.21) {\scriptsize $1$};
\draw[ink2,very thin,fill=fwd!22] (1.92,0.42) rectangle (2.84,0.84);
\node at (2.38,0.63) {\scriptsize $1$};
\draw[ink2,very thin,fill=white] (1.92,0.84) rectangle (2.84,1.26);
\draw[ink2,very thin,fill=white] (1.92,1.26) rectangle (2.84,1.68);
\draw[ink2,very thin,fill=white] (1.92,1.68) rectangle (2.84,2.1);
\draw[ink2,very thin,fill=white] (1.92,2.1) rectangle (2.84,2.52);
\node at (2.38,-0.22) {\scriptsize $2$};
\draw[ink2,very thin,fill=fwd!22] (2.84,0) rectangle (3.76,0.42);
\node at (3.3,0.21) {\scriptsize $1$};
\draw[ink2,very thin,fill=fwd!22] (2.84,0.42) rectangle (3.76,0.84);
\node at (3.3,0.63) {\scriptsize $1$};
\draw[ink2,very thin,fill=white] (2.84,0.84) rectangle (3.76,1.26);
\draw[ink2,very thin,fill=white] (2.84,1.26) rectangle (3.76,1.68);
\draw[ink2,very thin,fill=white] (2.84,1.68) rectangle (3.76,2.1);
\draw[ink2,very thin,fill=white] (2.84,2.1) rectangle (3.76,2.52);
\node at (3.3,-0.22) {\scriptsize $3$};
\draw[ink2,very thin,fill=fwd!22] (3.76,0) rectangle (4.68,0.42);
\node at (4.22,0.21) {\scriptsize $1$};
\draw[ink2,very thin,fill=white] (3.76,0.42) rectangle (4.68,0.84);
\draw[ink2,very thin,fill=accent!28] (3.76,0.84) rectangle (4.68,1.26);
\node at (4.22,1.05) {\scriptsize $3$};
\draw[ink2,very thin,fill=white] (3.76,1.26) rectangle (4.68,1.68);
\draw[ink2,very thin,fill=white] (3.76,1.68) rectangle (4.68,2.1);
\draw[ink2,very thin,fill=white] (3.76,2.1) rectangle (4.68,2.52);
\node at (4.22,-0.22) {\scriptsize $4$};
\draw[ink2,very thin,fill=fwd!22] (4.68,0) rectangle (5.6,0.42);
\node at (5.14,0.21) {\scriptsize $1$};
\draw[ink2,very thin,fill=white] (4.68,0.42) rectangle (5.6,0.84);
\draw[ink2,very thin,fill=white] (4.68,0.84) rectangle (5.6,1.26);
\draw[ink2,very thin,fill=white] (4.68,1.26) rectangle (5.6,1.68);
\draw[ink2,very thin,fill=white] (4.68,1.68) rectangle (5.6,2.1);
\draw[ink2,very thin,fill=accent!28] (4.68,2.1) rectangle (5.6,2.52);
\node at (5.14,2.31) {\scriptsize $1$};
\node at (5.14,-0.22) {\scriptsize $5$};
\draw[ink2,very thin,fill=fwd!22] (5.6,0) rectangle (6.52,0.42);
\node at (6.06,0.21) {\scriptsize $1$};
\draw[ink2,very thin,fill=white] (5.6,0.42) rectangle (6.52,0.84);
\draw[ink2,very thin,fill=white] (5.6,0.84) rectangle (6.52,1.26);
\draw[ink2,very thin,fill=white] (5.6,1.26) rectangle (6.52,1.68);
\draw[ink2,very thin,fill=white] (5.6,1.68) rectangle (6.52,2.1);
\draw[ink2,very thin,fill=white] (5.6,2.1) rectangle (6.52,2.52);
\node at (6.06,-0.22) {\scriptsize $6$};
\node[left,inner sep=2pt] at (1,0.21) {\scriptsize $H_0$};
\node[left,inner sep=2pt] at (1,0.63) {\scriptsize $H_1$};
\node[left,inner sep=2pt] at (1,1.05) {\scriptsize $H_2$};
\node[left,inner sep=2pt] at (1,1.47) {\scriptsize $H_3$};
\node[left,inner sep=2pt] at (1,1.89) {\scriptsize $H_4$};
\node[left,inner sep=2pt] at (1,2.31) {\scriptsize $H_5$};
\node at (3.76,-0.62) {\scriptsize scale $k$ (steps of $\frac1{12}$ of a turn)};
\draw[ink2] (1,3.04)--(6.06,3.04);
\draw[ink2] (4.22,2.97)--(4.22,3.11);
\draw[ink2] (4.956,2.97)--(4.956,3.11);
\draw[ink2] (5.271,2.97)--(5.271,3.11);
\draw[ink2] (6.06,2.97)--(6.06,3.11);
\node[above,inner sep=2pt] at (2.61,3.04) {\scriptsize $S^1$};
\node[above,inner sep=2pt] at (4.588,3.04) {\scriptsize $S^3$};
\node[above,inner sep=2pt] at (5.134,3.34) {\scriptsize $S^5$};
\draw[ink2,very thin] (5.114,3.06)--(5.134,3.34);
\node[above,inner sep=2pt] at (5.666,3.04) {\scriptsize $\cdots$};
\node[below,inner sep=2.5pt] at (4.22,3.02) {\tiny $\frac13$};
\node[below,inner sep=2.5pt] at (4.956,3.02) {\tiny $\frac25$};
\node[below,inner sep=2.5pt] at (6.06,3.02) {\tiny $\frac12$};
\node[right,inner sep=3pt] at (6.06,3.04) {\scriptsize circle};
\end{tikzpicture}
\caption{Betti numbers over $\Fp_2$ of the Vietoris--Rips complex of twelve equally spaced points on a circle, by scale. The class of the circle (blue) lasts up to $k=3$. At $k=4$, exactly a third of a turn, three classes appear in degree $2$, and at $k=5$ one in degree $5$ (red); at $k=6$ the complex is a full simplex. The line above shows the homotopy type of the complex of the whole circle at the corresponding scale \cite{AdAd17}.}\label{fig:barcode}
\end{figure}
\noindent For $n=12$ the Betti numbers over $\Fp_2$ are $(1,1)$ for $k=1,2,3$; $(1,0,3)$ for $k=4$; and
$(1,0,0,0,0,1)$ for $k=5$ (\cref{fig:barcode}). For $n=13$ and $k=5$, which lies between $\frac13$ and $\frac25$, they are $(1,0,0,1)$.
\chk{V4, V5} For $16$ random points on the unit circle whose largest gap is a chord of length $1.516$, the complex
has Betti numbers $(11,0)$ at $r=0.15$, $(1,1)$ at $r=1.55$ and $(1,0)$ at $r=1.9$. \chk{V6} The circle is seen from the largest gap up to about $\sqrt3$,
the chord of a third of a turn. Above that scale the classes in dimensions
$2$, $3$ and $5$ are topology of the construction and not of the data. A learned model that consumes persistence
diagrams should not treat high-dimensional classes at large scales as evidence of high-dimensional structure.
\subsection{Stability}
A \term{persistence diagram} records, for each homology class of the sublevel sets $\{f\le t\}$ of a function,
the levels at which it is born and dies. The \term{bottleneck distance} between two diagrams is the least
$\delta$ for which their points can be matched, to each other or to the diagonal, with no point moved by more
than $\delta$.
\begin{theorem}[Stability]\label{thm:stability}
\Scl[\cite{CEH07}] For two functions $f,g$ on a finite complex, the bottleneck distance between their persistence
diagrams is at most $\max|f-g|$.
\end{theorem}
\noindent For $60$ random functions on a cycle of $40$ vertices, perturbed by between $0.02$ and $0.3$ in the
maximum norm, the distance between the diagrams in degree $0$ was never larger than the perturbation, and
equal to it in the worst case, while the number of points of the diagram changed in $35$ of the $60$ cases.
\chk{V7} The diagram is a Lipschitz function of the data and a Betti number is not even continuous. This is the
property that lets persistence enter a model as a feature or a loss, and it is the quantitative form of the
functoriality of homology: a small change of $f$ is an interleaving of the two filtrations.
\section{Counts}\label{sec:counts}
\subsection{Where regions meet}
\begin{theorem}[Junctions]\label{thm:junctions}
\Srf[Lebesgue; \cite{ADTHC}, Thm.~4.3] Let the cube $[0,1]^n$ be covered by finitely many closed sets, none of
which meets two opposite faces. Then some point lies in at least $n+1$ of them.
\end{theorem}
\noindent Apply this to the closures of the decision regions of a classifier, a region being a connected set of inputs
with one label. If no region reaches across the cube, there is a point every neighbourhood of which meets $n+1$
regions. Small regions
cannot be arranged so that at most $n$ meet anywhere; the brick pattern, in which exactly $n+1$ meet, is optimal
\cite[Fig.~4.4]{ADTHC}.
\begin{figure}[t]
\centering
\begin{tikzpicture}
\fill[fwd!10] (1.401,2.877)--(0.521,3.118)--(0,3.082)--(0,0.925)--(1.286,1.775)--cycle;
\fill[fwd!10] (0.826,5.4)--(0.079,5.4)--(0.53,3.569)--(1.116,4.969)--cycle;
\fill[fwd!10] (1.882,0)--(4.185,0)--(3.21,1.164)--(2.829,1.232)--(2.243,1.074)--cycle;
\fill[bwd!14] (0.079,5.4)--(0,5.4)--(0,3.082)--(0.521,3.118)--(0.53,3.569)--cycle;
\fill[accent!10] (1.116,4.969)--(0.53,3.569)--(0.521,3.118)--(1.401,2.877)--(2.026,3.347)--(2.102,3.835)--cycle;
\fill[fwd!10] (2.407,3.084)--(2.576,2.811)--(3.841,2.118)--(4.278,2.381)--(3.928,3.183)--cycle;
\fill[bwd!14] (5.4,2.101)--(5.4,4.757)--(4.151,4.075)--(3.928,3.183)--(4.278,2.381)--cycle;
\fill[bwd!14] (3.841,2.118)--(2.576,2.811)--(2.829,1.232)--(3.21,1.164)--cycle;
\fill[bwd!14] (0,0)--(1.882,0)--(2.243,1.074)--(1.286,1.775)--(0,0.925)--cycle;
\fill[ink2!12] (2.026,3.347)--(1.401,2.877)--(1.286,1.775)--(2.243,1.074)--(2.829,1.232)--(2.576,2.811)--(2.407,3.084)--cycle;
\fill[accent!10] (4.185,0)--(5.4,0)--(5.4,2.101)--(4.278,2.381)--(3.841,2.118)--(3.21,1.164)--cycle;
\fill[bwd!14] (2.982,5.4)--(0.826,5.4)--(1.116,4.969)--(2.102,3.835)--(2.86,4.425)--cycle;
\fill[fwd!24] (2.86,4.425)--(2.102,3.835)--(2.026,3.347)--(2.407,3.084)--(3.928,3.183)--(4.151,4.075)--cycle;
\fill[fwd!10] (5.4,4.757)--(5.4,5.4)--(2.982,5.4)--(2.86,4.425)--(4.151,4.075)--cycle;
\draw[ink2,thin] (1.401,2.877)--(0.521,3.118)--(0,3.082)--(0,0.925)--(1.286,1.775)--cycle;
\draw[ink2,thin] (0.826,5.4)--(0.079,5.4)--(0.53,3.569)--(1.116,4.969)--cycle;
\draw[ink2,thin] (1.882,0)--(4.185,0)--(3.21,1.164)--(2.829,1.232)--(2.243,1.074)--cycle;
\draw[ink2,thin] (0.079,5.4)--(0,5.4)--(0,3.082)--(0.521,3.118)--(0.53,3.569)--cycle;
\draw[ink2,thin] (1.116,4.969)--(0.53,3.569)--(0.521,3.118)--(1.401,2.877)--(2.026,3.347)--(2.102,3.835)--cycle;
\draw[ink2,thin] (2.407,3.084)--(2.576,2.811)--(3.841,2.118)--(4.278,2.381)--(3.928,3.183)--cycle;
\draw[ink2,thin] (5.4,2.101)--(5.4,4.757)--(4.151,4.075)--(3.928,3.183)--(4.278,2.381)--cycle;
\draw[ink2,thin] (3.841,2.118)--(2.576,2.811)--(2.829,1.232)--(3.21,1.164)--cycle;
\draw[ink2,thin] (0,0)--(1.882,0)--(2.243,1.074)--(1.286,1.775)--(0,0.925)--cycle;
\draw[ink2,thin] (2.026,3.347)--(1.401,2.877)--(1.286,1.775)--(2.243,1.074)--(2.829,1.232)--(2.576,2.811)--(2.407,3.084)--cycle;
\draw[ink2,thin] (4.185,0)--(5.4,0)--(5.4,2.101)--(4.278,2.381)--(3.841,2.118)--(3.21,1.164)--cycle;
\draw[ink2,thin] (2.982,5.4)--(0.826,5.4)--(1.116,4.969)--(2.102,3.835)--(2.86,4.425)--cycle;
\draw[ink2,thin] (2.86,4.425)--(2.102,3.835)--(2.026,3.347)--(2.407,3.084)--(3.928,3.183)--(4.151,4.075)--cycle;
\draw[ink2,thin] (5.4,4.757)--(5.4,5.4)--(2.982,5.4)--(2.86,4.425)--(4.151,4.075)--cycle;
\draw[ink2,thick] (0,0) rectangle (5.4,5.4);
\fill[ink2] (0.361,2.232) circle (1pt);
\fill[ink2] (0.597,4.061) circle (1pt);
\fill[ink2] (2.761,0.268) circle (1pt);
\fill[ink2] (0.242,3.974) circle (1pt);
\fill[ink2] (0.833,3.962) circle (1pt);
\fill[ink2] (3.404,2.723) circle (1pt);
\fill[ink2] (4.621,3.254) circle (1pt);
\fill[ink2] (3.096,2.16) circle (1pt);
\fill[ink2] (1.343,0.745) circle (1pt);
\fill[ink2] (2.286,2.031) circle (1pt);
\fill[ink2] (4.171,1.449) circle (1pt);
\fill[ink2] (2.152,5.109) circle (1pt);
\fill[ink2] (3.35,3.571) circle (1pt);
\fill[ink2] (3.715,4.915) circle (1pt);
\draw[accent,thick,fill=white] (1.401,2.877) circle (2.1pt);
\draw[accent,thick,fill=white] (0.521,3.118) circle (2.1pt);
\draw[accent,thick,fill=white] (1.286,1.775) circle (2.1pt);
\draw[accent,thick,fill=white] (0.53,3.569) circle (2.1pt);
\draw[accent,thick,fill=white] (1.116,4.969) circle (2.1pt);
\draw[accent,thick,fill=white] (3.21,1.164) circle (2.1pt);
\draw[accent,thick,fill=white] (2.829,1.232) circle (2.1pt);
\draw[accent,thick,fill=white] (2.243,1.074) circle (2.1pt);
\draw[accent,thick,fill=white] (2.026,3.347) circle (2.1pt);
\draw[accent,thick,fill=white] (2.102,3.835) circle (2.1pt);
\draw[accent,thick,fill=white] (2.407,3.084) circle (2.1pt);
\draw[accent,thick,fill=white] (2.576,2.811) circle (2.1pt);
\draw[accent,thick,fill=white] (3.841,2.118) circle (2.1pt);
\draw[accent,thick,fill=white] (4.278,2.381) circle (2.1pt);
\draw[accent,thick,fill=white] (3.928,3.183) circle (2.1pt);
\draw[accent,thick,fill=white] (4.151,4.075) circle (2.1pt);
\draw[accent,thick,fill=white] (2.86,4.425) circle (2.1pt);
\end{tikzpicture}
\caption{A nearest-prototype classifier of the square with $14$ classes; the dots are the prototypes. No region reaches from one side to the opposite side, and there are $17$ points (circled) where three classes meet. By \cref{thm:junctions} at least one is forced, however the regions are drawn.}\label{fig:voronoi}
\end{figure}
For $60$ random nearest-prototype classifiers of the square with $14$ classes (one is drawn in
\cref{fig:voronoi}) there were between $13$ and $18$ triple points, and for $8$ classifiers of the cube with $40$ classes between $143$ and $174$ points
where four classes meet. \chk{N1, N2} The statement is a topological companion to results on the unavoidability of nearby misclassification
\cite{SHSFG19}: those use isoperimetric inequalities to estimate the measure of the points near a boundary, and
this one says that the boundaries themselves must meet, $n+1$ at a time. The proof is Sperner's
lemma, and the lemma comes with an algorithm: walk from cell to cell through faces carrying a fixed set of $n$
labels. For a labelling induced by a smooth self-map of the triangle the walk reaches a complete cell, and with
it an approximate fixed point, in $13$, $25$, $50$, $97$ steps on grids of side $16$, $32$, $64$, $128$, linear
in the side although the number of cells is quadratic. \chk{N3} In high dimension the walk can be exponentially
long, and finding its end is complete for the class PPAD \cite{Pap94,DGP09}; this is the complexity of computing
an equilibrium of a game, or a fixed point of an implicit layer \cite{BKK19}, without further structure.
\subsection{Fixed points of attractors}
Recurrent networks that hold a continuous variable do so on a manifold of fixed points: a ring for a heading, a
torus for a position \cite{BBS95,Zha96,GHP22}. A trained or perturbed network is a map of that manifold
close to the identity, or to another map of known degree.
\begin{theorem}[Lefschetz counts]\label{thm:lefcount}
\Scl[\cite{ADTHC}, Thm.~6.2, Prop.~6.3] \emph{(a)} A map of the circle of degree $d$ with non-degenerate fixed points
has fixed points of total index $1-d$; for $d=1$ their number is even, and for a map close to the identity half of them are stable. \emph{(b)} The zeros of
a vector field on a torus have total index $0$, and on a sphere $2$. \emph{(c)} A map of a closed manifold
homotopic to the identity has Lefschetz number $\chi$.
\end{theorem}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\begin{scope}[shift={(0.6,0)}]
\draw[ink2] (0,0) rectangle (6.6,4.3);
\draw[ink2] (0,0)--(0,-0.07) node[below,inner sep=1.5pt]{\scriptsize $0$};
\draw[ink2] (3.3,0)--(3.3,-0.07) node[below,inner sep=1.5pt]{\scriptsize $\pi$};
\draw[ink2] (6.6,0)--(6.6,-0.07) node[below,inner sep=1.5pt]{\scriptsize $2\pi$};
\draw[ink2] (0,0.59)--(-0.07,0.59) node[left,inner sep=1.5pt]{\scriptsize $-2\pi$};
\draw[ink2] (0,2.073)--(-0.07,2.073) node[left,inner sep=1.5pt]{\scriptsize $0$};
\draw[ink2] (0,3.556)--(-0.07,3.556) node[left,inner sep=1.5pt]{\scriptsize $2\pi$};
\node[below] at (3.3,-0.38) {\scriptsize $\theta$};
\draw[ink2,densely dotted] (0,0.59)--(6.6,0.59);
\draw[ink2,densely dotted] (0,2.073)--(6.6,2.073);
\draw[ink2,densely dotted] (0,3.556)--(6.6,3.556);
\draw[thick,bwd] plot coordinates {(0,2.67) (0.022,2.656) (0.044,2.642) (0.066,2.628) (0.088,2.615) (0.11,2.603) (0.132,2.591) (0.154,2.58) (0.176,2.571) (0.198,2.562) (0.22,2.554) (0.242,2.547) (0.264,2.541) (0.286,2.536) (0.308,2.533) (0.33,2.53) (0.352,2.529) (0.374,2.528) (0.396,2.529) (0.418,2.53) (0.44,2.532) (0.462,2.536) (0.484,2.539) (0.506,2.544) (0.528,2.549) (0.55,2.554) (0.572,2.56) (0.594,2.565) (0.616,2.571) (0.638,2.577) (0.66,2.583) (0.682,2.588) (0.704,2.592) (0.726,2.596) (0.748,2.6) (0.77,2.602) (0.792,2.604) (0.814,2.604) (0.836,2.604) (0.858,2.602) (0.88,2.599) (0.902,2.594) (0.924,2.588) (0.946,2.58) (0.968,2.57) (0.99,2.559) (1.012,2.546) (1.034,2.532) (1.056,2.516) (1.078,2.498) (1.1,2.479) (1.122,2.458) (1.144,2.435) (1.166,2.411) (1.188,2.386) (1.21,2.359) (1.232,2.331) (1.254,2.302) (1.276,2.271) (1.298,2.24) (1.32,2.209) (1.342,2.176) (1.364,2.143) (1.386,2.11) (1.408,2.077) (1.43,2.043) (1.452,2.01) (1.474,1.977) (1.496,1.945) (1.518,1.913) (1.54,1.882) (1.562,1.852) (1.584,1.823) (1.606,1.795) (1.628,1.769) (1.65,1.744) (1.672,1.72) (1.694,1.698) (1.716,1.678) (1.738,1.66) (1.76,1.644) (1.782,1.629) (1.804,1.617) (1.826,1.607) (1.848,1.598) (1.87,1.592) (1.892,1.588) (1.914,1.585) (1.936,1.585) (1.958,1.587) (1.98,1.59) (2.002,1.595) (2.024,1.602) (2.046,1.61) (2.068,1.619) (2.09,1.63) (2.112,1.642) (2.134,1.655) (2.156,1.669) (2.178,1.683) (2.2,1.698) (2.222,1.713) (2.244,1.728) (2.266,1.743) (2.288,1.758) (2.31,1.773) (2.332,1.787) (2.354,1.8) (2.376,1.812) (2.398,1.823) (2.42,1.833) (2.442,1.842) (2.464,1.849) (2.486,1.854) (2.508,1.857) (2.53,1.859) (2.552,1.858) (2.574,1.856) (2.596,1.851) (2.618,1.845) (2.64,1.836) (2.662,1.824) (2.684,1.811) (2.706,1.795) (2.728,1.777) (2.75,1.757) (2.772,1.734) (2.794,1.71) (2.816,1.684) (2.838,1.656) (2.86,1.626) (2.882,1.594) (2.904,1.561) (2.926,1.527) (2.948,1.491) (2.97,1.455) (2.992,1.418) (3.014,1.38) (3.036,1.341) (3.058,1.303) (3.08,1.264) (3.102,1.226) (3.124,1.188) (3.146,1.15) (3.168,1.113) (3.19,1.078) (3.212,1.043) (3.234,1.01) (3.256,0.978) (3.278,0.948) (3.3,0.919) (3.322,0.893) (3.344,0.869) (3.366,0.847) (3.388,0.827) (3.41,0.809) (3.432,0.795) (3.454,0.782) (3.476,0.773) (3.498,0.765) (3.52,0.761) (3.542,0.759) (3.564,0.76) (3.586,0.763) (3.608,0.769) (3.63,0.777) (3.652,0.787) (3.674,0.8) (3.696,0.814) (3.718,0.831) (3.74,0.849) (3.762,0.869) (3.784,0.891) (3.806,0.913) (3.828,0.937) (3.85,0.962) (3.872,0.987) (3.894,1.013) (3.916,1.038) (3.938,1.064) (3.96,1.09) (3.982,1.115) (4.004,1.14) (4.026,1.163) (4.048,1.186) (4.07,1.207) (4.092,1.227) (4.114,1.245) (4.136,1.262) (4.158,1.276) (4.18,1.288) (4.202,1.298) (4.224,1.306) (4.246,1.31) (4.268,1.313) (4.29,1.312) (4.312,1.309) (4.334,1.303) (4.356,1.295) (4.378,1.283) (4.4,1.269) (4.422,1.252) (4.444,1.232) (4.466,1.209) (4.488,1.184) (4.51,1.157) (4.532,1.127) (4.554,1.095) (4.576,1.061) (4.598,1.026) (4.62,0.988) (4.642,0.949) (4.664,0.909) (4.686,0.867) (4.708,0.825) (4.73,0.782) (4.752,0.739) (4.774,0.695) (4.796,0.652) (4.818,0.609) (4.84,0.566) (4.862,0.524) (4.884,0.483) (4.906,0.444) (4.928,0.405) (4.95,0.369) (4.972,0.334) (4.994,0.302) (5.016,0.271) (5.038,0.243) (5.06,0.217) (5.082,0.195) (5.104,0.175) (5.126,0.157) (5.148,0.143) (5.17,0.132) (5.192,0.124) (5.214,0.12) (5.236,0.118) (5.258,0.12) (5.28,0.124) (5.302,0.132) (5.324,0.143) (5.346,0.158) (5.368,0.175) (5.39,0.194) (5.412,0.217) (5.434,0.242) (5.456,0.27) (5.478,0.3) (5.5,0.332) (5.522,0.365) (5.544,0.401) (5.566,0.438) (5.588,0.477) (5.61,0.517) (5.632,0.557) (5.654,0.599) (5.676,0.641) (5.698,0.683) (5.72,0.725) (5.742,0.767) (5.764,0.809) (5.786,0.85) (5.808,0.89) (5.83,0.93) (5.852,0.968) (5.874,1.005) (5.896,1.041) (5.918,1.075) (5.94,1.107) (5.962,1.138) (5.984,1.166) (6.006,1.193) (6.028,1.217) (6.05,1.239) (6.072,1.259) (6.094,1.277) (6.116,1.292) (6.138,1.305) (6.16,1.316) (6.182,1.325) (6.204,1.332) (6.226,1.336) (6.248,1.338) (6.27,1.338) (6.292,1.337) (6.314,1.334) (6.336,1.328) (6.358,1.322) (6.38,1.314) (6.402,1.305) (6.424,1.294) (6.446,1.283) (6.468,1.27) (6.49,1.257) (6.512,1.244) (6.534,1.23) (6.556,1.215) (6.578,1.201) (6.6,1.187)};
\fill[bwd] (4.827,0.59) circle (1.9pt);
\draw[bwd,fill=white] (5.649,0.59) circle (1.9pt);
\fill[bwd] (1.411,2.073) circle (1.9pt);
\draw[thick,fwd] plot coordinates {(0,2.67) (0.022,2.661) (0.044,2.652) (0.066,2.643) (0.088,2.635) (0.11,2.628) (0.132,2.621) (0.154,2.615) (0.176,2.61) (0.198,2.606) (0.22,2.603) (0.242,2.601) (0.264,2.6) (0.286,2.6) (0.308,2.602) (0.33,2.604) (0.352,2.608) (0.374,2.612) (0.396,2.618) (0.418,2.624) (0.44,2.631) (0.462,2.639) (0.484,2.648) (0.506,2.657) (0.528,2.667) (0.55,2.678) (0.572,2.688) (0.594,2.699) (0.616,2.71) (0.638,2.72) (0.66,2.731) (0.682,2.741) (0.704,2.751) (0.726,2.76) (0.748,2.768) (0.77,2.775) (0.792,2.782) (0.814,2.787) (0.836,2.792) (0.858,2.795) (0.88,2.796) (0.902,2.796) (0.924,2.795) (0.946,2.792) (0.968,2.788) (0.99,2.782) (1.012,2.774) (1.034,2.764) (1.056,2.753) (1.078,2.74) (1.1,2.726) (1.122,2.71) (1.144,2.692) (1.166,2.673) (1.188,2.653) (1.21,2.631) (1.232,2.608) (1.254,2.583) (1.276,2.558) (1.298,2.532) (1.32,2.505) (1.342,2.478) (1.364,2.45) (1.386,2.422) (1.408,2.393) (1.43,2.365) (1.452,2.337) (1.474,2.309) (1.496,2.281) (1.518,2.254) (1.54,2.228) (1.562,2.203) (1.584,2.179) (1.606,2.156) (1.628,2.135) (1.65,2.114) (1.672,2.096) (1.694,2.079) (1.716,2.064) (1.738,2.051) (1.76,2.039) (1.782,2.03) (1.804,2.022) (1.826,2.017) (1.848,2.014) (1.87,2.012) (1.892,2.013) (1.914,2.016) (1.936,2.02) (1.958,2.027) (1.98,2.035) (2.002,2.045) (2.024,2.056) (2.046,2.07) (2.068,2.084) (2.09,2.1) (2.112,2.117) (2.134,2.134) (2.156,2.153) (2.178,2.172) (2.2,2.192) (2.222,2.212) (2.244,2.232) (2.266,2.252) (2.288,2.272) (2.31,2.292) (2.332,2.311) (2.354,2.329) (2.376,2.346) (2.398,2.362) (2.42,2.377) (2.442,2.39) (2.464,2.402) (2.486,2.412) (2.508,2.421) (2.53,2.427) (2.552,2.432) (2.574,2.434) (2.596,2.435) (2.618,2.433) (2.64,2.429) (2.662,2.422) (2.684,2.414) (2.706,2.403) (2.728,2.39) (2.75,2.375) (2.772,2.357) (2.794,2.338) (2.816,2.317) (2.838,2.293) (2.86,2.268) (2.882,2.242) (2.904,2.214) (2.926,2.184) (2.948,2.154) (2.97,2.122) (2.992,2.09) (3.014,2.057) (3.036,2.024) (3.058,1.99) (3.08,1.956) (3.102,1.923) (3.124,1.89) (3.146,1.857) (3.168,1.825) (3.19,1.795) (3.212,1.765) (3.234,1.736) (3.256,1.71) (3.278,1.684) (3.3,1.661) (3.322,1.639) (3.344,1.62) (3.366,1.603) (3.388,1.588) (3.41,1.576) (3.432,1.566) (3.454,1.558) (3.476,1.554) (3.498,1.552) (3.52,1.552) (3.542,1.555) (3.564,1.561) (3.586,1.569) (3.608,1.579) (3.63,1.592) (3.652,1.608) (3.674,1.625) (3.696,1.645) (3.718,1.666) (3.74,1.69) (3.762,1.715) (3.784,1.741) (3.806,1.769) (3.828,1.797) (3.85,1.827) (3.872,1.857) (3.894,1.888) (3.916,1.918) (3.938,1.949) (3.96,1.98) (3.982,2.01) (4.004,2.04) (4.026,2.068) (4.048,2.096) (4.07,2.122) (4.092,2.147) (4.114,2.17) (4.136,2.191) (4.158,2.21) (4.18,2.228) (4.202,2.242) (4.224,2.255) (4.246,2.265) (4.268,2.272) (4.29,2.276) (4.312,2.278) (4.334,2.277) (4.356,2.273) (4.378,2.267) (4.4,2.258) (4.422,2.245) (4.444,2.231) (4.466,2.213) (4.488,2.193) (4.51,2.171) (4.532,2.146) (4.554,2.119) (4.576,2.09) (4.598,2.059) (4.62,2.026) (4.642,1.992) (4.664,1.957) (4.686,1.92) (4.708,1.883) (4.73,1.845) (4.752,1.807) (4.774,1.768) (4.796,1.73) (4.818,1.691) (4.84,1.654) (4.862,1.617) (4.884,1.581) (4.906,1.546) (4.928,1.513) (4.95,1.481) (4.972,1.452) (4.994,1.424) (5.016,1.398) (5.038,1.375) (5.06,1.355) (5.082,1.337) (5.104,1.322) (5.126,1.309) (5.148,1.3) (5.17,1.294) (5.192,1.291) (5.214,1.291) (5.236,1.295) (5.258,1.301) (5.28,1.311) (5.302,1.324) (5.324,1.34) (5.346,1.359) (5.368,1.381) (5.39,1.406) (5.412,1.433) (5.434,1.463) (5.456,1.496) (5.478,1.531) (5.5,1.568) (5.522,1.606) (5.544,1.647) (5.566,1.689) (5.588,1.733) (5.61,1.777) (5.632,1.823) (5.654,1.869) (5.676,1.916) (5.698,1.963) (5.72,2.01) (5.742,2.057) (5.764,2.104) (5.786,2.15) (5.808,2.195) (5.83,2.24) (5.852,2.283) (5.874,2.325) (5.896,2.366) (5.918,2.405) (5.94,2.442) (5.962,2.477) (5.984,2.511) (6.006,2.542) (6.028,2.572) (6.05,2.599) (6.072,2.624) (6.094,2.646) (6.116,2.667) (6.138,2.685) (6.16,2.701) (6.182,2.714) (6.204,2.726) (6.226,2.735) (6.248,2.742) (6.27,2.748) (6.292,2.751) (6.314,2.752) (6.336,2.752) (6.358,2.751) (6.38,2.748) (6.402,2.743) (6.424,2.738) (6.446,2.731) (6.468,2.724) (6.49,2.716) (6.512,2.707) (6.534,2.698) (6.556,2.689) (6.578,2.679) (6.6,2.67)};
\fill[fwd] (1.702,2.073) circle (1.9pt);
\draw[fwd,fill=white] (2.052,2.073) circle (1.9pt);
\fill[fwd] (3.004,2.073) circle (1.9pt);
\draw[fwd,fill=white] (4.03,2.073) circle (1.9pt);
\fill[fwd] (4.588,2.073) circle (1.9pt);
\draw[fwd,fill=white] (5.749,2.073) circle (1.9pt);
\draw[thick,accent] plot coordinates {(0,2.67) (0.022,2.665) (0.044,2.661) (0.066,2.658) (0.088,2.655) (0.11,2.652) (0.132,2.651) (0.154,2.65) (0.176,2.65) (0.198,2.651) (0.22,2.653) (0.242,2.656) (0.264,2.66) (0.286,2.665) (0.308,2.671) (0.33,2.678) (0.352,2.687) (0.374,2.696) (0.396,2.707) (0.418,2.718) (0.44,2.73) (0.462,2.743) (0.484,2.757) (0.506,2.771) (0.528,2.786) (0.55,2.801) (0.572,2.817) (0.594,2.832) (0.616,2.848) (0.638,2.864) (0.66,2.879) (0.682,2.894) (0.704,2.909) (0.726,2.923) (0.748,2.936) (0.77,2.948) (0.792,2.96) (0.814,2.97) (0.836,2.98) (0.858,2.987) (0.88,2.994) (0.902,2.999) (0.924,3.003) (0.946,3.005) (0.968,3.005) (0.99,3.004) (1.012,3.001) (1.034,2.997) (1.056,2.991) (1.078,2.983) (1.1,2.973) (1.122,2.962) (1.144,2.949) (1.166,2.935) (1.188,2.92) (1.21,2.903) (1.232,2.884) (1.254,2.865) (1.276,2.845) (1.298,2.824) (1.32,2.802) (1.342,2.779) (1.364,2.756) (1.386,2.733) (1.408,2.71) (1.43,2.686) (1.452,2.663) (1.474,2.64) (1.496,2.617) (1.518,2.595) (1.54,2.574) (1.562,2.554) (1.584,2.535) (1.606,2.517) (1.628,2.5) (1.65,2.485) (1.672,2.472) (1.694,2.46) (1.716,2.45) (1.738,2.441) (1.76,2.435) (1.782,2.43) (1.804,2.428) (1.826,2.427) (1.848,2.429) (1.87,2.433) (1.892,2.438) (1.914,2.446) (1.936,2.455) (1.958,2.467) (1.98,2.48) (2.002,2.495) (2.024,2.511) (2.046,2.529) (2.068,2.549) (2.09,2.569) (2.112,2.591) (2.134,2.614) (2.156,2.638) (2.178,2.662) (2.2,2.687) (2.222,2.712) (2.244,2.737) (2.266,2.762) (2.288,2.787) (2.31,2.811) (2.332,2.835) (2.354,2.858) (2.376,2.88) (2.398,2.901) (2.42,2.921) (2.442,2.939) (2.464,2.956) (2.486,2.971) (2.508,2.985) (2.53,2.996) (2.552,3.005) (2.574,3.013) (2.596,3.018) (2.618,3.021) (2.64,3.022) (2.662,3.021) (2.684,3.017) (2.706,3.011) (2.728,3.003) (2.75,2.993) (2.772,2.98) (2.794,2.966) (2.816,2.949) (2.838,2.931) (2.86,2.911) (2.882,2.889) (2.904,2.866) (2.926,2.842) (2.948,2.816) (2.97,2.79) (2.992,2.762) (3.014,2.734) (3.036,2.706) (3.058,2.677) (3.08,2.649) (3.102,2.62) (3.124,2.592) (3.146,2.564) (3.168,2.537) (3.19,2.511) (3.212,2.487) (3.234,2.463) (3.256,2.441) (3.278,2.421) (3.3,2.402) (3.322,2.386) (3.344,2.372) (3.366,2.359) (3.388,2.35) (3.41,2.342) (3.432,2.337) (3.454,2.335) (3.476,2.335) (3.498,2.338) (3.52,2.343) (3.542,2.351) (3.564,2.362) (3.586,2.375) (3.608,2.39) (3.63,2.408) (3.652,2.428) (3.674,2.451) (3.696,2.475) (3.718,2.502) (3.74,2.53) (3.762,2.56) (3.784,2.591) (3.806,2.624) (3.828,2.658) (3.85,2.692) (3.872,2.727) (3.894,2.763) (3.916,2.799) (3.938,2.834) (3.96,2.87) (3.982,2.905) (4.004,2.939) (4.026,2.973) (4.048,3.005) (4.07,3.037) (4.092,3.066) (4.114,3.094) (4.136,3.121) (4.158,3.145) (4.18,3.167) (4.202,3.187) (4.224,3.204) (4.246,3.219) (4.268,3.231) (4.29,3.241) (4.312,3.247) (4.334,3.251) (4.356,3.252) (4.378,3.251) (4.4,3.246) (4.422,3.239) (4.444,3.229) (4.466,3.217) (4.488,3.202) (4.51,3.184) (4.532,3.164) (4.554,3.142) (4.576,3.118) (4.598,3.092) (4.62,3.065) (4.642,3.035) (4.664,3.005) (4.686,2.973) (4.708,2.941) (4.73,2.908) (4.752,2.875) (4.774,2.841) (4.796,2.807) (4.818,2.774) (4.84,2.741) (4.862,2.709) (4.884,2.679) (4.906,2.649) (4.928,2.62) (4.95,2.594) (4.972,2.569) (4.994,2.546) (5.016,2.526) (5.038,2.507) (5.06,2.492) (5.082,2.479) (5.104,2.469) (5.126,2.461) (5.148,2.457) (5.17,2.456) (5.192,2.458) (5.214,2.463) (5.236,2.471) (5.258,2.483) (5.28,2.498) (5.302,2.515) (5.324,2.536) (5.346,2.56) (5.368,2.587) (5.39,2.617) (5.412,2.649) (5.434,2.684) (5.456,2.722) (5.478,2.762) (5.5,2.804) (5.522,2.847) (5.544,2.893) (5.566,2.94) (5.588,2.989) (5.61,3.038) (5.632,3.089) (5.654,3.14) (5.676,3.192) (5.698,3.244) (5.72,3.296) (5.742,3.348) (5.764,3.399) (5.786,3.45) (5.808,3.501) (5.83,3.55) (5.852,3.598) (5.874,3.645) (5.896,3.691) (5.918,3.735) (5.94,3.777) (5.962,3.817) (5.984,3.856) (6.006,3.892) (6.028,3.926) (6.05,3.958) (6.072,3.988) (6.094,4.016) (6.116,4.041) (6.138,4.064) (6.16,4.085) (6.182,4.104) (6.204,4.12) (6.226,4.134) (6.248,4.146) (6.27,4.157) (6.292,4.165) (6.314,4.171) (6.336,4.176) (6.358,4.18) (6.38,4.181) (6.402,4.182) (6.424,4.181) (6.446,4.18) (6.468,4.177) (6.49,4.174) (6.512,4.17) (6.534,4.166) (6.556,4.162) (6.578,4.157) (6.6,4.153)};
\draw[accent,fill=white] (5.833,3.556) circle (1.9pt);
\node[bwd,anchor=west,inner sep=2pt] at (6.6,1.187) {\scriptsize $d=0$};
\node[fwd,anchor=west,inner sep=2pt] at (6.6,2.67) {\scriptsize $d=1$};
\node[accent,anchor=west,inner sep=2pt] at (6.6,4.153) {\scriptsize $d=2$};
\end{scope}
\end{tikzpicture}
\caption{Fixed points of three maps $\theta\mapsto d\theta+\epsilon g(\theta)$ of the circle, with the same $g$. Plotted is the displacement $(d-1)\theta+\epsilon g(\theta)$; a fixed point is a crossing of a multiple of $2\pi$ (dotted). Downward crossings have index $1$ (filled) and upward ones index $-1$ (open). The curve for $d$ climbs by $d-1$ levels in one turn, so the indices add up to $1-d$: here $3$, $6$, $1$ points with sums $1$, $0$, $-1$ for $d=0,1,2$.}\label{fig:circlemap}
\end{figure}
\noindent For circle maps $\theta\mapsto d\theta+\epsilon g(\theta)$ with random $g$ and $\epsilon=2$, the fixed
points number $5,7,6,9,8$ for $d=-2,0,1,2,3$ and their indices add up to $3,1,0,-1,-2$ (\cref{fig:circlemap}
shows three maps of the same kind). \chk{N4} For three drift
fields on a torus there are four zeros each, a source, a sink and two saddles. \chk{N5} The consequences differ
by manifold. On a ring or a torus, noise in the weights breaks the continuum of fixed points into isolated ones,
stable and unstable in balance, or removes all of them and leaves a uniform drift, which $\chi=0$ permits. On a
sphere that second outcome is impossible: every perturbation of a spherical attractor keeps a fixed point,
because $\chi=2$.
\subsection{Degree and the passage through zero}
Let a network produce $u_w(\theta)\in\R^2$ for an input on a circle and output the direction $u_w/|u_w|$. As long
as $u_w$ does not vanish this is a map of the circle to itself with a degree.
\begin{theorem}\label{thm:zero}
\Scl[\cite{ADTHC}, Thm.~9.1] \emph{(a)} The degree is the signed number of preimages of any regular direction.
\emph{(b)} Along a path of weights the degree is constant unless $u_w(\theta)=0$ for some $\theta$ and some
weight on the path.
\end{theorem}
\begin{figure}[t]
\centering
\begin{tikzpicture}
\draw[ink2,very thin] (0,0)--(1.927,0);
\draw[ink2,very thin] (1.021,-1.254)--(1.021,1.254);
\draw[fwd,thick] plot coordinates {(1.743,-0.243) (1.736,-0.21) (1.73,-0.177) (1.722,-0.144) (1.715,-0.11) (1.706,-0.076) (1.697,-0.043) (1.687,-0.009) (1.677,0.024) (1.666,0.058) (1.654,0.091) (1.642,0.124) (1.63,0.157) (1.617,0.19) (1.603,0.222) (1.589,0.254) (1.574,0.285) (1.559,0.316) (1.543,0.347) (1.527,0.377) (1.511,0.406) (1.494,0.435) (1.477,0.464) (1.459,0.491) (1.441,0.518) (1.423,0.545) (1.404,0.571) (1.385,0.596) (1.365,0.62) (1.345,0.644) (1.325,0.667) (1.305,0.689) (1.284,0.711) (1.262,0.732) (1.241,0.752) (1.219,0.772) (1.197,0.791) (1.174,0.809) (1.151,0.826) (1.128,0.843) (1.105,0.859) (1.081,0.875) (1.057,0.89) (1.033,0.904) (1.009,0.918) (0.984,0.931) (0.96,0.943) (0.935,0.955) (0.91,0.967) (0.886,0.977) (0.861,0.988) (0.837,0.997) (0.813,1.006) (0.789,1.015) (0.765,1.022) (0.742,1.03) (0.719,1.036) (0.696,1.042) (0.674,1.048) (0.653,1.052) (0.632,1.056) (0.611,1.06) (0.591,1.063) (0.572,1.065) (0.553,1.067) (0.535,1.068) (0.518,1.068) (0.501,1.068) (0.484,1.067) (0.469,1.065) (0.454,1.062) (0.439,1.059) (0.425,1.056) (0.412,1.051) (0.399,1.046) (0.386,1.04) (0.374,1.033) (0.362,1.026) (0.351,1.018) (0.341,1.009) (0.33,1) (0.32,0.99) (0.31,0.979) (0.301,0.967) (0.292,0.954) (0.283,0.941) (0.274,0.927) (0.266,0.913) (0.258,0.897) (0.25,0.881) (0.243,0.865) (0.235,0.847) (0.228,0.829) (0.222,0.811) (0.215,0.791) (0.209,0.772) (0.203,0.751) (0.197,0.73) (0.192,0.709) (0.187,0.687) (0.182,0.665) (0.177,0.642) (0.173,0.619) (0.17,0.595) (0.166,0.571) (0.163,0.547) (0.161,0.523) (0.159,0.498) (0.157,0.474) (0.156,0.449) (0.155,0.423) (0.155,0.398) (0.155,0.373) (0.156,0.347) (0.157,0.321) (0.159,0.296) (0.162,0.27) (0.164,0.244) (0.168,0.218) (0.172,0.192) (0.176,0.166) (0.182,0.14) (0.187,0.114) (0.193,0.088) (0.2,0.062) (0.208,0.037) (0.215,0.011) (0.224,-0.015) (0.233,-0.04) (0.243,-0.065) (0.253,-0.091) (0.264,-0.116) (0.275,-0.141) (0.287,-0.166) (0.3,-0.19) (0.313,-0.215) (0.327,-0.239) (0.342,-0.263) (0.357,-0.287) (0.373,-0.311) (0.39,-0.335) (0.407,-0.359) (0.425,-0.382) (0.444,-0.405) (0.463,-0.429) (0.483,-0.452) (0.504,-0.474) (0.526,-0.497) (0.548,-0.52) (0.571,-0.542) (0.595,-0.564) (0.619,-0.586) (0.644,-0.608) (0.67,-0.629) (0.696,-0.651) (0.722,-0.672) (0.75,-0.693) (0.777,-0.713) (0.805,-0.733) (0.834,-0.753) (0.862,-0.773) (0.891,-0.792) (0.92,-0.81) (0.949,-0.828) (0.978,-0.846) (1.007,-0.864) (1.036,-0.88) (1.065,-0.896) (1.093,-0.912) (1.121,-0.927) (1.149,-0.942) (1.176,-0.956) (1.202,-0.969) (1.228,-0.982) (1.254,-0.994) (1.278,-1.005) (1.302,-1.016) (1.325,-1.026) (1.348,-1.036) (1.369,-1.044) (1.39,-1.053) (1.41,-1.06) (1.429,-1.067) (1.447,-1.073) (1.465,-1.079) (1.482,-1.084) (1.498,-1.088) (1.513,-1.091) (1.527,-1.094) (1.541,-1.097) (1.554,-1.098) (1.567,-1.099) (1.579,-1.099) (1.59,-1.099) (1.601,-1.098) (1.611,-1.097) (1.621,-1.094) (1.63,-1.091) (1.639,-1.088) (1.647,-1.083) (1.655,-1.078) (1.663,-1.072) (1.67,-1.066) (1.677,-1.059) (1.683,-1.051) (1.69,-1.042) (1.696,-1.032) (1.702,-1.022) (1.707,-1.011) (1.712,-0.999) (1.718,-0.986) (1.722,-0.973) (1.727,-0.958) (1.732,-0.943) (1.736,-0.927) (1.74,-0.91) (1.744,-0.892) (1.748,-0.873) (1.751,-0.854) (1.755,-0.833) (1.758,-0.812) (1.76,-0.79) (1.763,-0.767) (1.765,-0.743) (1.767,-0.719) (1.769,-0.694) (1.77,-0.668) (1.771,-0.641) (1.772,-0.613) (1.772,-0.585) (1.772,-0.557) (1.771,-0.528) (1.77,-0.498) (1.769,-0.467) (1.767,-0.437) (1.764,-0.405) (1.761,-0.374) (1.757,-0.342) (1.753,-0.309) (1.748,-0.276) (1.743,-0.243)};
\draw[fwd,thick,-{Stealth[length=4pt]}] (1.325,0.667)--(1.284,0.711);
\fill[accent] (1.021,0) circle (1.8pt);
\node at (0.964,-1.504) {\scriptsize $b=0$};
\node at (0.964,-1.824) {\scriptsize degree $1$};
\draw[ink2,very thin] (2.277,0)--(4.204,0);
\draw[ink2,very thin] (2.496,-1.254)--(2.496,1.254);
\draw[fwd,thick] plot coordinates {(4.02,-0.243) (4.014,-0.21) (4.007,-0.177) (4,-0.144) (3.992,-0.11) (3.983,-0.076) (3.974,-0.043) (3.964,-0.009) (3.954,0.024) (3.943,0.058) (3.932,0.091) (3.92,0.124) (3.907,0.157) (3.894,0.19) (3.88,0.222) (3.866,0.254) (3.851,0.285) (3.836,0.316) (3.821,0.347) (3.805,0.377) (3.788,0.406) (3.771,0.435) (3.754,0.464) (3.736,0.491) (3.718,0.518) (3.7,0.545) (3.681,0.571) (3.662,0.596) (3.642,0.62) (3.623,0.644) (3.602,0.667) (3.582,0.689) (3.561,0.711) (3.54,0.732) (3.518,0.752) (3.496,0.772) (3.474,0.791) (3.451,0.809) (3.429,0.826) (3.405,0.843) (3.382,0.859) (3.358,0.875) (3.334,0.89) (3.31,0.904) (3.286,0.918) (3.261,0.931) (3.237,0.943) (3.212,0.955) (3.188,0.967) (3.163,0.977) (3.139,0.988) (3.114,0.997) (3.09,1.006) (3.066,1.015) (3.042,1.022) (3.019,1.03) (2.996,1.036) (2.973,1.042) (2.951,1.048) (2.93,1.052) (2.909,1.056) (2.888,1.06) (2.868,1.063) (2.849,1.065) (2.83,1.067) (2.812,1.068) (2.795,1.068) (2.778,1.068) (2.762,1.067) (2.746,1.065) (2.731,1.062) (2.716,1.059) (2.702,1.056) (2.689,1.051) (2.676,1.046) (2.663,1.04) (2.651,1.033) (2.64,1.026) (2.629,1.018) (2.618,1.009) (2.607,1) (2.597,0.99) (2.588,0.979) (2.578,0.967) (2.569,0.954) (2.56,0.941) (2.552,0.927) (2.543,0.913) (2.535,0.897) (2.527,0.881) (2.52,0.865) (2.513,0.847) (2.506,0.829) (2.499,0.811) (2.492,0.791) (2.486,0.772) (2.48,0.751) (2.474,0.73) (2.469,0.709) (2.464,0.687) (2.459,0.665) (2.455,0.642) (2.451,0.619) (2.447,0.595) (2.443,0.571) (2.441,0.547) (2.438,0.523) (2.436,0.498) (2.434,0.474) (2.433,0.449) (2.432,0.423) (2.432,0.398) (2.433,0.373) (2.433,0.347) (2.435,0.321) (2.436,0.296) (2.439,0.27) (2.442,0.244) (2.445,0.218) (2.449,0.192) (2.454,0.166) (2.459,0.14) (2.464,0.114) (2.471,0.088) (2.477,0.062) (2.485,0.037) (2.493,0.011) (2.501,-0.015) (2.51,-0.04) (2.52,-0.065) (2.53,-0.091) (2.541,-0.116) (2.552,-0.141) (2.564,-0.166) (2.577,-0.19) (2.59,-0.215) (2.604,-0.239) (2.619,-0.263) (2.634,-0.287) (2.65,-0.311) (2.667,-0.335) (2.684,-0.359) (2.702,-0.382) (2.721,-0.405) (2.74,-0.429) (2.761,-0.452) (2.781,-0.474) (2.803,-0.497) (2.825,-0.52) (2.848,-0.542) (2.872,-0.564) (2.896,-0.586) (2.921,-0.608) (2.947,-0.629) (2.973,-0.651) (3,-0.672) (3.027,-0.693) (3.054,-0.713) (3.082,-0.733) (3.111,-0.753) (3.139,-0.773) (3.168,-0.792) (3.197,-0.81) (3.226,-0.828) (3.255,-0.846) (3.284,-0.864) (3.313,-0.88) (3.342,-0.896) (3.37,-0.912) (3.398,-0.927) (3.426,-0.942) (3.453,-0.956) (3.48,-0.969) (3.505,-0.982) (3.531,-0.994) (3.555,-1.005) (3.579,-1.016) (3.602,-1.026) (3.625,-1.036) (3.646,-1.044) (3.667,-1.053) (3.687,-1.06) (3.706,-1.067) (3.725,-1.073) (3.742,-1.079) (3.759,-1.084) (3.775,-1.088) (3.79,-1.091) (3.805,-1.094) (3.818,-1.097) (3.832,-1.098) (3.844,-1.099) (3.856,-1.099) (3.867,-1.099) (3.878,-1.098) (3.888,-1.097) (3.898,-1.094) (3.907,-1.091) (3.916,-1.088) (3.924,-1.083) (3.932,-1.078) (3.94,-1.072) (3.947,-1.066) (3.954,-1.059) (3.961,-1.051) (3.967,-1.042) (3.973,-1.032) (3.979,-1.022) (3.984,-1.011) (3.99,-0.999) (3.995,-0.986) (4,-0.973) (4.004,-0.958) (4.009,-0.943) (4.013,-0.927) (4.017,-0.91) (4.021,-0.892) (4.025,-0.873) (4.029,-0.854) (4.032,-0.833) (4.035,-0.812) (4.038,-0.79) (4.04,-0.767) (4.043,-0.743) (4.045,-0.719) (4.046,-0.694) (4.048,-0.668) (4.049,-0.641) (4.049,-0.613) (4.049,-0.585) (4.049,-0.557) (4.049,-0.528) (4.048,-0.498) (4.046,-0.467) (4.044,-0.437) (4.041,-0.405) (4.038,-0.374) (4.034,-0.342) (4.03,-0.309) (4.025,-0.276) (4.02,-0.243)};
\draw[fwd,thick,-{Stealth[length=4pt]}] (3.602,0.667)--(3.561,0.711);
\fill[accent] (2.496,0) circle (1.8pt);
\node at (3.241,-1.504) {\scriptsize $b=1.2930$};
\node at (3.241,-1.824) {\scriptsize undefined};
\draw[ink2,very thin] (4.554,0)--(6.98,0);
\draw[ink2,very thin] (4.709,-1.254)--(4.709,1.254);
\draw[fwd,thick] plot coordinates {(6.795,-0.243) (6.789,-0.21) (6.783,-0.177) (6.775,-0.144) (6.767,-0.11) (6.759,-0.076) (6.75,-0.043) (6.74,-0.009) (6.73,0.024) (6.719,0.058) (6.707,0.091) (6.695,0.124) (6.683,0.157) (6.669,0.19) (6.656,0.222) (6.642,0.254) (6.627,0.285) (6.612,0.316) (6.596,0.347) (6.58,0.377) (6.564,0.406) (6.547,0.435) (6.53,0.464) (6.512,0.491) (6.494,0.518) (6.475,0.545) (6.457,0.571) (6.437,0.596) (6.418,0.62) (6.398,0.644) (6.378,0.667) (6.357,0.689) (6.336,0.711) (6.315,0.732) (6.294,0.752) (6.272,0.772) (6.25,0.791) (6.227,0.809) (6.204,0.826) (6.181,0.843) (6.158,0.859) (6.134,0.875) (6.11,0.89) (6.086,0.904) (6.062,0.918) (6.037,0.931) (6.012,0.943) (5.988,0.955) (5.963,0.967) (5.939,0.977) (5.914,0.988) (5.89,0.997) (5.865,1.006) (5.841,1.015) (5.818,1.022) (5.794,1.03) (5.771,1.036) (5.749,1.042) (5.727,1.048) (5.705,1.052) (5.684,1.056) (5.664,1.06) (5.644,1.063) (5.625,1.065) (5.606,1.067) (5.588,1.068) (5.57,1.068) (5.553,1.068) (5.537,1.067) (5.521,1.065) (5.506,1.062) (5.492,1.059) (5.478,1.056) (5.464,1.051) (5.451,1.046) (5.439,1.04) (5.427,1.033) (5.415,1.026) (5.404,1.018) (5.393,1.009) (5.383,1) (5.373,0.99) (5.363,0.979) (5.354,0.967) (5.345,0.954) (5.336,0.941) (5.327,0.927) (5.319,0.913) (5.311,0.897) (5.303,0.881) (5.295,0.865) (5.288,0.847) (5.281,0.829) (5.274,0.811) (5.268,0.791) (5.262,0.772) (5.256,0.751) (5.25,0.73) (5.244,0.709) (5.239,0.687) (5.235,0.665) (5.23,0.642) (5.226,0.619) (5.222,0.595) (5.219,0.571) (5.216,0.547) (5.214,0.523) (5.211,0.498) (5.21,0.474) (5.209,0.449) (5.208,0.423) (5.208,0.398) (5.208,0.373) (5.209,0.347) (5.21,0.321) (5.212,0.296) (5.214,0.27) (5.217,0.244) (5.221,0.218) (5.225,0.192) (5.229,0.166) (5.234,0.14) (5.24,0.114) (5.246,0.088) (5.253,0.062) (5.26,0.037) (5.268,0.011) (5.277,-0.015) (5.286,-0.04) (5.295,-0.065) (5.306,-0.091) (5.316,-0.116) (5.328,-0.141) (5.34,-0.166) (5.353,-0.19) (5.366,-0.215) (5.38,-0.239) (5.395,-0.263) (5.41,-0.287) (5.426,-0.311) (5.442,-0.335) (5.46,-0.359) (5.478,-0.382) (5.497,-0.405) (5.516,-0.429) (5.536,-0.452) (5.557,-0.474) (5.579,-0.497) (5.601,-0.52) (5.624,-0.542) (5.648,-0.564) (5.672,-0.586) (5.697,-0.608) (5.722,-0.629) (5.749,-0.651) (5.775,-0.672) (5.802,-0.693) (5.83,-0.713) (5.858,-0.733) (5.886,-0.753) (5.915,-0.773) (5.944,-0.792) (5.973,-0.81) (6.002,-0.828) (6.031,-0.846) (6.06,-0.864) (6.089,-0.88) (6.118,-0.896) (6.146,-0.912) (6.174,-0.927) (6.201,-0.942) (6.229,-0.956) (6.255,-0.969) (6.281,-0.982) (6.306,-0.994) (6.331,-1.005) (6.355,-1.016) (6.378,-1.026) (6.4,-1.036) (6.422,-1.044) (6.443,-1.053) (6.463,-1.06) (6.482,-1.067) (6.5,-1.073) (6.518,-1.079) (6.534,-1.084) (6.55,-1.088) (6.566,-1.091) (6.58,-1.094) (6.594,-1.097) (6.607,-1.098) (6.62,-1.099) (6.632,-1.099) (6.643,-1.099) (6.654,-1.098) (6.664,-1.097) (6.673,-1.094) (6.683,-1.091) (6.691,-1.088) (6.7,-1.083) (6.708,-1.078) (6.715,-1.072) (6.723,-1.066) (6.73,-1.059) (6.736,-1.051) (6.742,-1.042) (6.749,-1.032) (6.754,-1.022) (6.76,-1.011) (6.765,-0.999) (6.77,-0.986) (6.775,-0.973) (6.78,-0.958) (6.784,-0.943) (6.789,-0.927) (6.793,-0.91) (6.797,-0.892) (6.801,-0.873) (6.804,-0.854) (6.807,-0.833) (6.81,-0.812) (6.813,-0.79) (6.816,-0.767) (6.818,-0.743) (6.82,-0.719) (6.822,-0.694) (6.823,-0.668) (6.824,-0.641) (6.825,-0.613) (6.825,-0.585) (6.825,-0.557) (6.824,-0.528) (6.823,-0.498) (6.821,-0.467) (6.819,-0.437) (6.817,-0.405) (6.814,-0.374) (6.81,-0.342) (6.806,-0.309) (6.801,-0.276) (6.795,-0.243)};
\draw[fwd,thick,-{Stealth[length=4pt]}] (6.378,0.667)--(6.336,0.711);
\fill[accent] (4.709,0) circle (1.8pt);
\node at (5.767,-1.504) {\scriptsize $b=2.2$};
\node at (5.767,-1.824) {\scriptsize degree $0$};
\end{tikzpicture}
\caption{The output curve of a network with four hidden units, for three values of a bias $b$ added to the first output; the dot is the origin. The normalized output has degree $1$ while the curve encloses the origin and degree $0$ after it has left; in between, at $b=1.2930$, the curve passes through the origin and the normalized output is not defined.}\label{fig:degree}
\end{figure}
\noindent For a network with four hidden units (\cref{fig:degree}) the degree is $1$, and the signed number of preimages of three
directions is $1$ each. Adding a bias $b$ to the first output, the degree drops to $0$ at $b=1.2930$, where the
smallest output norm over the circle is $10^{-4}$. \chk{N6} Training that must change the degree of the output,
to fit a target of another class, has to pass through weights at which the normalized output is undefined and
its gradient unbounded; and if the initial class is the right one, a barrier of the same kind protects it. By
Hopf's theorem the degree is the only such invariant for maps to a sphere of the same dimension.
\subsection{Zeros of odd networks}
\begin{proposition}[Odd networks]\label{prop:odd}
\Scl[Borsuk--Ulam \cite{Mat03}] A network $\R^{n+1}\to\R^n$ without biases and with odd activations is an odd map,
and it vanishes somewhere on every sphere centred at the origin. For $n=1$, if its restriction to the circle is
continuously differentiable and all its zeros are simple, their number is congruent to $2$ modulo $4$.
\end{proposition}
\begin{proof}
Borsuk--Ulam gives an antipodal pair with equal values. Oddness makes that common value zero.
For $n=1$, start the half-turn at a point with nonzero output. The endpoint signs are opposite, and each
simple zero changes the sign, so the half-turn contains an odd number of zeros. The other half-turn contains
their antipodes, giving twice an odd number in all.
\end{proof}
\noindent A sign scan on the unit circle found $2$ crossings for $193$ of $200$ random networks with six
hyperbolic tangent units and $6$ for the other $7$. An output bias of $10$ makes the last network strictly
positive, since it exceeds the sum of absolute output weights. \chk{N7} Oddness also applies to
\cref{thm:bottleneck}, whose collisions are the zeros of the odd map $e(x)-e(-x)$. An architecture made odd for
the sake of a symmetry therefore pays for it: its scalar outputs cannot be of one sign on any sphere, and the
decision boundary of a bias-free odd classifier meets every sphere round the origin.
\section{Summary of results}\label{sec:summary}
\begin{table*}[t]
\centering\small
\begin{tabular}{@{}>{\raggedright}p{0.14\textwidth}>{\raggedright}p{0.33\textwidth}>{\raggedright}p{0.36\textwidth}l@{}}
\toprule
Topic & Qualitative statement & Quantitative statement & Checks\\
\midrule
Bottleneck & no continuous injective code of $S^n$ in $\R^n$ & worst-case error $\ge1$, attained; fibre radius $1.0000$ in $100$ trials & O1--O3\\
Rotations & no continuous quaternion or Euler-angle target on a non-contractible loop; a six-dimensional one exists & jumps $2.0000$ and $3.1416$ against steps $0.004$; decoder Lipschitz constant $\le1.40$ & O4, O5\\
Meshes & no global frame field unless $\chi=0$; on spheres only for $n=1,3,7$ & index sums $2,2,0,1,0$ on five surfaces; frame on $S^3$ to $10^{-15}$ & O6, O11\\
Pieces & degree needs pieces & $N\ge2|d|+1$; windings $-2,3,3$ for $d=3$, $N=5,7,12$ & O7, O8\\
Depth & composition multiplies degree & degree $2^L$ with $4\cdot2^L$ pieces at depth $L\le6$; one layer needs more than $2^L-2$ units & O9\\
Width & $n$ units per layer cannot enclose a region; $n+1$ can & $30$ networks: both regions connected and unbounded; island value $1$ inside, $\le-2.46$ outside & O10\\
Hodge diffusion & converges to real homology; blind to torsion & kernels equal Betti numbers on six complexes; gap $1.5858$, $99$ layers & V1--V3\\
Rips complexes & higher spheres at large scales are artefacts & $n=12$ has $S^1$ for $1\le k\le3$, a wedge of three $S^2$ at $k=4$, and $S^5$ at $k=5$. Circle seen for $1.52<r<\sqrt3$ & V4--V6\\
Persistence & diagrams are stable, counts are not & distance $\le$ perturbation in $60$ trials, ratio up to $1.000$; count changed in $35$ & V7\\
Decision regions & $n+1$ regions meet & $13$--$18$ triple points; $143$--$174$ quadruple points & N1, N2\\
Sperner walk & a complete cell is found by a path & $13,25,50,97$ steps on sides $16,\dots,128$ & N3\\
Attractors & index sum $1-d$ on a circle, $0$ on a torus, $2$ on a sphere & $5,7,6,9,8$ fixed points with sums $3,1,0,-1,-2$; four zeros on the torus & N4, N5\\
Normalized outputs & degree changes only through zero & degree $1\to0$ at bias $1.2930$, norm $10^{-4}$ & N6\\
Odd networks & a zero on every origin-centred sphere in $\R^{n+1}$ for $n$ outputs & $2$ sign crossings in $193$ and $6$ in $7$ of $200$ networks. The last is positive with output bias $10$ & N7\\
\bottomrule
\end{tabular}
\caption{Qualitative statements with their quantitative counterparts. Every number is recomputed by the companion script.}\label{tab:summary}
\end{table*}
\Cref{tab:summary} pairs the statements. The three headings correspond to three uses of a functor. An obstruction
is a diagram that the functor forbids. An invariant is its value. A count is its value when that value is an
integer that the geometry must realize as a number of points.
\section{Limits}\label{sec:limits}
\emph{Worst case.} \Cref{thm:bottleneck,thm:rotation} bound the supremum of an error. They say nothing about the
average, and an obstruction confined to a set of small measure may be harmless in practice. What they exclude
is its absence.
\emph{Idealization of data.} The data are taken to be exactly a sphere, a rotation group or a circle. Real data
are samples near such a set, and a network is evaluated on finitely many points, where every map is continuous.
The theorems constrain the functions that interpolate, and through them the behaviour between samples.
\emph{Small exact models.} The complexes have at most a few hundred simplices, the attractors are maps of a
circle or a torus given by formulas, and the classifier is a nearest-prototype rule. No trained network was
examined.
\emph{Real coefficients.} \Cref{prop:torsion} concerns the limit of diffusion. A simplicial network also sees the
non-zero spectrum of its Laplacians, which can distinguish complexes with the same real homology; the statement
is about harmonic features only.
\emph{Hypotheses on activations.} \Cref{thm:narrow} is proved for activations that are homeomorphisms of the
line. For the rectifier the regions need not be homeomorphic to $\R^n$, and what survives is as cited.
\emph{Complexity.} The PPAD-completeness quoted after \cref{thm:junctions} is for fixed-point problems given by
circuits; the walk on a smooth example is short.
\emph{Novelty.} The theorems are classical. \Cref{thm:pieces}, \cref{prop:depth}, \cref{prop:torsion} and the
constant in \cref{thm:bottleneck} are tagged as observations or reformulations; they are elementary and may be in the
literature in other words. The second monograph of the source, on framed manifolds and the first stable stems
\cite[Ch.~8--12]{ADTHC}, has no application here beyond the rotation groups, and we have not forced one.
\appendix
\section{The companion script}\label{app:checks}
\texttt{verify-topology-learning.py} runs in about ten seconds and prints one line per check.
\textbf{O1--O3} antipodal collisions of codes on the circle and the sphere, and the radius of the worst fibre;
\textbf{O4, O5} steps of four codes for rotations along a full turn, and the Gram--Schmidt decoder;
\textbf{O6} index sums on five triangulated surfaces;
\textbf{O7, O8} piecewise linear functions as rectifier networks, and winding numbers of polygons;
\textbf{O9} windings and pieces of the iterated doubling map;
\textbf{O10} decision regions of narrow networks, and a bounded region with three units;
\textbf{O11} the quaternion frame on the $3$-sphere;
\textbf{V1--V3} Hodge Laplacians, coefficients, and convergence of diffusion;
\textbf{V4--V6} Rips complexes of equally spaced and of random points on a circle;
\textbf{V7} bottleneck distances between persistence diagrams of perturbed functions;
\textbf{N1, N2} junctions of nearest-prototype classifiers in dimensions two and three;
\textbf{N3} the length of the Sperner walk;
\textbf{N4, N5} fixed points of circle maps and zeros of fields on a torus;
\textbf{N6} the degree of a small network and the bias at which it changes;
\textbf{N7} zeros of odd networks on a circle.
Homology is computed exactly, by Smith normal form over the integers and Gaussian elimination over prime
fields, with the library of the companion volume. Random inputs use fixed seeds. The figures were drawn
by a separate plotting script from the same formulas and are embedded in the source as coordinates.
\begin{thebibliography}{DFdC$^{+}$18}\footnotesize\setlength{\itemsep}{0.5pt}
\newcommand{\bi}[1]{\bibitem[#1]{#1}}
\bi{ABMM18} R.~Arora, A.~Basu, P.~Mianjy, A.~Mukherjee, Understanding deep neural networks with rectified linear units, \emph{Proc.\ ICLR} 2018.
\bi{Ada13} M.~Adamaszek, Clique complexes and graph powers, \emph{Israel J.~Math.} 196 (2013), 295--319.
\bi{AdAd17} M.~Adamaszek, H.~Adams, The Vietoris--Rips complexes of a circle, \emph{Pacific J.~Math.} 290 (2017), 1--40. Checked.
\bi{ADTHC} Anonymous, \emph{Algebraic and Differential Topology in Higher Categories}, Higher Categorical Semantics, 2026. Companion volume.
\bi{Ban67} T.~Banchoff, Critical points and curvature for embedded polyhedra, \emph{J.~Differential Geom.} 1 (1967), 245--256.
\bi{BBS95} R.~Ben-Yishai, R.~L.~Bar-Or, H.~Sompolinsky, Theory of orientation tuning in visual cortex, \emph{Proc.\ Nat.\ Acad.\ Sci.\ U.S.A.} 92 (1995), 3844--3848.
\bibitem[BFW$^{+}$21]{BFW21} C.~Bodnar, F.~Frasca, Y.~Wang, N.~Otter, G.~Mont\'ufar, P.~Li\`o, M.~Bronstein, Weisfeiler and Lehman go topological: message passing simplicial networks, \emph{Proc.\ ICML} 2021.
\bi{BKK19} S.~Bai, J.~Z.~Kolter, V.~Koltun, Deep equilibrium models, \emph{Adv.\ Neural Inf.\ Process.\ Syst.} 32 (2019).
\bi{Car09} G.~Carlsson, Topology and data, \emph{Bull.\ Amer.\ Math.\ Soc.} 46 (2009), 255--308.
\bi{CEH07} D.~Cohen-Steiner, H.~Edelsbrunner, J.~Harer, Stability of persistence diagrams, \emph{Discrete Comput.\ Geom.} 37 (2007), 103--120.
\bi{CWKW19} T.~Cohen, M.~Weiler, B.~Kicanaoglu, M.~Welling, Gauge equivariant convolutional networks and the icosahedral CNN, \emph{Proc.\ ICML} 2019.
\bibitem[DFdC$^{+}$18]{DFdC18} T.~R.~Davidson, L.~Falorsi, N.~De~Cao, T.~Kipf, J.~M.~Tomczak, Hyperspherical variational auto-encoders, \emph{Proc.\ UAI} 2018.
\bi{DGP09} C.~Daskalakis, P.~W.~Goldberg, C.~H.~Papadimitriou, The complexity of computing a Nash equilibrium, \emph{SIAM J.~Comput.} 39 (2009), 195--259.
\bi{Eck44} B.~Eckmann, Harmonische Funktionen und Randwertaufgaben in einem Komplex, \emph{Comment.\ Math.\ Helv.} 17 (1944), 240--255.
\bi{EdHa10} H.~Edelsbrunner, J.~Harer, \emph{Computational Topology: An Introduction}, American Mathematical Society, 2010.
\bi{EDS20} S.~Ebli, M.~Defferrard, G.~Spreemann, Simplicial neural networks, NeurIPS Workshop on Topological Data Analysis and Beyond, 2020.
\bibitem[FdH$^{+}$18]{FdH18} L.~Falorsi, P.~de~Haan, T.~R.~Davidson, N.~De~Cao, M.~Weiler, P.~Forr\'e, T.~S.~Cohen, Explorations in homeomorphic variational auto-encoding, ICML Workshop on Theoretical Foundations and Applications of Deep Generative Models, 2018.
\bibitem[GHP$^{+}$22]{GHP22} R.~J.~Gardner, E.~Hermansen, M.~Pachitariu, Y.~Burak, N.~A.~Baas, B.~A.~Dunn, M.-B.~Moser, E.~I.~Moser, Toroidal topology of population activity in grid cells, \emph{Nature} 602 (2022), 123--128.
\bi{HaSe17} B.~Hanin, M.~Sellke, Approximating continuous functions by ReLU nets of minimal width, arXiv:1710.11278, 2017.
\bi{Joh19} J.~Johnson, Deep, skinny neural networks are not universal approximators, \emph{Proc.\ ICLR} 2019.
\bi{Lim20} L.-H.~Lim, Hodge Laplacians on graphs, \emph{SIAM Rev.} 62 (2020), 685--715.
\bi{Mat03} J.~Matou\v{s}ek, \emph{Using the Borsuk--Ulam Theorem}, Springer, 2003.
\bi{NSW08} P.~Niyogi, S.~Smale, S.~Weinberger, Finding the homology of submanifolds with high confidence from random samples, \emph{Discrete Comput.\ Geom.} 39 (2008), 419--441.
\bi{NZL20} G.~Naitzat, A.~Zhitnikov, L.-H.~Lim, Topology of deep neural networks, \emph{J.~Mach.\ Learn.\ Res.} 21 (2020), no.~184, 1--40.
\bi{Pap94} C.~H.~Papadimitriou, On the complexity of the parity argument and other inefficient proofs of existence, \emph{J.~Comput.\ System Sci.} 48 (1994), 498--532.
\bibitem[PBB$^{+}$24]{PBB24} T.~Papamarkou, T.~Birdal, M.~Bronstein, G.~Carlsson, J.~Curry, Y.~Gao, M.~Hajij, R.~Kwitt, P.~Li\`o, P.~Di~Lorenzo, V.~Maroulas, N.~Miolane, F.~Nasrin, K.~N.~Ramamurthy, B.~Rieck, S.~Scardapane, M.~T.~Schaub, P.~Veli\v{c}kovi\'c, B.~Wang, Y.~Wang, G.-W.~Wei, G.~Zamzmi, Position: topological deep learning is the new frontier for relational learning, \emph{Proc.\ ICML} 2024, PMLR 235, 39529--39555. Checked.
\bi{SHSFG19} A.~Shafahi, W.~R.~Huang, C.~Studer, S.~Feizi, T.~Goldstein, Are adversarial examples inevitable?, \emph{Proc.\ ICLR} 2019.
\bi{Tel16} M.~Telgarsky, Benefits of depth in neural networks, \emph{Proc.\ COLT} 2016, PMLR 49, 1517--1539.
\bi{ZBLYL19} Y.~Zhou, C.~Barnes, J.~Lu, J.~Yang, H.~Li, On the continuity of rotation representations in neural networks, \emph{Proc.\ CVPR} 2019, 5745--5753. Checked.
\bi{Zha96} K.~Zhang, Representation of spatial orientation by the intrinsic dynamics of the head-direction cell ensemble: a theory, \emph{J.~Neurosci.} 16 (1996), 2112--2126.
\end{thebibliography}
\end{document}