Let $(M,g)$ be a spin manifold with boundary $\partial M= N_1 \cup N_2$, $N_i$ connected spin manifolds. Suppose that $H^*(M,\partial M)=0$ and the index of the Dirac operator of $M$, $ind_M(\mathcal{D} )=0$, then have we:
$$ind_{N_1}(\mathcal{D})=ind_{N_2}(\mathcal{D})$$
?