MerLean-example

8 Rem 7: Exactness of Boundary and Coboundary Maps

This chapter establishes the exactness of boundary and coboundary maps for graphs with cycles. When a generating set of cycles for a graph \(G\) is chosen, the maps \(\partial _2\) (from cycles to edges) and \(\partial \) (from edges to vertices) form an exact sequence: \(\operatorname {im}(\partial _2) = \ker (\partial )\). Dually, the coboundary maps \(\delta \) and \(\delta _2\) satisfy \(\ker (\delta _2) = \operatorname {im}(\delta )\). A key observation is that \(\ker (\delta ) = \{ 0, \mathbf{1}\} \) for connected graphs, since every edge has exactly two endpoints.

8.1 Definitions and Basic Properties

Definition 215 Valid Cycle Edge Set
#

A set of edges \(S \subseteq E\) is a valid cycle edge set in a graph \(G\) if every vertex \(v \in V\) has even degree in \(S\), i.e.,

\[ \forall v \in V,\quad |\{ e \in S \mid e \text{ is incident to } v\} | \equiv 0 \pmod{2}. \]
Definition 216 Graph With Valid Cycles

A graph with valid cycles extends a GraphWithCycles structure with the additional property that every cycle \(c \in C\) satisfies the valid cycle condition: \(\operatorname {cycles}(c)\) is a valid cycle edge set.

Definition 217 All-Ones Vector
#

The all-ones vector \(\mathbf{1} \in \mathbb {F}_2^V\) is defined by \(\mathbf{1}(v) = 1\) for all \(v \in V\).

Definition 218 Zero Vector
#

The zero vector \(\mathbf{0} \in \mathbb {F}_2^V\) is defined by \(\mathbf{0}(v) = 0\) for all \(v \in V\).

Definition 219 Vertex Degree Mod 2

The degree of vertex \(v\) modulo 2 in an edge-vector \(f \in \mathbb {F}_2^E\) is

\[ \operatorname {deg}_2(f, v) = \sum _{e \in \operatorname {incidentEdges}(v)} f(e) \in \mathbb {F}_2. \]
Definition 220 Adjacent Vertices
#

Two vertices \(v, w \in V\) are adjacent (written \(v \sim w\)) if there exists an edge \(e \in E\) whose endpoints are \(\{ v, w\} \).

Definition 221 Connected Graph

A graph \(G\) is connected if for any two vertices \(v, w \in V\), \(w\) is reachable from \(v\) by the reflexive-transitive closure of the adjacency relation.

8.2 All-Ones Vector and Nontrivial Kernel

Theorem 222 Two Endpoints Sum to Zero
#

In \(\mathbb {F}_2\), we have \(1 + 1 = 0\).

Proof

This is verified by computation in \(\mathbb {Z}/2\mathbb {Z}\).

Theorem 223 All-Ones in Kernel of Coboundary

The all-ones vector \(\mathbf{1}\) lies in \(\ker (\delta )\): \(\delta (\mathbf{1}) = 0\). This is because every edge has exactly two endpoints.

Proof

By extensionality, it suffices to show \(\delta (\mathbf{1})(e) = 0\) for an arbitrary edge \(e\). Using the formula \(\delta (\mathbf{1})(e) = \sum _{v \in \operatorname {edgeVertices}(e)} \mathbf{1}(v)\) and the definition of \(\mathbf{1}\), we expand the sum. Since the endpoints of \(e\) are distinct (by edge_endpoints_ne), we have \(\operatorname {edgeVertices}(e) = \{ v_1, v_2\} \) with \(v_1 \neq v_2\). Rewriting the membership set as a pair and applying the pair-sum formula, we obtain \(\delta (\mathbf{1})(e) = 1 + 1 = 0\) in \(\mathbb {F}_2\), verified by computation.

Theorem 224 Zero in Kernel of Coboundary

The zero vector \(\mathbf{0}\) lies in \(\ker (\delta )\): \(\delta (\mathbf{0}) = 0\).

Proof

We note that \(\mathbf{0} = 0\) by definition. Rewriting with this, the result follows directly from \(\delta \) being a linear map: \(\delta (0) = 0\) by map_zero.

Theorem 225 Nontrivial Kernel of Coboundary

The kernel of \(\delta \) is nontrivial: \(\delta (\mathbf{0}) = 0\) and \(\delta (\mathbf{1}) = 0\).

Proof

This is the conjunction of zero_in_ker_coboundary and allOnes_in_ker_coboundary.

Theorem 226 Kernel Contains Zero and All-Ones

For any graph \(G\), if \(f = 0\) or \(f = \mathbf{1}\), then \(\delta (f) = 0\). That is, \(\{ 0, \mathbf{1}\} \subseteq \ker (\delta )\).

Proof

Assume \(f = 0 \lor f = \mathbf{1}\). We decompose by cases:

  • If \(f = 0\): the result follows from zero_in_ker_coboundary.

  • If \(f = \mathbf{1}\): the result follows from allOnes_in_ker_coboundary.

Theorem 227 All-Ones Vector is Nonzero

If \(V\) is nonempty, then \(\mathbf{1} \neq 0\).

Proof

Suppose for contradiction that \(\mathbf{1} = 0\). Evaluating at an arbitrary vertex \(v_0 \in V\) (which exists since \(V\) is nonempty), we obtain \(1 = 0\) in \(\mathbb {F}_2\) by simplification using the definition of \(\mathbf{1}\), which is a contradiction.

Theorem 228 Kernel Has Nonzero Element

For a nonempty graph, \(\ker (\delta )\) contains a nonzero element: there exists \(f \neq 0\) with \(\delta (f) = 0\).

Proof

Take \(f = \mathbf{1}\). Then \(f \neq 0\) by allOnesV_ne_zero, and \(\delta (f) = 0\) by allOnes_in_ker_coboundary.

8.3 Coboundary Characterization

Theorem 229 Coboundary at an Edge

For any vertex-vector \(f\) and edge \(e\) with endpoints \(v_1, v_2\), the coboundary is

\[ \delta (f)(e) = f(v_1) + f(v_2). \]
Proof

We rewrite using the formula \(\delta (f)(e) = \sum _{v \in \operatorname {edgeVertices}(e)} f(v)\). Since the endpoints are distinct (\(v_1 \neq v_2\) by edge_endpoints_ne), and \(\operatorname {edgeVertices}(e) = \{ v_1, v_2\} \) by definition, we apply the pair-sum formula to obtain \(\delta (f)(e) = f(v_1) + f(v_2)\).

Theorem 230 \(\mathbb {F}_2\) Addition Characterization
#

In \(\mathbb {F}_2\), \(a + b = 0\) if and only if \(a = b\).

Proof

We prove both directions. \((\Rightarrow )\): Assume \(a + b = 0\). Adding \(b\) to both sides gives \(a + b + b = b\). Since \(b + b = 0\) in \(\mathbb {F}_2\) (verified by case analysis on \(b\)), we have \(a + 0 = b\) by associativity, hence \(a = b\). \((\Leftarrow )\): Assume \(a = b\). Rewriting, we need \(b + b = 0\), which holds by case analysis on \(b \in \{ 0, 1\} \) in \(\mathbb {F}_2\).

Theorem 231 Coboundary Zero Iff Same Value

The coboundary is zero at edge \(e = \{ v_1, v_2\} \) if and only if \(f(v_1) = f(v_2)\):

\[ \delta (f)(e) = 0 \iff f(v_1) = f(v_2). \]
Proof

Rewriting using the edge formula \(\delta (f)(e) = f(v_1) + f(v_2)\), the result follows from the characterization \(a + b = 0 \iff a = b\) in \(\mathbb {F}_2\).

Theorem 232 Coboundary of All-Ones at Edge

For every edge \(e\), \(\delta (\mathbf{1})(e) = 0\).

Proof

Rewriting using the edge formula, \(\delta (\mathbf{1})(e) = \mathbf{1}(v_1) + \mathbf{1}(v_2) = 1 + 1\). By the definition of \(\mathbf{1}\) and computation in \(\mathbb {F}_2\), this equals \(0\).

8.4 Chain Complex Property

If a set of edges \(S\) is a valid cycle edge set, then \(\partial (\mathbf{1}_S) = 0\), where \(\mathbf{1}_S(e) = 1\) if \(e \in S\) and \(0\) otherwise.

Proof

By extensionality, let \(v\) be an arbitrary vertex. We simplify using the boundary formula. We establish that the sum \(\sum _{e \in \operatorname {incidentEdges}(v)} \mathbf{1}_S(e)\) equals the cardinality \(|S \cap \operatorname {incidentEdges}(v)|\) cast to \(\mathbb {F}_2\): this follows by rewriting the sum via the filter-sum identity \(\sum _{e \in A} [e \in S] = |A \cap S|\) and using the constant sum formula with natural number cast. The filter sets \(\{ e \in \operatorname {incidentEdges}(v) \mid e \in S\} \) and \(\{ e \in S \mid e \text{ incident to } v\} \) are equal by extensionality and logical equivalence. Since \(S\) is a valid cycle, this cardinality is even. The even natural number casts to \(0\) in \(\mathbb {F}_2\).

Theorem 234 Chain Complex Property: \(\partial \circ \partial _2 = 0\)

If all cycles are valid, then \(\partial \circ \partial _2 = 0\) as a linear map \(\mathbb {F}_2^C \to \mathbb {F}_2^V\).

Proof

By linear map extensionality, let \(\mathbf{c} \in \mathbb {F}_2^C\) be arbitrary, and let \(w \in V\) be an arbitrary vertex. We show \((\partial \circ \partial _2)(\mathbf{c})(w) = 0\). Expanding, we rewrite using the boundary formula at vertex \(w\) and the boundary-2 map formula. After simplification, we exchange the order of summation (sum over edges first, then cycles, becomes sum over cycles first). For each cycle \(c\), we compute the inner sum \(\sum _{e \in \operatorname {incidentEdges}(w)} \mathbf{c}(c) \cdot \partial _2(\mathbf{e}_c)(e)\). Factoring out \(\mathbf{c}(c)\), this equals \(\mathbf{c}(c) \cdot |\{ e \in \operatorname {cycles}(c) \mid e \text{ incident to } w\} |\), where we use the filter-sum identity and the indicator function for cycle membership. Since each cycle is valid, the cardinality \(|\{ e \in \operatorname {cycles}(c) \mid e \text{ incident to } w\} |\) is even. An even natural number casts to \(0\) in \(\mathbb {F}_2\), so each term becomes \(\mathbf{c}(c) \cdot 0 = 0\). The sum of zeros is zero.

Theorem 235 Image of \(\partial _2\) in Kernel of \(\partial \)

If all cycles are valid, then \(\operatorname {im}(\partial _2) \subseteq \ker (\partial )\): for every \(\mathbf{c} \in \mathbb {F}_2^C\), \(\partial (\partial _2(\mathbf{c})) = 0\).

Proof

From the chain complex property \(\partial \circ \partial _2 = 0\), we evaluate at \(\mathbf{c}\): \((\partial \circ \partial _2)(\mathbf{c}) = 0\). Simplifying the composition gives \(\partial (\partial _2(\mathbf{c})) = 0\).

8.5 Cochain Complex Property

Theorem 236 Cycle Visits Vertex Evenly

For a valid cycle \(c\) and any vertex \(v\), the number of edges in \(\operatorname {cycles}(c)\) incident to \(v\) is even.

Proof

This is immediate from the definition of valid cycle edge set applied to vertex \(v\).

Theorem 237 Cochain Complex Property: \(\delta _2 \circ \delta = 0\)

If all cycles are valid, then \(\delta _2 \circ \delta = 0\) as a linear map \(\mathbb {F}_2^V \to \mathbb {F}_2^C\).

Proof

By linear map extensionality, let \(\mathbf{v} \in \mathbb {F}_2^V\) be an arbitrary vertex-vector, and let \(c\) be an arbitrary cycle index. We show \((\delta _2 \circ \delta )(\mathbf{v})(c) = 0\). Expanding using the coboundary-2 formula, we need \(\sum _{e \in \operatorname {cycles}(c)} \delta (\mathbf{v})(e) = 0\).

Using the edge formula, each \(\delta (\mathbf{v})(e) = \mathbf{v}(v_1^e) + \mathbf{v}(v_2^e)\) where \(v_1^e, v_2^e\) are the endpoints of \(e\). We distribute the sum:

\[ \sum _{e \in \operatorname {cycles}(c)} \delta (\mathbf{v})(e) = \sum _{e \in \operatorname {cycles}(c)} \mathbf{v}(v_1^e) + \sum _{e \in \operatorname {cycles}(c)} \mathbf{v}(v_2^e). \]

We rewrite each sum using fiberwise summation: grouping edges by their first (resp. second) endpoint \(v\), we obtain

\[ \sum _{v \in V} |\{ e \in \operatorname {cycles}(c) \mid v_1^e = v\} | \cdot \mathbf{v}(v) + \sum _{v \in V} |\{ e \in \operatorname {cycles}(c) \mid v_2^e = v\} | \cdot \mathbf{v}(v). \]

Combining these sums, we factor out \(\mathbf{v}(v)\) for each vertex \(v\). The key observation is that for each \(v\), the sets \(\{ e \mid v_1^e = v\} \) and \(\{ e \mid v_2^e = v\} \) are disjoint (since \(v_1^e \neq v_2^e\) by edge_endpoints_ne), and their union equals \(\{ e \in \operatorname {cycles}(c) \mid e \text{ incident to } v\} \). Thus the sum of cardinalities equals the total incident count.

Since cycles are valid, each vertex has even incident count in the cycle. The sum of the two cardinalities cast to \(\mathbb {F}_2\) is therefore \(0\), giving \((|A_v| + |B_v|) \cdot \mathbf{v}(v) = 0 \cdot \mathbf{v}(v) = 0\) for each \(v\). The total sum is zero.

Theorem 238 Image of \(\delta \) in Kernel of \(\delta _2\)

If all cycles are valid, then \(\operatorname {im}(\delta ) \subseteq \ker (\delta _2)\): for every \(\mathbf{v} \in \mathbb {F}_2^V\), \(\delta _2(\delta (\mathbf{v})) = 0\).

Proof

From the cochain complex property \(\delta _2 \circ \delta = 0\), we evaluate at \(\mathbf{v}\): \((\delta _2 \circ \delta )(\mathbf{v}) = 0\). Simplifying the composition gives \(\delta _2(\delta (\mathbf{v})) = 0\).

8.6 Zero Boundary Characterization

Theorem 239 Boundary Equals Vertex Degree Mod 2

For any edge-vector \(f\) and vertex \(v\), \(\partial (f)(v) = \operatorname {deg}_2(f, v)\).

Proof

Unfolding the definition of \(\operatorname {deg}_2\), this is exactly the formula for \(\partial (f)(v)\) given by boundaryMap_apply_vertex.

Theorem 240 Zero Boundary Iff All Degrees Zero

\(\partial (f) = 0\) if and only if \(\operatorname {deg}_2(f, v) = 0\) for all \(v \in V\).

Proof

We prove both directions. \((\Rightarrow )\): Assume \(\partial (f) = 0\) and let \(v\) be arbitrary. From \(\partial (f) = 0\), evaluating at \(v\) gives \(\partial (f)(v) = 0\). Rewriting using the equality \(\partial (f)(v) = \operatorname {deg}_2(f, v)\) yields the result. \((\Leftarrow )\): Assume \(\operatorname {deg}_2(f, v) = 0\) for all \(v\). By extensionality, for arbitrary \(v\), rewriting \(\partial (f)(v) = \operatorname {deg}_2(f, v) = 0\) gives \(\partial (f) = 0\).

Theorem 241 Zero Boundary Iff Even Degree

\(\partial (f) = 0\) if and only if every vertex has even degree in the edge-set: \(\forall v,\; \operatorname {deg}_2(f, v) = 0\).

Proof

This is identical to boundary_zero_iff_all_degrees_zero.

8.7 Connected Graph Kernel Classification

Theorem 242 Kernel Constant on Adjacent Vertices

If \(f \in \ker (\delta )\) and \(v \sim w\) are adjacent, then \(f(v) = f(w)\).

Proof

From the adjacency \(v \sim w\), we obtain an edge \(e\) connecting them. Since \(\delta (f) = 0\), evaluating at \(e\) gives \(\delta (f)(e) = 0\). By the characterization coboundaryMap_zero_at_edge_iff, this means \(f(v_1^e) = f(v_2^e)\) where \(v_1^e, v_2^e\) are the endpoints of \(e\).

We consider two cases for the adjacency witness: either \((v_1^e, v_2^e) = (v, w)\) or \((v_1^e, v_2^e) = (w, v)\). In the first case, \(f(v) = f(w)\) directly. In the second case, \(f(w) = f(v)\) and we take the symmetric equality.

Theorem 243 Kernel Constant on Connected Graph

For a connected graph \(G\), if \(f \in \ker (\delta )\), then \(f\) is constant: \(f(v) = f(w)\) for all \(v, w \in V\).

Proof

Let \(v, w \in V\). By connectedness, \(w\) is reachable from \(v\) by the reflexive-transitive closure of the adjacency relation. We proceed by induction on the reachability proof.

Base case (reflexivity): \(v = w\), so \(f(v) = f(w)\) by reflexivity.

Inductive step: Suppose \(v\) reaches some vertex \(u\) (with \(f(v) = f(u)\) by the inductive hypothesis) and \(u \sim w\). By ker_coboundary_constant_on_adjacent, \(f(u) = f(w)\). By transitivity, \(f(v) = f(w)\).

Theorem 244 \(\mathbb {F}_2\) Dichotomy
#

Every element of \(\mathbb {F}_2\) is either \(0\) or \(1\).

Proof

By case analysis on \(x \in \mathbb {F}_2\) (which has exactly two elements), followed by simplification.

Theorem 245 Kernel Classification for Connected Graphs

For a connected graph \(G\), if \(f \in \ker (\delta )\) then \(f = 0\) or \(f = \mathbf{1}\).

Proof

We consider whether \(V\) is nonempty.

Case 1: \(V\) is nonempty. Choose some \(v_0 \in V\). By ker_coboundary_constant_of_connected, \(f\) is constant: \(f(v) = f(v_0)\) for all \(v\). By the \(\mathbb {F}_2\) dichotomy, \(f(v_0) = 0\) or \(f(v_0) = 1\).

  • If \(f(v_0) = 0\): then \(f(v) = 0\) for all \(v\), so \(f = 0\) by extensionality and simplification.

  • If \(f(v_0) = 1\): then \(f(v) = 1\) for all \(v\), so \(f = \mathbf{1}\) by extensionality and simplification using the definition of \(\mathbf{1}\).

Case 2: \(V\) is empty. Then \(f = 0\) vacuously, since for any \(v\), the hypothesis that \(V\) is empty yields a contradiction.

Theorem 246 Kernel Equals \(\{ 0, \mathbf{1}\} \) for Connected Graphs

For a connected graph \(G\), if \(\delta (f) = 0\) then \(f = 0\) or \(f = \mathbf{1}\).

Proof

This follows directly from ker_coboundary_classification.

For a connected graph \(G\) and any \(f \in \mathbb {F}_2^V\),

\[ \delta (f) = 0 \iff f = 0 \lor f = \mathbf{1}. \]
Proof

We prove both directions. \((\Rightarrow )\): This is ker_coboundary_classification. \((\Leftarrow )\): We decompose the disjunction. If \(f = 0\), then \(\delta (0) = 0\) by zero_in_ker_coboundary. If \(f = \mathbf{1}\), then \(\delta (\mathbf{1}) = 0\) by allOnes_in_ker_coboundary.

8.8 Exactness Properties

Definition 248 Cycles Generate

The cycles of \(G\) generate all cycles if every edge-chain \(f\) with zero boundary can be written as a sum of cycle boundaries:

\[ \forall f \in \mathbb {F}_2^E,\quad \partial (f) = 0 \implies \exists g \in \mathbb {F}_2^C,\; \partial _2(g) = f. \]

Assuming all cycles are valid and the cycles generate, an edge-chain \(f\) is in \(\operatorname {im}(\partial _2)\) if and only if \(\partial (f) = 0\):

\[ (\exists g,\; \partial _2(g) = f) \iff \partial (f) = 0. \]
Proof

We prove both directions. \((\Rightarrow )\): Suppose \(\partial _2(g) = f\) for some \(g\). Rewriting, \(\partial (f) = \partial (\partial _2(g)) = 0\) by im_boundary2_subset_ker_boundary. \((\Leftarrow )\): This is exactly the cycle generation property applied to \(f\).

Definition 250 Cuts Generate

The cuts of \(G\) generate all cocycles if every edge-chain \(f\) in \(\ker (\delta _2)\) is in \(\operatorname {im}(\delta )\):

\[ \forall f \in \mathbb {F}_2^E,\quad \delta _2(f) = 0 \implies \exists g \in \mathbb {F}_2^V,\; \delta (g) = f. \]

Assuming all cycles are valid and the cuts generate, an edge-chain \(f\) is in \(\operatorname {im}(\delta )\) if and only if \(\delta _2(f) = 0\):

\[ (\exists g,\; \delta (g) = f) \iff \delta _2(f) = 0. \]
Proof

We prove both directions. \((\Rightarrow )\): Suppose \(\delta (g) = f\) for some \(g\). Rewriting, \(\delta _2(f) = \delta _2(\delta (g)) = 0\) by im_coboundary_subset_ker_coboundary2. \((\Leftarrow )\): This is exactly the cut generation property applied to \(f\).

Theorem 252 Key Assertion: \(\ker (\delta ) = \{ 0, \mathbf{1}\} \) for Connected Graphs

For a connected graph \(G\), \(\ker (\delta ) = \{ 0, \mathbf{1}\} \): \(\delta (f) = 0\) if and only if \(f = 0\) or \(f = \mathbf{1}\).

Proof

This follows directly from ker_coboundary_iff.