Proof (Seifert-van Kampen)

We write $[α]_A\in π_1(A, x_0)$ for a loop $α$ in $A$ and $[β]_B\in π_1(B, x_0)$ for a loop $β$ in $B$. > Use $\cdot$ to denote usual path concatenation, and use $*$ to denote the group operation in the amalgamated free product $π_1(A, x_0) *_{π_1(A\cap B, x_0)} π_1(B, x_0)$. We can perform two kinds of operations on a (possibly unreduced) word without changing the corresponding element in the amalgamated free product:

  1. $[α]_A * [α']_A = [α\cdot α']_A$ and $[β]_B * [β']_B = [β\cdot β']_B$;

  2. $[γ]_A = [γ]_B$ for a loop $γ$ in $A\cap B$.

    > $Φ$ converts $[α]_A$ and $[β]_B$ into elements in $π_1(X, x_0)$.

Surjectivity

Let $γ: [0,1]\to X$ be a loop at $x_0$. $\set{γ\inv(A), γ\inv(B)}$ is an open cover of $[0,1]$, so we can let $1/n$ be a Lesbegue number for this cover. This means each path $γ|_{[i/n, (i+1)/n]}$ is either entirely in $A$ or entirely in $B$. Concatenating consecutive paths that are all entirely in $A$ and consecutive paths that are all entirely in $B$, we can write $$ \begin{align*} γ \simeq γ_1 \cdot γ_2 \cdot \ldots \cdot γ_k \end{align*} $$ where each $γ_i$ lies entirely in $A$ or $B$, and all $γ_i(0)$ and $γ_i(1)$ lie in $A\cap B$.

For each $i=1,2,\ldots,k-1$, choose a path $u_i: γ_i(1) \rightsquigarrow x_0$ in $A\cap B$. Then $$ \begin{align*} γ \simeq (γ_1 \cdot u_1) \cdot (u_1\inv\cdot γ_2 \cdot u_2) \cdot \ldots \cdot (u_{k-1}\inv\cdot γ_k) \end{align*} $$ as paths in $X$, where each bracketed path is a loop based at $x_0$ lying entirely in $A$ or $B$. Hence $$ \begin{align*} [γ] = Φ([γ_1\cdot u_1] * [u_1\inv\cdot γ_2\cdot u_2] * \ldots * [u_{k-1}\inv\cdot γ_k]) \end{align*} $$ is the image of a product of elements coming from $π_1(A, x_0)$ and $π_1(B, x_0)$.

Injectivity

WLOG assume $A,B$ are path-connected: if there is a path-component of $A$ or $B$ that does not intersect with $A\cap B$, then removing it does not affect $π_1(A,x_0)$, $π_1(B,x_0)$ or $π_1(A\cap B, x_0)$. $π_1(X,x_0) = \im Φ$ is also unchanged by the surjectivity of $Φ$.

Suppose $Φ([γ_1]_{S_1} * \ldots * [γ_n]_{S_n}) = [c_{x_0}]$ where $S_i \in \set{A, B}$ and $γ_i$ is a loop in $S_i$ based at $x_0$, and we want to show that $[γ_1]_{S_1} * \ldots * [γ_n]_{S_n}$ is the identity in the amalgamated free product.

The hypothesis says we have $c_{x_0} \simeq γ_1 \cdot \ldots \cdot γ_n$ as paths in $X$, so let $H: [0,1]\times [0,1]\to X$ be a homotopy of loops between them. By reparametrising we can assume $H|_{[\frac{i-1}{n}, \frac{i}{n}] \times \set{0}}$ equals running $γ_i$ $n$ times as fast. Now $\set{H\inv(A), H\inv(B)}$ is an open cover of $[0,1]\times [0,1]$, so there exists some $N\in \N$ such that $n\mid N$ and the image of each grid square $[\frac{i-1}{N}, \frac{i}{N}] \times [\frac{j-1}{N}, \frac{j}{N}]$ under $H$ lies entirely in $A$ or entirely in $B$. Call this choice $S_{i,j}\in \set{A,B}$.

For each grid point $(\frac{i}{N}, \frac{j}{N})$, choose a path $u_{i,j}: H(\frac{i}{N}, \frac{j}{N}) \rightsquigarrow x_0$. By path-connectedness of $A$, $B$ and $A\cap B$, if $H(\frac{i}{N}, \frac{j}{N}) \in A\cap B$, then we can choose $u_{i,j}$ to lie entirely in $A\cap B$, and similarly with just $A$ or just $B$. Moreover if $H(\frac{i}{N}, \frac{j}{N}) = x_0$ already, then we can take $u_{i,j} = c_{x_0}$.

Let $\tilde h_{i,j}: (\frac{i-1}{N}, \frac{j}{N})\rightsquigarrow (\frac{i}{N}, \frac{j}{N})$ and $\tilde v_{i,j}: (\frac{i}{N}, \frac{j-1}{N}) \rightsquigarrow (\frac{i}{N}, \frac{j}{N})$ be the straight line paths on $[0,1]\times [0,1]$. We see the homotopic relations $$ \begin{align*} &&\tilde h_{i,j} &\simeq \tilde v_{i-1,j}\inv \cdot \tilde h_{i,j-1} \cdot \tilde v_{i,j} &&\text{as paths in $[0,1]\times [0,1]$}\\ \implies && h_{i,j} &\simeq v_{i-1,j}\inv \cdot h_{i,j-1} \cdot v_{i,j} &&\text{as paths in $S_{i,j}$} \end{align*} $$ where $h_{i,j} = H\circ \tilde h_{i,j}$ and $v_{i,j} = H\circ \tilde v_{i,j}$. Thus conjugating with $u$'s gives an equality $$ \begin{align*} [u_{i-1,j}\inv\cdot h_{i,j} \cdot u_{i,j}]_{S_{i,j}} ={}& [u_{i-1,j-1}\inv\cdot v_{i-1,j} \cdot u_{i-1,j}]_{S_{i,j}}\inv \\ &* [u_{i-1,j-1}\inv \cdot h_{i,j-1} \cdot u_{i,j-1}]_{S_{i,j}} \\ &* [u_{i,j-1}\inv \cdot v_{i,j}\cdot u_{i,j}]_{S_{i,j}}. \end{align*} $$ in $π_1(S_{i,j}, x_0)$ and thus (via operation 1) in the amalgamated free product.

Therefore all elements on a row $j$ form a telescoping product $$ \begin{align*} \prod_{i=1}^{N} [u_{i-1,j}\inv \cdot h_{i,j} \cdot u_{i,j}]_{S_{i,j}} ={}& [u_{0,j-1}\inv\cdot v_{0,j} \cdot u_{0,j}]_{S_{0,j}}\inv \\ &* \prod_{i=1}^{N} [u_{i-1,j-1}\inv \cdot h_{i,j-1} \cdot u_{i,j-1}]_{S_{i,j}} \\ &* [u_{N,j-1}\inv\cdot v_{N,j}\cdot u_{0,j}]_{S_{N,j}} \end{align*} $$ because $[u_{i,j-1}\inv \cdot v_{i,j} \cdot u_{i,j}]_{S_{i,j}}$ and $[u_{i,j-1}\inv\cdot v_{i,j}\cdot u_{i,j}]_{S_{i+1,j}}$ are identified (via operation 2) in the amalgamated free product.

However note $H|_{\set{0}\times [0,1]}$ and $H|_{\set{1}\times [0,1]}$ are constant $x_0$, so the first and last factors are identities. Hence inducting on $j$ yields $$ \begin{align*} \prod_{i=1}^{N} [u_{i-1,0}\inv\cdot h_{i,0}\cdot u_{i,0}]_{S_{i,0}} = \prod_{i=1}^{N} [u_{i-1,N}\inv \cdot h_{i,N}\cdot u_{i,N}]_{S_{i,N}}. \end{align*} $$

On the left hand side, group every $N/n$ factors together to form $[γ_1]_{S_1} * \ldots * [γ_n]_{S_n}$. Also since the bottom edge of $H$ is $c_{x_0}$, the right hand side is identity. This gives the desired result.