Solution (source code)

= Solution

Work in the smooth or piecewise-linear category; embedded spheres and disks are locally flat. A closed connected orientable <three-manifold> is an <irreducible three-manifold> when every embedded $S^2$ bounds an embedded three-ball. It is a <prime three-manifold> when $M\cong P\mathbin\#Q$ forces $P\cong S^3$ or $Q\cong S^3$. A separating sphere gives such a <connected sum> after capping its two sides with balls. Irreducibility therefore implies primeness, but a prime manifold can still have a nonseparating sphere.

A <geometrizable three-manifold> is one whose prime summands, after sphere splitting and capping, can be cut along disjoint essential <tori> into pieces whose interiors admit complete geometric structures modeled on the eight <Thurston geometries>:
$$
S^3,\quad\mathbb R^3,\quad\mathbb H^3,\quad S^2\times\mathbb R,\quad
\mathbb H^2\times\mathbb R,\quad\widetilde{SL}_2(\mathbb R),\quad\mathrm{Nil},\quad\mathrm{Sol}.
$$
Here a geometric structure is a locally homogeneous quotient structure modeled on the stated simply connected space. The original manifold need not itself carry one geometry before decomposition.

A <Heegaard splitting> is $M=H_1\cup_\phi H_2$, where $H_1,H_2$ are <handlebodies> with their boundaries identified. Its genus is the common boundary genus. The <Heegaard genus> $g_H(M)$ is the least possible genus of such a splitting. Thus \b[“genus $g$” as a minimum requires both a genus-$g$ splitting and the nonexistence of one of smaller genus]; an arbitrary genus-$g$ splitting only proves $g_H(M)\le g$.