Kernel of graph’s incidence matrix = Number of graph’s connected component

graph theorymatrices

From Royle & Gosil's Algebraic Graph Theory, Theorem 8.3.1

Theorem: Let $X$ be a graph with $n$ vertices and $c$ connected components. If $X^{\sigma}$ is an orientation of $X$ and $D$ is the incidence matrix of $X^{\sigma}$, then $rank(D) = n – c$.
Proof: We shall show that the nullspace of $D$ has dimension $c$, and hence that $rank(D) = n -c$. Suppose that $z$ is a vector in $\mathbb{R}^n$ such that $z^T B = 0$. If $uv$ is an edge of $X$, then $z_u – z_v = 0$. Therefore, if we view $z$ as a function on $V(X)$, it is constant on any connected component of $X$. The space of such vectors has dimension $c$.

Here, $V(X)$ is the graph $X$'s vertex set, and $B = \vert D \vert$ element-wise, i.e., $B$ is the incidence matrix of the underlying undirected graph of $X$. So this theorem says that dim$(\ker(D)) \geq 1$ since a graph has at least 1 connected component. But in this post Kernel of the incidence matrix of a tree is $\emptyset$ it is shown that $\ker(D)$ is empty if it is a tree.

What did I mix up?

Best Answer

First off, the kernel of a matrix is never empty as it always contains the zero vector. If the kernel of the matrix $M$ consists only of the zero vector, then it is common to write (with a slight abuse of notation) $\ker(M) = 0$; you should not confuse this with $\ker(M) = \varnothing$.

Second, there are two typos in the proof. Taken from the errata page of the book:

In the first line of the proof we should have "null space of $D^T$". In the second sentence of the proof, on the next line, we should have "$z^TD=0$".

So to address your confusion: if the underlying graph of the graph is a tree, then indeed $\ker(D) = 0$, but $\ker(D^T) = 1$. Since $D$ is an $n \times (n-1)$ matrix, both observations are equivalent to $rank(D) = n-1$.