# Showing that cellular homology gives a chain complex

I've just been introduced to the Eilenberg-Steenrod axioms, and as an example, we are constructing cellular homology. Let $$X$$ be a CW complex and define $$C_n(X)$$ to be the free abelian group generated by $$n$$-cells of $$X$$. Define boundary homomorphisms $$C_{n}(X)\to C_{n-1}(X)$$ by, where $$e_\alpha^n$$ is an $$n$$-cell of $$X$$ and $$e^{n-1}_\beta$$ an $$(n-1)$$-cell $$d_n[e^n_\alpha]=\sum_\beta c_{\alpha\beta} [e^{n-1}_\beta]$$ Define the coefficients $$c_{\alpha\beta}$$ to be the degree of the map $$S^{n-1}\xrightarrow{\chi_\alpha} X_{n-1}\to X_{n-1}/(X_{n-1}\setminus e^{n-1}_\beta)\to S^{n-1}$$ Where $$\chi_\alpha$$ is the attaching map of $$e^n_\alpha$$, the second map collapses everything but $$e^{n-1}_\beta$$ to a point, and the last map is the characteristic map of $$e^{n-1}_\beta$$. My question is, how does this give a chain complex? I can't easily see that $$d^2=0$$.

Rather than defining $$C_n(X)$$ in the informal manner you describe, it is better to define it formally as the relative singular homology group $$C_n(X) = H_n(X_n,X_{n-1})$$ You can then prove that $$C_n(X)$$ is a free abelian group, with a basis element for each $$n$$ cell $$e^n_\alpha$$, where that basis element can be described explicitly as the image of the generator of $$H_n(D^n,S^{n-1}) \approx \mathbb Z$$ under the homomorphism induced by the characteristic map $$x^n_\alpha : (D^n,S^{n-1}) \to (X_n,X_{n-1})$$ of the cell $$e^n_\alpha$$. And then you can prove that the boundary homomorphism you describe is identical to a connecting homomorphism in the long exact sequence of the triple $$(X_n,X_{n-1},X_{n-2})$$, namely $$H_n(X_n,X_{n-1}) \mapsto H_{n-1}(X_{n-1},X_{n-2})$$ And, finally, you can do a diagram chase to prove that the composition of two successive boundary homomorphisms factors through the composition of two successive terms of an exact sequence, namely through $$H_n(X^n) \mapsto H_n(X^n,X^{n-1}) \mapsto H_{n-1}(X^{n-1})$$ I cannot quite reproduce the diagram here because you can't draw diagonal arrows in mathjax, but here's the best I can do: $$\require{AMScd}$$ $$\begin{CD} H_n(X^n) \\ @AAA \\ H_{n+1}(X^{n+1},X^{n}) @>>> H_n(X^n,X^{n-1}) @>>> H_{n-1}(X^{n-1},X^{n-2}) \\ @. @. @AAA \\ @. @. H_{n-1}(X^{n-1}) \end{CD}$$ The vertical arrows are homomorphisms of certain long exact sequences of pairs. If you draw in the two diagonal arrows of negative slope then you'll get two commutative triangles and a 3 term exact sequence of negative slope.