If you imagine a hole on a plane—say, a circular one with radius —as being an infinitely tall column rising above the plane, you can determine how many holes exist on that surface in the following natural way:
Suppose that you take a string, tie it into a loop, and lay it on the surface. If you can pull the loop in a free manner to any location on the surface without breaking it, then it must not loop around any of these columns. Suppose that every conceivable loop on this surface has the same property. Then that surface must logically not have any of these columns—i.e., it must not have any holes.
You can construct these loops rigorously in the following way: specify a base point on the space that will serve as both the start and end point of the loop. Then, define a continuous path function such that . In other words, as you slide from 0 to 1, you traverse the length of the loop.
To define the ‘pulling’ aspect of the analogy, you define an equivalence relation: loop is equivalent to loop if one can be continuously deformed into the other without breaks. This idea is satisfied if there exists a continuous function such that , , and . In other words, as traverses the unit interval, you take loop and ‘pull’ it into loop ‘s position without breaking it (and there are several other intermediate loops along the way, all of which, by virtue of being in the ‘pull’ path, are equivalent to the loop you’re ‘pulling’ from). As traverses the unit interval, you traverse the length of the loop (which may be an intermediate loop, or it may be loops or , depending on the value of ).
This equivalence relation defines a set of equivalence classes (or homotopy classes, as they’re called) on the loops. In other words, it partitions the set of all loops in the space disjointedly according to the holes they’re tied around. This allows you to take a quotient over the space and simplify it considerably.
The example space used above (the one with no holes) has the ‘trivial’ homotopy class, where every loop is equivalent to every other loop. The surface of a sphere, , is just such a space.
Adding a single hole adds some complication. Imagine you’re sitting in a plane with a single hole. You have two general types of loops. You have the trivial one which doesn’t wrap around the hole, and you have loops which do. The loops which do wrap around the hole can be subdivided into how many times they wrap around (this property is called the winding number of the loop). The trivial loop is given a winding number of zero.
Now, I wasn’t exactly honest with my ‘rigor’, in the sense that I built my loops so that they had at least one common point. This is done so that you can create a group structure on the set of loop homotopy classes by specifying a binary relation: the ‘addition’ of two loops means that you follow the first loop around and then you follow the second, making a new, longer loop. Without fixing such a point, ‘adding loops’ makes no sense. If two loops are totally disjoint, following one loop and then following the other loop doesn’t produce another loop! In that case, the set of homotopy classes isn’t closed under that specific binary relation, which means you can’t form a group using that relation.
In any case, this homotopy group is what’s called the fundamental group. With this picture, a plane with a hole in it is isomorphic to the group , since the winding number uniquely specifies which equivalence class you’re talking about, and you can ‘add’ as many loops together (and thus add their winding numbers) as you wish (as long as it’s countable). The circle, , must also be isomorphic to this group. Generalizing this concept of things to higher dimensions produces further homotopy groups. As you might imagine, ‘holes’ get much more complicated in three dimensions or higher.