TITLE: When does a space admit a flat metric?
QUESTION [35 upvotes]: Once upon a time I was told that the torus is flat. This was supposed to be surprising, since the ordinary picture of a torus we have in our heads looks inherently curved. However, thinking instead of a torus as a square in the plane with opposite points identified, it becomes 'clear' that the torus at least admits a flat metric, because the plane admits a flat metric.
However, a two-holed torus can also be obtained in this way: it is an octagon in the plane with appropriate pairs of edges identified. However, by the Gauss-Bonnet theorem, this surface does not admit a flat metric.
Thus, something about the way we make the identifications for the 1-torus is compatible with the flat metric structure on the plane, and this is not so for the 2-torus. I am hence lead to ask:
Given a smooth manifold $M$ obtained from $\mathbb{R}^n$ by appropriate identifications, is there some general criterion for determining whether the flat metric on $\mathbb{R}^n$ descends to $M$? Or is the $n$-dimensional torus  particularly special in its ability to inherit a metric from the plane? If so, what is special about it?

REPLY [13 votes]: You can use this idea to put a flat metric (in a sense) on any surface obtained by identifying the edges of a polygon in pairs. But the metric won't be smooth unless whenever you have a set of vertices being identified, the angles at those vertices add up to exactly $360^\circ$. It works for the square because you have four $90^\circ$ angles meeting at a point. To see what goes wrong, cut a regular octagon out of a piece of paper, then tear off eight pieces containing the eight vertices and try to tape them all together so that all the vertices meet at a point. You can do it, but you'll get a shape that can't be flattened out without a lot of creasing.
Here's an example of a hexagon that works:

The vertices labeled A are all identified with each other, as are the vertices labeled B. Since the angles all measure $120^\circ$, each set of three angles fits together to make a smooth flat surface. (The resulting surface is homeomorphic to the torus, as it must be because it has a flat metric. It's an interesting exercise to prove this directly by cutting and pasting.) 
The reason you can put a smooth hyperbolic metric on a surface of genus $n=2$ or more is that as long as $n\ge 2$, it's possible to find a regular $4n$-sided geodesic polygon in the hyperbolic plane whose angles are all exactly $360^\circ/4n$, so they all fit together to make a smooth surface with a hyperbolic metric.