Formalization Blueprint for “An Introduction to Algebraic Combinatorics” by Darij Grinberg

5.5 The LGV lemma: weighted and generalized versions

5.5.1 The weighted version

Theorem 5.154 LGV lemma, lattice weight version

Let \(K\) be a commutative ring.

For each arc \(a\) of the digraph \(\mathbb {Z}^{2}\), let \(w(a)\) be an element of \(K\). We call \(w(a)\) the weight of \(a\).

For each path \(p\) of \(\mathbb {Z}^{2}\), define the weight \(w(p)\) of \(p\) by

\[ w(p) := \prod _{a \text{ is an arc of } p} w(a). \]

For each path tuple \(\mathbf{p} = (p_1, p_2, \ldots , p_k)\), define the weight \(w(\mathbf{p})\) of \(\mathbf{p}\) by

\[ w(\mathbf{p}) := w(p_1)\, w(p_2) \cdots w(p_k). \]

Let \(k \in \mathbb {N}\). Let \(\mathbf{A} = (A_1, A_2, \ldots , A_k)\) and \(\mathbf{B} = (B_1, B_2, \ldots , B_k)\) be two \(k\)-vertices. Then,

\[ \det \! \left(\left(\sum _{p : A_i \to B_j} w(p)\right)_{1 \le i \le k,\; 1 \le j \le k}\right) = \sum _{\sigma \in S_k} (-1)^{\sigma } \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \sigma , (, \mathbf , {, B, }, )]}} w(\mathbf{p}). \]

Here, “\(p : A_i \to B_j\)” means “\(p\) is a path from \(A_i\) to \(B_j\)”.

Proof

This is the special case of Theorem 5.155 for the integer lattice \(\mathbb {Z}^2\), which is a path-finite acyclic digraph.

5.5.2 Generalization to acyclic digraphs

Theorem 5.155 LGV lemma, digraph weight version

Let \(K\) be a commutative ring.

Let \(D\) be a path-finite (but possibly infinite) acyclic digraph.

For each arc \(a\) of \(D\), let \(w(a) \in K\). For each path \(p\) of \(D\), define \(w(p) := \prod _{a \text{ is an arc of } p} w(a)\). For each path tuple \(\mathbf{p} = (p_1, \ldots , p_k)\), define \(w(\mathbf{p}) := w(p_1) \cdots w(p_k)\).

Let \(k \in \mathbb {N}\). Let \(\mathbf{A} = (A_1, \ldots , A_k)\) and \(\mathbf{B} = (B_1, \ldots , B_k)\) be two \(k\)-tuples of vertices of \(D\). Then,

\[ \det \! \left(\left(\sum _{p : A_i \to B_j} w(p)\right)_{1 \le i \le k,\; 1 \le j \le k}\right) = \sum _{\sigma \in S_k} (-1)^{\sigma } \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \sigma , (, \mathbf , {, B, }, )]}} w(\mathbf{p}). \]
theorem LGV.lgv_weighted_digraph {K : Type u_2} [CommRing K] {V : Type u_4} [DecidableEq V] {D : SimpleDigraph V} (hpf : D.IsPathFinite) (hac : D.IsAcyclic) {k : } (w : ArcWeight D K) (A B : kVertex V k) :
(pathWeightMatrix hpf w A B).det = σ : Equiv.Perm (Fin k), Equiv.Perm.sign σ nipatWeightSum hpf w A (permuteKVertex σ B) σ
Proof

The same argument as for Proposition 5.153 can be used here; just replace \(\operatorname {sign}(\sigma , \mathbf{p}) := (-1)^{\sigma }\) by \(\operatorname {sign}(\sigma , \mathbf{p}) = (-1)^{\sigma } \cdot w(\mathbf{p})\). The only new observation required is that when we exchange the tails of two paths in our path tuple, the weight of the path tuple does not change. This is clear: the weight of a path tuple is the product of the weights of all arcs in all paths of the tuple; when we exchange the tails of two paths, some arcs get moved from one path to the other, but the total product stays unchanged.

More precisely, the proof expands the determinant via the Leibniz formula. Each summand \((-1)^\sigma \prod _i M_{i,\sigma (i)}\) expands (by distributivity) into a sum over all path tuples from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\), weighted by \((-1)^\sigma \, w(\mathbf{p})\). Split the sum into non-intersecting and intersecting path tuples.

For the intersecting path tuples, a sign-reversing involution \(\varphi \) (Lemma 5.161) is defined as follows: given an intersecting path tuple paired with a permutation \((\sigma , \mathbf{p})\), find the canonical first intersection point, exchange the tails of the two relevant paths at that point, and compose \(\sigma \) with the corresponding transposition. This involution reverses the sign factor \((-1)^\sigma \) (Lemma 5.162) while preserving the weight \(w(\mathbf{p})\) (Lemma 5.163), and has no fixed points among intersecting path tuples (Lemma 5.164). Therefore the contributions of intersecting path tuples cancel in pairs, leaving only the non-intersecting ones.

5.5.3 Helper lemmas for the sign-reversing involution

Lemma 5.156 Vertices are distinct in acyclic digraphs

In an acyclic digraph \(D\), all vertices on a path are distinct.

Proof

If a vertex appeared twice at positions \(i {\lt} j\), we could extract the subpath from \(i\) to \(j\), which forms a cycle. By acyclicity, this subpath has length \(1\), so \(i = j\).

Lemma 5.157 Exchange of tails preserves weight

Let \(D\) be an acyclic digraph with arc weight function \(w\). Let \(p\) and \(q\) be two paths sharing a vertex \(v\). Let \((p', q')\) be the result of exchanging the tails of \(p\) and \(q\) at \(v\) (i.e., \(p'\) takes the head of \(p\) up to \(v\) followed by the tail of \(q\) from \(v\), and symmetrically for \(q'\)). Then \(w(p) \cdot w(q) = w(p') \cdot w(q')\).

theorem LGV.exchangeTails_weight {K : Type u_2} [CommRing K] {V : Type u_3} [DecidableEq V] {D : SimpleDigraph V} (w : ArcWeight D K) (p q : D.Path) (v : V) (hv_p : v p.vertices) (hv_q : v q.vertices) :
pathWeight w p * pathWeight w q = pathWeight w (exchangeTails p q v hv_p hv_q).1 * pathWeight w (exchangeTails p q v hv_p hv_q).2
Proof

The weight of a path is the product of the weights of its arcs. When we exchange tails at \(v\), arcs are redistributed between the two paths, but the total multiset of arcs is preserved. Hence the product is unchanged.

Lemma 5.158 Exchange of tails is an involution

Let \(D\) be an acyclic digraph, and let \(p, q\) be paths sharing a vertex \(v\). Let \((p', q')\) be the result of exchanging the tails of \(p\) and \(q\) at \(v\). Then exchanging the tails of \(p'\) and \(q'\) at \(v\) returns \((p, q)\).

theorem LGV.exchangeTails_involutive {V : Type u_3} [DecidableEq V] {D : SimpleDigraph V} (_hac : D.IsAcyclic) (p q : D.Path) (v : V) (hv_p : v p.vertices) (hv_q : v q.vertices) :
let p' := (exchangeTails p q v hv_p hv_q).1; let q' := (exchangeTails p q v hv_p hv_q).2; have hv_p' := ; have hv_q' := ; exchangeTails p' q' v hv_p' hv_q' = (p, q)
Proof

Exchanging tails at \(v\) twice returns each path to its original form, since the head and tail of each path at \(v\) are restored.

Lemma 5.159 Sign-reversing map preserves intersection

Let \(D\) be a path-finite acyclic digraph. If \((\sigma , \mathbf{p})\) is an intersecting path tuple with permutation, then \(\varphi (\sigma , \mathbf{p})\) is also intersecting.

theorem LGV.signReversing_isIntersecting {V : Type u_3} [DecidableEq V] {D : SimpleDigraph V} (hac : D.IsAcyclic) {k : } {A B : kVertex V k} (sp : pathTupleWithPerm A B) (hip : sp.snd.isIntersecting) :
Proof

By Lemma 5.158, exchanging tails is an involution. If the result were non-intersecting, applying \(\varphi \) again would give a non-intersecting tuple equal to the original (contradicting the hypothesis that it is intersecting).

Lemma 5.160 Canonical intersection data is invariant

Let \(D\) be an acyclic digraph and \((\sigma , \mathbf{p})\) an intersecting path tuple with canonical intersection data \((i, j, v)\). After applying the sign-reversing map, the canonical intersection data of the resulting tuple \(\varphi (\sigma , \mathbf{p})\) is still \((i, j, v)\).

Proof

The head of path \(i\) (vertices before \(v\), inclusive) is unchanged by the tail exchange, so \(v\) remains the first crowded vertex on path \(i\). Furthermore, \(i\) is still the smallest crowded path index (indices below \(i\) have unchanged paths), and \(j\) is still the largest index sharing vertex \(v\) with \(i\) (the set of path indices containing \(v\) is preserved).

Lemma 5.161 Sign-reversing involution is an involution

Let \(D\) be a path-finite acyclic digraph. Let \((\sigma , \mathbf{p})\) be an intersecting path tuple with permutation. Then the sign-reversing map \(\varphi \) satisfies: if \(\varphi (\sigma , \mathbf{p})\) is intersecting, then \(\varphi (\varphi (\sigma , \mathbf{p})) = (\sigma , \mathbf{p})\).

theorem LGV.signReversing_involutive {V : Type u_3} [DecidableEq V] {D : SimpleDigraph V} (hac : D.IsAcyclic) {k : } {A B : kVertex V k} (sp : pathTupleWithPerm A B) (hip : sp.snd.isIntersecting) :
have sp' := signReversing hac sp hip; ∃ (hip' : sp'.snd.isIntersecting), signReversing hac sp' hip' = sp
Proof

After applying \(\varphi \), the canonical intersection data \((i, j, v)\) is preserved (Lemma 5.160). Applying \(\varphi \) again thus uses the same \((i, j, v)\), and the paths and permutation are restored by Lemma 5.158 and the identity \((\sigma \cdot (i\; j)) \cdot (i\; j) = \sigma \).

Lemma 5.162 Sign-reversing involution reverses sign

The sign-reversing map \(\varphi \) satisfies: if \(\varphi (\sigma ,\mathbf{p}) = (\sigma ', \mathbf{p}')\), then \((-1)^{\sigma '} = -(-1)^{\sigma }\).

Proof

The permutation component of \(\varphi (\sigma , \mathbf{p})\) is \(\sigma \cdot (i\; j)\) for distinct \(i \ne j\) (Lemma 5.165). Since transpositions have sign \(-1\), the sign of the new permutation is \(-(-1)^\sigma \).

Lemma 5.163 Sign-reversing involution preserves weight

The sign-reversing map \(\varphi \) satisfies: if \(\varphi (\sigma , \mathbf{p}) = (\sigma ', \mathbf{p}')\), then \(w(\mathbf{p}') = w(\mathbf{p})\).

theorem LGV.signReversing_weight {K : Type u_2} [CommRing K] {V : Type u_3} [DecidableEq V] {D : SimpleDigraph V} (hac : D.IsAcyclic) {k : } {A B : kVertex V k} (w : ArcWeight D K) (sp : pathTupleWithPerm A B) (hip : sp.snd.isIntersecting) :
Proof

Only paths \(i\) and \(j\) are modified (their tails are exchanged), and the remaining paths are unchanged (Lemma 5.166). By Lemma 5.157, the product of the weights of paths \(i\) and \(j\) is preserved. Hence the total weight \(w(\mathbf{p}) = \prod _l w(p_l)\) is unchanged.

Lemma 5.164 Sign-reversing involution has no fixed points

The sign-reversing map \(\varphi \) has no fixed points among intersecting path tuples: if \(\mathbf{p}\) is intersecting, then \(\varphi (\sigma , \mathbf{p}) \ne (\sigma , \mathbf{p})\).

theorem LGV.signReversing_no_fixed_points {V : Type u_3} [DecidableEq V] {D : SimpleDigraph V} (hac : D.IsAcyclic) {k : } {A B : kVertex V k} (sp : pathTupleWithPerm A B) (hip : sp.snd.isIntersecting) :
signReversing hac sp hip sp
Proof

The permutation component changes by a non-trivial transposition, so it cannot equal \(\sigma \).

Lemma 5.165 Permutation of sign-reversing map

The sign-reversing map \(\varphi \) applied to \((\sigma , \mathbf{p})\) produces a permutation \(\sigma ' = \sigma \cdot (i\; j)\) for some distinct indices \(i \ne j\).

theorem LGV.signReversing_perm {V : Type u_3} [DecidableEq V] {D : SimpleDigraph V} (hac : D.IsAcyclic) {k : } {A B : kVertex V k} (sp : pathTupleWithPerm A B) (hip : sp.snd.isIntersecting) :
∃ (i : Fin k) (j : Fin k), i j (signReversing hac sp hip).fst = sp.fst * Equiv.swap i j
Proof

By definition: the canonical intersection data selects indices \(i\) and \(j\), and \(\varphi \) composes \(\sigma \) with the transposition \((i\; j)\).

Lemma 5.166 Paths of sign-reversing map

The sign-reversing map \(\varphi \) applied to \((\sigma , \mathbf{p})\) produces paths \(\mathbf{p}'\) such that: paths at indices \(i\) and \(j\) have their tails exchanged at the crowded vertex \(v\), while all other paths remain unchanged.

theorem LGV.signReversing_paths {V : Type u_3} [DecidableEq V] {D : SimpleDigraph V} (hac : D.IsAcyclic) {k : } {A B : kVertex V k} (sp : pathTupleWithPerm A B) (hip : sp.snd.isIntersecting) :
∃ (i : Fin k) (j : Fin k), i j ∃ (v : V) (hvi : v (sp.snd.paths i).vertices) (hvj : v (sp.snd.paths j).vertices), (signReversing hac sp hip).snd.paths i = (exchangeTails (sp.snd.paths i) (sp.snd.paths j) v hvi hvj).1 (signReversing hac sp hip).snd.paths j = (exchangeTails (sp.snd.paths i) (sp.snd.paths j) v hvi hvj).2 ∀ (l : Fin k), l il j(signReversing hac sp hip).snd.paths l = sp.snd.paths l
Proof

By definition: \(\varphi \) selects the canonical intersection data \((i, j, v)\) and exchanges the tails of paths \(i\) and \(j\) at \(v\), leaving all other paths untouched.

5.5.4 Infrastructure for the LGV proof

Lemma 5.167 Signed sum over intersecting path tuples is zero

For any path-finite acyclic digraph \(D\) with arc weights \(w\),

\[ \sum _{\substack{[(, \sigma , ,, , \mathbf , {, p, }, ), , \\ , , \mathbf , {, p, }, , \text , {, , i, n, t, e, r, s, e, c, t, i, n, g, }]}} (-1)^\sigma \, w(\mathbf{p}) = 0. \]
theorem LGV.sum_ipatWithPerm_signed_weight_eq_zero {K : Type u_2} [CommRing K] {V : Type u_4} [DecidableEq V] {D : SimpleDigraph V} (hpf : D.IsPathFinite) (hac : D.IsAcyclic) {k : } (w : ArcWeight D K) (A B : kVertex V k) :
spipatWithPermFinset hpf A B, (Equiv.Perm.sign sp.fst) * pathTupleWeight w sp.snd.paths = 0
Proof

Apply the sign-reversing involution \(\varphi \) as a fixed-point-free involution. Each pair \(\{ (\sigma , \mathbf{p}),\; \varphi (\sigma , \mathbf{p})\} \) contributes \((-1)^\sigma w(\mathbf{p}) + (-(-1)^\sigma ) w(\mathbf{p}) = 0\).

Lemma 5.168 Determinant equals sum over all path tuples with permutation

For any path-finite digraph \(D\) with arc weights \(w\),

\[ \det (M) = \sum _{(\sigma , \mathbf{p})} (-1)^\sigma \, w(\mathbf{p}), \]

where the sum ranges over all pairs of a permutation \(\sigma \) and a path tuple \(\mathbf{p}\) from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\).

theorem LGV.det_eq_sum_allPathTupleWithPerm {K : Type u_2} [CommRing K] {V : Type u_4} [DecidableEq V] {D : SimpleDigraph V} (hpf : D.IsPathFinite) {k : } (w : ArcWeight D K) (A B : kVertex V k) :
Proof

Expand \(\det (M)\) by the Leibniz formula. Each summand \((-1)^\sigma \prod _i M_{i,\sigma (i)}\) expands (using the definition \(M_{i,j} = \sum _{p : A_i \to B_j} w(p)\) and distributivity) into a sum over all path tuples from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\). Combine over all \(\sigma \) to obtain the sum over all pairs \((\sigma , \mathbf{p})\).

Lemma 5.169 Nipat sum over permutations equals weighted nipat sum

The sum over non-intersecting path tuples with permutation equals

\[ \sum _{\sigma \in S_k} (-1)^\sigma \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \sigma , (, \mathbf , {, B, }, )]}} w(\mathbf{p}). \]
theorem LGV.sum_nipatWithPerm_eq_sum_nipatWeightSum {K : Type u_2} [CommRing K] {V : Type u_4} [DecidableEq V] {D : SimpleDigraph V} (hpf : D.IsPathFinite) {k : } (w : ArcWeight D K) (A B : kVertex V k) :
spnipatWithPermFinset hpf A B, (Equiv.Perm.sign sp.fst) * pathTupleWeight w sp.snd.paths = σ : Equiv.Perm (Fin k), Equiv.Perm.sign σ nipatWeightSum hpf w A (permuteKVertex σ B) σ
Proof

Decompose the set of non-intersecting path tuples with permutation as a disjoint union over permutations \(\sigma \) and nipats from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\), then factor out \((-1)^\sigma \) from each inner sum.

Lemma 5.170 Product of path weight sums equals sum over path tuples

For a path-finite digraph \(D\) with arc weights \(w\),

\[ \prod _{j=1}^{k} \biggl(\sum _{p : A_j \to B_j} w(p)\biggr) = \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , p, a, t, h, , t, u, p, l, e, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \mathbf , {, B, }]}} w(\mathbf{p}). \]
theorem LGV.prod_pathWeightSum_eq_sum_pathTupleWeight {K : Type u_2} [CommRing K] {V : Type u_4} [DecidableEq V] {D : SimpleDigraph V} (hpf : D.IsPathFinite) {k : } (w : ArcWeight D K) (A B : kVertex V k) :
j : Fin k, pathWeightSum hpf w (A j) (B j) = ptallPathTupleFinset hpf A B, pathTupleWeight w pt.paths
Proof

Expand the finite product of finite sums using distributivity. The resulting index set bijects with all path tuples (choosing one path for each component).

5.5.5 The nonpermutable case

Lemma 5.171 Discrete intermediate value theorem

Let \(f : \mathbb {Z} \to \mathbb {Z}\) satisfy \(|f(n+1) - f(n)| \le 1\) for all \(n \in [a, b)\). If \(f(a) \ge 0\) and \(f(b) \le 0\), then there exists \(c \in [a, b]\) with \(f(c) = 0\).

theorem LGV.discrete_ivt {a b : } (hab : a b) (f : ) (hf : ∀ (n : ), a nn < b|f (n + 1) - f n| 1) (hfa : 0 f a) (hfb : f b 0) :
∃ (c : ), a c c b f c = 0
Proof

By induction on \(b - a\). If \(f(a) = 0\), take \(c = a\). Otherwise, \(f(a) {\gt} 0\) and the step bound gives \(f(a+1) \ge 0\). If \(f(a+1) \le 0\), take \(c = a + 1\); otherwise apply the induction hypothesis to \([a+1, b]\).

Lemma 5.172 Baby Jordan curve theorem for lattice paths

Let \(A, A', B, B' \in \mathbb {Z}^2\) with \(\operatorname {x}(A') \le \operatorname {x}(A)\), \(\operatorname {y}(A) \le \operatorname {y}(A')\), \(\operatorname {x}(B') \le \operatorname {x}(B)\), and \(\operatorname {y}(B) \le \operatorname {y}(B')\). If \(p\) is a path from \(A\) to \(B'\) and \(p'\) is a path from \(A'\) to \(B\), then \(p\) and \(p'\) share a vertex.

theorem LGV.baby_jordan {A A' B B' : × } (hxA : xCoord A' xCoord A) (hyA : yCoord A yCoord A') (hxB : xCoord B' xCoord B) (hyB : yCoord B yCoord B') (p : integerLattice.Path) (hp_start : p.start = A) (hp_finish : p.finish = B') (p' : integerLattice.Path) (hp'_start : p'.start = A') (hp'_finish : p'.finish = B) :
Proof

Consider the “coordinate sum” \(s = x + y\) along each path. The range of \(s\)-values for \(p\) is \([A_x + A_y,\; B'_x + B'_y]\), and for \(p'\) it is \([A'_x + A'_y,\; B_x + B_y]\). These ranges overlap. At the low end of the overlap, the \(x\)-coordinate of \(p\) is \(\ge \) that of \(p'\); at the high end, it is \(\le \). Since the \(x\)-coordinate changes by at most \(1\) per step, a discrete intermediate value argument (Lemma 5.171) yields a value of \(s\) where \(p\) and \(p'\) have the same \(x\)-coordinate. Since they also have the same coordinate sum \(s\), the \(y\)-coordinates agree as well, so they share that vertex.

Lemma 5.173 Monotone permutation is identity

If \(\sigma \in S_k\) satisfies \(\sigma (i) \le \sigma (j)\) whenever \(i {\lt} j\), then \(\sigma = \operatorname {id}\).

theorem LGV.monotone_perm_eq_id {k : } (σ : Equiv.Perm (Fin k)) (h : ∀ (i j : Fin k), i < jσ i σ j) :
Proof

By strong induction. If \(\sigma \) is monotone, then for the smallest element \(i\) we have \(\sigma (i) \ge i\) (otherwise injectivity is violated) and \(\sigma (i) \le i\) (otherwise the preimage of \(i\) would have to be smaller, violating monotonicity). Hence \(\sigma (i) = i\), and the claim follows by induction.

Lemma 5.174 No nipats for non-identity permutations under sorting

Under the sorting conditions of Corollary 5.175, if \(\sigma \in S_k\) is not the identity permutation, then there are no non-intersecting path tuples from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\).

theorem LGV.no_nipats_nonidentity {k : } (A B : kVertex ( × ) k) (hxA : xDecreasing A) (hyA : yIncreasing A) (hxB : xDecreasing B) (hyB : yIncreasing B) (σ : Equiv.Perm (Fin k)) ( : σ Equiv.refl (Fin k)) :
Proof

Since \(\sigma \ne \operatorname {id}\), by Lemma 5.173 there exists \(i \in [k-1]\) with \(\sigma (i) {\gt} \sigma (i+1)\). The sorting conditions then satisfy the hypotheses of Lemma 5.172 for paths \(p_i : A_i \to B_{\sigma (i+1)}\) and \(p_{i+1} : A_{i+1} \to B_{\sigma (i)}\), so these two paths must intersect. Hence no nipat exists.

Corollary 5.175 LGV lemma, nonpermutable lattice weight version

Consider the setting of Theorem 5.154, but additionally assume that

\begin{align} \operatorname {x}(A_1) & \ge \operatorname {x}(A_2) \ge \cdots \ge \operatorname {x}(A_k); \label{eq.cor.lgv.kpaths.wt-np.xA} \\ \operatorname {y}(A_1) & \le \operatorname {y}(A_2) \le \cdots \le \operatorname {y}(A_k); \label{eq.cor.lgv.kpaths.wt-np.yA} \\ \operatorname {x}(B_1) & \ge \operatorname {x}(B_2) \ge \cdots \ge \operatorname {x}(B_k); \label{eq.cor.lgv.kpaths.wt-np.xB} \\ \operatorname {y}(B_1) & \le \operatorname {y}(B_2) \le \cdots \le \operatorname {y}(B_k). \label{eq.cor.lgv.kpaths.wt-np.yB} \end{align}

Here, \(\operatorname {x}(P)\) and \(\operatorname {y}(P)\) denote the two coordinates of any point \(P \in \mathbb {Z}^2\).

Then, there are no nipats from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\) when \(\sigma \in S_k\) is not the identity permutation \(\operatorname {id} \in S_k\). Therefore, the claim of Theorem 5.154 simplifies to

\begin{equation} \det \! \left(\left(\sum _{p : A_i \to B_j} w(p)\right)_{1 \le i \le k,\; 1 \le j \le k}\right) = \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \mathbf , {, B, }]}} w(\mathbf{p}). \label{eq.cor.lgv.kpaths.wt-np.claim} \end{equation}
20

Proof

Let \(\sigma \in S_k\) be a permutation that is not the identity permutation \(\operatorname {id} \in S_k\). By Lemma 5.174, there are no nipats from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\), so

\[ \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \sigma , (, \mathbf , {, B, }, )]}} w(\mathbf{p}) = 0. \]

Now, Theorem 5.154 yields

\begin{align*} & \det \! \left(\left(\sum _{p : A_i \to B_j} w(p)\right)_{1 \le i \le k,\; 1 \le j \le k}\right) \\ & = \sum _{\sigma \in S_k} (-1)^{\sigma } \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \sigma , (, \mathbf , {, B, }, )]}} w(\mathbf{p}) \\ & = \underbrace{(-1)^{\operatorname {id}}}_{=1} \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \mathbf , {, B, }]}} w(\mathbf{p}) + \sum _{\substack{[\sigma , \in , S, _, k, , \\ , , \sigma , \ne , \operatorname , {, i, d, }]}} (-1)^{\sigma } \underbrace{\sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \sigma , (, \mathbf , {, B, }, )]}} w(\mathbf{p})}_{= 0} \\ & = \sum _{\substack{[\mathbf , {, p, }, , \text , {, , i, s, , a, , n, i, p, a, t, }, , \\ , , \text , {, f, r, o, m, , }, , \mathbf , {, A, }, , \text , {, , t, o, , }, , \mathbf , {, B, }]}} w(\mathbf{p}). \end{align*}

5.5.6 Applications

Nonnegativity of binomial coefficient determinants

Lemma 5.176 FKG inequality for binomial coefficients

Let \(a, b, c, d\) be nonnegative integers with \(a \ge b\) and \(c \ge d\). Then

\[ \binom {a}{d} \binom {b}{c} \le \binom {a}{c} \binom {b}{d}. \]
theorem LGV.binom_2x2_ineq (a b c d : ) (hab : b a) (hcd : d c) :
(a.choose d) * (b.choose c) (a.choose c) * (b.choose d)
Proof

By induction on \(c - d\). The base case \(c = d\) is trivial. For the inductive step, use the identity \(\binom {n}{m+1}(m+1) = \binom {n}{m}(n - m)\) to reduce the \((c+1)\) case to the \(c\) case, together with the inequality \(b - m \le a - m\) (from \(b \le a\)).

Lemma 5.177 Lattice path count equals binomial coefficient

The number of lattice paths in \(\mathbb {Z}^2\) from \((0, -a)\) to \((b, -b)\) equals \(\binom {a}{b}\).

Proof

A path from \((0,-a)\) to \((b,-b)\) has exactly \(a\) steps (the coordinate sum \(x+y\) increases from \(-a\) to \(0\)), of which exactly \(b\) are east-steps (the \(x\)-coordinate increases from \(0\) to \(b\)). Choosing which \(b\) of the \(a\) steps are east-steps gives a bijection with \(b\)-element subsets of \([a]\), so the count is \(\binom {a}{b}\).

Lemma 5.178 Lattice paths biject to subsets

There is a bijection between paths from \((0, -a)\) to \((b, -b)\) in the integer lattice and \(b\)-element subsets of \(\{ 1, \ldots , a\} \).

  • One or more equations did not get rendered due to their size.
Proof

A path is uniquely determined by the positions of its east-steps among all \(a\) steps. This gives a bijection to \(b\)-element subsets of \(\{ 1, \ldots , a\} \).

Helpers for Corollary 5.181

Lemma 5.179 Binomial matrix equals path weight matrix

With \(A_i = (0, -a_i)\), \(B_j = (b_j, -b_j)\), and unit arc weights, the path weight matrix equals the matrix \(\bigl(\binom {a_i}{b_j}\bigr)\).

Proof

The \((i,j)\) entry of the path weight matrix (with unit weights) is the number of paths from \(A_i\) to \(B_j\), which by Lemma 5.177 equals \(\binom {a_i}{b_j}\).

Lemma 5.180 Signed ipat count is zero (unit weight case)

With unit arc weights on the integer lattice,

\[ \sum _{\sigma \in S_k} (-1)^\sigma \, \bigl|\{ \mathbf{p} \text{ ipat from } \mathbf{A} \text{ to } \sigma (\mathbf{B})\} \bigr| = 0. \]
Proof

This is the specialization of the signed ipat cancellation (Lemma 5.167) to unit weights, where the weight of each path tuple is \(1\) and the sum reduces to a signed cardinality count.

Corollary 5.181

Let \(k \in \mathbb {N}\). Let \(a_1, a_2, \ldots , a_k\) and \(b_1, b_2, \ldots , b_k\) be nonnegative integers such that

\[ a_1 \ge a_2 \ge \cdots \ge a_k \qquad \text{and} \qquad b_1 \ge b_2 \ge \cdots \ge b_k. \]

Then,

\[ \det \! \left(\left(\binom {a_i}{b_j}\right)_{1 \le i \le k,\; 1 \le j \le k}\right) \ge 0. \]
theorem LGV.binom_det_nonneg {k : } (a b : Fin k) (ha : ∀ (i j : Fin k), i ja j a i) (hb : ∀ (i j : Fin k), i jb j b i) :
0 (Matrix.of fun (i j : Fin k) => ((a i).choose (b j))).det
Proof

Set \(K = \mathbb {Z}\) and \(w(a) := 1\) for each arc \(a\) of \(\mathbb {Z}^2\). Define the lattice points

\[ A_i := (0, -a_i) \qquad \text{and} \qquad B_i := (b_i, -b_i) \]

for all \(i \in [k]\). These lattice points satisfy the assumptions of Corollary 5.175. Hence, 20 entails

\[ \det \! \left(\left(\text{\# of paths from } A_i \text{ to } B_j\right)_{1 \le i \le k,\; 1 \le j \le k}\right) = \text{\# of nipats from } \mathbf{A} \text{ to } \mathbf{B}. \]

Using Proposition 5.129, the matrix on the left hand side is \(\bigl(\binom {a_i}{b_j}\bigr)_{1 \le i \le k,\; 1 \le j \le k}\). The right hand side is \(\ge 0\), so the determinant is \(\ge 0\).

In Lean, the cases \(k = 0\) and \(k = 1\) are proved directly (empty and \(1\times 1\) determinants), \(k = 2\) uses the FKG inequality (Lemma 5.176), and \(k \ge 3\) uses the full LGV machinery.

Catalan Hankel determinant

Lemma 5.182 Dyck digraph is acyclic

The Dyck digraph (with vertex set \(\mathbb {Z} \times \mathbb {N}\) and arcs \((i,j) \to (i+1, j+1)\) and \((i,j) \to (i+1, j-1)\) for \(j {\gt} 0\)) is acyclic.

Proof

Every arc increases the first coordinate by \(1\), so any path is strictly increasing in the first coordinate. Hence there can be no cycle.

Lemma 5.183 Dyck digraph is path-finite

The Dyck digraph is path-finite.

Proof

Since the first coordinate increases by exactly \(1\) on each arc, a path of length \(n\) visits vertices whose first coordinates form a consecutive sequence. The second coordinate is bounded by the first coordinate difference, so there are only finitely many possible vertex sequences.

Lemma 5.184 Dyck paths count equals Catalan number

The number of paths from \((0, 0)\) to \((2n, 0)\) in the Dyck digraph equals the Catalan number \(c_n\).

Proof

A path from \((0,0)\) to \((2n, 0)\) in the Dyck digraph consists of \(2n\) steps, each going either up-right or down-right, and never going below the \(x\)-axis. Such a path is exactly a Dyck path of semilength \(n\). The bijection with Dyck words (Lemma 5.185) establishes the correspondence with the Catalan number.

Helpers for the Dyck path–DyckWord bijection

Lemma 5.185 Dyck path to DyckWord bijection

There is a bijection between paths from \((0, 0)\) to \((2n, 0)\) in the Dyck digraph and Dyck words of semilength \(n\). The forward direction converts each arc into an up or down step; the backward direction constructs a vertex list from a Dyck word.

def LGV.dyckPathToWord (p : dyckDigraph.Path) (hstart : p.start = (0, 0)) (hfinish : p.finish.2 = 0) :
Proof

The forward map sends each arc \((x, y) \to (x+1, y+1)\) to an up-step and each arc \((x, y) \to (x+1, y-1)\) to a down-step, verifying that the resulting list of steps forms a well-formed Dyck word. The backward map constructs vertices by scanning the Dyck word and accumulating \(y\)-coordinates. Round-trip equalities (the two maps are mutual inverses) are verified by induction on the step list.

Lemma 5.186 Shifted Dyck paths count equals Catalan number

The number of paths from \((-2i, 0)\) to \((2j, 0)\) in the Dyck digraph equals \(c_{i+j}\).

Proof

By translation invariance (Lemma 5.187), the set of paths from \((-2i, 0)\) to \((2j, 0)\) bijects with paths from \((0, 0)\) to \((2(i+j), 0)\), which has cardinality \(c_{i+j}\) by Lemma 5.184.

Lemma 5.187 Translation is a bijection on Dyck paths

For any integer \(d\), translation by \((d, 0)\) is a bijection on paths in the Dyck digraph: if \(p\) is a path from \(A\) to \(B\), then translating each vertex by \((d, 0)\) gives a path from \(A + (d, 0)\) to \(B + (d, 0)\). The map is injective and surjective (the inverse translates by \((-d, 0)\)).

Proof

Each arc \((x, y) \to (x+1, y \pm 1)\) is preserved by horizontal translation, so the translated vertex list forms a valid path. Injectivity follows from injectivity of the translation map on vertices. Surjectivity follows from the inverse translation.

Lemma 5.188 Catalan Hankel matrix equals path weight matrix

The Catalan Hankel matrix \((c_{i+j})_{0 \le i,j {\lt} k}\) equals the path weight matrix of the Dyck digraph with unit arc weights and \(k\)-vertices \(A_i = (-2i, 0)\), \(B_j = (2j, 0)\).

Proof

The \((i,j)\) entry of the path weight matrix (with unit weights) counts paths from \((-2i, 0)\) to \((2j, 0)\), which equals \(c_{i+j}\) by Lemma 5.186.

Helpers for the unique nipat (Catalan case)

Lemma 5.189 Nested Dyck path construction

For each \(i \in \mathbb {N}\), define the nested Dyck path \(\gamma _i\) as the path in the Dyck digraph from \((-2i, 0)\) to \((2i, 0)\) that goes straight up (northeast) from \((-2i, 0)\) to \((0, 2i)\) and then straight down (southeast) from \((0, 2i)\) to \((2i, 0)\). This path has \(4i\) arcs and visits the vertices \((j - 2i,\; \min (j,\; 4i - j))\) for \(j = 0, 1, \ldots , 4i\).

Proof

The vertex list is constructed explicitly. The start and finish are verified by evaluating the vertex list at positions \(0\) and \(4i\). Each consecutive pair of vertices forms a valid Dyck arc (either up-right or down-right, with \(y \ge 0\)).

Lemma 5.190 Nested Dyck paths are disjoint

For \(i \ne j\), the nested Dyck paths \(\gamma _i\) and \(\gamma _j\) share no vertices.

Proof

A vertex on \(\gamma _i\) at position \(m\) has \(y = \min (m, 4i - m)\). At any shared \(x\)-coordinate, the corresponding positions yield different \(y\)-coordinates when \(i \ne j\), because the maximum height \(2i\) differs.

Lemma 5.191 Dyck path parity constraint

For any path \(p\) in the Dyck digraph, the \(y\)-coordinate at step \(m\) has the same parity as \(y_{\mathrm{start}} + m\), where \(y_{\mathrm{start}}\) is the \(y\)-coordinate of the starting vertex. (Each arc changes \(y\) by \(\pm 1\), so the parity alternates.)

Proof

By induction on \(m\). Each arc changes \(y\) by \(\pm 1\), flipping the parity.

Lemma 5.192 Dyck path height upper bound

For a path \(p\) in the Dyck digraph from \((-2i, 0)\) to \((2i, 0)\), the \(y\)-coordinate at step \(m\) satisfies \(y_m \le \min (m,\; 4i - m)\).

Proof

Each step changes \(y\) by at most \(+1\), so \(y_m \le m\). Symmetrically, \(y\) must return to \(0\) in \(4i - m\) remaining steps, so \(y_m \le 4i - m\).

Lemma 5.193 Nested Dyck paths form the unique nipat

Define \(k\)-vertices \(A_i := (-2(i-1), 0)\) and \(B_i := (2(i-1), 0)\) for \(i \in [k]\). There is exactly one non-intersecting path tuple from \(\mathbf{A}\) to \(\mathbf{B}\) in the Dyck digraph: the nested Dyck paths, where path \(i\) goes from \((-2i, 0)\) up to \((0, 2i)\) and back down to \((2i, 0)\).

theorem LGV.catalan_unique_nipat (k : ) :
have A := fun (i : Fin k) => (-2 * i, 0); have B := fun (i : Fin k) => (2 * i, 0); ∃! pt : PathTuple dyckDigraph k A B, pt.isNonIntersecting
Proof

Existence and non-intersection: The nested Dyck path for index \(i\) visits only vertices \((x, y)\) with \(|x| \le 2i\) and \(y \le 2i\), and at the midpoint \(x = 0\) it reaches height exactly \(2i\). Two nested paths for indices \(i \ne j\) are disjoint because they reach different maximum heights (Lemma 5.190).

Uniqueness: Any nipat must equal the nested one. At the midpoint of path \(i\) (step \(2i\)), the \(y\)-coordinate must be exactly \(2i\): it is at most \(2i\) (by Lemma 5.192), has the correct parity (by Lemma 5.191), and cannot equal \(2m\) for any \(m {\lt} i\) because that would force a shared vertex with the (inductively determined) path \(m\). Once the midpoint heights are fixed, the entire path is forced (it must go straight up, then straight down) by parity and the non-intersection constraint.

For \(k \ge 2\), the full proof uses strong induction on the path index.

Corollary 5.194

Let \(k \in \mathbb {N}\). Recall the Catalan numbers \(c_n = \frac{1}{n+1}\binom {2n}{n}\) for all \(n \in \mathbb {N}\). Then,

\[ \det \! \left(\left(c_{i+j-2}\right)_{1 \le i \le k,\; 1 \le j \le k}\right) = \det \! \begin{pmatrix} c_0 & c_1 & \cdots & c_{k-1} \\ c_1 & c_2 & \cdots & c_k \\ \vdots & \vdots & \ddots & \vdots \\ c_{k-1} & c_k & \cdots & c_{2k-2} \end{pmatrix} = 1. \]
Proof

We use not the lattice \(\mathbb {Z}^2\), but a different digraph: the simple digraph with vertex set \(\mathbb {Z} \times \mathbb {N}\) and arcs \((i,j) \to (i+1, j+1)\) for all \((i,j) \in \mathbb {Z} \times \mathbb {N}\) and \((i,j) \to (i+1, j-1)\) for all \((i,j) \in \mathbb {Z} \times \mathbb {P}\). It is easy to see that this digraph is acyclic and path-finite.

Set \(K = \mathbb {Z}\) and \(w(a) = 1\) for each arc \(a\). Define \(A_i := (-2(i-1), 0)\) and \(B_i := (2(i-1), 0)\) for \(i \in [k]\).

The Catalan number \(c_n\) counts the paths from \((0,0)\) to \((2n,0)\) on this digraph (Dyck paths). Hence \(c_n\) also counts the paths from \((i,0)\) to \((2n+i, 0)\) for any \(i \in \mathbb {N}\). By Lemma 5.184, the number of paths from \(A_i\) to \(B_j\) is \(c_{i+j-2}\). Hence the path weight matrix is the Catalan Hankel matrix (Lemma 5.188).

It is not hard to show (Lemma 5.193) that there is only one nipat from \(\mathbf{A}\) to \(\mathbf{B}\). Moreover, there are no nipats from \(\mathbf{A}\) to \(\sigma (\mathbf{B})\) for \(\sigma \ne \operatorname {id}\) (by an argument analogous to Corollary 5.175). Hence, by Theorem 5.155, the determinant equals \(1\).

5.5.7 Bridge between path representations

Lemma 5.195 Lattice path conversion is a bijection

There is a bijection between step-based lattice paths (lists of east/north steps starting at a given point) and vertex-based digraph paths in \(\mathbb {Z}^2\) starting at that point. The forward direction computes the list of visited vertices; the backward direction recovers the step sequence from consecutive vertex pairs.

noncomputable def LGV.latticePath'Equiv (start : × ) :
  • One or more equations did not get rendered due to their size.
Proof

The forward map is injective (Lemma 5.196) and surjective (Lemma 5.197), establishing the equivalence.

Lemma 5.196 Step-to-vertex map is injective

Different step sequences starting from the same point produce different vertex-based paths.

Proof

By induction on the path length. If two step sequences produce the same vertex list, the second vertices must agree. Since each step (east or north) produces a distinct target from the same source, the first steps must be equal. Apply the induction hypothesis to the tails.

Lemma 5.197 Step-to-vertex map is surjective

Every vertex-based path in the integer lattice starting at a given point is the image of some step sequence.

theorem LGV.LatticePath'.toPath_surjective (start : × ) (p : integerLattice.Path) :
p.start = start∃ (path : LatticePath'), path.toPath start = p
Proof

Convert the path’s vertex list to a step list by recovering each step from consecutive vertex pairs: if the \(x\)-coordinate increases by \(1\), the step is east; otherwise it is north. The round-trip identity follows by construction.

Lemma 5.198 Path tuple bijection preserves intersection

A step-based lattice path tuple is intersecting if and only if the corresponding vertex-based path tuple is intersecting.

Proof

Both representations check whether any two paths share a vertex. Since the step-to-vertex map preserves the vertex list, a vertex \(v\) appears in two step-based paths if and only if it appears in the corresponding vertex-based paths.