crn

02 — Mathematics | 01 Aug 2026

Bipartiteness via Cohomology

Needlessly complicated proof of a simple result on graphs

It is well known that a graph GG (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 GG. For this, we first show the following duality result:

The bilinear form

⟨∙∣∙⟩:H1(G)⊕H1(G)→F2\langle\bullet\vert\bullet\rangle :H_1(G)\oplus H^1(G)\to\mathbb{F}_2

is a perfect pairing. In particular, it induces an isomorphism

H1(G)≅H1(G)∨.H^1(G)\cong H_1(G)^\vee.

We show that there is a basis ρ1,…,ρg\rho_1,\dots,\rho_g of H1(G)H^1(G) so that the ⟨∙∣ρj⟩\langle\bullet\vert\rho_j\rangle induce a basis for H1(G)∨H_1(G)^\vee. Without loss of generality we may assume that GG is connected; we may do this since the (co)homology turns disjoint unions into direct sums. Let TT be a spanning tree of GG. We then consider for every d∈E(G)∖E(T)d\in E(G)\setminus E(T) the cohomology class ρd=[d]\rho_d = [d] in H1(G)H^1(G) and the homology class γd\gamma_d defined by the unique cycle appering when adding the edge dd to TT. We first show that this is a basis for H1(G)H^1(G). We can see immediately that the ρd\rho_d are linearly independent, since only ρd\rho_d contains the indicator function of the edge dd. Moreover, the alternating sum formula for cohomology shows that h1(G)=∣E(G)∖E(T)∣h^1(G) = |E(G)\setminus E(T)|, so the ρd\rho_d indeed generate H1(G)H^1(G). We now observe that for b,d∈E(G)∖E(T)b,d\in E(G)\setminus E(T) we have ⟨γd∣ρb⟩=⟦b=d⟧\langle \gamma_d\vert \rho_b\rangle = \llbracket b = d\rrbracket. The same argument as above shows that the γd\gamma_d form a basis for homology, so it follows that the ⟨∙∣ρd⟩\langle \bullet\vert\rho_d\rangle are precisely their dual basis, as desired. □\square

We now recall the definition of bipartiteness:

A graph GG is bipartite if there is an assignment φ:V(G)→F2\varphi:V(G)\to \mathbb{F}_2 so that no two vertices connected by an edge carry the same label.

The condition on φ\varphi means precisely that for every edge b=xyb = xy we have φ(x)+φ(y)=1\varphi(x) +\varphi(y) = 1, i.e. dφ(b)=1\mathrm{d} \varphi(b) = 1. Hence a graph GG is bipartite if and only if the cohomology class [1][1] vanishes. Let γ∈H1(G)\gamma\in H_1(G) be any cycle. Then

⟨γ∣1⟩=∑b∈γ1\langle \gamma\vert 1\rangle = \sum_{b\in\gamma} 1

which vanishes if and only if γ\gamma has even length. In other words, the class [1][1] represents the length parity functional on cycles. By duality, the class [1][1] vanishes if and only if the length parity functional vanishes, which means that we have shown the desired statement:

A graph GG is bipartite if and only if it contains no cycles of odd length.

All things