Van Kampen's theorem computes the fundamental group of a space by cutting the space into pieces. If a complicated space can be written as a union of simpler open pieces, its fundamental group can be assembled algebraically from the fundamental groups of the pieces.
Recall that the fundamental group \pi_1(X, x_0) consists of loops that start and end at the base point x_0, where two loops count as the same when one can be deformed continuously into the other. It records how loops wind around the holes of X, but computing it straight from the definition is hard.
The key is how the pieces overlap. A loop that travels around the whole space passes from one piece to the other, and the information about those passages is carried by the fundamental group of the intersection. The choice of the intersection decides how hard the computation will be.
The theorem goes back to Herbert Seifert [1] and Egbert van Kampen [2] in the early 1930s, which is why it is also called the Seifert-van Kampen theorem.
Let X = U_1 \cup U_2, where U_1 and U_2 are open sets of X. Assume that U_1, U_2 and U_1 \cap U_2 are all path-connected, and take the base point x_0 in U_1 \cap U_2.
Then the fundamental group of X is the amalgamated product of the fundamental groups of the two pieces over the fundamental group of their intersection [3].
\pi_1(X, x_0) \cong \pi_1(U_1, x_0) *_{\pi_1(U_1 \cap U_2, x_0)} \pi_1(U_2, x_0)
The idea is that every loop in X can be cut into arcs in U_1 and arcs in U_2, with the cutting points in the intersection. Joining each cutting point to x_0 by a path inside U_1 \cap U_2 turns every arc into a loop in one piece, and the amalgamated product records how these loops fit together at the cutting points.
If the intersection were not path-connected, the cutting points could not be joined to x_0 inside it, and the theorem would fail. This is why the conditions are needed.
Suppose groups G_1, G_2 and H are given, together with homomorphisms i_1 : H \to G_1 and i_2 : H \to G_2. In van Kampen's theorem these are induced by the inclusions of the intersection, and they need not be injective.
The amalgamated product G_1 *_H G_2 is characterized by a universal property: any pair of homomorphisms from G_1 and G_2 to a group G that agree on H factors through G_1 *_H G_2 in exactly one way.
For computations, presentations are more useful. If G_1 = \langle S_1 \mid R_1 \rangle and G_2 = \langle S_2 \mid R_2 \rangle, the amalgamated product has the following presentation.
G_1 *_H G_2 = \langle S_1, S_2 \mid R_1, R_2, i_1(h) = i_2(h) \quad (h \in H) \rangle
So we collect all generators and relations of both groups and add relations saying that an element of H is the same whether it is read in G_1 or in G_2. One relation for each generator of H is enough, and these relations are the constraints that come from the intersection.
The easiest case is when the intersection is simply connected, that is, \pi_1(U_1 \cap U_2) = 0. Then H is the trivial group, no relations are added, and the amalgamated product becomes the free product.
\pi_1(X) \cong \pi_1(U_1) * \pi_1(U_2)
The free product G_1 * G_2 consists of words that alternate between elements of G_1 and elements of G_2, and no relation is imposed except cancelling neighbouring letters. The figure shows \mathbb{Z} * \mathbb{Z}: the path of the word a b a^{-1} b^{-1} does not come back to where it started.
So everything depends on whether the fundamental group of the intersection is trivial. A trivial one gives a free product, which suits wedge sums of circles. A nontrivial one gives an amalgamated product with extra relations, which is what surfaces need.
Every example below follows the same three steps. First, split the space into two path-connected open sets. Second, find the fundamental groups of each set and of their intersection. Third, put them into the presentation of the amalgamated product and read off the relations.
Three building blocks appear again and again. The circle has \pi_1(S^1) \cong \mathbb{Z}, generated by the loop that goes around once, and an element is counted by its winding number.
A contractible space such as a disk shrinks to a point and has trivial fundamental group, so it contributes a trivial factor. A sphere S^n with n \geq 2 is also simply connected and contributes nothing to fundamental groups.
Let us check that S^n with n \geq 2 is simply connected. Take U_1 to be the sphere minus the north pole and U_2 the sphere minus the south pole. By stereographic projection both are homeomorphic to \mathbb{R}^n, so both are contractible.
The intersection is the sphere minus two points, which is homotopy equivalent to S^{n-1}. For n \geq 2 it is path-connected, so the theorem applies and gives \pi_1(S^n) \cong 0 *_{\pi_1(S^{n-1})} 0 = 0.
For n = 1 the intersection is a circle minus two points, that is, two disjoint arcs. It is not path-connected, and the theorem cannot be used in this form. This is exactly where the circle, with \pi_1(S^1) \cong \mathbb{Z}, escapes the argument.
Consider the wedge of two circles S^1 \vee S^1, the figure eight. Let U_1 be one circle together with a small open neighbourhood of the wedge point, and U_2 the other circle with such a neighbourhood. Each deformation retracts onto its circle, and the intersection is a small cross around the wedge point, which is contractible.
With \pi_1(U_1) = \langle a \rangle \cong \mathbb{Z}, \pi_1(U_2) = \langle b \rangle \cong \mathbb{Z} and \pi_1(U_1 \cap U_2) = 0, a free product appears.
\pi_1(S^1 \vee S^1) \cong \mathbb{Z} * \mathbb{Z} = \langle a, b \rangle = F_2
This is the free group on two generators, and the same argument gives the free group F_n for a wedge of n circles. Since no relations are added, ab \neq ba: going around a first and then b is a different loop from going around b first.
Next comes a general principle behind all the surface computations. Let Y be a path-connected space and attach a disk e^2 along a loop \gamma : S^1 \to Y to obtain X = Y \cup_\gamma e^2.
Take U_1 to be X minus the centre of the disk and U_2 the open disk. Then U_1 deformation retracts onto Y, U_2 is contractible, and the intersection is a punctured disk, homotopy equivalent to a circle. Its generator becomes \gamma in U_1 and becomes trivial in U_2.
\pi_1(X) \cong \pi_1(Y) / \langle\langle \gamma \rangle\rangle
Here \langle\langle \gamma \rangle\rangle is the smallest normal subgroup containing \gamma. In words, attaching one 2-cell kills the loop along its boundary. In the figure Y is a tube and \gamma goes once around its upper rim; gluing the disk e^2 to the rim makes \gamma trivial, and the fundamental group drops from \mathbb{Z} to 0. Many surfaces are a wedge of circles with one 2-cell attached, so this principle alone computes their fundamental groups.
The torus T^2 is obtained from a square by gluing opposite sides in the same direction. The four sides become two circles a and b, and the four corners become a single point, so T^2 is the figure eight S^1 \vee S^1 with one 2-cell attached.
The attaching loop runs once around the boundary of the square and reads the word a b a^{-1} b^{-1}, the commutator [a, b]. By the principle of the previous section we divide F_2 = \langle a, b \rangle by this word.
\pi_1(T^2) \cong \langle a, b \mid a b a^{-1} b^{-1} = 1 \rangle \cong \mathbb{Z}^2
The relation a b a^{-1} b^{-1} = 1 says ab = ba, so the generators commute and the group is \mathbb{Z}^2. A single commutator relation turns the noncommutative free group F_2 into the abelian group \mathbb{Z}^2.
The real projective plane \mathbb{RP}^2 is a disk whose boundary points are glued to their antipodal points. After the gluing, going once around the boundary circle runs through the loop a exactly twice.
So \mathbb{RP}^2 is the circle S^1 = \langle a \rangle with a 2-cell attached along a^2, and the relation a^2 = 1 is added.
\pi_1(\mathbb{RP}^2) \cong \langle a \mid a^2 = 1 \rangle \cong \mathbb{Z}/2\mathbb{Z}
The fundamental group is finite of order 2. The loop a cannot be shrunk after one turn, but after two turns it is the boundary of the disk and shrinks. This is also where the torsion \mathbb{Z}/2 in the homology of \mathbb{RP}^2 comes from.
The Klein bottle K is obtained from a square by gluing its sides according to the word a b a b^{-1}. As with the torus, one 2-cell is attached to the figure eight, but the attaching word is no longer a commutator.
\pi_1(K) \cong \langle a, b \mid a b a b^{-1} = 1 \rangle
This group is not abelian, and abelianizing it shows its shape. In additive notation the relation becomes a + b + a - b = 2a = 0, so H_1(K) \cong \mathbb{Z} \oplus \mathbb{Z}/2\mathbb{Z}.
Unlike the \mathbb{Z}^2 of the torus, a torsion part \mathbb{Z}/2 appears, and the algebra detects that the Klein bottle is not orientable. In the fundamental group itself ab \neq ba; the noncommutativity disappears only after abelianizing.
In the surface examples so far one factor was contractible, and the computation was really a quotient. In the next example both factors are nontrivial and the amalgamation does real work: the Klein bottle is also two Möbius bands glued along their boundary circles.
A Möbius band deformation retracts onto its central circle, so its fundamental group is \mathbb{Z}. Call the generators of the two bands u and v. The boundary of a Möbius band winds twice around the central circle, so the gluing circle becomes u^2 in the first band and v^2 in the second.
\pi_1(K) \cong \langle u, v \mid u^2 = v^2 \rangle
This is another presentation of the same group as \langle a, b \mid a b a b^{-1} \rangle: putting u = b and v = ab turns one into the other. Both factors and the intersection are \mathbb{Z}, and the maps between them are doubling maps, which is where the amalgamation shows.
The torus computation extends to higher genus. The orientable closed surface \Sigma_g of genus g is obtained from a 4g-gon by gluing its sides according to the word [a_1, b_1] \cdots [a_g, b_g], and the figure shows g = 2. This is a wedge of 2g circles with one 2-cell attached.
\pi_1(\Sigma_g) \cong \langle a_1, b_1, \ldots, a_g, b_g \mid [a_1, b_1] \cdots [a_g, b_g] = 1 \rangle
Here [a, b] = a b a^{-1} b^{-1} is the commutator. For g = 1 this is the \mathbb{Z}^2 of the torus. For g \geq 2 a single long relation cannot make the generators commute, and the group is not abelian.
Abelianizing kills every commutator, so H_1(\Sigma_g) \cong \mathbb{Z}^{2g} remains, and the first Betti number of the surface is 2g.
Amalgamated products are not limited to surfaces. A three-dimensional example is the complement of a torus knot. View S^3 as two solid tori V_1 and V_2 glued along their common boundary torus. The (p, q) torus knot K_{p,q} lies on that torus.
Cut the complement S^3 \setminus K_{p,q} into its part on the side of V_1 and its part on the side of V_2. Each solid torus minus the knot still deformation retracts onto its core circle, so each part has fundamental group \mathbb{Z}. The intersection is the boundary torus minus the knot, an annulus, again with group \mathbb{Z}.
The core of that annulus winds p times around the core of V_1 and q times around the core of V_2, so its generator becomes a^p on one side and b^q on the other [3].
\pi_1(S^3 \setminus K_{p,q}) \cong \langle a, b \mid a^p = b^q \rangle
The trefoil in the figure is the (2, 3) torus knot, so its group is \langle a, b \mid a^2 = b^3 \rangle. The maps from the intersection are again power maps, as in the example of the Möbius bands, now one dimension higher.
The figure sorts the results by the kind of group, from the trivial group on the left to the free group on the right. A simply connected intersection gives a free product and a nontrivial one gives an amalgamated product, and this distinction runs through all the examples.
From a single theorem we obtained groups of very different kinds: the trivial group, free groups, abelian groups and non-abelian groups. That range is the strength of van Kampen's theorem.
The theorem also holds for more than two open sets. Let X be the union of path-connected open sets U_\alpha, each containing the base point x_0.
If every intersection U_\alpha \cap U_\beta of two sets is path-connected, the homomorphism from the free product of the groups \pi_1(U_\alpha) to \pi_1(X) is surjective. If moreover every intersection of three sets is path-connected, its kernel is the normal subgroup generated by the elements that identify the two images of each element of \pi_1(U_\alpha \cap U_\beta) [3].
Which sets meet which is recorded by the nerve of the cover, a simplicial complex with a vertex for each open set, an edge for each nonempty intersection of two sets and a triangle for each nonempty intersection of three. In practice one cuts a complicated space into simple open sets, looks at how they overlap and assembles the fundamental group from that.