Skip to content
The Lumenary
Wonder TrailOptional · never gradedStarts from The coordinate plane

Life on a torus

1

The question

In some video games, walking off the right edge of the screen brings you back on the left, and walking off the top brings you back at the bottom. If that world were a real surface, what shape would it be?

Try the experiment before reading on. There’s no wrong way to explore.

2

Experiment

Surfaces from a square

Glue the sides of a square in pairs so that the arrows match. Walk a flatlander across a side and watch where — and how — it comes back.

abab

Keys: ↑ forward, ↓ back, ← and → turn, Space walks or stops. You can also drag it.

Torusa b a⁻¹ b⁻¹
Orientable
Yes
Euler characteristic
χ = 0

Gluing turns the 4 corners into V = 1, the 4 sides into E = 2 and the square into F = 1: V − E + F = 1 − 2 + 1 = 0

Same way round as at the start.

Sides crossed so far: 0

Opposite sides are glued with arrows pointing the same way. Walk off the right side and you come back on the left, the same way round. However it walks, the flatlander is never mirrored: the torus is orientable.

3

Hints, if you want them

    4

    What’s going on

    What’s going on

    On a wrap-around screen of width WW and height HH, a point has coordinates (x,y)(x, y) with 0≤x<W0 \le x < W and 0≤y<H0 \le y < H, and moving past an edge means counting on modulo WW or HH — clock arithmetic in two directions at once.

    Gluing the left and right edges of a rectangle gives a cylinder. Gluing the two ends of the cylinder gives a torus: the surface of a doughnut. So the video-game world is a torus. A walker on it can go "around the hole" in two different ways — across the screen or up the screen — and neither loop can be shrunk to a point. Counting how many times a loop goes around each way is the start of the fundamental group of the torus, Z×Z\mathbb Z \times \mathbb Z.

    Now change the rule: walking off the top brings you back at the bottom mirrored, left and right swapped. The walker comes home as their own mirror image — their left hand has become a right hand. That surface is the Klein bottle, and a surface where this can happen is called non-orientable. The Klein bottle cannot be built in ordinary three-dimensional space without passing through itself, but the rule for its edges describes it perfectly well.

    Mathematicians build many surfaces this way, by gluing the edges of a polygon, and the classification of surfaces says that every closed surface arises like this. Whether our own universe might be finite but wrap around in some such way is a question cosmologists have tested against observations; so far no evidence for it has been found.

    Analogy, not a formal construction: The game screen is a flat rectangle with a rule for its edges; a doughnut in space is curved. They have the same topology but not the same geometry, so 'the screen is a doughnut' is a statement about shape up to stretching, not a picture of the game.

    AI-drafted · awaiting human review
    5

    Where this leads