# Fundamental groups of graphs and two-complexes

*Written by Claude Opus 5.5 (Anthropic), October 2026. Self-checked by the writing AI. Public domain (CC0).*

This lesson computes the fundamental groups of graphs and of the complexes obtained from them by attaching cells. For a graph, every loop is homotopic to the path of a closed walk, and two closed walks give homotopic loops exactly when they are homotopic as walks, that is, when they differ by inserting and deleting backtracks; so the fundamental group is the group of walks, and a spanning tree gives a free basis. The proof unwinds the graph into the tree of its reduced walks. Attaching \(2\)-cells divides the fundamental group by the normal subgroup generated by the attaching loops, and attaching cells of higher dimension does not change it. The group of a presentation is the fundamental group of its presentation complex, and every two-dimensional complex is homotopy equivalent to the presentation complex of its fundamental group read off a spanning tree.

- Fundamental groups and coverings (Section 1).
- Graphs (Section 2).
- Attaching cells (Section 3).
- Presentation complexes (Section 4).

Cell complexes, graphs, walks and their paths, and the realization of a graph given by darts are as in [Cell complexes and homotopy equivalences](cell-complexes-and-homotopy-equivalences.md); words, free groups, presentations, walks up to backtracking and trees are as in [Words, free groups and Cayley graphs](course:van-kampen-diagrams/words-free-groups-and-cayley-graphs).

## 1. Fundamental groups and coverings

We use the following results of the core course [Algebraic Topology](https://kokunoyumeto.github.io/program-matematika-indonesia/en/#course-D60), cited by lecture and statement number as in the edition linked from the course card. Paths are maps \(I\to X\); the *concatenation* \(\gamma*\eta\) of paths with \(\gamma(1)=\eta(0)\) runs through \(\gamma\) on \([0,\frac12]\) and through \(\eta\) on \([\frac12,1]\), and \(\bar\gamma(t)=\gamma(1-t)\) is the reverse path. Homotopies of paths fix the endpoints.

1. *The fundamental group* \(\pi_1(X,x)\) is the set of homotopy classes of loops at \(x\), with the product \([\gamma][\eta]=[\gamma*\eta]\) [Algebraic Topology, Lecture 7, Proposition 7.1 and Definition 7.1]. A map \(f\colon X\to Y\) induces a homomorphism \(f_*\colon\pi_1(X,x)\to\pi_1(Y,f(x))\) [Lecture 7, Corollary 7.1]. A path \(h\) from \(x\) to \(x'\) gives the isomorphism \(T_h\colon[\gamma]\mapsto[\bar h*\gamma*h]\) from \(\pi_1(X,x)\) to \(\pi_1(X,x')\); if \(H\) is a homotopy from \(f\) to \(g\) and \(h(t)=H(x,t)\), then \(T_h\circ f_*=g_*\) [Lecture 18, Lemma 18.2 with \(n=1\)].
2. A homotopy equivalence induces isomorphisms of fundamental groups [Lecture 18, Proposition 18.2].
3. \(\pi_1(\partial D^2,\omega(0))\) is infinite cyclic, generated by the class of the loop \(\omega(t)=(\cos2\pi t,\sin2\pi t)\) [Lecture 10, Theorem 10.1, whose proof sends the class of \(\omega\) to \(1\in\mathbb Z\)]; the spheres \(S^m\), \(m\ge2\), are simply connected [Lecture 12, Example 12.2].
4. *Seifert–van Kampen theorem* [Lecture 12, Corollary 12.1]. Let \(X\) be path-connected, \(U,V\) open sets covering \(X\) such that \(U\), \(V\) and \(U\cap V\) are path-connected, and \(x\in U\cap V\). Then the square of groups formed by \(\pi_1(U\cap V,x)\), \(\pi_1(U,x)\), \(\pi_1(V,x)\) and \(\pi_1(X,x)\), with the maps induced by the inclusions, is a pushout.
5. *Coverings* are as in [Lecture 4, Definition 4.4]. Paths lift uniquely from every point of the fibre over their start [Lecture 5, Theorem 5.1]. For a covering \(p\colon Z\to X\), \(z\in p^{-1}(x)\) and a loop \(\gamma\) at \(x\), the end of the lift of \(\gamma\) from \(z\) depends only on \([\gamma]\); written \(z\cdot[\gamma]\), it defines a right action of \(\pi_1(X,x)\) on \(p^{-1}(x)\) [Lecture 7, Lemma 7.1 and Section 3]. If \(Z\) is simply connected, then \(g\mapsto z\cdot g\) is a bijection from \(\pi_1(X,x)\) onto \(p^{-1}(x)\) [Lecture 10, Corollary 10.1].

A space is *simply connected* if it is path-connected and its fundamental group is trivial. We also use that the restriction of a quotient map \(Y\to Z\) to the preimage of an open set \(O\subseteq Z\) is a quotient map onto \(O\): a set \(S\subseteq O\) whose preimage is open in the preimage of \(O\) has an open preimage in \(Y\), so it is open in \(Z\).

## 2. Graphs

Let \(Y\) be a graph with chosen characteristic maps \(\Phi_e\colon I\to Y\) of its edges, so that every edge has the darts \(e^+\) and \(e^-\). Write \(\pi_1^{\mathrm w}(Y,v)\) for the group of classes of closed walks at a vertex \(v\) under homotopy of walks [Words, free groups and Cayley graphs, Lemma 3.1](course:van-kampen-diagrams/words-free-groups-and-cayley-graphs), and \(\rho(c)\) for the reduced walk homotopic to a walk \(c\).

**Lemma 2.1.** For walks \(c,c'\) such that \(c'\) starts at the end of \(c\), the paths \(|cc'|\) and \(|c|*|c'|\) are homotopic, and the path of the reverse walk is the reverse path. Homotopic walks have homotopic paths. So \([c]\mapsto[|c|]\) defines a homomorphism
\[
\iota\colon\pi_1^{\mathrm w}(Y,v)\longrightarrow\pi_1(Y,v).
\]

*Proof.* There is an increasing piecewise linear map \(\sigma\colon I\to I\) with \(|cc'|=(|c|*|c'|)\circ\sigma\): it maps the time interval of each dart in \(|cc'|\) linearly onto its time interval in \(|c|*|c'|\). It fixes \(0\) and \(1\) unless \(c\) or \(c'\) is empty, and \(|c|*|c'|\) is constant between \(0\) and \(\sigma(0)\) and between \(\sigma(1)\) and \(1\). So the homotopy \((|c|*|c'|)((1-s)\sigma(t)+st)\) joins the two paths and fixes the endpoints. The reverse of a walk traverses the same darts backwards, which reverses the path. For a backtrack \((e^+,e^-)\) the path is \(t\mapsto\Phi_e(1-|2t-1|)\), and \((s,t)\mapsto\Phi_e((1-s)(1-|2t-1|))\) contracts it relative to its endpoints; likewise for \((e^-,e^+)\). Inserting or deleting a backtrack inside a walk therefore changes its path, up to the homotopies just described, by a null-homotopic factor. \(\square\)

**Construction 2.2** (the tree of reduced walks). Let \(Y\) be a connected graph and \(v\) a vertex. Let \(\widetilde Y\) be the graph whose vertices are the reduced walks starting at \(v\), and whose darts are the pairs \((c,d)\) of such a walk \(c\) and a dart \(d\) of \(Y\) whose tail is the end of \(c\); the dart \((c,d)\) runs from \(c\) to \(\rho(cd)\), and
\[
\theta(c,d)=(\rho(cd),\theta d).
\]
Here \(\rho(cd)\) is \(cd\) if \(c\) does not end with \(\theta d\), and \(c\) without its last dart otherwise. Since \(\rho(\rho(cd)\,\theta d)=\rho(c\,d\,\theta d)=c\), the map \(\theta\) is an involution, and it has no fixed points because \(c\) and \(\rho(cd)\) have different lengths. The map \(p\) sends the vertex \(c\) to the end of \(c\) and the dart \((c,d)\) to \(d\); it is compatible with tails and with \(\theta\). In the realization of \(\widetilde Y\), let the edge of the darts \((c,e^+)\) and \(\theta(c,e^+)\) have the characteristic map whose \(+\) dart is \((c,e^+)\); then \(p\) is the map of realizations that is \(\Phi_e\) on this edge.

**Theorem 2.3.** Let \(Y\) be a connected graph and \(v\) a vertex.

1. \(\widetilde Y\) is a tree, and \(p\colon\widetilde Y\to Y\) is a covering map.
2. The homomorphism \(\iota\colon\pi_1^{\mathrm w}(Y,v)\to\pi_1(Y,v)\) is an isomorphism.

*Proof.* *Lifting walks.* For every vertex \(c\) of \(\widetilde Y\), the darts of \(\widetilde Y\) leaving \(c\) are the \((c,d)\), one for each dart \(d\) of \(Y\) leaving the end of \(c\). Hence every walk \(w=(d_1,\ldots,d_k)\) of \(Y\) that starts at the end of \(c\) has exactly one lift to a walk of \(\widetilde Y\) starting at \(c\), namely \(((c_0,d_1),\ldots,(c_{k-1},d_k))\) with \(c_0=c\) and \(c_j=\rho(c_{j-1}d_j)\); it ends at \(\rho(cw)\). The path of this lift is a lift of the path \(|w|\), by the choice of characteristic maps.

*A tree.* The vertex \(c\) of \(\widetilde Y\) is the end of the lift of \(c\) from the empty walk \(\varnothing\), so \(\widetilde Y\) is connected. A cycle of \(\widetilde Y\) would give a reduced closed walk of positive length in \(\widetilde Y\), starting at some \(c\). Its image \(w\) in \(Y\) is reduced: a backtrack \(d,\theta d\) in \(w\) lifts to \((c',d),\theta(c',d)\), a backtrack. And \(\rho(cw)=c=\rho(c)\), so \(cw\simeq c\) and \(w\simeq\bar c\,c\,w\simeq\bar c\,c\simeq\varnothing\); a reduced walk homotopic to the empty walk is empty, by the uniqueness in [Words, free groups and Cayley graphs, Lemma 3.1](course:van-kampen-diagrams/words-free-groups-and-cayley-graphs). This contradicts the positive length, so \(\widetilde Y\) has no cycles.

*A covering.* For an edge \(e\) of \(Y\) let \(\mathring e=\Phi_e((0,1))\), and for a vertex \(u\) let \(\mathrm{St}(u)\) be the union of \(\{u\}\), the sets \(\Phi_e([0,\frac12))\) over the edges with \(\Phi_e(0)=u\), and the sets \(\Phi_e((\frac12,1])\) over the edges with \(\Phi_e(1)=u\). These sets are open, by their preimages under the characteristic maps, and they cover \(Y\); the same definitions apply in \(\widetilde Y\). The preimage of \(\mathring e\) is the disjoint union of the open edges of \(\widetilde Y\) over \(e\), each mapped homeomorphically onto \(\mathring e\). The preimage of \(\mathrm{St}(u)\) is the disjoint union of the sets \(\mathrm{St}(c)\) over the vertices \(c\) of \(\widetilde Y\) ending at \(u\), and \(p\) maps each of them bijectively onto \(\mathrm{St}(u)\), because the darts leaving \(c\) correspond to the darts leaving \(u\). This bijection is a homeomorphism: in both sets a subset is open exactly when it meets each of the half-open segments in an open set, and \(p\) is a homeomorphism from each segment onto its image. So \(p^{-1}(\mathrm{St}(u))\) is homeomorphic over \(\mathrm{St}(u)\) to \(\mathrm{St}(u)\times p^{-1}(u)\), and likewise for \(\mathring e\); \(p\) is a covering map.

*The isomorphism.* The tree \(\widetilde Y\) is contractible by [Cell complexes and homotopy equivalences, Proposition 4.2](cell-complexes-and-homotopy-equivalences.md), hence simply connected, and \(p^{-1}(v)\) is the set of reduced closed walks at \(v\). By Section 1, item 5, the map \(\pi_1(Y,v)\to p^{-1}(v)\), \(g\mapsto\varnothing\cdot g\), is a bijection. For a closed walk \(c\) at \(v\), the lift of \(|c|\) from \(\varnothing\) is the path of the lift of the walk \(c\), so \(\varnothing\cdot\iota[c]=\rho(c)\). The map \([c]\mapsto\rho(c)\) from \(\pi_1^{\mathrm w}(Y,v)\) to the reduced closed walks at \(v\) is a bijection by [Words, free groups and Cayley graphs, Lemma 3.1](course:van-kampen-diagrams/words-free-groups-and-cayley-graphs). Hence \(\iota\) is bijective, and it is a homomorphism by Lemma 2.1. \(\square\)

**Corollary 2.4** (free bases). Let \(Y\) be a connected graph, \(T\) a spanning tree, \(v\) a vertex, and \(E'\) the set of edges outside \(T\). For a vertex \(u\) let \(\tau_u\) be the reduced walk in \(T\) from \(v\) to \(u\), and for \(e\in E'\) put
\[
c_e=\tau_{\Phi_e(0)}\;e^+\;\bar\tau_{\Phi_e(1)} .
\]
The homomorphism from the free group \(F(E')\) to \(\pi_1(Y,v)\) that sends \(e\) to \([|c_e|]\) is an isomorphism. In particular, the fundamental group of a graph with one vertex is free on the classes of the paths \(\Phi_e\) of its loops.

*Proof.* By Theorem 2.3 it suffices to work with \(\pi_1^{\mathrm w}(Y,v)\). For a walk \(c\) let \(\lambda(c)\) be the word obtained by deleting the darts of \(T\) and writing \(e\) for \(e^+\) and \(e^{-1}\) for \(e^-\) when \(e\in E'\). A backtrack goes to the empty word or to a cancelling pair, so homotopic walks have freely equal words, and \(\lambda\) induces a homomorphism \(\lambda\colon\pi_1^{\mathrm w}(Y,v)\to F(E')\). Let \(\mu\colon F(E')\to\pi_1^{\mathrm w}(Y,v)\) be the homomorphism with \(\mu(e)=[c_e]\), which exists by [Words, free groups and Cayley graphs, Lemma 1.2](course:van-kampen-diagrams/words-free-groups-and-cayley-graphs). Since \(\lambda(c_e)=e\), \(\lambda\mu\) is the identity. Let \(c=(d_1,\ldots,d_k)\) be a closed walk at \(v\) through the vertices \(v=u_0,u_1,\ldots,u_k=v\). Inserting the walks \(\bar\tau_{u_j}\tau_{u_j}\), which cancel, gives
\[
c\simeq\prod_{j=1}^k\tau_{u_{j-1}}\,d_j\,\bar\tau_{u_j}.
\]
A factor with \(d_j\) in \(T\) is a closed walk in the tree \(T\), homotopic to the empty walk by [Words, free groups and Cayley graphs, Lemma 3.3](course:van-kampen-diagrams/words-free-groups-and-cayley-graphs); a factor with \(d_j=e^\pm\), \(e\in E'\), is \(c_e\) or its reverse. So \([c]=\mu(\lambda(c))\), and \(\mu\lambda\) is the identity. \(\square\)

**Corollary 2.5** (paths in graphs). Let \(Y\) be a graph.

1. Every path in \(Y\) between vertices \(u\) and \(w\) is homotopic to the path of a walk from \(u\) to \(w\), and two walks from \(u\) to \(w\) have homotopic paths exactly when they are homotopic walks.
2. Every map \(f\colon\partial D^2\to Y\) is homotopic to a map \(f'\) such that \(f'\circ\omega\) is the path of a closed walk, possibly empty.

*Proof.* 1. The path lies in a path-connected subgraph, a connected graph by [Cell complexes and homotopy equivalences, Lemma 4.1](cell-complexes-and-homotopy-equivalences.md). Choose a walk \(\beta\) from \(w\) to \(u\). By Theorem 2.3 the loop \(\gamma*|\beta|\) is homotopic to \(|c|\) for a closed walk \(c\) at \(u\), so \(\gamma\simeq\gamma*|\beta|*|\bar\beta|\simeq|c|*|\bar\beta|\simeq|c\bar\beta|\) by Lemma 2.1. If \(|c|\simeq|c'|\) for walks from \(u\) to \(w\), then \(|c\bar c'|\) is null-homotopic, so \(c\bar c'\simeq\varnothing\) by Theorem 2.3, and \(c\simeq c\,\bar c'c'\simeq c'\).

2. If \(f\) meets a vertex, say \(f(\omega(t_0))\) is a vertex, the rotations \(f_s(\omega(t))=f(\omega(t+st_0))\) form a homotopy from \(f\) to a map \(f_1\) with \(f_1(\omega(0))\) a vertex. The loop \(f_1\circ\omega\) is homotopic, fixing its endpoints, to \(|c|\) for a closed walk \(c\), by part 1; since \(\omega\) identifies \(I/\{0,1\}\) with \(\partial D^2\) and the product of this quotient map with \(I\) is a quotient map, the homotopy defines a homotopy of maps \(\partial D^2\to Y\). If \(f\) meets no vertex, its connected image lies in a single open edge \(\mathring e\), and \(f_s=\Phi_e\circ((1-s)\Phi_e^{-1}\circ f)\) is a homotopy to the constant map at the vertex \(\Phi_e(0)\), the path of the empty walk there. \(\square\)

## 3. Attaching cells

For a space \(W\) and maps \(f_\alpha\colon\partial D^n\to W\), \(\alpha\in J\), let \(Y=W\cup_f\bigsqcup_\alpha D^n_\alpha\) be the space obtained by attaching the disks along the \(f_\alpha\), with the maps \(\Phi_\alpha\colon D^n_\alpha\to Y\) and the open cells \(e_\alpha=\Phi_\alpha(\operatorname{int}D^n_\alpha)\), as in Section 3 of [Cell complexes and homotopy equivalences](cell-complexes-and-homotopy-equivalences.md).

**Lemma 3.1.** Let \(W\) be a Hausdorff space and \(Y=W\cup_f\bigsqcup_\alpha D^n_\alpha\). Then \(Y\) is Hausdorff, and every compact subset of \(Y\) meets only finitely many of the open cells \(e_\alpha\). For every set \(F\subseteq J\), the union \(Y_F\) of \(W\) and the cells \(e_\alpha\), \(\alpha\in F\), is closed in \(Y\), and its topology as a subspace is the topology of \(W\cup_f\bigsqcup_{\alpha\in F}D^n_\alpha\).

*Proof.* \(Y\) is Hausdorff by the argument of the step "The skeleta" in the proof of Lemma 1.2 of [Cell complexes and homotopy equivalences](cell-complexes-and-homotopy-equivalences.md), with \(W\) in place of \(X^{n-1}\). In particular points of \(Y\) are closed. Let \(K\subseteq Y\) be compact, and suppose it meets infinitely many open cells; choose one point of \(K\) in each of infinitely many of them. Every subset \(S\) of the chosen points is closed: its preimage meets each disk in at most one point and \(W\) in none. So the chosen points form an infinite closed discrete subset of \(K\), which contradicts compactness. For \(F\subseteq J\), the preimage of \(Y_F\) consists of \(W\), the disks with index in \(F\) and the boundaries of the others, so \(Y_F\) is closed. If \(C\subseteq Y_F\) is closed in the topology of the attachment of the cells in \(F\), its preimages in \(W\) and in the disks with index in \(F\) are closed, and its preimage in a disk with index outside \(F\) is \(f_\alpha^{-1}(C\cap W)\), closed as well; so \(C\) is closed in \(Y\). \(\square\)

**Lemma 3.2** (a pushout with a trivial corner). Let \(\kappa\colon A\to G\) be a homomorphism of groups, and \(N\) the normal subgroup of \(G\) generated by \(\kappa(A)\). In a pushout square of groups with the maps \(\kappa\) and \(A\to1\), the corner opposite to \(A\) is identified with \(G/N\), compatibly with the map from \(G\).

*Proof.* The quotient map \(G\to G/N\) and the map \(1\to G/N\) form a commutative square with \(\kappa\) and \(A\to1\). If \(h\colon G\to Q\) and \(1\to Q\) form another such square, then \(h\kappa\) is trivial, so \(h\) vanishes on \(N\) and factors uniquely through \(G/N\). So \(G/N\) with these maps is a pushout, and pushouts agree up to a unique isomorphism compatible with the maps. \(\square\)

**Theorem 3.3** (attaching cells). Let \(W\) be a path-connected Hausdorff space, \(w_0\in W\), \(n\ge2\), and \(Y=W\cup_f\bigsqcup_{\alpha\in J}D^n_\alpha\), with the inclusion \(i\colon W\to Y\).

1. If \(n=2\), then \(i_*\colon\pi_1(W,w_0)\to\pi_1(Y,w_0)\) is surjective, and its kernel is the normal subgroup generated by the classes \([\gamma_\alpha*(f_\alpha\circ\omega)*\bar\gamma_\alpha]\), \(\alpha\in J\), for any paths \(\gamma_\alpha\) in \(W\) from \(w_0\) to \(f_\alpha(\omega(0))\).
2. If \(n\ge3\), then \(i_*\) is an isomorphism.

Changing \(\gamma_\alpha\) conjugates the class of \(\alpha\), so the normal subgroup in part 1 does not depend on the paths.

*Proof.* *One cell.* Let \(J=\{\alpha\}\), \(u_0=\omega(0)\), \(w_1=f_\alpha(u_0)\), and let \(U\) be \(Y\) without the centre \(\Phi_\alpha(0)\), \(V=e_\alpha\), and \(x=\Phi_\alpha(\frac12u_0)\). The sets \(U\), \(V\) and
\[
U\cap V=\Phi_\alpha(\{ru:0<r<1\})
\]
are open, by their preimages, and path-connected; \(V\) is homeomorphic to an open ball, hence simply connected, and \(Y\) is path-connected. The radial homotopy \(R_t(\Phi_\alpha(ru))=\Phi_\alpha(((1-t)r+t)u)\) for \(r>0\), constant on \(W\), deforms \(U\) into \(W\); it is continuous because the restriction of the quotient map to the preimage of \(U\) is a quotient map (Section 1), whose product with \(I\) is a quotient map. So the inclusion \(W\to U\) is a homotopy equivalence, with homotopy inverse \(R_1\), and induces isomorphisms of fundamental groups (Section 1, item 2). Likewise \(U\cap V\) deforms into the sphere \(\Phi_\alpha(\{\frac12u\})\), so \(\pi_1(U\cap V,x)\) is trivial if \(n\ge3\) and generated by the class of \(\sigma(t)=\Phi_\alpha(\frac12\omega(t))\) if \(n=2\) (Section 1, item 3). By the Seifert–van Kampen theorem and Lemma 3.2, the map \(\pi_1(U,x)\to\pi_1(Y,x)\) induced by the inclusion is surjective, with kernel the normal subgroup generated by the image of \(\pi_1(U\cap V,x)\). Let \(\kappa(t)=\Phi_\alpha(\frac{1+t}2u_0)\), a path in \(U\) from \(x\) to \(w_1\). The maps \(g_s\colon\partial D^2\to U\), \(g_s(u)=\Phi_\alpha(\frac{1+s}2u)\), form a homotopy from \(\sigma\circ\omega^{-1}\) to \(f_\alpha\) whose base point runs along \(\kappa\); by Section 1, item 1, \(T_\kappa[\sigma]=[f_\alpha\circ\omega]\) in \(\pi_1(U,w_1)\). Transport along \(\kappa\) commutes with the maps induced by inclusions. So, after moving the base point to \(w_1\), the map \(\pi_1(W,w_1)\to\pi_1(Y,w_1)\) is surjective with kernel the normal subgroup generated by \([f_\alpha\circ\omega]\) if \(n=2\), and bijective if \(n\ge3\). Transport along \(\gamma_\alpha\) gives the statement at \(w_0\).

*Finitely many cells.* Attach the cells one at a time: \(Y_k\) arises from \(Y_{k-1}\) by attaching one cell along a map into \(W\subseteq Y_{k-1}\), and \(Y_{k-1}\) is Hausdorff and path-connected by Lemma 3.1, with the topology of a subspace of \(Y\). For \(n=2\), the map \(\pi_1(W,w_0)\to\pi_1(Y_k,w_0)\) is a composite of surjections, and its kernel is generated, as a normal subgroup, by the classes of the first \(k\) cells, because the normal subgroup of \(G/N\) generated by the image of an element \(g\) is the image of the normal subgroup of \(G\) generated by \(N\) and \(g\). For \(n\ge3\) it is a composite of isomorphisms.

*Arbitrary families.* Each loop \(\gamma_\alpha*(f_\alpha\circ\omega)*\bar\gamma_\alpha\) is null-homotopic in \(Y\), since \(f_\alpha\circ\omega=\Phi_\alpha\circ\omega\) is contracted, fixing its endpoints, by \((s,t)\mapsto\Phi_\alpha((1-s)\omega(t)+su_0)\). A loop at \(w_0\) in \(Y\) has a compact image, which meets only finitely many cells by Lemma 3.1; so it lies in \(Y_F\) for a finite set \(F\), where it is homotopic to a loop in \(W\) by the finite case. A loop in \(W\) that is null-homotopic in \(Y\) is null-homotopic in some \(Y_F\) with \(F\) finite, since the image of the homotopy is compact; by the finite case its class lies in the normal subgroup generated by the classes of the cells in \(F\). This proves part 1, and part 2 in the same way. \(\square\)

**Corollary 3.4.** Let \(X\) be a cell complex and \(v\) a vertex. If \(X\) is connected, so is its \(1\)-skeleton. The inclusion \(X^2\to X\) induces an isomorphism \(\pi_1(X^2,v)\to\pi_1(X,v)\). The inclusion \(X^1\to X^2\) induces a surjection whose kernel is the normal subgroup generated by the classes of the attaching loops \(\varphi_\alpha\circ\omega\) of the \(2\)-cells, joined to \(v\) by paths in \(X^1\).

*Proof.* The path components of the graph \(X^1\) are subcomplexes, by the proof of [Cell complexes and homotopy equivalences, Lemma 4.1](cell-complexes-and-homotopy-equivalences.md). For \(m\ge2\) the image of an attaching map \(\partial D^m\to X^{m-1}\) is path-connected; by induction over \(m\), it lies in \(X_C\cap X^{m-1}\) for exactly one path component \(C\) of \(X^1\), where \(X_C\) is the union of \(C\) and of all cells whose attaching maps lead, in this way, to \(C\). The sets \(X_C\) are disjoint subcomplexes covering \(X\). A union of subcomplexes is a subcomplex, since a closed cell meets only finitely many cells; so each \(X_C\) is open and closed, and \(X\) is connected only if \(X^1\) is. For connected \(X\), every \(X^m\) is path-connected and Hausdorff, and \(X^m\) arises from \(X^{m-1}\) by attaching \(m\)-cells; Theorem 3.3 gives the statements for \(X^1\to X^2\) and the isomorphisms \(\pi_1(X^{m-1},v)\to\pi_1(X^m,v)\) for \(m\ge3\). A loop or a homotopy in \(X\) has a compact image, which lies in a finite subcomplex and hence in some skeleton \(X^m\) [Grassmannians and classifying maps, Lemma 7.1](course:DG-CHAR/DG-CHAR-03); so \(\pi_1(X^2,v)\to\pi_1(X,v)\) is bijective. \(\square\)

## 4. Presentation complexes

**Definition 4.1.** Let \(A\) be a set and \(R\) a set of words in the letters \(a^{\pm1}\), \(a\in A\). The *presentation complex* \(K(A,R)\) has one vertex \(o\), one edge \(\ell_a\) for each \(a\in A\), a loop at \(o\) with the darts \(\ell_a^+\) and \(\ell_a^-\), and one \(2\)-cell for each \(r\in R\), attached along the closed walk that reads \(r\): the walk \((\ell_{a_1}^{\epsilon_1},\ldots,\ell_{a_k}^{\epsilon_k})\) for \(r=a_1^{\epsilon_1}\cdots a_k^{\epsilon_k}\), and the empty walk at \(o\) for the empty word.

**Corollary 4.2.** The homomorphism \(F(A)\to\pi_1(K(A,R),o)\) that sends \(a\) to the class of the loop \(\Phi_{\ell_a}\) is surjective, and its kernel is the normal subgroup generated by \(R\). So \(\pi_1(K(A,R),o)\cong\langle A\mid R\rangle\).

*Proof.* By Corollary 2.4, with the spanning tree \(\{o\}\), the homomorphism is an isomorphism onto \(\pi_1(K^1,o)\). The attaching loop of the cell of \(r\) is the path of the walk reading \(r\), whose class is the image of \(r\) by Lemma 2.1. By Theorem 3.3, with constant paths \(\gamma_\alpha\), the map \(\pi_1(K^1,o)\to\pi_1(K,o)\) is surjective with kernel the normal subgroup generated by these classes. \(\square\)

**Corollary 4.3.** Let \(Y\) be a connected cell complex whose \(2\)-cells \(\alpha\) are attached along closed walks \(c_\alpha\), let \(T\) be a spanning tree of \(Y^1\), \(v\) a vertex, \(E'\) the set of edges outside \(T\), and \(\lambda(c)\) the word of a walk \(c\) with the darts of \(T\) deleted, as in the proof of Corollary 2.4. Then \(e\mapsto[|c_e|]\) induces an isomorphism
\[
\bigl\langle E'\ \big|\ \lambda(c_\alpha),\ \alpha\ \text{a }2\text{-cell}\bigr\rangle\longrightarrow\pi_1(Y,v).
\]

*Proof.* By Corollary 2.4, \(\mu\colon e\mapsto[c_e]\) is an isomorphism from \(F(E')\) onto \(\pi_1^{\mathrm w}(Y^1,v)\) with inverse \(\lambda\). If \(c_\alpha\) starts at \(u\), the attaching loop joined to \(v\) is the path of \(\tau_u\,c_\alpha\,\bar\tau_u\), whose image under \(\lambda\) is \(\lambda(c_\alpha)\). By Corollary 3.4, \(\pi_1(Y,v)\) is the quotient of \(\pi_1(Y^1,v)\) by the normal subgroup generated by these classes, and by Theorem 2.3 and Corollary 2.4 this is the quotient of \(F(E')\) by the normal subgroup generated by the words \(\lambda(c_\alpha)\). \(\square\)

**Corollary 4.4** (two-complexes up to homotopy). Let \(Y\) be a connected cell complex of dimension at most two.

1. \(Y\) is homotopy equivalent, by maps that are the identity on \(Y^1\) and homotopies constant on \(Y^1\), to a cell complex \(Y'\) with the same \(1\)-skeleton whose \(2\)-cells are attached along closed walks.
2. For such \(Y'\) and a spanning tree \(T\) of \(Y^1\), with the notation of Corollary 4.3, \(Y'\) is homotopy equivalent to the presentation complex \(K(E',\{\lambda(c_\alpha)\})\).
3. If \(Y\) is finite, it is homotopy equivalent to the realization of a finite simplicial complex of dimension at most two.

*Proof.* 1. By Corollary 2.5, every attaching map \(\varphi_\alpha\) is homotopic to a map \(\varphi'_\alpha\) with \(\varphi'_\alpha\circ\omega\) the path of a closed walk. Apply [Cell complexes and homotopy equivalences, Proposition 3.1](cell-complexes-and-homotopy-equivalences.md) with \(W=Y^1\).

2. By Corollary 4.4 of that lesson, \(Y'\to Y'/T\) is a homotopy equivalence, and \(Y'/T\) has one vertex, the loops \(e\in E'\), and \(2\)-cells attached along the maps \(q\circ\varphi'_\alpha\). The loop \(q\circ|c_\alpha|\) stays at the vertex while \(|c_\alpha|\) runs through a dart of \(T\), and traverses the loop \(e\) where \(|c_\alpha|\) runs through \(e^\pm\); so \(q\circ|c_\alpha|=|w_\alpha|\circ\sigma\), where \(w_\alpha\) is the walk reading \(\lambda(c_\alpha)\) and \(\sigma\colon I\to I\) is an increasing surjection, possibly constant on intervals, fixing \(0\) and \(1\) (for the empty word, \(|w_\alpha|\) is constant). The homotopy \(|w_\alpha|((1-s)\sigma(t)+st)\) and Proposition 3.1 of that lesson give \(Y'/T\simeq K(E',\{\lambda(c_\alpha)\})\).

3. By part 1, \(Y\simeq Y'\), and \(Y'\) is homeomorphic to the realization of a finite simplicial complex of dimension at most two by [Cell complexes and homotopy equivalences, Proposition 5.1](cell-complexes-and-homotopy-equivalences.md). \(\square\)

## 5. Exercises

**5.1.** Let \(Y\) be the graph with vertices \(u,w\) and edges \(e,f,g\) from \(u\) to \(w\). Write down the free basis of \(\pi_1(Y,u)\) given by Corollary 2.4 for the spanning tree consisting of \(e\), and express the class of the loop \(|(f^+,g^-)|\) in it.

**5.2.** Show that a finite connected graph with \(V\) vertices and \(E\) edges has a free fundamental group of rank \(E-V+1\).

**5.3.** Show that \(\pi_1(K(\{a\},\{a^n\}),o)\) is cyclic of order \(n\) for \(n\ge1\), and infinite cyclic for the empty set of relators.

**5.4.** Let \(r\) be a word and \(r'\) a cyclic permutation of \(r\) or of \(r^{-1}\). Show that \(K(A,\{r\})\) and \(K(A,\{r'\})\) have isomorphic fundamental groups, and that they are homeomorphic.

**5.5.** Let \(Y\) be the graph with one vertex and loops \(a,b\), and let \(Z\) be obtained from \(Y\) by attaching a \(2\)-cell along \((a^+,b^+,a^-,b^-)\) and a \(3\)-cell along any map \(\partial D^3\to Z^2\). Show that \(\pi_1(Z)\cong\mathbb Z^2\).

## 6. Solutions

**5.1.** \(T\) consists of \(u,w,e\); \(\tau_u=\varnothing\) and \(\tau_w=(e^+)\). The basis is \(c_f=(f^+,e^-)\) and \(c_g=(g^+,e^-)\). The walk \((f^+,g^-)\) is homotopic to \((f^+,e^-,e^+,g^-)=c_f\,\bar c_g\), so its class is \([c_f][c_g]^{-1}\); the word \(\lambda\) of the walk is \(fg^{-1}\).

**5.2.** A spanning tree has \(V\) vertices, hence \(V-1\) edges by Exercise 6.3 of [Cell complexes and homotopy equivalences](cell-complexes-and-homotopy-equivalences.md); the remaining \(E-V+1\) edges form the free basis of Corollary 2.4. The rank of a free group is determined by the group, because the free group of rank \(m\) has \(2^m\) homomorphisms to \(\mathbb Z/2\).

**5.3.** By Corollary 4.2 the group is \(\langle a\mid a^n\rangle=F(\{a\})/\langle a^n\rangle\). The free group on one letter is infinite cyclic, generated by \(a\), by the normal form, and the normal subgroup generated by \(a^n\) is \(\langle a^n\rangle\), of index \(n\). Without relators the group is \(F(\{a\})\cong\mathbb Z\).

**5.4.** In \(F(A)\), a cyclic permutation of \(r\) is conjugate to \(r\), and \(r^{-1}\) is the inverse of \(r\), so \(r\) and \(r'\) generate the same normal subgroup, and Corollary 4.2 gives the isomorphism. Both walks traverse each dart in the same time, so the attaching map of a cyclic permutation of \(r\) is the attaching map of \(r\) composed with a rotation of \(\partial D^2\), and the attaching map of \(r^{-1}\) is that of \(r\) composed with the reflection \((x,y)\mapsto(x,-y)\), since \(|\bar c|(t)=|c|(1-t)\). Rotations and this reflection extend to homeomorphisms of \(D^2\), so the two complexes are even homeomorphic.

**5.5.** By Corollary 3.4, \(\pi_1(Z)\cong\pi_1(Z^2)\), and \(Z^2=K(\{a,b\},\{aba^{-1}b^{-1}\})\), whose group \(\langle a,b\mid aba^{-1}b^{-1}\rangle\) is isomorphic to \(\mathbb Z^2\) by [Words, free groups and Cayley graphs, Exercise 5.2](course:van-kampen-diagrams/words-free-groups-and-cayley-graphs).

## References

- [Hatcher] A. Hatcher, *Algebraic Topology*, Cambridge University Press, 2002, Section 1.2 (Proposition 1.26 on attaching cells), Section 1.A (graphs and free groups, Proposition 1A.2) and Section 1.3, on the author's page. https://pi.math.cornell.edu/~hatcher/AT/ATpage.html
