A chain complex is a sequence of abelian groups connected by homomorphisms (boundary operators) whose composition is zero: the boundary of a boundary is always zero. In simplicial homology, the chain groups are generated by simplices and the boundary operator records how each simplex is bounded by lower-dimensional simplices. The condition d_{n-1} compose d_n = 0 is the algebraic engine that makes homology possible, creating a natural quotient ker(d)/im(d) that detects "holes."
The passage from simplicial complexes to homology begins with the chain complex. Given a simplicial complex K, the n-th chain group C_n(K) is the free abelian group generated by the oriented n-simplices of K. An oriented simplex is an equivalence class of orderings of vertices: [v_0, v_1, v_2] and [v_1, v_2, v_0] represent the same orientation, while [v_1, v_0, v_2] represents the opposite orientation (and is identified with -[v_0, v_1, v_2] in the chain group). A general n-chain is a formal integer linear combination of oriented n-simplices, such as 3[a,b,c] - 2[d,e,f]. The chain groups are abelian groups, typically isomorphic to Z^k where k is the number of n-simplices.
The boundary operator d_n : C_n(K) -> C_{n-1}(K) maps each oriented n-simplex to the alternating sum of its (n-1)-dimensional faces: d_n([v_0, v_1, ..., v_n]) = sum_{i=0}^{n} (-1)^i [v_0, ..., hat{v_i}, ..., v_n], where hat{v_i} means the vertex v_i is omitted. For example, d_1([v_0, v_1]) = v_1 - v_0 (the "endpoint minus startpoint" of an edge), and d_2([v_0, v_1, v_2]) = [v_1, v_2] - [v_0, v_2] + [v_0, v_1] (the three edges forming the boundary of the triangle, with consistent orientations). The alternating signs ensure that the orientations of adjacent faces are compatible, matching the geometric intuition of a consistently oriented boundary.
The fundamental property of the boundary operator is that d_{n-1} compose d_n = 0: the boundary of a boundary is always zero. This can be verified by direct computation — applying the alternating sum formula twice produces a double sum in which every term appears twice with opposite signs and cancels — but the geometric content is more illuminating. The boundary of a filled triangle is a closed loop (no endpoints); the boundary of a solid tetrahedron is a closed surface (no boundary edges). At every dimension, the boundary of a region is itself closed, which translates algebraically to the vanishing of d compose d.
This vanishing condition means that the image of d_{n+1} (the group of boundaries) is always a subgroup of the kernel of d_n (the group of cycles). A cycle is a chain with zero boundary — a "closed" chain, like a loop of edges with no endpoints. A boundary is a chain that is the boundary of some higher-dimensional chain — like the edges around a filled triangle. Every boundary is automatically a cycle (d of d is zero), but not every cycle need be a boundary. The difference — cycles that are not boundaries — is what homology measures. The chain complex structure, with its sequence of groups and boundary maps satisfying d compose d = 0, provides the algebraic framework for making this precise.
The notion of a chain complex is far more general than simplicial homology. Any sequence of abelian groups ... -> A_{n+1} -> A_n -> A_{n-1} -> ... connected by homomorphisms d_n : A_n -> A_{n-1} satisfying d_{n-1} compose d_n = 0 is a chain complex, and one can define its homology groups H_n = ker(d_n)/im(d_{n+1}). This abstraction is the foundation of homological algebra: the same algebraic machinery applies to singular chains, cellular chains, de Rham complexes, and chain complexes arising in purely algebraic contexts. Understanding the simplicial case builds the intuition that transfers to all these settings.