Give a child a pencil and ask them to draw a fence that closes up on itself. It can wiggle, double back and wander all over the page, as long as it never crosses itself and ends where it began. Now drop a ladybug somewhere on the paper and ask: is it inside the fence or outside? The child will tell you there are only two answers, and that to get from one to the other the ladybug has to cross the fence.
They're right. They are also stating one of the most famously stubborn results in mathematics. In 1887 the French mathematician Camille Jordan wrote it down in his textbook on analysis, along with a proof. It became known as the Jordan curve theorem, and the question of whether his proof really worked kept people arguing for years. This essay is about that theorem, why something so obvious was so hard, and how it quietly powers one of our cleanest two-colour puzzles, Yin-Yang.
The most obvious theorem in mathematics
Here is the statement. A simple closed curve is a loop in the plane that never touches itself. The theorem says that every such loop splits the plane into exactly two regions: a bounded inside and an unbounded outside. Any path from a point inside to a point outside must cross the curve.
For a circle or a square this is easy to believe and easy to prove. The trouble is that "any loop" really means any loop. Curves can be wildly crinkly, so jagged that no piece of them is straight or smooth, with wiggles inside wiggles at every scale. A proof has to work for all of them, and the tools that handle nice curves fall apart on the nasty ones.
Mathematicians long felt that Jordan's own argument left gaps. The American mathematician Oswald Veblen published a proof in 1905 that is usually credited as the first fully rigorous one. A century later, in the early 2000s, the theorem was one of the results that mathematicians checked line by line with computer proof assistants, programs that refuse to accept any step they can't verify. A fact a child can see took more than a century to pin down beyond all doubt.
Counting crossings
There is a lovely practical trick hiding in the theorem. Suppose a loop is so tangled that you can't tell by looking whether a point is inside it. Draw a straight ray from the point out to the edge of the page, and count how many times it crosses the loop.
Every crossing flips you between inside and outside. You finish far away, outside. So if the count is odd, you started inside. If it's even, you started outside. Computer graphics programs use this same parity test, often called the even-odd rule, to decide which pixels fall inside a shape. No intuition needed, just counting.
Keep that idea in your pocket: a closed loop is a wall, and the only way across a wall is through it.
Yin-Yang: two colours, no walls allowed
Yin-Yang is played on a square grid with a few circles already placed. You fill every cell with a black or white circle so that:
- All the black cells form one connected group, linked through up, down, left and right neighbours.
- All the white cells form one connected group too.
- No 2x2 square is entirely one colour.
Diagonal neighbours don't count for connection. That detail matters, because it means a chain of one colour can act as a wall against the other. If black cells ever form a closed loop, any white cells trapped inside are cut off from the white cells outside, and the puzzle is broken. Jordan's theorem, in grid form, is the whole game: each colour must snake through the board without ever fencing in a piece of its rival.
Two rules the theorem hands you
Most Yin-Yang hints are local: if three cells of a 2x2 share a colour, the fourth must be the other one. But the theorem gives you two global rules that experienced solvers lean on constantly.
1. No checkerboards. Look at any 2x2 square. Suppose black sits in the top-left and bottom-right corners, and white in the other two. In a finished puzzle, those two black cells must be joined by a black path somewhere on the board. Add the little diagonal step through the middle of the square, and that path becomes a closed loop. One of the white corners is now inside it and the other is outside, so the whites can never meet. That's a contradiction, so a solved Yin-Yang never contains a diagonal checkerboard 2x2. Combined with the no-solid-block rule, every 2x2 square is either three-and-one or split cleanly down the middle into two pairs side by side.
In practice: whenever you see two same-colour cells touching only at a corner, with one of the other two cells already filled with the opposite colour, the last cell is forced. The checkerboard rule says it must take the same colour as the diagonal pair.
2. The border changes colour at most twice. Walk all the way around the outer edge of a solved grid and note the colour of each edge cell. You'll find at most one run of black and one run of white. Never black, white, black, white. Why? If two separate black runs existed, the black path joining them through the grid, together with the outside edge, would split the board into two pieces, with a white run stranded in each. So the border's colours can change zero times or twice, never more.
This is gold early on. If the edge already shows a white cell, then a black, then a white further along, every border cell on the stretch between those two whites that doesn't pass the black must be white. One glance at the rim can fill a long run of it.
The wall you can't see
The deep lesson of Jordan's theorem isn't really about curves. It's that some facts are global. You can't check them one cell at a time, because they're about how the whole picture hangs together. A Yin-Yang solver who only looks at tiny neighbourhoods will get stuck. One who keeps asking "would this close a loop? would this strand a group?" sees moves that are invisible up close.
Everyday problems have the same shape. A calendar can look fine day by day and still leave no single free afternoon all week. A floor plan can have doors in every room and still trap someone in a corner. Sometimes the useful question isn't "is this step allowed?" but "what does this step enclose?" It took mathematics decades to prove the ladybug's answer. Luckily, you only need to borrow it.


