[step:Track the fundamental group through one spherical surgery]Let $N$ be a connected closed orientable three-manifold, and suppose a surgery cuts $N$ along a finite disjoint family of embedded two-spheres
$S_1,\dots,S_k \subset N$
and caps every resulting spherical boundary component with a three-ball. Let
$N_1,\dots,N_m$
denote the connected closed components obtained after this operation. For any path-[connected space](/page/Connected%20Space) $X$ with a chosen basepoint, let $\pi_1(X)$ denote its fundamental group; in the free-factor statements below, changing basepoints inside a connected component only conjugates the identified subgroup and does not change whether it is a free factor.
We claim that each group $\pi_1(N_j)$ is isomorphic to a free factor of $\pi_1(N)$.
It is enough to treat one embedded two-sphere $S \subset N$, because the finite case follows by induction over $S_1,\dots,S_k$. The group-theoretic point used in the induction is that a free factor of a free factor is a free factor: if $G \cong H * K$ and $H \cong L * Q$, then associativity of free products gives $G \cong L * Q * K$, so $L$ is a free factor of $G$. For each use of van Kampen below, replace the closed pieces by open collar neighbourhoods of those pieces inside the glued manifold. The collars have the same homotopy type as the corresponding pieces, their intersections deformation retract onto the common sphere or disk attachments, and the hypotheses of the [Seifert-van Kampen Theorem](/theorems/1905) are then satisfied. If $S$ is separating, write
$N \setminus S = A^\circ \sqcup B^\circ$,
where $A$ and $B$ are the compact manifolds with boundary $\partial A = S = \partial B$. Let $D_A$ and $D_B$ be three-balls, and define the closed manifolds $A^+$ and $B^+$ by
\begin{align*}
A^+ &:= A \cup_S D_A.
\end{align*}
Also set
\begin{align*}
B^+ &:= B \cup_S D_B.
\end{align*}
Since $S$ and each three-ball are path-connected and simply connected, the inclusion $A \hookrightarrow A^+$ induces an isomorphism $\pi_1(A) \cong \pi_1(A^+)$, and the inclusion $B \hookrightarrow B^+$ induces an isomorphism $\pi_1(B) \cong \pi_1(B^+)$. Applying the [Seifert-van Kampen Theorem](/theorems/1905) to the decomposition $N=A\cup_S B$, whose intersection $S$ is path-connected and has fundamental group equal to the identity group, gives
\begin{align*}
\pi_1(N) \cong \pi_1(A^+) * \pi_1(B^+).
\end{align*}
Thus $\pi_1(A^+)$ and $\pi_1(B^+)$ are free factors of $\pi_1(N)$.
If $S$ is nonseparating, cutting along $S$ gives one compact connected manifold $A$ with two spherical boundary components $S_-$ and $S_+$. Let $D_-$ and $D_+$ be three-balls glued to $S_-$ and $S_+$, and set
\begin{align*}
A^+ := A \cup_{S_-} D_- \cup_{S_+} D_+.
\end{align*}
The original manifold $N$ is recovered from $A$ by identifying the two boundary spheres $S_-$ and $S_+$ by the gluing diffeomorphism determined by the cut. Equivalently, after capping both boundary components, this reconstruction identifies $N$ with the connected sum
\begin{align*}
A^+ \# (S^2 \times S^1).
\end{align*}
Indeed, removing the interiors of the two capping balls from $A^+$ returns $A$, while the product region $S^2 \times [0,1]$ with its two end spheres identified supplies the missing neck and contributes the $S^2 \times S^1$ summand. Applying the [Seifert-van Kampen Theorem](/theorems/1905) to the connected-sum decomposition along a separating two-sphere, whose fundamental group is the identity group, gives
\begin{align*}
\pi_1(N) \cong \pi_1(A^+) * \pi_1(S^2 \times S^1) \cong \pi_1(A^+) * \mathbb Z.
\end{align*}
Therefore $\pi_1(A^+)$ is again a free factor of $\pi_1(N)$.[/step]