Square Maximality for Spanning Trees of Induced Grid Subgraphs

Among induced square-lattice graphs on n2 vertices, the n×n square uniquely maximizes spanning trees.

Abstract

For a finite S⊂Z2, let τ(S) be the number of spanning trees of its induced square-lattice graph. For positive integers r,s, set Λr,s={0,…,r−1}×{0,…,s−1} and τ(r,s)=τ(Λr,s). We prove that, for every n≥1,

|S|=n2⟹τ(n,n)≥τ(S),

with equality exactly for n×n lattice squares. More precisely, suppose that |S|=n2, that its induced graph is connected, and that Λr,s is its minimal rectangular hull after translation; then |Λr,s∖S|=rs−n2. Interchanging r and s if necessary,

log⁡τ(r,s)−log⁡τ(S) ≥ 4GCatπ(rs−n2) ≥ log⁡τ(r,s)−log⁡τ(n,n),

where GCat is Catalan’s constant. Filling in the hull is worth at least the square-lattice tree entropy per vertex added, and enlarging the n×n square to the hull at most that; the same number of vertices is added in each case, so cancelling log⁡τ(r,s) gives the theorem.

Background. In 1999, Chung obtained boundary-sensitive estimates for spanning-tree counts in lattice subgraphs [Chu99]. In 2010, Swanepoel proposed on MathOverflow that square shapes should maximize the count at fixed cardinality [Swa10]. Procaccia and Tucker-Foltz recorded the conjecture in the research literature in 2022 [PTF22], and Tapp established general boundary-sensitive grid-graph bounds in 2024 [Tap24]. In 2026, Zhang proved exact balancing for free rectangular grids [Zha26a], then extended the extremal result to pure Cartesian-product families with free and periodic boundary conditions and, in the first version of that paper, formulated the induced-subgraph conjecture for all d≥2 [Zha26b]. The present note proves the square-maximality conjecture recorded by Procaccia and Tucker-Foltz in 2022, resolving for arbitrary finite induced subgraphs of the square lattice both the question proposed by Swanepoel in 2010 and the two-dimensional case of that original conjecture. Version 2 of [Zha26b] cites this planar result and retains the conjecture for d≥3.

1 Introduction

Let L be the infinite square-lattice graph with vertex set Z2. Vertices x=(x1,x2) and y=(y1,y2) are adjacent when

|x1−y1|+|x2−y2|=1.

We call every finite subgraph of L a square-lattice graph. For a finite graph G, write V(G) and E(G) for its vertex and edge sets, and let τ(G) denote its number of spanning trees. We set τ(G)=0 when G is disconnected and τ(G)=1 when G consists of a single vertex. For a finite set S⊂Z2, let L[S] be the subgraph induced by S, and write

τ(S):=τ(L[S]).

For positive integers r,s, set

Λr,s:={0,…,r−1}×{0,…,s−1},Rr,s:=L[Λr,s],τ(r,s):=τ(Rr,s).

All logarithms are natural. We use

GCat:=∑j≥0(−1)j(2j+1)2

for Catalan’s constant.

Conjecture 1.1 ([PTF22]). Let n≥1, and let H be a finite connected subgraph of L with |V(H)|=n2. Then

τ(H)≤τ(n,n).

For a graph H in Conjecture 1.1, put S:=V(H). Adding all lattice edges with both endpoints in S produces L[S], and every spanning tree of H remains a spanning tree of L[S]. Thus

H⊆L[S],τ(H)≤τ(S),

so it suffices to consider induced subgraphs. If H≠L[S], adding a missing lattice edge strictly increases the spanning-tree count: adding that edge to any spanning tree of H and deleting one edge from the resulting cycle produces a new spanning tree containing the added edge. We prove the conjecture and characterize equality.

Theorem 1.2 (Square maximality). Let n≥1, and let S⊂Z2 be finite with |S|=n2. Then

τ(S)≤τ(n,n).

Equality holds if and only if S is an n×n lattice square, up to translation and the symmetries of the square lattice.

1.1 Outline of the proof

Theorem 1.2 follows from two finite inequalities carrying the same constant: one compares rectangles of different areas, the other compares a set with its rectangular hull.

  1. Rectangular area penalty (Lemma 3.1). For positive integers n,r,s with r≤s and rs≥n2,

    log⁡τ(r,s)−log⁡τ(n,n)≤4GCatπ(rs−n2),

    with equality only when r=s=n. The proof telescopes log⁡τ in one side length, drawing on the rectangular product and hyperbolic formulas, the trapezoidal estimate, and the residual bounds of [Zha26a]; the individual references are given in Section 3.

  2. Normalized rectangular-hull inequality (Lemma 4.1). Let S⊂Z2, suppose that L[S] is connected, and suppose that the smallest axis-parallel lattice vertex rectangle containing S is Λr,s after translation. Then

    log⁡τ(S)−log⁡τ(r,s)≤−4GCatπ|Λr,s∖S|.

    Interior vacancy components are controlled by planar duality and Tapp’s bound (Theorem 2.1). Boundary-attached vacancies are handled by Lemma 5.1 and the sliding-window and closed-walk arguments in Section 5.

  3. Exact matching and square maximality (Theorem 1.2). If L[S] is connected, |S|=n2, and the smallest axis-parallel lattice vertex rectangle containing S is Λr,s, then

    |Λr,s∖S|=rs−n2,

    and the two inequalities match exactly:

    log⁡τ(S)−log⁡τ(n,n)≤−4GCatπ(rs−n2)+4GCatπ(rs−n2)=0.

    The strictness of the rectangular estimate forces r=s=n, after which equality of cardinalities forces S=Λn,n, up to lattice symmetry.

Kirchhoff’s Matrix–Tree Theorem is the classical starting point for exact spanning-tree enumeration [Kir47]. Square-lattice tree entropy and product formulas have been studied extensively; we use the standard closed-walk evaluation recorded, for example, in [SW00]. Tapp proved boundary-sensitive upper and lower bounds for arbitrary finite grid graphs [Tap24]. The rectangular balancing theorem gives the sharp finite comparison within the free rectangular family [Zha26a], while the product-grid extension studies other boundary conditions and higher-dimensional product families [Zha26b].

Organization. Section 2 fixes notation and records the external inputs. Section 3 proves the rectangular estimate. Sections 4 and 5 prove the normalized hull inequality. Section 6 completes the proof of Theorem 1.2, and Section 7 discusses the argument.

2 Preliminaries and Notation

Empty products and 0×0 determinants are equal to one. The free-boundary constant is

α:=arsinh(1)=log⁡(1+2).

The square-lattice tree entropy is 4GCat/π.

For v∈Z2, let ◻v be the unit-square graph having v as its bottom-right corner. Following [Tap24, Definition 6], the top-left boundary of a finite square-lattice graph H is

∂H^:={v∈V(H):◻v is not a subgraph of H}.

Let sq(H) denote the number of unit lattice squares whose four boundary edges belong to H. Thus sq(H)=|V(H)|−|∂H^|.

Theorem 2.1 ([Tap24, Theorem 9]). If H is a finite connected square-lattice graph, then

log⁡τ(H)≥4GCatπsq(H).

We also use two standard facts about spanning trees. First, if G is a connected planar multigraph, let G⋆ denote its geometric dual, including the exterior dual vertex. Deletion of a primal edge corresponds to contraction of its dual edge, so the cycle matroids of G and G⋆ are dual. For an edge set A⊆E(G), let G/A denote the multigraph obtained by simultaneously contracting the edges of A, discarding the resulting loops and retaining parallel-edge multiplicities.

Second, if T is a uniform spanning tree of a connected multigraph G and F is a forest, then

Pr(F⊆T)=τ(G/F)τ(G).

The transfer-current theorem represents this probability as a principal minor of a positive semidefinite kernel [BP93]. Hadamard–Fischer therefore implies that, for an integer d≥1 and pairwise disjoint edge sets F1,…,Fd whose union is a forest,

(2.1)Pr(⋃i=1dFi⊆T)≤∏i=1dPr(Fi⊆T).

3 Rectangular Area Penalty

We first compare a rectangle whose area is at least n2 with the n×n square.

Lemma 3.1 (Rectangular area penalty). Let n,r,s be positive integers with r≤s and rs≥n2. Then

(3.1)log⁡τ(r,s)−log⁡τ(n,n)≤4GCatπ(rs−n2).

Equality holds if and only if r=s=n.

Proof. Both cases below telescope log⁡τ in one side length. Each increment splits into a main term, depending only on the side length held fixed, and a residual. The main terms supply the entropy constant together with a deficit of at least α; each residual sum contributes less than α. The strict inequality comes from that margin.

For 0≤x≤1 and every integer a≥1, define

c(x)=arcosh(2−cos⁡πx),Ca=∑j=1a−1c(j/a).

Set

εa:=a4GCatπ−α−Ca.

The rectangular product formula, its hyperbolic reduction, and the trapezoidal estimate in [Zha26a, Proposition 2.1, equations (3.1)–(3.2), Lemmas 3.1, 3.2, and 5.1, and equation (5.6)] give

(3.2)Ca=a4GCatπ−α−εa,εa≥0,εaa is nonincreasing.

The identification of the integral in the main term with 4GCat/π is [Zha26a, Appendix Lemma A.3].

For positive integers a,t, define

Ra(t):=∑j=1a−1log⁡1−e−2(t+1)c(j/a)1−e−2tc(j/a).

The same hyperbolic formula gives

(3.3)Δa(t):=log⁡τ(a,t+1)τ(a,t)=Ca+Ra(t),

and Ra(t)≥0. These formulas include a=1 by the empty-product convention.

Since c is concave, c(0)=0, and c(1)=2α, for 1≤j≤a−1 we have

c(j/a)≥2αja.

For integers u≥t≥a, set

q:=e−4α=(3−22)2,K:=∑j≥1−log⁡(1−qj).

The residuals telescope to give

∑v=tu−1Ra(v)=∑j=1a−1log⁡1−e−2uc(j/a)1−e−2tc(j/a).

For j≥1, the estimate

−log⁡(1−qj)≤qj1−qj≤qj1−q

therefore gives the uniform bound

(3.4)0≤∑v=tu−1Ra(v)<K≤q(1−q)2=132<α.

Suppose first that r≤n≤s. Put

k=n−r,ℓ=s−n,δ=rs−n2=ℓr−kn.

Telescoping (3.3) and using symmetry gives

(3.5)log⁡τ(r,s)τ(n,n)=∑t=ns−1Δr(t)−∑t=rn−1Δn(t).

Substituting (3.3) splits the right side of (3.5) into a C-part and a residual part:

log⁡τ(r,s)τ(n,n)=(ℓCr−kCn)+(∑t=ns−1Rr(t)−∑t=rn−1Rn(t)).

We bound the two in turn.

The area condition δ≥0 reads ℓr≥kn. If the rectangles are distinct it forces ℓ−k≥1: when k=0, distinctness implies ℓ≥1; when k>0, the inequality ℓr≥kn together with r<n gives ℓ>k. The monotonicity in (3.2) gives εr/r≥εn/n, whence

ℓεr≥ℓrnεn≥kεn.

By (3.2) the C-part is therefore

ℓCr−kCn=δ4GCatπ−(ℓ−k)α−ℓεr+kεn≤δ4GCatπ−(ℓ−k)α.

In the residual part the subtracted sum is nonnegative, and the first sum is less than K<α by (3.4). For distinct rectangles ℓ−k≥1, so the two parts together are less than δ4GCat/π; thus (3.1) is strict unless r=s=n.

It remains to consider n≤r≤s. For a≥1, symmetry and (3.3) give

log⁡τ(a+1,a+1)τ(a,a)=Δa(a)+Δa+1(a).

The C-part is

(2a+1)4GCatπ−2α−εa−εa+1.

The first residual, Ra(a), is less than 1/32. For 1≤j≤a, concavity also gives

2ac(j/(a+1))≥4aa+1αj≥2αj.

With q0=e−2α=3−22, the second residual, Ra+1(a), is therefore less than

∑j≥1−log⁡(1−q0j)≤q0(1−q0)2=14.

Since 1/32+1/4<2α, we obtain

log⁡τ(a+1,a+1)−log⁡τ(a,a)<(2a+1)4GCatπ.

If r>n, summing this strict inequality gives

(3.6)log⁡τ(r,r)−log⁡τ(n,n)<4GCatπ(r2−n2);

when r=n, the left side and the right side are both zero.

If s>r, then (3.2) and (3.4) give

log⁡τ(r,s)τ(r,r)=(s−r)Cr+∑t=rs−1Rr(t)(3.7)<4GCatπr(s−r).

Indeed, before the last inequality the right side is at most

4GCatπr(s−r)−(s−r)α+K,

which is strictly smaller because s−r≥1 and K<α. When s=r, both sides of the corresponding non-strict inequality are zero. Adding (3.6) and (3.7),

log⁡τ(r,s)τ(n,n)=log⁡τ(r,r)τ(n,n)+log⁡τ(r,s)τ(r,r)≤4GCatπ(r2−n2)+4GCatπr(s−r)=4GCatπ(rs−n2),

which is (3.1). The first summand is strict when r>n and the second when s>r, so the inequality is strict unless r=s=n. This also covers n=1. □

4 Normalized Rectangular-Hull Inequality

For a finite nonempty S⊂Z2, define its coordinate extrema by

x−:=min(x,y)∈Sx,x+:=max(x,y)∈Sx,y−:=min(x,y)∈Sy,y+:=max(x,y)∈Sy.

Its minimal rectangular vertex hull is

{x−,…,x+}×{y−,…,y+}.

Thus, after translation, the hull is Λr,s, where r=x+−x−+1 and s=y+−y−+1. The central estimate is the following.

Lemma 4.1 (Normalized hull inequality). Let S⊂Z2 be finite, suppose that L[S] is connected, and suppose after translation that Λr,s is its minimal rectangular vertex hull. Then

(4.1)log⁡τ(S)−log⁡τ(r,s)≤−4GCatπ|Λr,s∖S|.

The proof runs to the end of Section 5. Passing to the planar dual converts the deletion of a set of vertices into the event that a prescribed forest is contained in a uniform spanning tree; the missing vertices are then split into king components, and negative correlation reduces the lemma to one bound per component. Components disjoint from the perimeter are handled below by counting the spanning trees of a union of unit squares in the dual, the rest by the determinant estimate of Section 5.

If r=1 or s=1, the connectedness of L[S] and the minimality of the hull imply S=Λr,s and τ(S)=τ(r,s), so (4.1) is immediate. We assume below that r,s≥2.

4.1 Dual Contractions

Let D=Rr,s⋆ be the geometric planar dual, including its exterior vertex. If e∈E(Rr,s), let e⋆ be its corresponding dual edge. For X⊆Λr,s, let

EX⋆:={e⋆:e∈E(Rr,s) has at least one endpoint in X},

and let HX be the dual subgraph formed by EX⋆, with isolated vertices suppressed.

Whenever L[Λr,s∖X] is connected, planar matroid duality gives

τ(Λr,s∖X)=τ(D/EX⋆).

Planar tree duality also gives τ(D)=τ(r,s). Indeed, deleting the primal edges incident with X leaves the connected graph Rr,s[Λr,s∖X], together with the isolated vertices of X. Its cycle-matroid bases are exactly the spanning trees of the connected component; the isolated vertices contribute no edge choice. Deletion of the primal edges is contraction of their duals.

Call a component nontrivial if it contains at least one edge, and let FX be a spanning forest of the nontrivial components of HX. Contracting FX makes every edge of EX⋆∖FX a loop, so the preceding duality identity and the contraction identity give

(4.2)τ(Λr,s∖X)τ(r,s)=Pr(FX⊆T),

where T is a uniform spanning tree of D.

For z=(z1,z2)∈Z2, set ‖z‖∞:=max{|z1|,|z2|}. Two lattice vertices u,v are king-adjacent when ‖u−v‖∞=1. The perimeter vertex set of the rectangular hull is

∂Λr,s:={(x,y)∈Λr,s:x∈{0,r−1} or y∈{0,s−1}}.

Partition Λr,s∖S into components for king adjacency. Let V∂vac be the union of those components that meet ∂Λr,s, and denote the remaining, interior components by

J1,…,Jm.

Here m may be zero. For a primal vertex v, call the subgraph formed by the duals of the primal edges incident with v its dual face-star. Distinct king components have disjoint dual edge sets. Two primal vertices can be incident with a common bounded unit face only if their ℓ∞-distance is at most one; their dual face-stars are therefore vertex-disjoint, except that different boundary components can share the exterior dual vertex. Within one king component, the face-stars of successive vertices meet, so their union is connected; for a boundary component, one of these stars also meets the exterior vertex. Hence HV∂vac is connected when V∂vac≠∅, and each HJi is connected. Set FV∂vac=∅ when V∂vac=∅; otherwise choose a spanning tree of HV∂vac. For 1≤i≤m, choose a spanning tree FJi of HJi. These forest edge blocks are pairwise disjoint, and their union is a spanning forest of the nontrivial components of HΛr,s∖S.

We record why all deletion graphs used here are connected. Every king component C has a nearest-neighbour edge to S: on a nearest-neighbour path from C to S, the first vertex outside C cannot lie in another king component. Moreover, a diagonal king step between u,v∈C can be replaced by a two-edge nearest-neighbour path through an orthogonal corner of their unit square. If the corner is in Λr,s∖S, it is king-adjacent to u and hence belongs to C; otherwise it belongs to S. Thus L[S∪C] is connected. It follows that every undeleted king component is joined to the common connected subgraph L[S]. Hence L[Λr,s∖V∂vac] and every L[Λr,s∖Ji] are connected.

Applying (4.2) and (2.1) to the disjoint forest edge blocks gives

(4.3)τ(S)τ(r,s)≤τ(Λr,s∖V∂vac)τ(r,s)∏i=1mτ(Λr,s∖Ji)τ(r,s).

The factor indexed by V∂vac is one when V∂vac=∅.

4.2 Interior Vacancy Components

For each i∈{1,…,m}, put J:=Ji. The following argument is vacuous when m=0. The dual graph HJ is a finite connected square-lattice graph. Every v∈J contributes a complete unit square to HJ, formed by the four duals of the primal edges incident with v. Different vertices give different squares, so

sq(HJ)≥|J|.

By Theorem 2.1,

τ(HJ)≥exp(4GCatπ|J|).

For every spanning tree F of HJ, (4.2) gives

Pr(F⊆T)=τ(Λr,s∖J)τ(r,s).

These events are pairwise incompatible: the union of two distinct spanning trees on the same vertex set contains a cycle, while T is acyclic. Summing over the spanning trees of HJ therefore gives

τ(HJ)τ(Λr,s∖J)τ(r,s)=∑FPr(F⊆T)≤1,

which with the preceding consequence of Tapp’s theorem yields

(4.4)τ(Λr,s∖J)τ(r,s)≤1τ(HJ)≤exp(−4GCatπ|J|).

The argument used that J misses the perimeter: only then does each v∈J have four incident primal edges, whose duals close into a unit square. A vacancy on ∂Λr,s has fewer, so the count above does not apply to it, and the same exponential factor for the union V∂vac of the boundary-attached components is obtained differently, in Section 5.

5 Boundary-Attached Vacancies

What is proved here is a comparison of two determinants. Both τ(r,s) and τ(Λr,s∖V∂vac) have the form det(4I−A) for the adjacency matrix of a set of unit faces, and expanding log⁡det in closed walks turns their ratio into a sum, over closed walks, of the number of placements meeting a face with a corner in V∂vac. The first three subsections bound that number by |V∂vac| plus a multiple of the number of vacancy runs interior to a row or column; the last assembles the estimate.

Retain the boundary-vacancy set V∂vac⊆Λr,s∖S from the preceding section. For z∈Z2 and A⊆Z2, define the translate

z+A:={z+a:a∈A}.

Let

Φ={0,…,r−2}×{0,…,s−2}

index the unit faces of Rr,s. The face indexed by z∈Φ has corner set z+{0,1}2. Define the marked and unmarked face sets by

M={z∈Φ:(z+{0,1}2)∩V∂vac≠∅},U=Φ∖M.

An interval component is a maximal nonempty set of consecutive integers. Let ρx be the total number of interval components of Λr,s∖V∂vac in all horizontal rows, and let ρy be the corresponding total in all vertical columns. Put

gx=ρx−s,gy=ρy−r.

Every row and column contains a vertex of S. Indeed, minimality gives a vertex of S on each of the two extreme columns, and a nearest-neighbour path in S between them visits every intermediate column. The row statement is identical. Consequently gx,gy≥0. Here a run of V∂vac is an interval component of V∂vac in a row or column, and it is internal when it touches neither endpoint of that row or column. Then gx is exactly the total number of horizontally internal runs of V∂vac, and gy is the corresponding number of vertically internal runs.

5.1 One-Dimensional Windows

We begin with an elementary interval estimate.

Lemma 5.1. Let L≥0 be an integer, let B⊆{0,…,L}, and let i(B) be the number of interval components of B that touch neither endpoint. For an integer p with 0≤p≤L, the number of integer intervals

[t,t+p]:={t,t+1,…,t+p}⊆{0,…,L},t∈Z,

that meet B is at most

|B|+pi(B).

Proof. A boundary run of length a is met by at most a such intervals, whereas an internal run of length a is met by at most a+p. Summing over the runs proves the claim; any double counting only strengthens the upper bound. □

For an integer p with 0≤p≤r−1, define

Yp={(x,y)∈{0,…,r−1−p}×{0,…,s−1}:([x,x+p]×{y})∩V∂vac≠∅}.

Applying Lemma 5.1 in each row gives

(5.1)|Yp|≤|V∂vac|+pgx.

5.2 A Sliding-Window Injection

For an integer x with 0≤x≤r−1−p, let

Yp,x={y:(x,y)∈Yp}.

The second ingredient is

(5.2)∑x=0r−1−pi(Yp,x)≤gy.

It is proved in two steps: each internal interval component of Yp,x contains the projection of a connected piece of vacancy runs lying in the window and carrying no run that touches row 0 or row s−1; and those pieces, taken over all windows, inject into the vertically internal runs of V∂vac.

To prove it, form the full run graph, whose vertices are the maximal vertical runs of V∂vac. Join two runs in adjacent columns when their integer intervals overlap or are adjacent, and mark a run if it touches row 0 or row s−1. The connected components of the full run graph are precisely the king components of V∂vac. Since every such component meets ∂Λr,s, it contains either a marked run or a run in column 0 or r−1.

Fix once and for all a rooted spanning tree in every component of the full run graph. Use a marked run as the root whenever possible, and otherwise use a run in column 0 or r−1. For the window of columns [x,x+p], consider the subgraph of the full run graph induced by the run vertices whose columns lie in this window. In each of its components containing no marked run, choose a run of minimum depth, where depth is measured in the previously fixed rooted tree.

If the chosen run is not the root, its parent lies outside the window; otherwise the parent would belong to the same induced component at a smaller depth. Parent and child lie in adjacent columns. If the parent is to the left, then x is the child’s column; if the parent is to the right, then x is the child’s column minus p. Thus the oriented parent–child pair determines the window start uniquely. If the chosen run is an unmarked root, column 0 forces x=0, while column r−1 forces x=r−1−p. Therefore the pairs

(window,unmarked induced component)

inject into the unmarked vertices of the full run graph. These vertices are exactly the vertically internal runs of V∂vac, of which there are gy.

Every internal interval component of Yp,x contains the vertical projection of an induced run-graph component containing no marked run. The projection of a connected induced run-graph component is itself an integer interval, because adjacent runs overlap or are one unit apart. Distinct interval components therefore contain distinct such induced components. This proves (5.2).

For integers a,b with 1≤a≤r and 1≤b≤s, define

wina,b(V∂vac):=|{(x,y)∈Z2:0≤x≤r−a,0≤y≤s−b,([x,x+a−1]×[y,y+b−1])∩V∂vac≠∅}|.

Applying Lemma 5.1 vertically and then using (5.1) and (5.2) gives, for every integer q with 0≤q≤s−1,

(5.3)winp+1,q+1(V∂vac)≤|V∂vac|+pgx+qgy.

5.3 Closed-Walk Charging

For an integer ℓ≥1, put e1=(1,0) and e2=(0,1). A closed step word of length ℓ is a sequence

ω=(d1,…,dℓ),di∈{±e1,±e2},∑i=1ℓdi=0.

Define its partial-sum set by

Pω={0,d1,d1+d2,…,d1+⋯+dℓ},

and set

rx(ω)=maxz∈Pωz1−minz∈Pωz1,ry(ω)=maxz∈Pωz2−minz∈Pωz2.

Let Cℓ be the set of closed words of length ℓ, and put wℓ=|Cℓ|.

We use two exact closed-walk sums. The first is the standard square-lattice tree-entropy identity [SW00]:

(5.4)∑ℓ≥1wℓℓ4ℓ=log⁡4−4GCatπ.

This series is absolutely convergent: w2a=(2aa)2 for a≥1, so its nonzero terms are O(a−2). The second is

(5.5)∑ℓ≥11ℓ4ℓ∑ω∈Cℓ(rx(ω)+1)=log⁡41+2.

We include the proof of (5.5). Let a≥1 and h=2a. A one-dimensional bridge of length h is a sequence γ=(γ0,…,γh) such that γ0=γh=0 and γt−γt−1∈{−1,1} for 1≤t≤h. Define

span(γ):=max0≤t≤hγt−min0≤t≤hγt.

Thus span(γ)+1 is the number of integer levels visited by γ. For an integer k>0 and a bridge that visits k, let σk be its first visit to k, and set

γt′={γt,t≤σk,2k−γt,t≥σk.

This reflection is a bijection with unrestricted walks of length h from 0 to 2k. The negative levels are symmetric, while level zero is visited by every bridge. Summing over levels rather than over bridges,

∑γ0=γh=0γt−γt−1∈{−1,1}, 1≤t≤h(span(γ)+1)=(ha)+∑k=1a[(ha+k)+(ha−k)]=2h.

For even ℓ, condition a two-dimensional closed word on the even number h of its horizontal steps and on their positions. Write [ζ0] for extraction of the constant term in the formal variable ζ. The bridge identity is also immediate when h=0. Using it gives

∑ω∈Cℓ(rx(ω)+1)=∑0≤h≤ℓh even(ℓh)2h(ℓ−h(ℓ−h)/2)=[ζ0](2+ζ+ζ−1)ℓ=(2ℓℓ).

There are no closed words for odd ℓ. For |t|<1/4, define

B(t):=∑ℓ≥1(2ℓℓ)tℓℓ=2log⁡21+1−4t.

At t=±1/4, its terms are O(ℓ−3/2), so both boundary series converge. Abel’s theorem extends the displayed closed form to both endpoints, applied to B(−t) for the negative endpoint. Taking the even part gives

B(1/4)+B(−1/4)2=log⁡41+2,

which proves (5.5).

Define

N(M;ω):=|{z∈Z2:z+Pω⊆Φ, (z+Pω)∩M≠∅}|.

Its bounding face rectangle has rx(ω)+1 face columns and ry(ω)+1 face rows. The corresponding primal vertex window has rx(ω)+2 columns and ry(ω)+2 rows and meets V∂vac. For fixed ω, translation by its coordinatewise minima makes the map from a start z to this window’s lower-left corner injective. If either span is too large for Φ, there is no admissible start and the desired estimate is immediate. Otherwise, taking p=rx(ω)+1 and q=ry(ω)+1 in (5.3) yields

(5.6)N(M;ω)≤|V∂vac|+gx(rx(ω)+1)+gy(ry(ω)+1).

5.4 The Determinant Estimate

Recall that M and U=Φ∖M are respectively the marked and unmarked face sets. Every face in M belongs to a face-star indexed by V∂vac. Since every king component of V∂vac meets the boundary, contraction of EV∂vac⋆ joins all these face vertices to the exterior dual vertex. On the other hand, a face indexed by U has no corner in V∂vac, so all four primal boundary edges remain. Thus the bounded faces of Rr,s[Λr,s∖V∂vac] are exactly those indexed by U.

For Y⊆Φ, let AY be the adjacency matrix of the face-grid graph induced by Y, and let I denote the identity matrix of the appropriate order. Rooted planar duality and the Matrix–Tree Theorem [Kir47] give

(5.7)τ(r,s)=det(4I−AΦ),τ(Λr,s∖V∂vac)=det(4I−AU).

Primal bridges become dual loops and do not affect the determinant. When U=∅, the second determinant is the 0×0 determinant and equals one.

The horizontal edges of Λr,s∖V∂vac number |Λr,s∖V∂vac|−ρx, and the vertical edges number |Λr,s∖V∂vac|−ρy. Therefore

|E(Rr,s[Λr,s∖V∂vac])|=2|Λr,s∖V∂vac|−ρx−ρy.

Since the graph is connected, Euler’s formula, together with gx=ρx−s, gy=ρy−r, and |Φ|=(r−1)(s−1), gives

|U|=|E(Rr,s[Λr,s∖V∂vac])|−|Λr,s∖V∂vac|+1=|Λr,s∖V∂vac|−ρx−ρy+1,

and therefore

(5.8)|M|=|V∂vac|+gx+gy.

The spectral radius of the rectangular face adjacency is

2cos⁡πr+2cos⁡πs<4.

Since AU is a principal submatrix, its spectral radius is also below 4, with the empty matrix assigned spectral radius zero. Hence, for Y∈{Φ,U}, the matrix trace tr satisfies

(5.9)log⁡det(4I−AY)=|Y|log⁡4−∑ℓ≥1tr(AYℓ)ℓ4ℓ.

Both log-determinant series are absolutely convergent by the preceding spectral-radius bound.

The trace difference counts precisely the closed-walk starts in Φ whose walk meets M:

(5.10)tr(AΦℓ)−tr(AUℓ)=∑ω∈CℓN(M;ω).

All terms used below are nonnegative, and (5.4)–(5.5) show that the dominating series are finite. Thus Tonelli’s theorem justifies the ensuing interchanges of sums. Subtract the two instances of (5.9), substitute (5.10), and apply the charging bound (5.6). Evaluating the three resulting series by (5.4) and (5.5), the gy term by symmetry between the coordinates, and then inserting (5.8) and the identifications (5.7), gives

log⁡τ(r,s)τ(Λr,s∖V∂vac)≥|M|log⁡4−|V∂vac|(log⁡4−4GCatπ)−(gx+gy)log⁡41+2=4GCatπ|V∂vac|+α(gx+gy)≥4GCatπ|V∂vac|.

We have proved the boundary factor

(5.11)τ(Λr,s∖V∂vac)τ(r,s)≤exp(−4GCatπ|V∂vac|).

Completion of the proof of Lemma 4.1. Substitute (4.4) and (5.11) into (4.3). Since Λr,s∖S is the disjoint union of V∂vac,J1,…,Jm, we obtain

τ(S)τ(r,s)≤exp(−4GCatπ|Λr,s∖S|).

Both tree counts are positive because L[S] and Rr,s are connected. Taking logarithms gives (4.1). □

6 Proof of Square Maximality

Proof of Theorem 1.2. Let |S|=n2. If L[S] is disconnected, then τ(S)=0<τ(n,n).

Assume that L[S] is connected. After translation and an interchange of coordinates, let its minimal rectangular vertex hull be Λr,s, where r≤s. Then

rs≥n2,|Λr,s∖S|=rs−n2.

Applying Lemmas 3.1 and 4.1 and adding their log-difference estimates gives

log⁡τ(S)−log⁡τ(n,n)≤−4GCatπ(rs−n2)+4GCatπ(rs−n2)=0.

This proves the inequality.

If (r,s)≠(n,n), Lemma 3.1 is strict, so equality is impossible. If r=s=n, then the hull and S both have n2 vertices, hence S=Λn,n. Undoing the translation and lattice symmetry gives the stated equality characterization. □

7 Discussion

The rectangular area penalty bounds the gain available from enlarging the hull, and the normalized hull inequality charges every omitted vertex by exactly the same entropy constant. In log-difference form the two estimates add, their constants cancel, and strictness comes entirely from the rectangular estimate.

Use of AI tools

A substantial part of the reasoning in this paper was developed with the assistance of a large language model. Both runs used Work mode with Speed mode enabled. GPT-5.6 Sol, at the Extra High reasoning setting, worked on the initial prompt below for 87 minutes 7 seconds and returned incomplete results. GPT-5.6 Sol Ultra continued from those results under the shorter follow-up prompt and produced its result after 199 minutes 9 seconds. The raw output became the basis for a substantial part of the present argument, in particular Lemmas 3.1 and 4.1. I manually checked the argument, prepared the bibliography, checked each citation against its source, and wrote the present note. Both prompts are published below.

I am deeply grateful to Sloan Nietert for many helpful suggestions and insightful discussions. I also thank him for collaborating with me on the prompting strategy for this problem and, in particular, for his “breakthrough” prompt.

Final verification (August 22, 2026). The square-maximality theorem as stated here for arbitrary finite square-lattice subgraphs, together with its equality characterization and complete proof chain, has been formalized in Lean 4 and checked by the Lean kernel. The formalization and its reproducible trust audit are available in the public repository. I also completed a paper-to-Lean specification audit matching the definitions, hypotheses, intermediate results, and conclusions in the formalization to the mathematical claims in this manuscript.

Palomar registration (August 23, 2026). The Lean verification has been registered in the Palomar Registry at a fixed commit of the public submission repository. The registration metadata records the role of the model and the subsequent human and kernel-level checks.

References

  1. [BP93] Robert Burton and Robin Pemantle. Local characteristics, entropy and limit theorems for spanning trees and domino tilings via transfer-impedances. The Annals of Probability, 21(3):1329–1371, 1993. doi:10.1214/aop/1176989121.
  2. [Chu99] Fan R. K. Chung. Spanning trees in subgraphs of lattices. In Applications of Curves over Finite Fields, volume 245 of Contemporary Mathematics, pages 201–219. American Mathematical Society, 1999. doi:10.1090/conm/245/03734.
  3. [Kir47] Gustav Kirchhoff. Ueber die Auflösung der Gleichungen, auf welche man bei der Untersuchung der linearen Vertheilung galvanischer Ströme geführt wird. Annalen der Physik, 148(12):497–508, 1847. doi:10.1002/andp.18471481202.
  4. [PTF22] Ariel D. Procaccia and Jamie Tucker-Foltz. Compact redistricting plans have many spanning trees. In Proceedings of the 2022 Annual ACM-SIAM Symposium on Discrete Algorithms, pages 3754–3771. SIAM, 2022. doi:10.1137/1.9781611977073.148.
  5. [SW00] Robert Shrock and F. Y. Wu. Spanning trees on graphs and lattices in d dimensions. Journal of Physics A: Mathematical and General, 33(21):3881–3902, 2000. doi:10.1088/0305-4470/33/21/303.
  6. [Swa10] Konrad J. Swanepoel. Comment on “Number of spanning trees in a grid.” MathOverflow, January 7, 2010.
  7. [Tap24] Kristopher Tapp. Spanning tree bounds for grid graphs. The Electronic Journal of Combinatorics, 31(1):P1.26, 2024. doi:10.37236/12130.
  8. [Zha26a] Jiechen Zhang. The balancing theorem for spanning trees of rectangular grid graphs. arXiv preprint arXiv:2605.23773, 2026. arXiv:2605.23773.
  9. [Zha26b] Jiechen Zhang. Extremal spanning trees in product grid graphs. arXiv preprint, 2026. arXiv:2606.24016v1 (original conjecture); v2 (revised version).