$\chi(X)=\chi(A)+\chi(X/A)-1$ Let $X$ be a finite CW complex, and $A$ a subcomplex. What I want to show is $\chi(X)=\chi(A)+\chi(X/A)-1$. Of course I can show this by just counting, that for $n>0$, (the number of $n$-cells of $X$) equals the sum of (the number of $n$-cells of $A$)$+$(the number of $n$-cells of $X/A$), and for $n=0$, (the number of $0$-cells of $A$)+(then number of $0$-cells of $X/A$)$=$(the number of $0$-cells of $X$)$+1$. But I want to prove this more rigorously.
I know that $\chi(X)=\sum_{n \geq 0} (-1)^n$rank $H_n(X) $. Can I use this to prove $\chi(X)=\chi(A)+\chi(X/A)-1$ by means of some long exact sequences, or etc?
 A: Note that since $X$ is finite, its cellular homology chain complex has finite length,
$$
\newcommand{\im}{\operatorname{im}}
\newcommand{\rk}{\operatorname{rk}}
0 \to C_n(X) \to \cdots \to C_0(X) \to 0.
$$
Now, it is a general fact for finite length chain complexes that
$$
\sum_{i}(-1)^i\rk C_i = \sum_{i}(-1)^i\rk H_i(C_\bullet).
$$
To see this, from the exact sequences
$$
0 \to \im d_{q+1} \to \ker d_q \to \ker d_q/\im d_{q+1} = H_q(C_\bullet) \to 0
$$
and
$$
0 \to \ker d_q \to C_q \to \im d_q \to 0
$$
we have
$$
\rk C_q = \rk \ker d_q + \rk \im d_q  = \rk H_q(C_\bullet) + \rk \im d_{q+1} + \rk \im d_q.
$$
It suffices now to use this equality and expand the alternating sum.
Going back to the question, since
$$
0 \to C_\bullet(A) \to C_\bullet(X) \to C_\bullet(X,A) \to 0
$$
is exact we have short exact sequences $0 \to C_q(A) \to C_q(X) \to C_q(X,A) \to 0$, which give
$$
\rk C_q(X) = \rk C_q(X) + \rk C_q(X,A).
$$
By passing to the alternating sum of ranks on the cellular complexes, we get
$$
\begin{align}
\chi(X) &= \sum_i(-1)^i\rk H_i(X) = \sum_i(-1)^i\rk C_i(X)\\
& = \sum_i(-1)^i\rk C_i(A) + \sum_i(-1)^i\rk C_i(X,A)\\
&= \sum_i(-1)^i\rk H_i(A) + \sum_i(-1)^i\rk H_i(X,A)\\
& = \chi(A) + \sum_i(-1)^i\rk H_i(X,A),
\end{align}
$$
and since $A$ is a subcomplex, by excision we know that
$$
H_i(X,A) \simeq \widetilde{H}_i(X/A).
$$
Finally, from the fact that $H_i(X/A) = \widetilde{H}_i(X/A)$ and $H_0(X/A) \oplus \mathbb{Z} = \widetilde{H}_0(X/A)$ we obtain
$$
\rk H_i(X,A) = \rk \widetilde{H}_i(X/A) = \rk H_i(X/A) - \delta_{i0}
$$
where $\delta$ is the Kroenecker delta, and plugging this into the alternating sum yields
$$
\chi(A) = \chi(X) + \chi(X/A) - 1
$$
as desired.
