We’ve all been there. You pick up a slice of pizza and you’re about to take a bite, but it flops over and dangles limply from your fingers instead. The crust isn’t stiff enough to support the weight of the slice. Maybe you should have gone for fewer toppings. But there’s no need to despair, for years of pizza eating experience have taught you how to deal with this situation. Just fold the pizza slice into a U shape (aka the fold hold). This keeps the slice from flopping over, and you can proceed to enjoy your meal. (If you don’t have a slice of pizza handy, you can try this out with a sheet of paper.)

Behind this pizza trick lies a powerful mathematical result about curved surfaces, one that’s so startling that its discoverer, the mathematical genius Carl Friedrich Gauss, named it Theorema Egregium, Latin for excellent or remarkable theorem.

Take a sheet of paper and roll it into a cylinder. It might seem obvious that the paper is flat, while the cylinder is curved. But Gauss thought about this differently. He wanted to define the curvature of a surface in a way that doesn’t change when you bend the surface.

If you zoom in on an ant that lives on the cylinder, there are many possible paths the ant could take. It could decide to walk down the curved path, tracing out a circle, or it could walk along the flat path, tracing out a straight line. Or it might do something in between, tracing out a helix.

Gauss’s brilliant insight was to define the curvature of a surface in a way that takes all these choices into account. Here’s how it works. Starting at any point, find the two most extreme paths that an ant can choose (i.e. the most concave path and the most convex path). Then multiply the curvature of those paths together (curvature is positive for concave paths, zero for flat paths, and negative for convex paths). And, voila, the number you get is Gauss’s definition of the curvature at that point.

Let’s try some examples. For the ant on the cylinder, the two extreme paths available to it are the curved, circle-shaped path, and the flat, straight-line path. But since the flat path has zero curvature, when you multiply the two curvatures together you get zero. As mathematicians would say, a cylinder is flat — it has zero *Gaussian curvature*. Which reflects the fact that you can roll one out of a sheet of paper.

If, instead, the ant lived on a ball, there would be no flat paths available to it. Now every path curves by the same amount, and so the Gaussian curvature is some positive number. So spheres are curved while cylinders are flat. You can bend a sheet of paper into a tube, but you can never bend it into a ball.

Gauss’s remarkable theorem, the one which I like to imagine made him giggle with joy, is that an ant living on a surface can work out its curvature without ever having to step outside the surface, just by measuring distances and doing some math. This, by the way, is what allows us to determine whether our universe is curved without ever having to step outside of the universe (as far as we can tell, it’s flat).

A surprising consequence of this result is that **you can take a surface and bend it any way you like, so long as you don’t stretch, shrink or tear it, and the Gaussian curvature stays the same.** That’s because bending doesn’t change any distances on the surface, and so the ant living on the surface would still calculate the same Gaussian curvature as before.

This might sound a little abstract, but it has real-life consequences. Cut an orange in half, eat the insides (yum), then place the dome-shaped peel on the ground and stomp on it. The peel will never flatten out into a circle. Instead, it’ll tear itself apart. That’s because a sphere and a flat surface have different Gaussian curvatures, so there’s no way to flatten a sphere without distorting or tearing it. Ever tried gift wrapping a basketball? Same problem. No matter how you bend a sheet of paper, it’ll always retain a trace of its original flatness, so you end up with a crinkled mess.

Another consequence of Gauss’s theorem is that it’s impossible to accurately depict a map on paper. The map of the world that you’re used to seeing depicts angles correctly, but it grossly distorts areas. The Museum of Math points out that clothing designers have a similar challenge — they design patterns on a flat surface that have to fit our curved bodies.

What does any of this have to do with pizza? Well, the pizza slice was flat before you picked it up (in math speak, it has zero Gaussian curvature). Gauss’s remarkable theorem assures us that **one direction of the slice must always remain flat** — no matter how you bend it, the pizza must retain a trace of its original flatness. When the slice flops over, the flat direction (shown in red below) is pointed sideways, which isn’t helpful for eating it. But by folding the pizza slice sideways, you’re forcing it to become flat in the other direction – the one that points towards your mouth. Theorema egregium, indeed.