= Solution
Write $M$ for either <connected> closed oriented <manifold> and $D$ for its embedded closed ball. A precise relative form of <Poincare duality> for a compact locally contractible subset is
$$
H_j(M,M\setminus D;\mathbb Z)\cong H^{n-j}(D;\mathbb Z).
$$
This is <Poincaré-Alexander duality>. It applies to the printed closed-ball complement without replacing $D$ by its interior. Since $D$ is contractible, the relative group is $\mathbb Z$ at $j=n$ and zero otherwise. Naturality identifies $H_n(M)\to H_n(M,M\setminus D)$ with restriction $H^0(M)\to H^0(D)$, which is an <isomorphism> because both spaces are <connected>. Equivalently, the <fundamental class> restricts to the relative <orientation> generator on the ball.
In the <long exact sequence of a pair>, the only potentially exceptional part is therefore
$$
0\to H_n(M\setminus D)\to H_n(M)\xrightarrow{\cong}\mathbb Z
\to H_{n-1}(M\setminus D)\to H_{n-1}(M)\to0.
$$
Exactness gives $H_n(M\setminus D)=0$ and the desired <isomorphism> in degree $n-1$. In every lower degree both adjacent relative terms are zero, so the same exact sequence gives the remaining isomorphisms. Thus
$$
\boxed{H_k(M_i\setminus D_i)\cong H_k(M_i),\qquad0\leq k<n}.
$$
For the pieces $M_i\setminus\operatorname{int}D_i$ used in the gluing, the same conclusion follows from <excision> and the pair $(D^n,S^{n-1})$, or from the radial deformation of a punctured ball to its boundary. These pieces also have zero top homology, and the image of their boundary <sphere>'s <fundamental class> is zero: it is the boundary of their relative oriented fundamental chain.
Back to article page