We study uniformity testing for the monomer-dimer model on a known graph G=(V,E). Given samples from an unknown distribution Dw(M)∝∏e∈Mwe over matchings M of G, we ask whether Dw is the uniform distribution over all matchings of G or is ε-far from it in total variation distance.
Our main result is that, for every maximum-degree bound Δ, uniformity can be tested with OΔ(m/ε2) samples, where m=∣E∣. We complement this with an information-theoretic lower bound for general graphs: for every pair of parameters n≤m≤n2, there are graphs with Θ(n) vertices and Θ(m) edges on which every tester requires Ω(m/ε2) samples. Thus, for bounded-degree graph families with m=Θ(n), testing uniformity over the space of matchings has Θ(n/ε2) sample complexity, in contrast with the Θ(n/ε2) samples needed to estimate Dw in total variation distance.
∗This project was carried out during his participation in the 2026 NII International Internship Program.
†Supported by JSPS KAKENHI Grant Number JP24K02903.
Contents
1 Introduction 1
1.1 Our results 2
1.2 Technical overview 3
1.3 Related work 6
1.4 Organization 7
2 Preliminaries 8
2.1 Setup 8
2.2 Uniformity is rigid in the all-matchings model 8
2.3 Conditioning on all other edges 8
2.4 Entropy and Poincare tools on the line graph 9
2.5 A lower bound on edge availability under U 11
3 Upper Bound 12
3.1 Preprocessing: estimating U(Ae) 12
3.2 Screening to bound the weights 13
3.3 The vector Ψ and its mean 14
3.4 Covariance bound when weights are bounded 15
3.5 Quadratic statistic when weights are bounded 16
3.6 Proof of the main upper bound 17
4 Lower Bound 19
4.1 Proof setup 19
4.2 The checkerboard family on K2q,2q 19
4.3 A quadratic log-MGF expansion on K2q,2q 23
4.4 The lower bound on Gt,q 31
A Learning the Matching Gibbs Family 37
1 Introduction
Distribution testing asks how many samples are needed to decide whether an unknown distribution has a prescribed property. Many basic questions are now well understood over unstructured finite domains; see, for example, the surveys [27, 10, 11] and the early work of Batu, Fortnow, Rubinfeld, Smith, and White [3]. In modern applications, however, the objects being sampled are often high-dimensional. Without structural assumptions, even basic testing and learning tasks over domains such as {0,1}n require sample complexity exponential in the dimension (see, e.g., [1, Appendix H.2] and [6, Theorem B.1]).
This curse of dimensionality has motivated a broad line of work on structured high-dimensional distribution testing. For families such as Bayesian networks, Ising models, and other graphical models, low-dimensional local or conditional structure can be used to detect global distance from the target distribution, and more broadly has led to sample- and time-efficient algorithms for testing and learning in important regimes [12, 18, 7, 8]. A natural next question is whether these techniques extend beyond product-like domains: can one test natural high-dimensional distributions whose support itself is defined by hard combinatorial constraints?
We study this question for the monomer-dimer model, equivalently the Gibbs family over all matchings of a known graph. Let G=(V,E) be an undirected graph with m=∣E∣, and let w=(we)e∈E be positive edge weights. The corresponding Gibbs distribution over matchings Dw is supported on the set M(G) of all matchings of G and is defined by
Dw(M)∝e∈M∏we,M∈M(G).
This is the standard weighted form of the monomer-dimer model from statistical physics [22]; equivalently, it is the hard-core model on the line graph L(G), whose vertices are the edges of G. The uniform distribution over all matchings corresponds to the all-one weight vector we≡1. Thus the problem is uniformity testing within a classical m-parameter Gibbs family.
The monomer-dimer model also has a direct modeling interpretation. Vertices represent sites or agents, edges represent possible pairings or interactions, and a matching records a set of pairings that can coexist because no vertex can participate in two pairs. Edge weights then represent local preferences or interaction intensities. This interpretation is common in applications to large communication and social networks, where one is interested in typical matchings and local participation probabilities [25].
In this interpretation, the uniform distribution over all matchings is the reference distribution with no edge-specific preference beyond the hard exclusion constraint itself. Testing uniformity asks whether observed matchings can be explained by the hard constraint alone, or whether they reveal nonuniform edge weights.
A sample from Dw is an edge-incidence vector in {0,1}E, but not an arbitrary one: it must lie in the constrained family M(G). The support can be exponentially large in m: for example, if G is the disjoint union of m edges, then every subset of edges is a matching and ∣M(G)∣=2m. The coordinates are also strongly dependent because choosing one edge deterministically rules out all adjacent edges.
The problem of testing uniformity asks whether an unknown member of this family is the uniform distribution U on M(G):
Given sample access to Dw (with w unknown) over a known graph G=(V,E): how many samples are needed to distinguish between the case Dw=U and the case dTV(Dw,U)≥ε, with probability at least 2/3?
Although this reference distribution is conceptually simple, the tester is not given oracle access to U or an explicit probability table for it. The distribution is specified only through the graph G and the feasible set M(G), which may have exponential size; sampling from U is a separate combinatorial problem.
The statistical difficulty is not merely that the sample space can be exponentially large: ordinary edge marginals are not the right local quantities. An edge may be absent because its own weight is small, or simply because a neighboring edge was selected. Thus the question is whether the matching constraint still leaves enough conditional structure to test the all-one-weight case with fewer samples than learning the full edge-weight model.
1.1 Our results
Our main result is a polynomial-time uniformity tester for bounded-degree graphs with sample complexity OΔ(m/ε2). We also prove a matching information-theoretic lower bound of Ω(m/ε2), in fact for graph families of every density (from bounded to unbounded degrees).
The algorithmic side is the following bounded-degree tester.
Theorem 1.1 (Efficient bounded-degree tester). There is a universal constant C<∞ such that the following holds. For every integer Δ≥1, there is an explicit constant
FΔ≤(CΔ)CΔ5
such that, for every graph G=(V,E) with Δ(G)≤Δ and m=∣E∣≥1, every 0<ε≤1, and every 0<δ<1, there is a tester which distinguishes
H0:Dw=UfromH1:dTV(Dw,U)≥ε
with error probability at most δ, using at most
FΔ(logδ4m+ε2mlog(2/δ))
samples from the unknown distribution. For every fixed Δ, the tester can be implemented in polynomial time in m, 1/ε, and log(2/δ).
For bounded-degree graph families, where m=Θ(n), Theorem 1.1 gives a O(n/ε2)-sample tester. We do not optimize the explicit dependence on Δ.
We next state a complementary lower bound, in a form that covers all graph densities between sparse and dense.
Theorem 1.2 (Lower bound at every density). There are absolute constants c0>0 and ε0>0 such that the following holds. For every pair of integers n,m with n≤m≤n2, there is a graph Gn,m satisfying
∣V(Gn,m)∣=Θ(n),∣E(Gn,m)∣=Θ(m),
such that every tester, given i.i.d. samples from an unknown Gibbs distribution over matchings of Gn,m, distinguishes
H0:Dw=UGn,mfromH1:dTV(Dw,UGn,m)≥ε
with success probability at least 2/3 must use at least
c0ε2m
samples for every 0<ε≤ε0; and m=m(n), where the expression depends on the degree.
Together, Theorems 1.1 and 1.2 show that m is the correct dependence for bounded-degree uniformity testing in this family. This is not the classical N rate for an explicit domain of size N: the domain is M(G), whose size can be exponential in m. Rather, testing is governed by the number of edge parameters. Compared with the Θ(m/ε2) samples needed to learn the full Gibbs family, this gives a quadratic testing-versus-learning separation on bounded-degree graphs.
1.2 Technical overview
The central issue is that a sample is not an unconstrained vector in {0,1}E: once an edge is present, all incident edges are forced to be absent. Thus edge marginals alone are a poor object to compare. The right local question is instead: if no edge adjacent to e is selected, is e itself chosen with probability 1/2, as it would be under U? This turns the matching constraint into local conditional tests.
Upper bound: from global distance to edgewise conditional statistics. The Gibbs family over matchings has a useful rigidity property: Dw=U if and only if we=1 for every edge e. This is why it is informative to look at a single edge after the states of all other edges have been fixed. For a matching M, write Xe(M)=1{e∈M} and Ae(M)=1{no edge adjacent to e is used in M}. When M is sampled from Dw or U, we suppress the argument and regard Xe and Ae as random variables. We also write ξe=Ae(2Xe−1). Conditional on all other coordinates, there are only two cases. If Ae=0, then Xe=0 is forced; if Ae=1, then
Dw(Xe=1∣X−e)=1+wewe,U(Xe=1∣X−e)=21,
where X−e∈{0,1}E∖{e} denotes any fixed configuration other than e (that is feasible for e to be matched, since Ae=1 here). Writing te=(we−1)/(we+1) and ae=Dw(Ae), ξe has expectation aete under Dw and has expectation zero under U. Thus the problem becomes to detect whether the expectations of these statistics are collectively nonzero.
The availability probabilities ae are themselves distribution dependent: changing weights near e can change how often e is available, even if the conditional bias te is small. The screening step estimates ae and aete from samples. To calibrate this step, we compute under U
αe:=U(Ae)=∣M(G)∣∣M(G(e))∣
up to constant relative accuracy using an FPTAS for counting matchings in bounded-degree graphs, where G(e) is obtained by deleting the edges conflicting with e [4]. 1 Thus the tester only needs the
1Note that one can also employ the Jerrum-Sinclair algorithm [24] to estimate the number of matchings, which can bypass the degree restriction here. But the main technical hurdle, which is Proposition 2.4, on the bounded-degree restriction for testing the monomer-dimer model remains.
probabilities αe under U, obtained from matching counts, not an explicit table or sampler for U. Then a small initial block of samples checks whether the empirical availability ae is close to this value under U and whether the empirical average ξe of ξe is close to zero for every edge. If either check fails, we have already detected evidence against uniformity and reject. If the checks pass, then the analysis proves more than empirical closeness: it forces ae≍Δαe, aete small, and in particular we∈[1/2,2] for every edge.
After screening, for each edge we use the normalized statistic
ψe(M):=αeξe(M),Ψ(M)=(ψe(M))e∈E,
where αe is the computed approximation to αe. The normalization makes the coordinates comparable across edges. The numerator ξe is conditionally unbiased under U, so EU[Ψ]=0 regardless of the normalizing constants.
The next step is to show that EDw[Ψ] is large whenever Dw is far from U. This follows the graphical-model testing strategy of reducing global distance to the mean of statistics defined from low-dimensional conditional distributions [12, 18]. Approximate tensorization of entropy on the line graph lets us upper bound DKL(Dw∥U) by a sum of one-edge conditional KL terms. For edge e, this conditional term is zero when Ae=0, because then both Dw and U force Xe=0; when Ae=1, it is the KL between Bernoulli (1+te)/2) and Bernoulli (1/2). Using spectral-independence and entropy-factorization results for hard-core measures on claw-free graphs [15, 16], this gives
After the screening step accepts, the Bernoulli KL is quadratic in te, and the comparison ae≍Δαe turns this local KL bound into a lower bound on ∥EDw[Ψ]∥22. Therefore total variation distance at least ε forces
ν:=EDw[Ψ],∥ν∥22≳Δε2.
Thus we have reduced the problem of testing uniformity to detecting an m-dimensional mean vector whose squared norm is at least a constant multiple of ε2.
The remaining question is why this mean can be tested with only m/ε2 samples rather than m/ε2. We use a quadratic statistic built from Ψ, together with a covariance bound tailored to matchings. Split the samples into two independent blocks and compute
S=⟨Ψ(1),Ψ(2)⟩.
The independence of the two blocks makes S an unbiased estimator of ∥ν∥22; using ∥Ψ∥22 from a single block would require subtracting a noise term and would create another bias-control problem. To bound the variance, we use the Poincaré inequality for the hard-core measure on the line graph, derived from the same spectral-independence and entropy-factorization results [15, 16]. The preliminary checks force we∈[1/2,2], so the Poincaré constant is bounded in terms of the degree rather than the unknown edge weights we. The Poincaré bound is then combined with a purely local sensitivity estimate: changing one edge variable can affect only the coordinates associated with that edge and its incident neighbors, and each such coordinate has magnitude OΔ(1). Hence the covariance matrix of Ψ has operator norm OΔ(1) and squared Frobenius norm OΔ(m). This gives
Var(S)≤OΔ(s2m+s∥ν∥22),
so s≍Δm/ε2 suffices. Repetition gives the stated confidence parameter. The resulting tester is therefore not learning the whole edge-weight vector: it estimates ∥EDw[Ψ]∥22.
Lower bound: hiding many perturbations inside a matching constraint. The lower bound shows that the m dependence is not an artifact of the tester. For bounded-degree graphs, one can already see the right order from disjoint edges, where the model contains product Bernoulli distributions. The main point of the lower bound is that the same lower bound persists in dense graphs, where the matching constraint creates strong dependencies and a sample contains only O(n) occupied edges even though the graph may have Θ(n2) edges.
The construction starts from one dense component Hq=K2q,2q. The left and right vertices are partitioned into pairs, and each block between a left pair and a right pair is assigned the checkerboard matrix
B=(1−1−11).
For a sign matrix σ∈{±1}q×q, define Hσ∈RE(Hq) by putting the four entries of σuvB on the four edges in the block corresponding to (u,v). Thus Hσ is indexed by the edges of K2q,2q, while σ is indexed by the q2 blocks. Perturb the all-one weights by we(σ)=exp(γHσ(e)). This is a dense analogue of Paninski-type balanced perturbations [26]: there are q2 hidden signs, but every row and every column of Hσ sums to zero.
The zero row and column sums remove the first-order effects that a tester could otherwise detect from simple vertex or size statistics. They also prevent row sums, column sums, and matching-size fluctuations from contributing large terms in the second-moment calculation. With these terms absent, the checkerboard scores
Tσ(M)=e∈M∑Hσ(e)
are centered and symmetric under the uniform distribution over all matchings. These scores also yield an isotropic covariance formula:
CovU(Tσ,Tτ)=4βqu,v∑σuvτuv,βq≍q1.
Setting τ=σ gives VarU(Tσ)=4βqq2=Θ(q). Thus a component contains q2 random signs, but the variance of each score Tσ matches the typical size of a matching in K2q,2q.
To build no-instances at total variation distance Ω(ε), take t disjoint copies of K2q,2q and choose independent checkerboard signs σ=(σ(1),…,σ(t)) on the copies. The sum of the component scores
Tσ=r=1∑tTσ(r)(r)
then has variance Θ(tq). The log-likelihood ratio for the corresponding no-instance has linear term γTσ, whose standard deviation is therefore Θ(γtq). We set
γ≍tqε.
With this choice of γ, a typical log-likelihood ratio fluctuates by order ε, enough to make each fixed no-instance far from U. Proving this rigorously requires a local quadratic expansion of logEUesTσ on K2q,2q. Since the distribution over matchings is not a product distribution, this expansion is not automatic. The proof exposes the matching one row-pair at a time. The checkerboard symmetry makes the increments a bounded martingale-difference sequence; then swapping the two vertices in each row pair and averaging over these swaps turns the exponential moment into a product of cosh terms.
For indistinguishability, choose the signs uniformly at random and bound the χ2 divergence of the k-sample mixture from the k-sample uniform distribution. Write Lσ=dDσ/dU for the likelihood ratio of one distribution indexed by a sign collection, and let Dk be the k-sample mixture over random signs with likelihood ratio Lk=dDk/dU⊗k. Then EU⊗k[Lk]=1, and hence
χ2(Dk,U⊗k)=EU⊗k[Lk2]−1.
Expanding the square of the mixture likelihood ratio gives
EU⊗k[Lk2]=Eσ,τ(EU[LσLτ])k.
Thus the χ2 distance is controlled by the average value of this expression for two independently chosen sign patterns. For such σ,τ,
The sum is a sum of tq2 independent uniform {±1} variables, so it has mean 0 and variance tq2. In the kth power above, the logarithm in the display is multiplied by k. A standard bound for sums of independent signs then gives
EU⊗k[Lk2]≤exp(O(k2βq2γ4tq2+ktqγ4)).
Here the first term comes from the random sum and the second from the error term in the display. Substituting βq≍1/q and γ2≍ε2/(tq) shows that the mixture second moment remains bounded as long as
k≲ε2qt=Θ(ε2∣E(Gt,q)∣),∣E(Gt,q)∣=4tq2.
No tester using fewer samples can reliably distinguish U from this mixture, and hence cannot solve the composite testing problem.
Finally, varying q and t interpolates between sparse and dense graphs. For every pair of target vertex and edge counts n≤m≤n2, the construction yields graphs with Θ(n) vertices and Θ(m) edges while preserving the same Ω(m/ε2) lower bound. This shows that the lower bound is not confined to sparse graphs: the same m lower bound remains as density increases, and in the bounded-degree regime it matches the upper-bound dependence on m=∣E∣ up to degree-dependent and logarithmic factors.
1.3 Related work
Testing high-dimensional structured distributions. Distribution testing over arbitrary high-dimensional domains suffers from the usual curse of dimensionality, so a central line of work asks when structural assumptions make identity and closeness testing possible with sample complexity polynomial in the ambient dimension rather than in the ambient domain size, and in some cases even sublinear in the dimension. A systematic starting point in this direction is the work of Canonne, Diakonikolas, Kane, and Stewart on testing Bayesian networks [12], where the directed graphical structure decomposes the testing problem into local conditional pieces, yielding polynomial sample bounds for constant in-degree Bayesian networks. Concurrent work [19] and subsequent works [13, 14] study this class of problems with similar localization ideas, but different sets of techniques.
Daskalakis, Dikkala, and Kamath initiated the analogous study for Markov random fields through independence and goodness-of-fit testing for Ising models [18], showing that graphical structure can avoid the exponential sample complexity of unstructured multivariate distribution testing. Our work belongs to the same broad program, but with a different source of structure: the domain is the constrained family M(G)⊆{0,1}E rather than a product space, and the relevant local tests are conditioned on which edges can be selected under the matching constraint.
Spin systems and graphical models. Identity testing for spin systems and undirected graphical models has also been studied directly. For Ising models, Daskalakis, Dikkala, and Kamath give positive results for independence and goodness-of-fit testing [18], while Bezáková, Blanca, Chen, Štefankovič, and Vigoda prove hardness results for antiferromagnetic Ising models and proper colorings [5]; related hardness results for restricted Boltzmann machines and Potts models appear in [9]. These works place testing in the same landscape as structure learning and approximate counting for spin systems. The monomer-dimer model considered here is another natural graphical model, but its variables live on the edges of G, with hard mutual-exclusion constraints at vertices.
Monomer-dimer counting and sampling. The monomer-dimer model is a classical model from statistical physics [22] and has a long algorithmic history because matchings are a central combinatorial structure. Markov-chain methods for matchings and permanents go back to Jerrum and Sinclair [23]; for counting all matchings in bounded-degree graphs, Bayati, Gamarnik, Katz, Nair, and Tetali gave a deterministic FPTAS based on correlation decay [4]. Lelarge and Zhou studied sublinear-time approximation of monomer-dimer partition functions and matching statistics on bounded-degree graphs, motivated in part by massive network settings [25]. More recently, Chen, Liu, and Vigoda developed entropy-factorization and spectral-independence tools that imply, among other applications, O(mlogn) mixing for Glauber dynamics for the monomer-dimer model on bounded-degree graphs with m edges [16]. We use this literature both as motivation and as a source of proof tools: bounded-degree counting gives the estimates of the probabilities U(Ae) used in the preprocessing step, while entropy and Poincaré inequalities supply, respectively, the lower bound on ∥EDw[Ψ]∥2 and the covariance bound used by the quadratic statistic. The question here is different from sampling or counting, however: given samples from the Gibbs distribution induced by an unknown edge-weight vector w, we ask whether this distribution is exactly the uniform distribution over all matchings or is far from it in total variation.
1.4 Organization
Section 2 sets up the Gibbs family over matchings, proves the rigidity of the all-one point, records the conditional distribution of one edge given all other edges, and states the entropy and Poincaré tools used later. Section 3 proves the upper bound. It describes the preprocessing step that estimates the probabilities U(Ae), the screening step that reduces to bounded edge weights, the vector Ψ, the covariance estimate, and the final quadratic tester. Section 4 proves the lower bound via checkerboard perturbations on disjoint copies of complete bipartite graphs. Appendix A gives an information-theoretic proper learning bound for the entire Gibbs family over matchings, to contrast the sample complexity of testing with that of learning.
2 Preliminaries
2.1 Setup
Let G=(V,E) be a finite graph, and let m:=∣E∣. Denote by
M(G):={M⊆E:Misamatching}
the family of all matchings of G, including the empty matching. For edge weights w=(we)e∈E∈R>0E, define the Gibbs distribution
Dw(M):=Z(w)1e∈M∏we,Z(w):=M∈M(G)∑e∈M∏we.
Let U denote the uniform distribution on M(G).
We study the promise problem
H0:Dw=UversusH1:dTV(Dw,U)≥ε.
2.2 Uniformity is rigid in the all-matchings model
Proposition 2.1 (Uniformity characterization). For w∈R>0E,
Dw=U⟺we=1foralle∈E.
Proof. The empty matching ∅ has weight 1, whereas the singleton matching {e} has weight we. If Dw is uniform over all matchings, then ∅ and {e} must have the same probability for every edge e, hence we=1 for every e. The converse is immediate.
Thus testing uniformity in this family is the same as testing whether w≡1.
2.3 Conditioning on all other edges
Fix an edge e∈E. For a matching M, define
Xe(M):=1{e∈M},
and also
Ae(M):=1{noedgeadjacenttoebelongstoM∖{e}}.
So Ae(M)=1 means that the edge e is available given the rest of the configuration. We also write
ξe(M):=Ae(M)(2Xe(M)−1).
Thus ξe(M)=1 if e∈M, ξe(M)=−1 if e is available but not in M, and ξe(M)=0 if e is not available. When the underlying matching is random, we suppress the argument and write Xe, Ae, and ξe for the corresponding random variables.
Lemma 2.2 (Conditional distribution of one edge). For every edge e∈E and every configuration of the other edge indicators,
the conditional distribution on the event Ae=1 is
Bernoulli(pe)underDw,Bernoulli(1/2)underU.
Proof. Once all other edges are fixed, there are only two possibilities for Xe. Either some adjacent edge is already present, in which case Xe=0 is forced, or else e may be present or absent. In the latter case the Gibbs weights of the two feasible options differ by the factor we:1, while under U the two feasible options are equally likely.
2.4 Entropy and Poincare tools on the line graph
From now on we assume that the maximum degree of G is bounded by a fixed constant:
Δ(G)≤Δ.
For a probability measure π and density f≥0, write
Entπ(f):=Eπ[flogf]−Eπ[f]logEπ[f].
For an edge e, let Ente(f) and Vare(g) denote the conditional entropy and conditional variance in the coordinate Xe, with all other coordinates held fixed.
Remark 2.3 (Line-graph representation). Let L(G) be the line graph of G. A subset M⊆E is a matching of G if and only if it is an independent set of L(G). Hence Dw is exactly the hard-core measure on L(G) with vertex weights λe=we. Moreover L(G) is claw-free and has maximum degree at most 2Δ−2.
The next proposition states the imported inequalities with an explicit dependence on the maximum degree. The constants are intentionally not optimized; they are obtained by inserting the explicit spectral-independence bound for claw-free hard-core models into the explicit entropy-factorization constant of Chen, Liu, and Vigoda.
Proposition 2.4 (Explicit imported entropy and Poincare inequalities). Fix Δ∈N. With CΔent defined in (4), the following holds for every graph G=(V,E) with Δ(G)≤Δ.
The uniform distribution U on M(G) satisfies the approximate tensorization of entropy: for every density f=dν/dU,
Proof. By Remark 2.3, every Gibbs distribution over matchings of G is a hard-core measure on L(G), and L(G) is a claw-free graph of maximum degree at most Δ.
We record the compatibility checks needed for the two imported results. Consider any hard-core measure μ on a claw-free graph H of maximum degree at most Δ, with vertex weights λv∈[1/2,2]; write λmin and λmax for their minimum and maximum.
(a) Pinnings. Conditioning a hard-core measure on a feasible pinning gives another hard-core measure on the induced graph obtained by deleting pinned vertices and the neighbors of vertices pinned to be occupied. This induced graph remains claw-free and has maximum degree at most Δ, and the remaining weights are still in [1/2,2].
(b) Spectral independence. Chen and Gu's hard-core theorem for claw-free graphs [15, Theorem 4] gives 2(1+ΔHλmax)-spectral independence for a claw-free hard-core instance of maximum degree ΔH. Applying this after every feasible pinning and using ΔH≤Δ and λmax≤2 gives the uniform bound
2(1+Δλmax)≤2(1+2Δ)=ηΔ.
(c) Marginal boundedness. For an unpinned vertex v, spin 0 has marginal probability at least 1/(1+λmax)≥1/3. If spin 1 is feasible, then conditioning on all vertices outside N(v)∪{v}, the neighbors of v form a claw-free neighborhood and hence contain no independent set of size three. Therefore the conditional weight of feasible configurations on N(v) is at most
1+Δλmax+(2Δ)λmax2≤1+2Δ+2Δ(Δ−1)=2Δ2+1
times the weight of the all-zero configuration on N(v). Thus, whenever spin 1 is feasible,
μ(σv=1)≥1+λminλmin⋅2Δ2+11≥3(2Δ2+1)1=bΔhc.
The same argument applies after every feasible pinning by item (a), so μ is bΔhc-marginally bounded.
(d) Total connectedness. Under any pinning, feasible configurations are independent sets of the residual induced graph. Deleting occupied vertices one at a time connects every feasible configuration to the empty configuration, so the support is connected under single-site moves.
(e) Small size. Chen, Liu, and Vigoda's approximate-tensorization theorem [16, Theorem 2.9] also assumes the number of vertices in the spin-system graph is at least
(bΔhc)224Δ((bΔhc)24ηΔ+1).
If H has fewer vertices, add isolated vertices with weights in [1/2, 2] until this condition holds. The augmented graph is still claw-free, has maximum degree at most Δ, and the augmented measure is the product of μ and independent one-site hard-core measures. Applying the theorem to functions that depend only on the original coordinates gives the same constant for μ.
Therefore [16, Theorem 2.9], with maximum degree Δ, marginal parameter b=bΔhc, and spectral-independence parameter ηΔ, yields approximate tensorization of entropy with constant
Part (1) applies this conclusion to the special all-one weight vector λe≡1, which is exactly the uniform distribution U on matchings. The displayed KL form is the same entropy tensorization with f=dDw/dU; this part does not require the weights we to be bounded.
Part (2) applies the same conclusion to the hard-core measure corresponding to Dw, and then uses Fact 3.5 of [16]: approximate tensorization with constant CΔent yields spectral gap at least 1/(CΔentm) for the heat-bath Glauber dynamics on the m vertices of L(G). Since the Dirichlet form of this dynamics is
m1e∈E∑EDw[Vare(g)],
the stated Poincare inequality follows. Finally, for Δ≥2 one has Δ≤2Δ, (bΔhc)−1≤CΔ2, and ηΔ≤CΔ, which gives (5).
2.5 A lower bound on edge availability under U
Lemma 2.5 (Availability is bounded away from zero under U). For every edge e∈E,
αe:=U(Ae)≥Δ21.
Proof. Fix an edge e=uv. Let
Ae:={M∈M(G):Ae(M)=1},Be:={M∈M(G):Ae(M)=0}.
For M∈Be, delete from M all edges incident to u or v and call the resulting matching R(M). Then R(M)∈Ae.
Conversely, fix M′∈Ae. To recover a preimage M of M′ under R, we may add back at most one edge incident to u (other than e) and at most one edge incident to v (other than e). Hence the number of choices is at most
(deg(u)−1)+(deg(v)−1)+(deg(u)−1)(deg(v)−1)≤Δ2−1.
Therefore
∣Be∣≤(Δ2−1)∣Ae∣.
It follows that
αe=∣Ae∣+∣Be∣∣Ae∣≥Δ21.
3 Upper Bound
The tester below is written as an explicit algorithm. Its only preprocessing step is to approximate, under U, the probability that each edge is available. After this preprocessing, the quadratic statistic uses the normalized variables ψe=ξe/αe defined below. The screening step separately handles large shifts in availability probabilities.
3.1 Preprocessing: estimating U(Ae)
For an edge e∈E, let
Γ(e):={f∈E∖{e}:fsharesanendpointwithe},
and let
G(e):=(V,E∖Γ(e)).
Thus e itself is retained, while the edges conflicting with e are removed. Recall
αe:=U(Ae).
Lemma 3.1 (Computing estimates of U(Ae)). Fix an integer Δ≥1 and set
τ:=4Δ21.
For every graph G=(V,E) with Δ(G)≤Δ, one can compute numbers (αe)e∈E satisfying
∣αe−αe∣≤8τ(e∈E)
in deterministic polynomial time for every fixed Δ. Moreover,
3231αe≤αe≤3233αe,αe≥32Δ231.
Proof. The event Ae=1 is exactly the event that the sampled matching uses no edge in Γ(e). Equivalently, it is the event that the matching belongs to M(G(e)). Therefore
αe=∣M(G)∣∣M(G(e))∣.(6)
The graphs G and G(e) all have maximum degree at most Δ. Use a deterministic FPTAS for counting all matchings in bounded-degree graphs, for instance Bayati, Gamarnik, Katz, Nair, and Tetali [4], to approximate the m+1 quantities ∣M(G)∣ and ∣M(G(e))∣, e∈E, to a sufficiently small relative accuracy ρΔ>0. Taking the ratio of the two estimates in (6) gives αe. Since ρΔ is a constant depending only on Δ, the total preprocessing time is polynomial in m for fixed Δ.
Choosing ρΔ sufficiently small ensures ∣αe−αe∣≤τ/8 for every e. The remaining two inequalities follow from Lemma 2.5, since
8τ=32Δ21≤32αe.
12
☐
3.2 Screening to bound the weights
Throughout the rest of the upper-bound proof, let (αe)e∈E be the output of Lemma 3.1. Given N0 i.i.d. samples M1,…,MN0∼Dw, compute
Lemma 3.2 (Consequences of the screening step). Assume m≥1 and 0<δ<1. If
N0≥2048Δ4logδ4m,
then with probability at least 1−δ the following event holds:
under H0, the screening step does not reject;
if the screening step accepts, then for every edge e,
∣ae−αe∣≤43τ,∣aete∣≤85τ,21≤we≤2,
where ae:=Dw(Ae) and te=(we−1)/(we+1);
if the screening step accepts, then
21ae≤αe≤2ae(e∈E).
Proof. Since each summand in ae and ξe lies in [−1,1], Hoeffding's inequality and a union bound over the 2m empirical quantities imply that, with the displayed value of N0, with probability at least 1−δ,
∣ae−ae∣≤8τ,∣ξe−aete∣≤8τ(∀e∈E).(7)
Work on this event.
Under H0, Proposition 2.1 gives we=1 for all e. Hence te=0 and ae=αe. Therefore, using Lemma 3.1,
∣ae−αe∣≤∣ae−αe∣+∣αe−αe∣≤8τ+8τ<2τ,
and
∣ξe∣≤8τ<2τ.
Thus screening does not reject under H0 on the concentration event.
Now suppose that screening accepts. Combining acceptance, Lemma 3.1, and (7) gives, for every edge e,
Pinsker's inequality gives DKL(Dw∥U)≥2dTV(Dw,U)2, and therefore ∥ν∥22≥κΔε2 for κΔ=(CΔentlog2)−1.
Under H0, conditional on X−e, either Ae=0 or Ae=1 and Xe∼Bernoulli(1/2) by Lemma 2.2. Therefore EU[ξe]=0 for every e, so ν=0.
3.4 Covariance bound when weights are bounded
Assume now that
21≤we≤2foralle∈E.
Write any vector c∈Rm as c=(cf)f∈E, and define
gc(M):=⟨c,Ψ(M)⟩=f∈E∑cfψf(M).
For an edge e, let
Be:={f∈E:f=eorf∼e}
be the set consisting of e and all edges adjacent to e. Since Δ(G)≤Δ,
∣Be∣≤2Δ−1.
Lemma 3.4 (Local sensitivity of Ψ). For every c∈Rm,
e∈E∑EDw[Vare(gc)]≤BΔ∥c∥22,BΔ:=4Δ2(2Δ−1)2.
Proof. Fix an edge e∈E and condition on X−e. If the conditional distribution of Xe is degenerate, then Vare(gc)=0. Otherwise there are exactly two feasible completions, say M(0) and M(1), differing only in the value of Xe, and hence
Vare(gc)≤41(gc(M(1))−gc(M(0)))2.
The coordinate ψf depends only on Xf and on the indicators of edges adjacent to f. Thus changing Xe can affect ψf only when f∈Be. Moreover, since ξf∈{−1,0,1} and Lemma 3.1 gives αf≥31/(32Δ2),
Each fixed f belongs to Be for at most 2Δ−1 choices of e, so
e∈E∑EDw[Vare(gc)]≤4Δ2(2Δ−1)2f∈E∑cf2.
This proves the claim.
Proposition 3.5 (Local covariance bound). Whenever 1/2≤we≤2 for all e∈E, one has, for every c∈Rm,
VarDw(⟨c,Ψ(M)⟩)≤VΔ∥c∥22,VΔ:=CΔentBΔ.
In particular, if Cw:=CovDw(Ψ), then
∥Cw∥op≤VΔ,tr(Cw2)≤mVΔ2.
Proof. By Proposition 2.4(2),
VarDw(gc)≤CΔente∈E∑EDw[Vare(gc)].
Combining this with Lemma 3.4 yields the asserted bound with VΔ:=CΔentBΔ. The operator-norm claim follows from the variational characterization of covariance. Finally, Cw is a positive semidefinite m×m matrix, so
tr(Cw2)≤m∥Cw∥op2≤mVΔ2.
3.5 Quadratic statistic when weights are bounded
Assume from now on that the screening step has accepted on the event of Lemma 3.2, so that 1/2≤we≤2 for every edge e. Set
Subtracting ∥ν∥24 and using ν⊤Cwν≤∥Cw∥op∥ν∥22 gives the claim.
3.6 Proof of the main upper bound
Proof of Theorem 1.1. Fix an integer Δ≥1 and define
BΔ:=4Δ2(2Δ−1)2,FΔ:=105(Δ4+BΔ(CΔent)2log2),
where CΔent is the explicit constant in (4). Then
FΔ≤(CΔ)CΔ5
for a universal constant C<∞ by (5), after increasing C if needed to cover Δ=1. Now fix a graph G=(V,E) with Δ(G)≤Δ and m=∣E∣≥1, and fix 0<ε≤1 and 0<δ<1. By Proposition 2.1, testing uniformity in this family is exactly testing whether w≡1.
Step 0: preprocessing. Compute the estimates (α~e)e∈E from Lemma 3.1. This step uses no samples from the unknown distribution.
Step 1: screening. Take
N0=⌈2048Δ4logδ12m⌉
samples and run the screening procedure from the previous subsection, with failure parameter δ/3. With probability at least 1−δ/3, Lemma 3.2 ensures that screening does not reject under H0, while if screening accepts then we∈[1/2,2] for every edge e and the comparability estimates needed below hold. If screening rejects, output H1.
From now on, condition on the event that screening accepts and the conclusion of Lemma 3.2 holds.
Step 2: mean lower bound. By Lemma 3.3, under H1 one has
∥ν∥22=∥EDw[Ψ]∥22≥κΔε2,κΔ=CΔentlog21.
Under H0 we have ν=0.
Step 3: one quadratic block. Take two fresh independent blocks of size
s:=⌈400κΔVΔε2m⌉
and compute the statistic S from Lemma 3.6. This explicit choice of s gives the following two bounds.
Under H0, since ν=0,
Var(S)≤s2mVΔ2≤160000κΔ2ε4.
Under H1, since ∥ν∥22≥κΔε2 and m≥1,
s2mVΔ2≤160000∥ν∥24,s2VΔ∥ν∥22≤200∥ν∥24.
Therefore
Var(S)≤s2mVΔ2+s2VΔ∥ν∥22≤190∥ν∥24.
Hence, by Chebyshev's inequality, under H0 the first event below fails with probability at most 9/160000, while under H1 the second event below fails with probability at most 9/190:
H0⟹S≤3κΔε2,H1⟹S≥32κΔε2.
Thus the block test which votes for H1 iff S>κΔε2/2 succeeds with probability at least 0.9.
Step 4: confidence boosting. Repeat the quadratic-block test independently
L=⌈20log(2/δ)⌉
times and take a majority vote. Standard Chernoff amplification reduces the error probability of this stage to at most δ/3.
It remains only to check the displayed sample count. Since
κΔVΔ=BΔ(CΔent)2log2,
and since m≥1, 0<ε≤1, and log(2/δ)≥log2, the ceiling terms are absorbed by the numerical factor 105 in the definition of FΔ. Also
logδ12m≤2logδ4m(m≥1,0<δ<1).
Combining the screening stage with the 2sL samples used in the quadratic stage proves the displayed sample bound.
For the running time, the preprocessing consists of m+1 calls to a bounded-degree matching-counting FPTAS with constant relative accuracy depending only on Δ. Given a sample matching, all coordinates Ae and ξe can be computed in OΔ(m) time by scanning the constant-size neighborhood of each edge. Thus the preprocessing takes mOΔ(1) time, and processing the displayed number of samples takes
OΔ(mFΔ(logδ4m+ε2mlog(2/δ)))
time.
18
□
Remark 3.7. The proof shows the qualitative separation
learning sample complexity ≍ε2m versus testing sample complexity ≍Δε2m
for the bounded-degree Gibbs family over all matchings.
The genuinely non-elementary inputs are isolated in Proposition 2.4 and in the approximate counting routine for bounded-degree graphs used in Lemma 3.1. Everything else in the testing argument is elementary.
4 Lower Bound
4.1 Proof setup
We now introduce the graph family used to prove Theorem 1.2. For a graph G, write UG for the uniform distribution on M(G).
For integers t,q≥1, let
Hq:=K2q,2q,Gt,q:=r=1⨆tHq(r),
where the Hq(r) are disjoint copies of Hq. Then
∣V(Gt,q)∣=4tq,∣E(Gt,q)∣=4tq2.
The proof builds a finite family of checkerboard perturbations on these components and bounds the second moment of the corresponding mixture over random signs.
Proposition 4.1 (Lower bound on the construction family). There are absolute constants c0>0 and ε0>0 such that for all integers t,q≥1 and all 0<ε≤ε0, any tester that, given i.i.d. samples from an unknown Gibbs distribution over matchings of Gt,q, distinguishes
H0:Dw=UGt,qfromH1:dTV(Dw,UGt,q)≥ε
with success probability at least 2/3 must use at least
c0ε2qt=c02ε2∣E(Gt,q)∣
samples.
4.2 The checkerboard family on K2q,2q
Fix q≥1 and write Hq=K2q,2q. Partition the left vertices into row-pairs
Figure 1: Checkerboard perturbation on Hq=K2q,2q. The left vertices are partitioned into row-pairs Ru={u+,u−} and the right vertices into column-pairs Cv={v+,v−}. Each (u,v)-block carries the signed checkerboard pattern σuvB, where B=(1−1−11). In particular, every row sum and every column sum of Hσ is zero.
For each sign matrix σ=(σuv)u,v∈[q]∈{±1}q×q, define the 2q×2q block matrix
Hσ:=(σuvB)u,v∈[q].
Equivalently,
Hσ(uα,vβ)=σuvαβ,α,β∈{+1,−1}.
This checkerboard construction is illustrated in Figure 1. For any matrix H∈R2q×2q and matching M of Hq, set
TH(M):=e∈M∑He.
We abbreviate
Tσ:=THσ.
Let Uq denote the uniform distribution on all matchings of Hq.
We begin with a few elementary facts.
Lemma 4.2. For every σ,τ∈{±1}q×q:
(i) every row sum and every column sum of Hσ is 0;
(ii)
⟨Hσ,Hτ⟩=4u,v=1∑qσuvτuv;
(iii) in particular,
∥Hσ∥F2=4q2.
Moreover, for every block matrix
H=u,v=1∑qauvBuv
with Buv equal to B in block (u,v) and 0 elsewhere, the distribution of TH under Uq is symmetric about 0.
Proof. The first two claims are immediate from the block form. For the symmetry statement, swap the two vertices inside each column-pair Cv. This is an automorphism of Hq, it preserves the uniform distribution on matchings, and it flips the sign of every checkerboard block. Hence TH is sent to −TH while the distribution is unchanged.
The next lemma gives an exact covariance formula on a complete bipartite graph.
Lemma 4.3 (Isotropic covariance on Ka,b). Let a,b≥2 and 0≤k≤min{a,b}. Let G=Ka,b, let Uk be the uniform distribution on the set of k-matchings of G, and for H∈Ra×b define
TH(M):=e∈M∑He.
Assume that H1=0 and 1⊤H=0, and likewise for H′. Then
The variance bounds are immediate from Var(Tσ)=4βqq2.
4.3 A quadratic log-MGF expansion on K2q,2q
We prove a local quadratic expansion for the logarithm of the moment-generating function for checkerboard scores on Hq.
4.3.1 Row-pair martingales and an exact log cosh representation
Fix a block matrix
H=u,v=1∑qauvBuvwith∣auv∣≤2.
Expose a matching of Hq row-pair by row-pair. Let Fu be the sigma-field generated by the restriction of the matching to R1,…,Ru, and let F0 be the trivial sigma-field. For u∈[q], let
Yu(M):=e∈Meincident toRu∑He.
Then
TH=u=1∑qYu.
Lemma 4.5. The sequence (Yu,Fu)u=1q is a martingale-difference sequence under Uq:
E[Yu∣Fu−1]=0.
Moreover,
∣Yu∣≤2vmax∣auv∣≤4almostsurely.
Proof. Conditional on Fu−1, the two vertices u+ and u− are symmetric in the remaining complete bipartite graph on the unrevealed vertices. Swapping them preserves the conditional distribution and flips the sign of Yu, because every block on row-pair Ru is of checkerboard form. Hence the conditional distribution of Yu is symmetric and therefore has mean 0.
Since Ru contains only two left vertices and each matched edge contributes at most maxv∣auv∣ in absolute value, the deterministic bound follows.
Let
ℓ(x):=logcoshx.
Lemma 4.6 (Log-cosh identities from row-pair symmetries). For every s∈R,
EUqexp(sTH−u=1∑qℓ(sYu))=1
and
EUqesTH=EUqexp(u=1∑qℓ(sYu)).
Proof. For each u∈[q], let τu be the graph automorphism of Hq that swaps the two vertices u+ and u− in the row-pair Ru. For
ε=(ε1,…,εq)∈{±1}q,
let τε be the composition of the maps τu with εu=−1. Since Uq is the uniform distribution on all matchings of Hq, it is invariant under every τε.
Fix a matching M. Swapping the row-pair Ru flips the sign of every checkerboard entry on the edges incident to Ru, while swapping a different row-pair does not affect those edges. Hence
for any fixed ordered pair of disjoint edges (e,f).
Lemma 4.8 (Matching-size monotonicity). Fix integers 1≤a≤b. Then the distribution of Ka,b is stochastically increasing in b. More precisely, Ka,b+1 stochastically dominates Ka,b.
Proof. The number of k-matchings in Ka,b is
Nk(a,b):=(ka)(kb)k!,0≤k≤a.
Hence
Nk(a,b)Nk(a,b+1)=b+1−kb+1,
which is increasing in k. Thus the probability mass function of Ka,b+1 is obtained from that of Ka,b by reweighting with an increasing function of k. This is the monotone-likelihood-ratio order, and in particular it implies stochastic domination.
Fix a new right vertex z and sample a matching of Ka,b+1 uniformly. Delete the edge incident to z if such an edge exists, and let L be the size of the resulting matching on Ka,b.
Every k-matching of Ka,b has exactly a−k+1 extensions to a matching of Ka,b+1: either the new vertex z is unused, or it is matched to one of the a−k unmatched left vertices. Therefore
P(L=k)∝(a−k+1)Nk(a,b).
Since the factor a−k+1 is decreasing in k, the distribution of L is the distribution of Ka,b reweighted by a decreasing function of k. Hence for every increasing function g,
E[g(L)]≤E[g(Ka,b)].
In particular,
E[L]≤E[Ka,b],E[L(L−1)]≤E[Ka,b(Ka,b−1)].
Let K′:=Ka,b+1 and let Iz be the indicator that z is used. Since the right vertices are symmetric,
E[Iz]=b+1E[K′].
Also L=K′−Iz, so
E[L]=b+1bE[K′].
Combining this with E[L]≤E[Ka,b] yields
E[K′]≤bb+1E[Ka,b],
while Lemma 4.8 gives the reverse inequality E[K′]≥E[Ka,b]. Hence
shows that if every column sum vanishes, then c(G)=0 and also S = 0, hence
i=i′j=j′∑GijGi′j′=∥G∥F2−∥r(G)∥22.
Substituting this into the first formula proves the claim.
4.3.4 Concentration of the realized quadratic variation
For the fixed block matrix H, keep the row-pair martingale differences Yu from Lemma 4.5, and define
Q:=u=1∑qYu2.
For s=0,1,…,q, let
Ss:=u>s∑Yu,Rs:=E[Ss2∣Fs].
Lemma 4.11. There is an absolute constant C with the following property.
For each s=1,…,q−1, conditional on Fs−1, the random variable Rs ranges over an interval of length at most C. Hence, if
Ms:=E[Q∣Fs],0≤s≤q,
then
∣Ms−Ms−1∣≤Calmostsurelyforevery1≤s≤q.
Proof. Fix s∈{1,…,q−1}. Conditional on Fs, the future matching lives on a complete bipartite graph Kas,bs, where
as:=2(q−s)
is the number of unrevealed left vertices and bs is the number of right vertices not yet used. Since each revealed row-pair can use at most two right vertices,
bs≥2q−2s=as.
Let Gs be the restriction of H to the unrevealed left vertices and currently unused right vertices. Then Ss=TGs.
Every column sum of Gs is zero: within each unrevealed row-pair the two entries in any fixed remaining column are opposite. Therefore Lemma 4.10 yields
Now fix Fs−1. Different outcomes of the sth row-pair remove from the current right side either 0, 1, or 2 right vertices. Hence any two possible resulting right sets differ in at most four vertices. Therefore the corresponding matrices Gs and Gs′ differ by adding or deleting at most four columns.
Because each entry has absolute value at most 2, adding or deleting one column changes the Frobenius norm squared by at most 4as, and adding or deleting at most four columns changes it by at most
∣∣Gs∣∣F2−∣∣Gs′∣∣F2∣≤16as.
Likewise, each row sum changes by at most 8 when at most four columns are altered. Since every row sum has magnitude at most 2bs,
Combining these estimates with the formula for Rs shows that every contribution to ∣Rs−Rs′∣ is bounded by an absolute constant. Therefore the conditional range of Rs is O(1).
Next, for every s,
Ms=u≤s∑Yu2+E[u>s∑Yu2∣Fs].
Because (Yu,Fu) is a martingale-difference sequence, the future conditional cross-terms vanish: for u<v with u,v>s,
Since 0≤Ys2≤16 and the conditional range of Rs is bounded by an absolute constant, the conditional range of Ys2+Rs is also bounded by an absolute constant, and thus
∣Ms−Ms−1∣≤C.
For s = q, one has Rq=0 and therefore
Mq−Mq−1=Yq2−E[Yq2∣Fq−1],
which is bounded by 16. After enlarging C if necessary, the claimed increment bound holds for all 1≤s≤q.
Corollary 4.12. There exists an absolute constant C such that for every λ∈R,
logEeλ(Q−EQ)≤Cqλ2.
In particular,
Var(Q)≤Cq.
Moreover,
EQ=Var(TH).
Proof. Apply Azuma–Hoeffding to the Doob martingale Ms=E[Q∣Fs] using Lemma 4.11. The identity EQ=Var(TH) follows from the orthogonality of martingale differences:
Var(u=1∑qYu)=u=1∑qE[Yu2]=EQ.
The next lemma gives the local quadratic expansion used in the second-moment argument.
Lemma 4.13 (Quadratic log-MGF expansion). There are absolute constants c∗,C∗>0 such that for every block matrix
H=u,v=1∑qauvBuvwith∣auv∣≤2,
and every ∣s∣≤c∗,
logEUqesTH−2s2VarUq(TH)≤C∗qs4.
Proof. By Lemma 4.5, ∣Yu∣≤4. Choose c∗>0 so small that ∣sYu∣≤1 whenever ∣s∣≤c∗. For such s, the Taylor expansion of ℓ(x)=logcoshx gives
0≤2x2−ℓ(x)≤Cx4(∣x∣≤1).
Hence, for each u,
2s2Yu2−Cs4Yu4≤ℓ(sYu)≤2s2Yu2.
Since ∣Yu∣≤4, we have Yu4≤16Yu2, so after summing over u we obtain
(2s2−Cs4)Q≤u=1∑qℓ(sYu)≤2s2Q.
Lemma 4.6 therefore gives
Ee(2s2−Cs4)Q≤EesTH≤Ee2s2Q.
For the upper bound, Corollary 4.12 yields
logEe2s2Q=2s2EQ+logEe2s2(Q−EQ)≤2s2EQ+Cqs4.
For the lower bound, Jensen's inequality gives
logEe(2s2−Cs4)Q≥(2s2−Cs4)EQ.
Finally, Corollary 4.12 also gives EQ=Var(TH), and the deterministic bound Q≤16q implies
EQ≤16q.
Hence
2s2Var(TH)−Cqs4≤logEesTH≤2s2Var(TH)+Cqs4.
This completes the proof.
4.4 The lower bound on Gt,q
Fix integers t,q≥1. Let
Gt,q=r=1⨆tHq(r)
be the disjoint union of t copies of Hq. For a sign collection
σ=(σ(1),…,σ(t))∈({±1}q×q)t,
define the total score
Tσ:=r=1∑tTσ(r)(r),
where Tσ(r)(r) is the checkerboard score on the rth copy. Let Ut,q denote the uniform distribution on all matchings of Gt,q. Since the components are disjoint, Ut,q is the product of t independent copies of Uq.
Lemma 4.14. There exist absolute constants c, C > 0 such that for every σ,
ctq≤VarUt,q(Tσ)≤Ctq,EUt,q[Tσ4]≤C(tq)2.
Moreover, the distribution of Tσ under Ut,q is symmetric about 0.
Proof. The component scores are independent and centered. By Lemma 4.4, each component has variance between q/2 and 4q, so
Var(Tσ)=r=1∑tVar(Tσ(r)(r))≍tq.
For the fourth moment, independence and centering give
Using Corollary 4.7 and Lemma 4.4, the first sum is O(tq2) and the second is O(t2q2), hence the total is O((tq)2).
Symmetry follows from Lemma 4.2, because each component score is symmetric and the components are independent.
For a parameter γ>0 and a sign collection σ, define edge weights on Gt,q by
we(σ):=exp(γHσ(r)(e))
for e in the rth copy. Let Dσ be the corresponding Gibbs distribution over matchings. Its likelihood ratio with respect to Ut,q is
Lσ(M):=dUt,qdDσ(M)=exp(γTσ(M)−Ψσ(γ)),
where
Ψσ(γ):=logEUt,qeγTσ.
We first show that each constructed distribution is genuinely Ω(ε)-far from Ut,q.
Proposition 4.15. There are absolute constants a,cfar,ε0>0 such that if
γ=atqε,0<ε≤ε0,
then, for every sign collection σ,
dTV(Dσ,Ut,q)≥cfarε.
Proof. Fix σ and abbreviate T:=Tσ. By Lemma 4.14,
E[T2]≍tq,E[T4]≤C(tq)2.
Applying the Paley–Zygmund inequality to T2 yields absolute constants p0,η>0 such that
Ut,q(T≥ηtq)≥p0.
Indeed, Ut,q(T2≥21E[T2])≥c, and symmetry of T splits this two-sided event evenly between the positive and negative tails.
Choose a and ε0 so that aε0≤c∗, where c∗ is the constant in Lemma 4.13; then γ≤c∗. Since T is a sum of t independent component scores and each component satisfies Lemma 4.13, we have
Choosing a > 0 small and then ε0>0 small enough, the last quantity is at least cfarε.
Next we estimate the overlap of two constructed distributions under a random choice of signs.
Lemma 4.16. Let σ,τ be two sign collections, and define
X(σ,τ):=r=1∑tu,v=1∑qσuv(r)τuv(r).
If ∣γ∣≤c∗, where c∗ is the constant in Lemma 4.13, then
logEUt,q[LσLτ]=4βqγ2X(σ,τ)+O(tqγ4),
where βq is the coefficient defined before Lemma 4.4.
Proof. Let Ψσ,τ(γ) denote the log-MGF of Tσ+Tτ under Ut,q. Then
logE[LσLτ]=Ψσ,τ(γ)−Ψσ(γ)−Ψτ(γ).
Each component of Tσ+Tτ is a checkerboard score with coefficients in {−2,0,2}, so Lemma 4.13 applies both to the single-score and to the summed-score log-MGFs. Therefore
Since the components are independent and each component covariance is given by Lemma 4.3 together with Lemma 4.2,
Cov(Tσ,Tτ)=4βqX(σ,τ).
This completes the proof.
Proposition 4.17. Let
Dk:=2−tq2σ∑Dσ⊗k.
There are absolute constants a,c,ε0>0 such that
χ2(Dk,Ut,q⊗k)≤91
whenever
γ=atqε,0<ε≤ε0,
and
k≤cε2qt.
Proof. By the standard mixture formula,
χ2(Dk,Ut,q⊗k)+1=Eσ,τ(E[LσLτ])k.
Choose a and ε0 so that aε0≤c∗, where c∗ is the constant in Lemma 4.13; then γ≤c∗. Applying Lemma 4.16 gives
χ2+1≤exp(Cktqγ4)⋅Eσ,τexp(4kβqγ2X(σ,τ)).
For independent uniform sign collections, the random variables
σuv(r)τuv(r)(1≤r≤t,1≤u,v≤q)
are i.i.d. uniform {±1} random variables. Hence
X(σ,τ)=di=1∑tq2ξi,ξi∈{±1}i.i.d.
and therefore
EeλX=cosh(λ)tq2≤exp(2tq2λ2)foreveryλ∈R.
Substituting λ=4kβqγ2 yields
χ2+1≤exp(Cktqγ4+Ck2βq2γ4tq2).
By Lemma 4.4, βq≤1/q. Since γ2=a2ε2/(tq),
ktqγ4=ktqa4ε4,k2βq2γ4tq2≤k2tq2a4ε4.
If k≤cqt/ε2, then
ktqγ4≤ca4ε2,k2βq2γ4tq2≤c2a4.
Choosing a>0 and c>0 sufficiently small and then ε0>0 sufficiently small makes the exponent at most log(10/9), which implies χ2≤1/9.
Proof of Proposition 4.1. Fix t,q and a target distance parameter ε≤cfarε0, where cfar is the constant from Proposition 4.15. Apply Propositions 4.15 and 4.17 with the parameter
ε′:=cfarε.
Thus
γ=atqε′
and every distribution in the finite family
A:={Dσ:σ∈({±1}q×q)t}
satisfies
dTV(Dσ,Ut,q)≥ε.
By Proposition 4.17, if
k≤c(ε′)2qt=ccfar2ε2qt,
then the mixture over signs Dk of the k-sample distributions satisfies
dTV(Dk,Ut,q⊗k)≤21χ2(Dk,Ut,q⊗k)≤41.
Therefore no tester can distinguish Ut,q⊗k from this mixture over no-instances with average success probability greater than
21+21dTV(Dk,Ut,q⊗k)≤21+121=127.
Equivalently, average success probability 2/3 would require dTV(Dk,Ut,q⊗k)≥1/3, whereas the bound above gives TV distance at most 1/4. In particular, a tester that succeeded with probability at least 2/3 for every no-instance in the support of the mixture would have average success probability at least 2/3 against the mixture, a contradiction. Since the mixture is supported on no-instances, the same lower bound applies to the original composite testing problem. Renaming the constant ccfar2 as c0 completes the proof.
Proof of Theorem 1.2. Fix integers n,m with n≤m≤n2. Set
q:=max{1,⌊nm⌋},t:=max{1,⌊8qn⌋},Gn,m:=Gt,q.
We verify the size parameters. If q<n/16, then t=Θ(n/q), and hence
∣V(Gn,m)∣=4tq=Θ(n),∣E(Gn,m)∣=4tq2=Θ(nq).
Moreover, if m<2n then q=1 and nq=Θ(m), while if m≥2n then q=Θ(m/n) and again nq=Θ(m). Thus in this case
∣V(Gn,m)∣=Θ(n),∣E(Gn,m)∣=Θ(m),qt=Θ(nq)=Θ(m).
If q≥n/16, then q=Θ(n) and therefore m=Θ(n2). Also t=Θ(1), so
Applying Proposition 4.1 to Gn,m=Gt,q and absorbing the absolute constants in the comparison qt=Θ(m) gives the claimed lower bound.
Acknowledgements. We thank Clément Canonne for helpful comments on an earlier version of this manuscript.
References
[1] Jayadev Acharya, Constantinos Daskalakis, and Gautam Kamath. Optimal testing for properties of distributions. In Advances in Neural Information Processing Systems (NIPS), pages 3591–3599, 2015.
[2] Hassan Ashtiani and Abbas Mehrabian. Some techniques in density estimation, 2018. arXiv:1801.04003.
[3] Tugkan Batu, Lance Fortnow, Ronitt Rubinfeld, Warren D. Smith, and Patrick White. Testing that distributions are close. In Proceedings of the Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 259–269, 2000.
[4] Mohsen Bayati, David Gamarnik, Dimitriy A. Katz, Chandra Nair, and Prasad Tetali. Simple deterministic approximation algorithms for counting matchings. In Proceedings of the 39th Annual ACM Symposium on Theory of Computing (STOC), pages 122–127, 2007.
[5] Ivona Bezáková, Antonio Blanca, Zongchen Chen, Daniel Štefankovič, and Eric Vigoda. Lower bounds for testing graphical models: Colorings and antiferromagnetic Ising models. Journal of Machine Learning Research, 21(25):1–62, 2020.
[6] Arnab Bhattacharyya, Clément L. Canonne, and Joy Qiping Yang. Independence testing for bounded degree bayesian networks. In Advances in Neural Information Processing Systems (NeurIPS), 2022.
[7] Arnab Bhattacharyya, Sutanu Gayen, Philips George John, Sayantan Sen, and N. V. Vinodchandran. Distribution learning meets graph structure sampling. In Advances in Neural Information Processing Systems (NeurIPS), 2025.
[8] Arnab Bhattacharyya, Sutanu Gayen, Eric Price, Vincent Y. F. Tan, and N. V. Vinodchandran. Near-optimal learning of tree-structured distributions by chow and liu. SIAM Journal on Computing, 52(3):761–793, 2023.
[9] Antonio Blanca, Zongchen Chen, Daniel Štefankovič, and Eric Vigoda. Hardness of identity testing for restricted Boltzmann machines and Potts models. Journal of Machine Learning Research, 22(152):1–56, 2021.
[10] Clément L. Canonne. A Survey on Distribution Testing: Your Data is Big. But is it Blue? Number 9 in Graduate Surveys. Theory of Computing Library, 2020.
[11] Clément L. Canonne. Topics and techniques in distribution testing: A biased but representative sample. Foundations and Trends in Communications and Information Theory, 19(6):1032–1198, 2022.
[12] Clément L. Canonne, Ilias Diakonikolas, Daniel M. Kane, and Alistair Stewart. Testing Bayesian networks. IEEE Transactions on Information Theory, 66(5):3132–3170, 2020.
[13] Clément L Canonne, Yash Pote, Jonathan Scarlett, and Joy Qiping Yang. Entropy equivalence testing. arXiv preprint arXiv:2605.23225, 2026.
[14] Clément L Canonne and Joy Q Yang. Entropy testing and its application to testing Bayesian networks. Advances in Neural Information Processing Systems, 2024.
[15] Zongchen Chen and Yuzhou Gu. Fast sampling of b-matchings and b-edge covers. In Proceedings of the 35th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 4972–4987, 2024.
[16] Zongchen Chen, Kuikui Liu, and Eric Vigoda. Optimal mixing of Glauber dynamics: Entropy factorization via high-dimensional expansion. SIAM Journal on Computing, pages STOC21–104–STOC21–153, October 2023. Open access at https://epubs.siam.org/doi/10.1137/21M1443340.
[17] Yu Cheng, Ilias Diakonikolas, Daniel M. Kane, and Alistair Stewart. Robust learning of fixed-structure Bayesian networks. In Advances in Neural Information Processing Systems 31, pages 10304–10316, 2018.
[18] Constantinos Daskalakis, Nishanth Dikkala, and Gautam Kamath. Testing Ising models. In Proceedings of the 29th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1989–2007, 2018.
[19] Constantinos Daskalakis and Qinxuan Pan. Square hellinger subadditivity for bayesian networks and its applications to identity testing. In COLT, volume 65 of Proceedings of Machine Learning Research, pages 697–703. PMLR, 2017.
[20] Luc Devroye and Gábor Lugosi. Combinatorial Methods in Density Estimation. Springer, 2001.
[21] Luc Devroye, Abbas Mehrabian, and Tommy Reddad. The minimax learning rates of normal and Ising undirected graphical models. Electronic Journal of Statistics, 14(1):2338–2361, 2020.
[22] Ole J. Heilmann and Elliott H. Lieb. Theory of monomer-dimer systems. Communications in Mathematical Physics, 25:190–232, 1972.
[23] Mark Jerrum and Alistair Sinclair. Approximating the permanent. SIAM Journal on Computing, 18(6):1149–1178, 1989.
[24] Mark Jerrum and Alistair Sinclair. The markov chain monte carlo method: an approach to approximate counting and integration. Approximation algorithms for NP-hard problems, pages 482–520, 1996.
[25] Marc Lelarge and Hang Zhou. Sublinear-time algorithms for monomer-dimer systems on bounded degree graphs. Theoretical Computer Science, 548:68–78, 2014.
[26] Liam Paninski. A coincidence-based test for uniformity given very sparsely sampled discrete data. IEEE Transactions on Information Theory, 54(10):4750–4755, 2008.
[27] Ronitt Rubinfeld. Taming big probability distributions. XRDS: Crossroads, The ACM Magazine for Students, 19(1):24–28, 2012.
[28] Yannis G. Yatracos. Rates of convergence of minimum distance estimators and Kolmogorov's entropy. The Annals of Statistics, 13(2):768–774, 1985.
A Learning the Matching Gibbs Family
We next record the information-theoretic sample complexity of learning the entire Gibbs distribution over matchings. This should be contrasted with the uniformity-testing guarantee above. The learning bound below is a direct application of the classical Yatracos minimum-distance method; see Yatracos [28], Devroye and Lugosi [20], and the exposition of Ashtiani and Mehrabian [2, Theorem 10 and Corollary 11]. Closely related VC/Yatracos arguments are also used for learning Ising and normal graphical models in [21].
For a fixed graph G=(V,E), write
FG:={Dw:w∈R>0E}.
A learner receives i.i.d. samples from an unknown member of FG and must output a distribution close to it in total variation distance. The result below is proper, in the sense that the output distribution is again a member of FG. It is, however, only an information-theoretic statement; no computational efficiency of the minimum-distance estimator is claimed.
Proposition A.1 (Information-theoretic proper learning upper bound). There is a universal constant C<∞ such that the following holds. For every graph G=(V,E) with m=∣E∣, every ε,δ∈(0,1), and every unknown w∈R>0E, there exists a proper learner which, given
n≥Cε2m+log(1/δ)
i.i.d. samples from Dw, outputs a distribution Dw∈FG satisfying
dTV(Dw,Dw)≤ε
with probability at least 1−δ. In particular, the learning upper bound is independent of the maximum degree of G and of the magnitude of the weights.
Proof. Let Ω:=M(G) be the domain. For a class A⊆2Ω and two probability distributions P,Q on Ω, write
∥P−Q∥A:=A∈Asup∣P(A)−Q(A)∣.
The Yatracos class of FG is
YG:={{M∈M(G):Dw(M)≥Dv(M)}:w,v∈R>0E}.
We first bound the VC dimension of YG. Identify a matching M with its edge-incidence vector
x(M):=(1{e∈M})e∈E∈{0,1}m.
For any two weight vectors w,v∈R>0E,
Dw(M)≥Dv(M)
is equivalent to
e∈E∑(logwe−logve)1{e∈M}≥logZ(w)−logZ(v).
Thus every set in YG is the restriction to {x(M):M∈M(G)}⊆{0,1}m of an affine halfspace in Rm. Since affine halfspaces in Rm have VC dimension m+1, restriction to a subset cannot increase VC dimension, and therefore
VC(YG)≤m+1.
Let P:=Dw be the unknown target distribution and let Pn be the empirical distribution of the n samples. By VC uniform convergence, with probability at least 1−δ,
∥Pn−P∥YG≤C0nm+log(1/δ)
for a universal constant C0.
Let P∈FG be an η-approximate empirical Yatracos minimizer:
∥P−Pn∥YG≤Q∈FGinf∥Q−Pn∥YG+η.
Such an approximate minimizer exists by the definition of the infimum. Since the target P itself belongs to FG,
∥P−Pn∥YG≤∥P−Pn∥YG+η.
Moreover, because both P and P belong to FG, the Yatracos class contains the set on which P−P is nonnegative, and therefore
Taking η≤ε/3 and n≥C(m+log(1/δ))/ε2 for a sufficiently large universal constant C gives the claimed bound. Writing P=Dw completes the proof.
Remark A.2 (Tightness of the learning sample complexity). The linear dependence on m in Proposition A.1 is unavoidable, even for graphs of maximum degree 1. Indeed, let
Gm:=i=1⨆mK2
be the disjoint union of m isolated edges. Then every matching is identified with a vector in {0,1}m, and the Gibbs distribution over matchings factorizes as
Dw=i=1⨂mBernoulli(1+wiwi).
Thus the Gibbs family over matchings realizes all m-dimensional Bernoulli product distributions with success probabilities in (0,1). The standard minimax lower bound for learning Bernoulli product distributions in total variation distance already holds in, say, a fixed neighborhood of the all-1/2 parameter vector, and is
Ω(ε2m)
samples for constant success probability; equivalently, this is the in-degree-zero case of the lower bound for learning fixed-structure Bernoulli Bayesian networks stated in [17]. Consequently, the minimax learning sample complexity of the Gibbs family over matchings is
Θ(ε2m)
for constant failure probability, while the uniformity-testing sample complexity proved above is of order m/ε2 up to the stated degree-dependent and logarithmic factors.