Variations on a theme of Kasteleyn, with application to the totally nonnegative Grassmannian

We provide a short proof of a classical result of Kasteleyn, and prove several variants thereof. One of these results has become key in the parametrization of positroid varieties, and thus deserves the short direct proof which we provide.

Theorem 1. Let G be a planar bipartite graph with N black vertices b 1 , b 2 , . . . , b N and N white vertices w 1 , w 2 , . . . , w N . There is a N × N matrix K with K ij = ±1 if there is an edge from i to j, and K ij = 0 otherwise, such that det K is the number of perfect matchings of G.
We will define a graph with boundary to be a finite graph G with a specified subset ∂G of the vertices of G, equipped with a circular ordering. We call the vertices of ∂G the boundary vertices and the other vertices of G the internal vertices. We define a perfect matching of a graph with boundary to be a collection M of edges of G which contains each internal vertex precisely once, and each boundary vertex at most once. For a perfect matching M , we define ∂M to be the set of boundary vertices contained in M . For a subset I of ∂G, we define D(G, I) to be the number of perfect matchings M of I with ∂M = I. We define a graph with boundary to be embedded in a disc if G is embedded in a closed planar disc D such that the the vertices of ∂G lie on ∂D, in their specified order.
The first variant of Kasteleyn's result which we want is: Theorem 2. Let G be a bipartite graph with boundary embedded in a disk, such that all of the boundary vertices are white. Let there be N + k black vertices b 1 , b 2 , . . . , b N +k , let there be N internal white vertices w 1 , w 2 , . . . , w N and let there be n boundary vertices w N +1 , . . . , w N +n , with that circular order. Then there is an (N + k) × (N + n) matix K with K ij = ±1 if there is an edge from i to j, and K ij = 0 otherwise, having the following property: For any k element subset I of ∂G, let K I be the submatrix of K using all rows, the first N columns, and the additional k columns indexed by I. Then D(G, I) = det K I .

This will then imply
Theorem 3. Let G be as in Theorem 2. Then there is a k × n real matrix L with the property we now describe: For any k element subset I of ∂G, let L I be the submatrix of L using all rows and the columns indexed by I. Then D(G, I) = det L I .
In particular, all maximal minors of L I are nonnegative. As we will point out explicitly in Corollary 3.4, that means that the n k numbers D(G, I) are the Plücker coordinates of a point in Postnikov's totally nonnegative Grassmannian.
Kasteleyn also proved a version of his theorem for graphs which are not bipartite: if there is an edge from i to j, and X ij = 0 otherwise, such that the Pfaffian Pf(X) is the number of perfect matchings of G.
We will prove this and the corresponding results: Theorem 5. Let G be a planar graph with boundary embedded in a disc, having N internal vertices v 1 , v 2 , . . . , v N and n boundary vertices v N +1 , v N +2 , . . . , v N +n in that circular order. Then there is an (N + n) × (N + n) skew symmetric matrix X with X ij = −X ji = ±1 if there is an edge from i to j, and X ij = 0 otherwise having the following property: For any subset I of ∂G, let X I be the submatrix of X using the first N rows and first N columns, and additionally those rows and columns indexed by I. Then D(G, I) = Pf(X I ).
Theorem 6. Let G be as in Theorem 5 and assume D(G, ∅) > 0 (which implies that N is even). Then there is an n × n skew symmetric real matrix Y with the following property: For any subset I of ∂G, let Y I be the submatrix using the rows and columns indexed by I. Then D(G, I) = Pf(Y I ) D(G, ∅) for all subsets I of ∂G.
Remark. We take the Pfaffian of an odd by odd skew symmetric matrix to be zero, so the theorems are true but trivial in the cases that involve such Pfaffians.
Remark. Theorem 6 shows that there are many skew-symmetric matrices all of whose Pfaffian's are nonnegative; it would be interesting to develop analogues of classical results on nonnegative matrices for Pfaffians.
All of these theorems have easy variants where there are weights on the edges of G. Specifically, let w : Edges(G) → R >0 be any weighting function. For a perfect matching M , we define w(M ) = e∈M w(e); we define D(G, I, w) = ∂M=I w(M ). Then the corresponding results are (1) In the setting of Theorem 1, there is a matrix or 0 as above such that Pf(X I ) = D(G, I, w). (6) In the setting of Theorem 6 (including the hypothesis that D(G, ∅, w) > 0), there is a real skewsymmetric matrix Y such that D(G, I, w) = Pf(Y I )D(G, ∅, w). In particular, part (3) shows that the n k numbers D(G, I, w), as I varies, are the Plücker coordinates of a point in the totally nonnegative Grassmannian. If we fix G and let w vary over all possible weightings of the edges of G, we thus obtain a parametrization of a portion of the totally nonnegative Grassmannian. This parametrization of the totally nonnegative Grassmannian is the one found by Postnikov [9], who described it in terms of certain random walks. Talaska [12] recast Postnikov's formulas in terms of flows. Postnikov, Williams and the author [10] implicitly pointed out that this was equivalent to summing over matchings. Lam's lecture notes [7] make the point explicit. As the positive Grassmannian and its parametrizations grow more popular, the author feels that there should be a brief paper which records a direct proof that w → (D(G, I, w)) I∈( [n] k ) parametrizes a portion of the totally nonnegative Grassmannian. The author would like to express his gratitude to Jim Propp for introducing him to Kasteleyn's method, Kuo's condensation theorem, and the pleasures of combinatorial research.

A topological proof of Theorems 1, 2, 4 and 5
The key to our proof is to prove a more general result for non-planar graphs. Let G be a general graph. We will define a planar immersion of G to be a continuous map φ : G → R 2 such that each edge of G is taken to a line segment and, for any edge e, and any vertex v not an end point of e, the point φ(v) is not contained in φ(e). We point out explicitly that a line segment has positive length; a single point is not a line segment.
For G a graph, φ : G → R 2 a planar immersion and M a perfect matching of G, we define cross(M ) to be the number of unordered pairs {e 1 , e 2 } of distinct edges of M for which φ(e 1 ) and φ(e 2 ) intersect. We set ǫ(M ) = (−1) cross(M) . Proposition 1.1. Let G be a bipartite graph with N black vertices b i and N white vertices w j , equipped with a planar immersion φ. Then there is an N × N matrix K ij , with K ij = ±1 if there is an edge from b i to w j , and 0 otherwise, such that det K = M ǫ(M ).
Proof. We first note that the theorem is easy if all the black vertices φ(b i ) lie in order on a line and all the white vertices φ(w j ) lie in order on a parallel line; just take K ij = 1 whenever there is an edge (b i , w j ). We must check that ǫ(M ) is the sign coming from the determinant. Let (b 1 , w σ(1) ), (b 2 , w σ(2) ), . . . , (b N , w σ(N ) ) be a perfect matching M , so σ is a permutation. The number of crossing edges of M is the number of (i 1 , i 2 ) such that i 1 < i 2 and σ(i 1 ) > σ(i 2 ). So cross(M ) is the number of inversions of σ, and ǫ(M ) is the sign of σ, as desired.
Given any point z ∈ (R 2 ) Vertices(G) , there is a map φ z : G → R 2 which sends a vertex v to z(v) and sends each edge to a line segment or point. Let Ω be the set of z for which φ z is a planar immersion.
We note that Ω is an open subset of (R 2 ) Vertices(G) ∼ = R 4N , obtained by deleting the codimension 1 subvarieties on which certain triples of vertices become colinear. Let Ω ′ ⊃ Ω be the open set where we impose that all the vertices have distinct images z(v), and also that the interiors of φ z (e 1 ) and φ z (e 2 ) do not overlap in a line segment for any distinct edges e 1 and e 2 . So Ω ′ is obtained from R 4N by deleting the codimension two subvarieties on which pairs of vertices become equal, or on which certain quadruples of vertices become colinear.
In particular, since Ω ′ is R 4N with codimension two subvarieties removed, Ω ′ is connected. Let z 0 be a point of Ω corresponding to the immersion in the first paragraph, so Proposition 1.1 is true at φ z0 . Let z 1 be any point of Ω, and choose a path z(t) from z 0 to z 1 through Ω ′ . We will show that the Proposition is true for every φ z(t) with z(t) ∈ Ω.
As we travel along z(t), the only changes of the topology of the embedding occur when a vertex v passes through an edge e. Let ǫ 1 and ǫ 2 denote the sign functions for the two topologies. We claim that ǫ 1 (M ) = −ǫ 2 (M ) if e ∈ M , and ǫ 1 (M ) = ǫ 2 (M ) otherwise. This is because M has exactly one edge incident to v. This edge crosses e in one topology and not the other, and no other crossings change. So, if K is a matrix which works for the first topology, then we can obtain a matrix for the second topology by switching the sign of the entry corresponding to edge e. Since we have a matrix which works at z 0 , we obtain a matrix which works at any z.
Proof of Theorem 1. Fary [1] showed that any planar graph can be drawn so that the edges are straight lines. Drawing G in this manner, the function ǫ is simply 1 and we obtain Theorem 1.
Remark 1.2. We could avoid appealing to Fary's theorem by using piecewise linear edges and adding additional coordinates for the positions of the bends in these edges. This creates a few new cases, but no significant difficulties. Remark 1.3. Norine [8] used planar immersions to provide a characterization of Pfaffian graphs, and thus implicitly to provide a proof of Kasteleyn's theorem, but did not discuss deforming the immersion. The author previously posted a sketch of this argument on Mathoverflow [11]. The author is not aware of any other prior sources for this argument.
We have proved Theorem 1. Slight variants of this argument prove Theorems 2, 4 and 5. For Theorem 2, we fix a closed rectangle D and consider immersions G → D taking ∂D → ∂G in the specified circular order. Our starting point is that the black vertices occurs in order on the top edge of the rectangle and the black vertices occur in order on the bottom edge. The fact that D is convex ensures that For Theorems 4 and 5, we proceed similarly. Our starting point is now to take all the vertices φ(v) to lie on the boundary of a circle, and recall that one way to describe the signs occurring in the Pfaffian is as the number of crossings when a matching is drawn in this manner.

Proofs of Theorems 3 and 6
We begin with Theorem 3. Let K be the matrix from Theorem 2. If G has no perfect matchings, the Theorem is immediate; take L = 0. So we may assume that G has perfect matchings, and thus that det K I = 0 for some I. In particular, the first N columns of K are linearly independent.
Therefore, applying row operations, we may transform K into a matrix of block form Id N * 0 L without changing any maximal minors. Then, in the notations of Theorems 2 and 3, we have det K I = det L I . This proves Theorem 3. The proof of Theorem 6 is similar. If G has no perfect matchings, take Y = 0. Otherwise, the upper left N × N submatrix, X ∅ must be of rank N . So we can write Left and right multiplying X by
Remark 3.3. Many authors have pointed out that Corollaries 3.1 and 3.2 and similar identities follow from properties of Pfaffians. (See [13], [2], [4].) It seems uncommon, though, to observe that the relations that occur when deleting subsets of n boundary vertices are precisely the relations between the Pfaffians of an n × n matrix.
There is no need to limit ourselves to 2 × 4 matrices. More generally, we deduce the following result: Corollary 3.4. Let G be as in Theorems 2 and 3. Then the n k numbers D(I), as I ranges through k-element subsets of ∂G, are either all zero or the Plücker coordinates of a point on the Grassmannian G(k, n).
Proof. By definition, the Plücker coordinates of RowSpan(L) are the maximal minors of L, assuming L has rank k.
As explained in the introduction, this last result is key to parametrizations of the totally nonnegative Grassmannian.