Ask a mathematician about topology and sooner or later you’ll hear the joke: a topologist cannot tell the difference between a coffee cup and a donut. The line gets a laugh at dinner parties and then, usually, a polite change of subject. But the joke is load-bearing. It compresses, into a single image, what topology is actually about and why it became one of the most productive branches of twentieth-century mathematics.

This article unpacks the joke — and then shows why “not being able to tell the difference” turns out to be a superpower.

Why the coffee cup and donut are the same

Imagine a clay coffee cup and a clay donut, both with the same amount of clay. Without tearing or gluing, can you deform the cup continuously into the donut?

The answer, surprisingly, is yes. Flatten the body of the cup into a flat disk with a handle sticking up. The handle is a loop of clay. Now compress the disk part into a ring around that loop. You have a torus — a donut shape. At no point did you cut the clay or fuse separate pieces together. You just stretched and pushed.

To a topologist, that continuous deformation is the only thing that matters. Two shapes are topologically equivalent if one can be deformed into the other without cutting or gluing. The coffee cup and the donut are equivalent. A sphere and a cube are also equivalent (imagine inflating a balloon inside a box). But a sphere and a donut are not equivalent — there is no way to turn one into the other without either cutting a hole or filling one in.

The thing the donut has and the sphere doesn’t is a hole. Counting holes is the simplest topological measurement there is.

The first real theorem: Euler’s polyhedron formula

Topology’s oldest result, discovered by Euler in 1750, is the polyhedron formula:

VE+F=2V - E + F = 2

For any convex polyhedron — cube, tetrahedron, dodecahedron — the number of vertices minus the number of edges plus the number of faces always equals 2.

The remarkable thing isn’t the equation itself but what it implies. That number, 2, is not really about the polyhedron. It’s about the sphere, which every convex polyhedron is a deformed version of. If you triangulate a donut instead of a sphere, you get VE+F=0V - E + F = 0. A double donut gives 2-2. This number, called the Euler characteristic, is the same for every triangulation of a given surface and depends only on the surface’s topology.

That was the first time a number was attached to a space that didn’t depend on how the space was drawn — only on what the space was. Euler’s formula is the seed from which the entire field of algebraic topology grew.

What holes really are

A “hole” sounds informal, but topology has made it precise. Think of a loop of string lying on your surface. If you can shrink the loop continuously to a point without leaving the surface, the loop is “trivial.” If you can’t — because it goes around a hole — the loop has detected something.

On a sphere, every loop is trivial: anywhere you draw it, you can slide and shrink it to a point. On a donut, loops that go around the donut’s hole or through its tube cannot shrink. They are permanent topological features.

The collection of all loops, organised by which ones can be deformed into which others, forms an algebraic object called the fundamental group. Sphere: trivial fundamental group. Donut: the group Z×Z\mathbb{Z} \times \mathbb{Z}, reflecting two independent directions of non-trivial looping.

This translation from geometry to algebra — “tell me which loops can be deformed into each other and I’ll tell you the shape” — is the single most productive idea in topology. Every hard topological question becomes a question about algebra, where we have better tools.

The Poincaré conjecture, briefly

In 1904, Henri Poincaré asked a natural-sounding question about three-dimensional spaces. Roughly: if a closed 3-dimensional space has no topological holes (every loop can be shrunk to a point), does that force it to be a 3-sphere?

In two dimensions, the answer was known to be yes. A closed, hole-free 2D surface has to be a sphere. Poincaré conjectured the same for three dimensions. It took almost a century to prove.

The breakthrough came from Grigori Perelman in 2002–2003, using techniques from Ricci flow — a way of letting a space evolve over time, smoothing out its curvature until its topology becomes visible. The Poincaré conjecture became the Poincaré theorem, and Perelman was awarded the Fields Medal and a million-dollar Clay Millennium Prize, both of which he famously declined.

You can read a more detailed account in our profile of Perelman. The punchline is that the question Poincaré asked in 1904 — which sounds like an idle geometric curiosity — required a hundred years of analytical and topological machinery to settle.

Why anyone cares

Topology’s ability to ignore distance turns out to be exactly what’s needed in many applied contexts.

Data analysis. Topological data analysis (TDA) extracts features from high-dimensional datasets that don’t depend on arbitrary metric choices. A cluster of data points “looks like” a circle if loops you draw around it can’t be shrunk. TDA has been used in everything from studying cancer tumours to analysing the shape of the universe.

Materials science. Topological insulators — materials whose electronic properties depend on topological invariants rather than local structure — were a major topic of the 2016 Nobel Prize in Physics. They’re being developed for quantum computing.

Robotics. Configuration spaces — the set of all possible positions of a robot — are often topologically non-trivial. Planning a path from point A to point B can mean navigating around topological obstructions.

Even when topology doesn’t show up by name, its ideas do. Any time you say “this problem doesn’t depend on exact measurements, only on what’s connected to what,” you’re reasoning topologically.

The joke, reconsidered

The coffee-cup-and-donut joke makes topologists sound like people who have lost the ability to count the number of things in front of them. The truth is almost the opposite: they’ve learned to stop counting the features that don’t matter, so that the features that do come into focus.

A coffee cup and a donut have one topological hole each. So they are the same. Once you’ve made peace with that, a surprising amount of mathematics opens up.

Frequently asked

Is topology just geometry without distances?

Essentially, yes. Topology studies what stays the same when you deform shapes continuously — stretching and bending allowed, cutting and gluing not. Anything that depends on distance or angle is the job of geometry, not topology.

Why is the Poincaré conjecture famous?

Because it's one of the very few Millennium Prize problems to have been solved — by Grigori Perelman in 2003. It confirmed a natural-looking topological statement that had resisted proof for a century: any closed, simply-connected 3-manifold is a 3-sphere.