02 — Mathematics | 01 Aug 2026
Bipartiteness via Cohomology
Needlessly complicated proof of a simple result on graphs
It is well known that a graph (undirected, finite) is bipartite if and only if it contains no cycles of odd length. As it turns out, this fact can be shown purely by considering the (modulo 2) homology and cohomology of . For this, we first show the following duality result:
The bilinear form
is a perfect pairing. In particular, it induces an isomorphism
We show that there is a basis of so that the induce a basis for . Without loss of generality we may assume that is connected; we may do this since the (co)homology turns disjoint unions into direct sums. Let be a spanning tree of . We then consider for every the cohomology class in and the homology class defined by the unique cycle appering when adding the edge to . We first show that this is a basis for . We can see immediately that the are linearly independent, since only contains the indicator function of the edge . Moreover, the alternating sum formula for cohomology shows that , so the indeed generate . We now observe that for we have . The same argument as above shows that the form a basis for homology, so it follows that the are precisely their dual basis, as desired.
We now recall the definition of bipartiteness:
A graph is bipartite if there is an assignment so that no two vertices connected by an edge carry the same label.
The condition on means precisely that for every edge we have , i.e. . Hence a graph is bipartite if and only if the cohomology class vanishes. Let be any cycle. Then
which vanishes if and only if has even length. In other words, the class represents the length parity functional on cycles. By duality, the class vanishes if and only if the length parity functional vanishes, which means that we have shown the desired statement:
A graph is bipartite if and only if it contains no cycles of odd length.