Rotate a letter F through a full turn and take a picture every half degree. That gives 720 images of 32 × 32 pixels, so each image is a point in \( \mathbb{R}^{1024} \). One number describes all of them: the angle. Now squeeze each image down to a single number with an encoder. Any continuous encoder will do, meaning one where a small change to the image gives a small change to the number: a linear projection, a neural network, anything built from continuous pieces. Can it give every rotation its own number?

It cannot. Whatever continuous encoder you pick, some two opposite rotations, \( \theta \) and \( \theta + 180° \), get exactly the same number. The notebook tries the first principal component and 200 random encoders, linear and nonlinear, and finds such a pair every time. With two numbers the problem disappears (Fig. 1).

Two panels. Left: the 720 rotated images, encoded by two numbers, form a circle; thumbnails show the F at 0, 90, 180 and 270 degrees at four points of the circle. Right: the first of those numbers alone, plotted against the rotation angle, is a cosine-like curve; a dashed horizontal line at 0 crosses it at 90 and 270 degrees, with thumbnails of the two different rotated Fs that share the code.
Fig. 1. Encoding rotated images of an F. Left: with two numbers (the first two principal components) the images form a loop. Rotations 10° or more apart get clearly different codes. Right: with one number, the F at 90° and the F at 270° get the same code.

Neither distances nor angles from Part 3 explain this. It is a fact about the shape of the data: the images form a loop, and a loop cannot be laid along a line without two of its points landing on top of each other. The branch of mathematics that can say this, while ignoring every length and angle, is topology. By the end of this post the puzzle will be a proposition with a three-line proof.

This is Part 5 of Math for GDL. The series works through a review paper by Sáez de Ocáriz Borde & Bronstein (2025), called the review below, one section at a time. Part 3 measured length, distance and angle, and Part 4 used them to differentiate. This part covers §4.1, §4.2 and §4.4 and goes the other way: it throws the measurements away and keeps only the idea of nearness. What survives is still enough to say a lot:

StructureWhat it can sayWhere
Metrichow far apart two points arePart 3
Topologywhich points are near, whether a space is in one piece, how many holes it hasthis part
Manifold hypothesishow many numbers the data really needsthis part
Table of contents
  1. Notation
  2. Nearness without distance
  3. Same nearness, different distances
  4. Continuity without epsilons
  5. Homeomorphisms
  6. Why a circle is not a line
  7. Homotopy and holes
  8. The manifold hypothesis
  9. Quick summary
  10. Open questions
  11. Code
  12. Citation
  13. References

Notation

SymbolMeaning
\( (X, \mathcal{T}) \)A topological space: a set \( X \) and its collection of open sets \( \mathcal{T} \)
\( \mathcal{P}(X) \)The power set of \( X \): all its subsets
\( B(x, r) \)The open ball of radius \( r \) around \( x \): all \( y \) with \( d(x, y) < r \)
\( f^{-1}(U) \)The preimage of \( U \): all \( x \) with \( f(x) \in U \)
\( X \cong Y \)\( X \) and \( Y \) are homeomorphic
\( X \simeq Y \)\( X \) and \( Y \) are homotopy equivalent
\( S^1 \), \( S^2 \)The circle and the sphere (surfaces only, not the filled-in shapes)
\( \chi \)The Euler characteristic
\( b_k \)The \( k \)-th Betti number: the number of independent \( k \)-dimensional holes

Nearness without distance

A bare set has no nearness at all. As the review puts it, in the set \( \mathbb{R}^2 \) the point \( (0, 0) \) is no closer to \( (0, 1) \) than to \( (10, 10) \). Part 3 added a distance. Topology starts from an observation: most jobs that distance does, such as defining continuity and convergence, only need open sets.

Definition 1 (Open set in a metric space). In a metric space \( (X, d) \), a subset \( U \) is open if every point of \( U \) has a ball around it that stays inside \( U \): for every \( x \in U \) there is an \( r > 0 \) with \( B(x, r) \subseteq U \).

The open interval \( (0, 1) \) is open: from any point inside, you can step a little in either direction and stay inside. The closed interval \( [0, 1] \) is not, because no ball around the endpoint 0 fits inside it. Topology keeps the open sets and drops the distance. With no distance left to define them, it lists the properties that open sets always have and takes those as the definition (Munkres 2000, §12).

Definition 2 (Topology). A topology on a set \( X \) is a collection \( \mathcal{T} \subseteq \mathcal{P}(X) \) of subsets, called open sets, such that

  1. \( \emptyset \) and \( X \) are open;
  2. any union of open sets is open, even of infinitely many;
  3. the intersection of finitely many open sets is open.

The pair \( (X, \mathcal{T}) \) is a topological space.

Why only finite intersections? The intervals \( (-1/k, 1/k) \) are all open, but their intersection over every \( k \) is the single point \( \{0\} \), which is not. The review lists three standard examples. The Euclidean topology on \( \mathbb{R}^n \) has as open sets all unions of open balls. The discrete topology makes every subset open. The trivial topology makes only \( \emptyset \) and \( X \) open. The discrete one has the most open sets (it is the finest), the trivial one the fewest (the coarsest).

On a small set you can list every topology by brute force. The notebook checks all collections of subsets against Definition 2 and finds 1, 4 and 29 topologies on sets of 1, 2 and 3 points. Not every collection passes. On \( X = \{a, b, c\} \) the collection \( \{\emptyset, \{a\}, \{b\}, X\} \) fails, because the union \( \{a\} \cup \{b\} = \{a, b\} \) is missing.

Why ML cares. A dataset is a finite set of points, and any metric on a finite set gives the discrete topology. Take a ball smaller than the smallest distance between two points: it contains only its centre, which makes every single point open. The topology of a point cloud therefore says nothing about its shape. Topological data analysis instead builds a new space at each scale, for example the union of balls of radius \( r \) around the points, and records which loops and holes persist as \( r \) grows. This is persistent homology (Carlsson 2009).

Same nearness, different distances

Different distances can give the same open sets. Part 3 met three norms on \( \mathbb{R}^n \), with very different unit balls: a diamond, a disk and a square in the plane. They measure different lengths, but they agree on what is near.

Proposition 1 (The three norms give one topology). On \( \mathbb{R}^n \), the norms \( L_1 \), \( L_2 \) and \( L_\infty \) have the same open sets.

Proof

For every \( x \), $$ \|x\|_\infty \;\le\; \|x\|_2 \;\le\; \|x\|_1 \;\le\; n\, \|x\|_\infty. $$ So the \( L_\infty \) ball of radius \( r/n \) sits inside the \( L_1 \) ball of radius \( r \), which sits inside the \( L_2 \) ball of radius \( r \), which sits inside the \( L_\infty \) ball of radius \( r \). Around every point of a set that is open for one norm, there is a ball of that norm inside the set, and a ball of each other norm inside that ball. So the set is open for every norm. ∎

Nested balls around the origin: an L1 diamond of radius 1, inside it an L-infinity square of radius one half, inside that an L2 circle of radius one half, inside that an L1 diamond of radius one half, then a smaller square and circle.
Fig. 2. Balls of the three norms nest inside each other like Russian dolls: \( L_1 \) radius 1, \( L_\infty \) radius ½, \( L_2 \) radius ½, \( L_1 \) radius ½, and so on. Wherever one norm finds room for a ball, the others do too, so all three agree on which sets are open.

Not every distance gives the same topology. The discrete metric puts every two different points at distance 1. Its balls of radius ½ are single points, so every set is open and the topology is discrete. With it, the sequence \( 1, \tfrac{1}{2}, \tfrac{1}{3}, \ldots \) no longer converges to 0: it never comes within ½ of 0. Topology forgets how far apart things are, but it remembers which sequences converge and which maps are continuous.

Continuity without epsilons

Part 4 defined continuity with distances: \( f(x) \) gets as close as you like to \( f(x_0) \) once \( x \) is close enough to \( x_0 \). Open sets say the same thing with no numbers at all.

Definition 3 (Continuity). A map \( f : X \to Y \) between topological spaces is continuous if the preimage of every open set is open: \( f^{-1}(U) \) is open in \( X \) whenever \( U \) is open in \( Y \).

For metric spaces this agrees with the distance version (the proof is below). Here it is at work on a jump. Take the step function that is 0 for \( x < 0 \) and 1 for \( x \ge 0 \). The preimage of the open interval \( (\tfrac12, \tfrac32) \) is \( [0, \infty) \). That set is not open, because every interval around 0 contains negative numbers. So the step function is not continuous, and the failure sits exactly at the jump. For \( f(x) = x^2 \), the preimage of \( (1, 4) \) is \( (-2, -1) \cup (1, 2) \), which is open.

Proof that Definition 3 matches the distance version

Suppose preimages of open sets are open, and take \( x_0 \) and \( \epsilon > 0 \). The ball \( B(f(x_0), \epsilon) \) is open, so its preimage is open and contains \( x_0 \). It therefore contains a ball \( B(x_0, \delta) \), and every \( x \) in that ball has \( d(f(x), f(x_0)) < \epsilon \). Conversely, suppose \( f \) passes the \( \epsilon \)-\( \delta \) test, and let \( U \) be open with \( x_0 \in f^{-1}(U) \). Some ball \( B(f(x_0), \epsilon) \) fits in \( U \), and the matching \( \delta \) gives \( B(x_0, \delta) \subseteq f^{-1}(U) \). So \( f^{-1}(U) \) is open. ∎

Two extreme cases show how much the choice of open sets matters. From a space with the discrete topology every map is continuous, since every preimage is open. Into a space with the trivial topology every map is continuous too, since the only preimages to check are \( \emptyset \) and \( X \). The more open sets the domain has, and the fewer the target has, the easier it is to be continuous.

Homeomorphisms

Definition 4 (Homeomorphism). A map \( f : X \to Y \) is a homeomorphism if it is a bijection, it is continuous, and its inverse is continuous. Then \( X \) and \( Y \) are homeomorphic, written \( X \cong Y \).

Homeomorphic spaces are the same space as far as topology can tell. The bijection, a one-to-one pairing of their points, also pairs up their open sets one for one. Size is invisible to topology. The map \( h(x) = x / (1 - |x|) \) stretches the short interval \( (-1, 1) \) onto the whole line \( \mathbb{R} \), and \( h^{-1}(y) = y / (1 + |y|) \) squeezes it back. Both are continuous, so a bounded interval and an unbounded line are homeomorphic.

Corners are invisible too. Pushing each point of a cube's surface out to the sphere, \( x \mapsto x / \|x\|_2 \), is a homeomorphism, with inverse \( x \mapsto x / \|x\|_\infty \). The notebook checks both round trips. (Do not confuse this with a homomorphism from Part 2, which preserves algebra, not nearness.)

Aside: the review's reason the cube and sphere are homeomorphic

The review's Fig. 10 says the cube and sphere are homeomorphic because "they are both simply connected (no holes) and can be continuously deformed into each other". The second half is the real reason, and the map above makes it explicit. The first half alone is not enough. A flat disk is simply connected too (every loop in it can be shrunk to a point), but it is not homeomorphic to a sphere: the disk has an edge and the sphere does not, and their Euler characteristics, introduced below, are 1 and 2. For closed surfaces without edges, being simply connected does force a sphere, but that takes the classification of surfaces, a much deeper theorem. And "no holes" fits the sphere awkwardly: it encloses a cavity, which the Betti number \( b_2 = 1 \) below counts.

Why a circle is not a line

Now the opening puzzle. The map that sends an angle to the image of the F rotated by that angle is continuous, since the pixels change smoothly as the F turns. It is also one-to-one, because the F has no rotational symmetry. The notebook's numbers agree, though they do not prove it: rotations at least 10° apart are always more than 15 times as far apart in pixel space as neighbouring half-degree rotations. So the 720 images are samples from a copy of the circle \( S^1 \) sitting inside \( \mathbb{R}^{1024} \): as far as topology can tell, the images form a circle. This map followed by an encoder, angle to image to code, is a continuous function on a circle.

Proposition 2 (A circle has no faithful one-number code). Every continuous \( f : S^1 \to \mathbb{R} \) takes the same value at some pair of opposite points: there is a \( \theta \) with \( f(\theta) = f(\theta + \pi) \). In particular, no continuous map from a circle to the line is one-to-one.

Proof

Let \( g(\theta) = f(\theta) - f(\theta + \pi) \). It is continuous, and $$ \begin{aligned} g(\theta + \pi) &= f(\theta + \pi) - f(\theta + 2\pi) && \text{; definition of } g \\ &= f(\theta + \pi) - f(\theta) && \text{; } \theta + 2\pi \text{ is the same point as } \theta \\ &= -g(\theta). && \end{aligned} $$ So \( g(0) \) and \( g(\pi) \) have opposite signs, or one is zero. The intermediate value theorem says that a continuous function on an interval takes every value between its values at the two ends, so \( g \) is zero somewhere between 0 and \( \pi \). ∎

For the first principal component of the F images, the pair is 90° and 270°, the two thumbnails on the right of Fig. 1. The notebook also tries 200 random encoders, linear and nonlinear, and bisection finds an opposite pair with equal codes for every one. A two-number code escapes because the plane has room for a loop. The first two principal components already work: in the notebook, rotations 10° apart always get codes more than 15 times farther apart than neighbouring rotations do.

Aside: which first principal component?

The first two principal components of the F images tie: each explains 27.5% of the variance, because turning the F moves variance evenly between them, like \( \cos \theta \) and \( \sin \theta \). Any orthonormal basis of the plane they span is an equally good answer, and different linear algebra libraries return different ones. The notebook fixes the pair so that code 1 points at the upright F. With another choice the matching pair moves, to 0° and 180° for example, but Proposition 2 guarantees that some opposite pair always shares a code.

Proposition 2 already shows that a circle is not homeomorphic to any interval. A second, standard proof uses cut points. Suppose a homeomorphism matched a circle with an interval. Remove a circle point whose image lies inside the interval, and remove that image too. What is left is still homeomorphic, and a homeomorphism never turns one piece into two. But the circle minus a point stays in one piece, while the interval falls into two. So no such homeomorphism exists. The notebook checks the discrete version on graphs: deleting any vertex of a 50-vertex cycle leaves it connected, while deleting any interior vertex of a 50-vertex path splits it.

Why ML cares. An autoencoder compresses each input to a short code, its latent, and rebuilds the input from that code. If the latent space has the wrong shape, the encoder must tear the data somewhere, either by gluing different inputs together or by jumping. Data that lives on a circle, or on the rotations of a 3D object, does not fit into a Euclidean latent space of the same dimension without such damage: a line for a circle, \( \mathbb{R}^3 \) for 3D rotations. A bigger Euclidean space can work, as the plane does for the F, but most of its room then goes unused. Falorsi et al. (2018) argue that the latent space should match the topology of the data and build a variational autoencoder whose latents are 3D rotations. Davidson et al. (2018) put the latents on a hypersphere instead of \( \mathbb{R}^n \), with a von Mises–Fisher distribution in place of the Gaussian.

Homotopy and holes

This section corrects two slips in the review. If you only want the machine learning thread, skip to the manifold hypothesis.

Homeomorphism is a strict test. A looser one lets you squash parts of a space, as long as you can undo it up to a continuous wiggle. Two maps \( f_0, f_1 : X \to Y \) are homotopic if one can be deformed into the other continuously: there is a continuous \( H : X \times [0, 1] \to Y \) with \( H(\cdot, 0) = f_0 \) and \( H(\cdot, 1) = f_1 \). For example, every map into the plane is homotopic to a constant map: slide each output point along a straight line to the origin.

Definition 5 (Homotopy equivalence). Spaces \( X \) and \( Y \) are homotopy equivalent, written \( X \simeq Y \), if there are continuous maps \( f : X \to Y \) and \( g : Y \to X \) such that \( g \circ f \) is homotopic to the identity of \( X \) and \( f \circ g \) is homotopic to the identity of \( Y \).

A filled disk is homotopy equivalent to a point. Let \( f \) send the whole disk to its centre, and let \( g \) put the point back as the centre. Then \( f \circ g \) is already the identity of the point. And \( g \circ f \), which crushes the disk to its centre, can be slid back to the identity: move each point along the straight line from the centre to where it started. A ring-shaped annulus is homotopy equivalent to a circle: squash the ring's width. Homeomorphic spaces are always homotopy equivalent, but not the other way round.

The review's example goes wrong here. It says a circle and a point are homotopy equivalent "because the circle can be continuously shrunk to a single point". A circle can be shrunk to a point inside the plane, by sliding it across the disk it bounds. That shows this loop surrounds no hole in the plane. It is the disk that is homotopy equivalent to a point. Inside the circle itself there is no room to slide, and the circle is not homotopy equivalent to a point. To prove it, count.

Definition 6 (Euler characteristic). Build a space from \( V \) vertices, \( E \) edges and \( F \) faces (and, in higher dimensions, solid pieces), where each face is a filled polygon and pieces meet only along whole edges and vertices. Its Euler characteristic is the alternating count $$ \chi = V - E + F - \cdots. $$

Five shapes with their Euler characteristic: a point, 1; a square loop of four vertices and four edges, 0; a filled triangle, 3 minus 3 plus 1 equals 1; an annulus triangulated with 16 vertices, 32 edges and 16 triangles, 0; a torus wireframe with 108 vertices, 216 edges and 108 squares, 0.
Fig. 3. Vertices minus edges plus faces. The point and the disk give 1, the circle, the annulus and the torus give 0, whatever the size or shape of their pieces.

The count does not depend on how you cut the shape into pieces: the notebook builds tori from 20 and from 108 vertices and gets \( \chi = 0 \) both times. More importantly, it is a homotopy invariant.

Theorem 1 (Euler–Poincaré). For a space built as in Definition 6 from finitely many pieces, $$ \chi = b_0 - b_1 + b_2 - \cdots, $$ where \( b_k \), the \( k \)-th Betti number, counts independent \( k \)-dimensional holes: \( b_0 \) the pieces, \( b_1 \) the loops that do not bound anything, \( b_2 \) the enclosed cavities. Betti numbers are unchanged by homotopy equivalence, so \( \chi \) is too (Hatcher 2002, §2.1 and §2.2).

The notebook computes Betti numbers from the ranks of boundary matrices and checks the theorem on nine shapes:

Shape\( b_0, b_1, b_2 \)\( \chi \)
point, disk, solid tetrahedron1, 0, 01
circle, annulus1, 1, 00
sphere (tetrahedron or octahedron surface)1, 0, 12
torus (two meshes)1, 2, 10

The disk and the point share \( \chi = 1 \), and the annulus and the circle share \( \chi = 0 \), as Theorem 1 requires. The circle (0) and the point (1) do not, so they are not homotopy equivalent. The review's paragraph on the Euler characteristic has a related slip. It says \( \chi \) is "not necessarily" preserved by homotopy equivalence, and gives as an example a sphere and a point, "homotopy equivalent (in the weak sense)" with \( \chi = 2 \) and 1. Both halves are off. \( \chi \) is a homotopy invariant, so the different values prove that the sphere is not homotopy equivalent to a point. The weaker notion also preserves Betti numbers, so it cannot match them either. The space that is homotopy equivalent to a point is the solid ball, and its \( \chi \) is 1.

The rotating F fits the same picture. Join each image to its two nearest neighbours in pixel space and you get a graph with 720 vertices, 720 edges and one piece. Its Euler characteristic is \( 720 - 720 = 0 \), and it has exactly one loop, \( b_1 = 1 \). The loop is visible in the data alone, without knowing that the images came from rotations.

The manifold hypothesis

The review closes §4 with the manifold hypothesis (Bengio et al. 2013): data that looks high-dimensional usually lies on or near a low-dimensional surface inside its space. Part 6 makes manifold precise; here it means a space that looks like \( \mathbb{R}^d \) near each point, for some small \( d \). The review is careful to add that in machine learning the word is used loosely. The data may not be smooth, and its dimension may change from place to place.

Its example is a dataset of grayscale images, which it places in \( \mathbb{R}^{256 \times \text{height} \times \text{width}} \). For raw pixel values the space is smaller: a grayscale image has one number per pixel, so it is a point in \( \mathbb{R}^{\text{height} \times \text{width}} \), with each coordinate one of 256 brightness levels. The factor 256 belongs only to a one-hot encoding, which stores a vector of 256 indicators per pixel. The point of the example stands: almost every point of that space is noise, and the images people care about fill a tiny part of it.

The rotating F is the smallest example. It sits in 1024 dimensions, but it is a loop, so its intrinsic dimension is 1. A flat method cannot see that. Principal component analysis looks for the best flat subspace, and a curved loop needs many flat directions: 7 for 90% of the variance and 16 for 99% (Fig. 4, left). A local method does better. The TwoNN estimator (Facco et al. 2017, used here in its maximum-likelihood form) looks only at each point's distances to its first and second nearest neighbours, \( r_1 \) and \( r_2 \). Suppose the data lies on a \( d \)-dimensional manifold, with roughly constant density out to each point's second neighbour. Then the ratio \( \mu = r_2 / r_1 \) satisfies \( P(\mu > m) = m^{-d} \) for \( m \ge 1 \), so \( \log \mu \) is exponential with rate \( d \). The maximum-likelihood estimate from \( n \) points is $$ \hat d = \frac{n}{\sum_{i=1}^n \log \mu_i}. $$

Data (all in \( \mathbb{R}^{1024} \))True degrees of freedomTwoNN estimate
F at 400 random angles10.97
F at 800 random angles and sizes21.92
the same 400 rotations plus pixel noise of 0.051, plus noise58.7
400 images of uniform noise1024178

The third row is the review's warning in numbers. A little noise makes every neighbourhood look high-dimensional at the smallest scale, even though the loop is still there at larger scales. The last row underestimates, as nearest-neighbour estimators do when there are far fewer points than dimensions.

Left: share of variance explained against number of principal components for the rotating F, rising to 90 percent at 7 components and 99 percent at 16. Right: three images: the F at 0 degrees, the pixel average of the F at 0 and at 90 degrees, which looks like two overlapping Fs, and the F at 45 degrees.
Fig. 4. Left: principal components need 16 flat directions to capture 99% of the variance of a loop whose intrinsic dimension is 1. Right: the pixel-wise average of the F at 0° and at 90° is a double exposure, not an F at 45°. In units of the distance between the two endpoints, every rotated F is at least 0.49 away from the average, and the F at 45° is 0.56 away.

The review also points out that a straight line in pixel space leaves the data. Fig. 4 shows it: halfway between two rotations of the F is a blurred double exposure, about as far from every rotated F as from the two images it was made from. To move between rotations you have to follow the loop. That is the job of an encoder's latent space, and the opening puzzle says how many numbers it needs: the loop's dimension is 1, but its shape asks for 2.

Why ML cares. Pope et al. (2021) estimate that ImageNet, with 150,528 numbers per image, has an intrinsic dimension between 26 and 43, and that datasets with lower intrinsic dimension are easier to learn and generalise from. Whether the hypothesis holds for a given dataset can itself be tested from samples (Fefferman et al. 2016).

Quick summary

Each idea from this post, with its example.

IdeaIn one lineExample in this postIn ML
Open sets, topologynearness without distance29 topologies on 3 pointsfinite data is discrete; look across scales
Same topologyballs nest inside each other\( L_1 \), \( L_2 \), \( L_\infty \) (Fig. 2)convergence does not depend on the norm
Continuitypreimages of open sets are openstep function fails at 0networks of continuous layers are continuous
Homeomorphismsame space up to stretching\( (-1, 1) \cong \mathbb{R} \), cube \( \cong \) spherelatents should match data topology
Circle vs lineopposite points share a valueF at 90° and 270°, same codecircular or spherical latents
Euler characteristic\( V - E + F = b_0 - b_1 + b_2 \)circle 0, point 1, sphere 2persistent homology
Manifold hypothesisfew degrees of freedom, many pixelsloop in \( \mathbb{R}^{1024} \): PCA 16, TwoNN 0.97ImageNet: 26 to 43

Open questions

Questions I'm carrying into the next parts:

  • What does a manifold look like up close? Here manifold was an informal word. Making it precise needs charts, maps that make each small patch look like \( \mathbb{R}^d \). (§4.3 of the review.)
  • How do you follow a curved surface? Straight lines in pixel space leave the data. On a manifold the replacement for a straight line is a geodesic. How do you compute one from samples?
  • Which shape should a latent space have? For a loop the answer is a circle. For real images, where the topology is unknown and noisy, is there a principled choice?

Next, Part 6 turns to §4.3: manifolds and differential geometry. It puts the calculus of Part 4 back on top of the topology of this part. That gives tangent spaces, Riemannian metrics and geodesics, the shortest paths that stay on a curved surface.

Code

All checks in this post, and Figs. 1 to 4, are in math-gdl-05-topology.ipynb (NumPy and Matplotlib; runs in about ten seconds). Each demo ends with a short exercise, such as giving the F a symmetry and predicting which checks break.

To skip the setup, open the interactive playground. It runs the same checks in your browser and adds controls for the exercises. The first load can take up to half a minute while Python starts up. Its source is math-gdl-05-topology-playground.py, a marimo notebook.

Corrections are welcome at .

Previous: Part 4, Slope, Flow, and Smoothness. Next: Part 6, Flat Maps of Curved Worlds. Series overview: Eight Puzzles That Helped Me Understand Geometric Deep Learning.

Citation

Cited as:

Pham, Anh-Duy. (Nov 2026). Shape without distance. Math for GDL, Part 5. https://www.adpham.de/blog/math-gdl-05-topology.html

Or

@article{pham2026mathgdl05,
  title   = "Shape Without Distance",
  author  = "Pham, Anh-Duy",
  journal = "www.adpham.de",
  year    = "2026",
  month   = "Nov",
  url     = "https://www.adpham.de/blog/math-gdl-05-topology.html"
}

References

  1. Sáez de Ocáriz Borde, H. & Bronstein, M. M. “Mathematical Foundations of Geometric Deep Learning.” arXiv:2508.02723 (2025).
  2. Munkres, J. R. Topology, 2nd edition. Prentice Hall (2000).
  3. Hatcher, A. Algebraic Topology. Cambridge University Press (2002).
  4. Carlsson, G. “Topology and data.” Bulletin of the American Mathematical Society 46(2), 255–308 (2009).
  5. Falorsi, L., de Haan, P., Davidson, T. R., De Cao, N., Weiler, M., Forré, P. & Cohen, T. S. “Explorations in homeomorphic variational auto-encoding.” ICML Workshop on Theoretical Foundations and Applications of Deep Generative Models (2018).
  6. Davidson, T. R., Falorsi, L., De Cao, N., Kipf, T. & Tomczak, J. M. “Hyperspherical variational auto-encoders.” Proceedings of the 34th Conference on Uncertainty in Artificial Intelligence, 855–864 (2018).
  7. Bengio, Y., Courville, A. & Vincent, P. “Representation learning: a review and new perspectives.” IEEE Transactions on Pattern Analysis and Machine Intelligence 35(8), 1798–1828 (2013).
  8. Fefferman, C., Mitter, S. & Narayanan, H. “Testing the manifold hypothesis.” Journal of the American Mathematical Society 29(4), 983–1049 (2016).
  9. Facco, E., d'Errico, M., Rodriguez, A. & Laio, A. “Estimating the intrinsic dimension of datasets by a minimal neighborhood information.” Scientific Reports 7, 12140 (2017).
  10. Pope, P., Zhu, C., Abdelkader, A., Goldblum, M. & Goldstein, T. “The intrinsic dimension of images and its impact on learning.” International Conference on Learning Representations (2021).