Given a space \(X\) with a CW structure, let us define the Euler Characteristic of the space as, \[ \chi(X) = \sum_{i} (-1)^i n_i(X) \] where \(n_i(X)\) counts the number of \(i\)-cells of \(X\).
Theorem 1.1
\(\chi(X) = \sum_{i} (-1)^i \rank H_i(X)\)
Proof. Let us start by looking at the cellular chain complex, \[ \ldots \longrightarrow C_{n + 1} \overset{\delta_{n + 1}}{\longrightarrow} C_{n} \overset{\delta_{n}}{\longrightarrow} C_{n - 1} \longrightarrow \ldots \longrightarrow C_0 \longrightarrow 0 \] where \(C_n = H_n(X^n, X^{n - 1})\). Let \(A_n = \ker \delta_n\) and \(B_n = \im \delta_{n}\), then by the fundamental isomorphism theorem and the definition of a homology we have two exact short sequences (since we know that the cellular homology is isomorphic to the singular homology for CW-complexes), \[ \begin{cases} 0 \longrightarrow A_n \longrightarrow C_n \longrightarrow B_{n} \longrightarrow 0 \\ 0 \longrightarrow B_{n + 1} \longrightarrow A_n \longrightarrow H_n \longrightarrow 0 \end{cases} \] now taking the ranks of the two equations we obtain that (since the rank is additive), \[ \rank C_n = \rank A_n + \rank B_n = \rank B_{n + 1} + \rank B_n + \rank H_n \] Thus, \[ \sum_{i} (-1)^i \rank H_n = \sum_{i} (-1)^i \biggl( \rank \im \delta_{n + 1} + \rank \im \delta_n + \rank H_n \biggr) = \sum_{i} (-1)^i \rank C_n = \sum_{i} (-1)^i n_i(X) \] since \(\rank \im \delta_0 = \rank 0 = 0\) and the last equality is due to \(C_k \cong H_k(X^k, X^{k - 1})\) which is isomorphic to the \(k\)-homology of the wedge sum of \(n_k\) \(k\)-spheres and thus a rank of \(n_k\)!
Remark 1.2
Note that the \(\rank C_n\) argument in the end can be more directly written as, \[ \rank H_k(X^k, X^{k - 1}) = \rank H_k \left( \bigvee_{i = 1}^{n_k(X)} S^k \right) = \rank \bigoplus_{i = 1}^{n_k(X)} H_k(S^k) = \rank \mathbb{Z}^{n_k(X)} = n_k(X) \]
The remarkable aspect is that the homology groups do not depend on the CW structure imposed on \(X\), since singular homology is the same as simplicial for CW complexes.