TITLE: Surgery and homology: a reference request
QUESTION [7 upvotes]: I need a reference (or a short proof) for the following statement:
Suppose a closed manifold $N$ is the result of a surgery (along an embedded sphere) on a closed manifold $M$. Then the difference $\sum dim H_i(N) - \sum dim H_i(M)$ (the homology is taken with coefficients in a field) is at most 2.

REPLY [12 votes]: To say that a smooth, closed manifold $N$ is obtained by surgery along a (framed) sphere in $M$ is to say that there is a cobordism $P$ from $M$ to $N$ and a Morse function $f\colon P\to [0,1]$, with $f^{-1}(0)=M$, $f^{-1}(1)=N$, and exactly one critical point $c$. By Morse theory, $H_*(P,M)$ is then 1-dimensional, generated by the descending disc of $c$. Likewise, $H_*(P,N)$ is 1-dimensional, generated by the ascending disc of $c$. 
By the homology exact sequence of the pair $(P,M)$, $\dim H_*(M)$ differs from $\dim H_*(P)$ by $1$. By the homology exact sequence of the pair $(P,N)$, $\dim H_*(N)$ also differs from $\dim H_*(P)$ by $1$. Hence $|\dim H_*(M) - \dim H_*(N)|$ is $0$ or $2$.