Introduction
A two-sample test for networks decides whether two samples of graphs come from the same distribution. Often the vertices of different graphs do not correspond, as with friendship networks of different schools, protein networks of different species, or molecules. The same is true when a graph generative model is evaluated, since its samples are compared with held-out graphs through degree distributions, clustering coefficients, subgraph counts or random graph-neural-network embeddings [66 , 54 , 63 , 38 ] . Without a correspondence, a test can only use quantities that do not depend on how each graph is labelled.
With aligned vertices, the sample complexity of two-sample testing for inhomogeneous random graphs is well understood [27 , 17 ] . Without alignment, many tests have been proposed [49 , 12 , 59 , 62 , 57 ] , but two basic questions remain open: how many graphs are needed, and which statistics can detect which differences? In practice, an evaluation metric that is insensitive to a class of failures reports a good model however many samples are drawn.
In this paper, we study both questions for graphon models, in which every graph has its own latent vertex positions. Our results suggest that both answers depend on the lowest order at which a Preprint. difference becomes visible to label-invariant statistics, and this order can be high for differences that are easy to detect with aligned vertices.
Sample complexity (Theorem 1). For an Erdős–Rényi null and a planted two-block difference that preserves every expected degree, with per-graph signal-to-noise ratio t < 1 t < 1 t < 1 , we prove that m ≍ t − 3 m \asymp t^{-3} m ≍ t − 3 graphs per group are necessary and sufficient and that signed triangles are optimal, with a lower bound that holds for every graph size. With aligned vertices m ≍ t − 1 m \asymp t^{-1} m ≍ t − 1 graphs suffice, so misalignment costs a factor of order t − 2 t^{-2} t − 2 . When the triangle signal cancels, the rate becomes t − 4 t^{-4} t − 4 and 4-cycles are needed (Proposition 1).
Tree statistics (Theorem 2). If the null is regular and the difference preserves degrees, every tree density is exactly unchanged, and tests using finitely many tree statistics have asymptotic power equal to their level. Since degree statistics, colour refinement and message-passing graph neural networks are determined by tree densities on graphons [28 , 9 ] (Böker 2023), they cannot detect such differences either.
Order of visibility (Theorem 3). For a non-constant null, a difference is generically visible at first order, and a motif test that does not know the null needs only order 1 / t 1/t 1/ t graphs, the aligned rate of Theorem 1. So the factor t − 2 t^{-2} t − 2 in Theorem 1 reflects first-order invisibility.
Few graphs and experiments. We give an exact permutation test for one graph per group (Proposition 2), and our simulations confirm the predicted exponents. Degree- and GNN-based metrics miss degree-preserving changes both in simulations and on protein graphs, where degree-corrected signed cycles reach power 1 / 2 1/2 1/2 with at most six graphs.
The second moment behind our lower bound for one graph is due to Mossel et al. [2015] and Banerjee [2018], Ghoshdastidar et al. [2017] use the same planted partition as a hard instance for one graph per group, and the sharp aligned threshold m t = 1 m t = 1 m t = 1 is known for sparse multilayer block models [15 ] . The population bounds, their comparison with alignment, the distributional invariance of tree statistics and the first-order analysis are new.
Setup
Graphons and graph samples. A graphon is a symmetric measurable function W : [ 0 , 1 ] 2 → [ 0 , 1 ] W : [0, 1]^2 \to[0, 1] W : [ 0 , 1 ] 2 → [ 0 , 1 ] . A graph G ∼ G ( n , W ) G \sim\mathcal{G}(n, W) G ∼ G ( n , W ) on [ n ] = { 1 , … , n } [n] = \{1, \ldots, n\} [ n ] = { 1 , … , n } is generated by drawing latent positions U 1 , … , U n U_1, \ldots, U_n U 1 , … , U n independently and uniformly from [ 0 , 1 ] [0, 1] [ 0 , 1 ] , and then independent edges A i j ∼ Bernoulli ( W ( U i , U j ) ) A_{ij} \sim\operatorname{Bernoulli}(W(U_i, U_j)) A ij ∼ Bernoulli ( W ( U i , U j )) for i < j i < j i < j . The degree function d W ( x ) = ∫ 0 1 W ( x , y ) d y d_W(x) = \int_0^1 W(x,y)\,\mathrm{d}y d W ( x ) = ∫ 0 1 W ( x , y ) d y , and W W W is regular if d W d_W d W is constant. For a finite graph F F F , t ( F , W ) t(F,W) t ( F , W ) denotes its homomorphism density [46 ] . The injective density t i n j ( F , G ) t_{\mathrm{inj}}(F,G) t inj ( F , G ) of a graph G G G is the fraction of injective maps V ( F ) → [ n ] V(F) \to[n] V ( F ) → [ n ] that send edges to edges, and it satisfies E t i n j ( F , G ) = t ( F , W ) \mathbb{E}\,t_{\mathrm{inj}}(F,G) = t(F,W) E t inj ( F , G ) = t ( F , W ) for G ∼ G ( n , W ) G \sim\mathcal{G}(n,W) G ∼ G ( n , W ) .
Unaligned two-sample testing. We observe G 1 , … , G m ∼ P G_1,\ldots,G_m \sim P G 1 , … , G m ∼ P and G 1 ′ , … , G m ′ ∼ Q G'_1,\ldots,G'_m \sim Q G 1 ′ , … , G m ′ ∼ Q , all independent, and test H 0 : P = Q H_0 : P = Q H 0 : P = Q against H 1 : P ≠ Q H_1 : P \ne Q H 1 : P = Q . A test ψ \psi ψ maps the 2 m 2m 2 m graphs to { 0 , 1 } \{0,1\} { 0 , 1 } , and its risk against a pair of hypotheses is the sum of its type I and type II errors. The samples are unaligned : every graph carries its own latent positions, so a vertex label in one graph says nothing about a vertex label in another. For a graphon model this is automatic, because the law of G ( n , W ) \mathcal{G}(n,W) G ( n , W ) is invariant under relabelling. Averaging any test over independent uniform relabellings of each graph therefore preserves both of its errors, and we may restrict attention to (possibly randomized) tests that are invariant under relabelling within each graph. Invariant polynomials of bounded degree are exactly linear combinations of subgraph counts [Carpenter et al., 2025, Lemma 3.2]. In the aligned version of the problem, all graphs share one vertex labelling and one set of latent positions.
The planted-partition difference. Our main example has an Erdős–Rényi null P 0 = G ( n , p ) P_0 = \mathcal{G}(n,p) P 0 = G ( n , p ) and the alternative P δ P_\delta P δ in which a vector σ ∈ { ± 1 } n \sigma\in\{\pm1\}^n σ ∈ { ± 1 } n with independent uniform entries is drawn and, given σ \sigma σ , edges are independent with
P ( A i j = 1 ∣ σ ) = p + δ σ i σ j , 0 < δ ≤ min { p , 1 − p } . (1) \mathbb{P}(A_{ij} = 1 \mid\sigma) = p + \delta\sigma_i \sigma_j,\qquad0 < \delta\le\min\{p,1-p\}. \tag*{(1)} P ( A ij = 1 ∣ σ ) = p + δ σ i σ j , 0 < δ ≤ min { p , 1 − p } . (1)
This is the graphon p + H p + H p + H with H ( x , y ) = δ s ( x ) s ( y ) H(x,y) = \delta s(x)s(y) H ( x , y ) = δ s ( x ) s ( y ) and s = 1 [ 0 , 1 / 2 ) − 1 [ 1 / 2 , 1 ] s = \mathbf{1}_{[0,1/2)} - \mathbf{1}_{[1/2,1]} s = 1 [ 0 , 1/2 ) − 1 [ 1/2 , 1 ] . Since ∫ H ( x , y ) d y = 0 \int H(x,y)\,\mathrm{d}y = 0 ∫ H ( x , y ) d y = 0 , every vertex has the same expected degree under both hypotheses. We write
η = δ 2 p ( 1 − p ) , t = n η , (2) \eta= \frac{\delta^2}{p(1-p)},\qquad t = n\eta, \tag*{(2)} η = p ( 1 − p ) δ 2 , t = n η , (2)
and call t t t the per-graph signal-to-noise ratio. In the notation a = n ( p + δ ) a = n(p + \delta) a = n ( p + δ ) and b = n ( p − δ ) b = n(p - \delta) b = n ( p − δ ) of the community detection literature, t = ( a − b ) 2 / ( 2 ( 1 − p ) ( a + b ) ) t = (a - b)^2/(2(1 - p)(a + b)) t = ( a − b ) 2 / ( 2 ( 1 − p ) ( a + b )) . The value t = 1 t = 1 t = 1 is the threshold below which a single graph from P δ P_\delta P δ cannot be distinguished from G ( n , p ) G(n,p) G ( n , p ) [52 ] (Banerjee 2018). Unaligned samples draw an independent σ \sigma σ for each graph. Aligned samples use one σ \sigma σ for all graphs of the first group.
Order of visibility. For graphons W W W and W + H W + H W + H and a motif F F F , expanding the product over the edges of F F F gives
t ( F , W + H ) − t ( F , W ) = ∑ ∅ ≠ S ⊆ E ( F ) t ( F ; H on S , W on E ( F ) ∖ S ) , (3) t(F, W + H) - t(F, W) = \sum_{\varnothing\ne S \subseteq E(F)} t(F; H\text{ on }S,\ W\text{ on }E(F)\setminus S), \tag*{(3)} t ( F , W + H ) − t ( F , W ) = ∅ = S ⊆ E ( F ) ∑ t ( F ; H on S , W on E ( F ) ∖ S ) , (3)
where each term integrates H H H over the edges in S S S and W W W over the remaining edges of F F F . The terms with ∣ S ∣ = 1 \lvert S\rvert= 1 ∣ S ∣ = 1 sum to ∑ e ∈ E ( F ) ⟨ H , W F , e ⟩ \sum_{e \in E(F)} \langle H, W_{F,e}\rangle ∑ e ∈ E ( F ) ⟨ H , W F , e ⟩ , where W F , e ( x , y ) W_{F,e}(x,y) W F , e ( x , y ) is the density of F F F with the endpoints of e e e fixed at ( x , y ) (x,y) ( x , y ) and the edge e e e removed. They are closely related to the two-point conditional kernels of Chatterjee et al. [ [16 ] . We say that H H H is visible at order k k k (relative to W W W ) if some motif has a non-vanishing term with ∣ S ∣ = k \lvert S\rvert= k ∣ S ∣ = k and none has one with ∣ S ∣ < k \lvert S\rvert< k ∣ S ∣ < k . When W W W is constant and H H H has zero degree function, integrating out a vertex of degree one in S S S gives zero, so only edge sets in which every vertex has degree at least two survive. The smallest such sets are triangles and 4-cycles, with densities tr H 3 \operatorname{tr} H^3 tr H 3 and tr H 4 > 0 \operatorname{tr} H^4 > 0 tr H 4 > 0 , and hence H H H is visible at order 3 if tr H 3 ≠ 0 \operatorname{tr} H^3 \ne0 tr H 3 = 0 and at order 4 otherwise. For (1), tr H 3 = δ 3 \operatorname{tr} H^3 = \delta^3 tr H 3 = δ 3 and the order is 3.
Sample complexity under an Erdős–Rényi null
Write q = p ( 1 − p ) q = p(1 - p) q = p ( 1 − p ) . Let g ( t ) = ∑ k ≥ 3 t k / ( 2 k ) = − 1 2 log ( 1 − t ) − t 2 − t 2 4 g(t) = \sum_{k \ge3} t^k/(2k) = -\frac{1}{2}\log(1 - t) - \frac{t}{2} - \frac{t^2}{4} g ( t ) = ∑ k ≥ 3 t k / ( 2 k ) = − 2 1 log ( 1 − t ) − 2 t − 4 t 2 for t ∈ [ 0 , 1 ) t \in[0,1) t ∈ [ 0 , 1 ) , and let g n ( t ) = ∑ k = 3 n ( n ) k 2 k n k t k ≤ g ( t ) g_n(t) = \sum_{k=3}^{n} \frac{(n)_k}{2k n^k}t^k \le g(t) g n ( t ) = ∑ k = 3 n 2 k n k ( n ) k t k ≤ g ( t ) be its finite-n n n version, where ( n ) k = n ! / ( n − k ) ! (n)_k = n!/(n-k)! ( n ) k = n ! / ( n − k )! . Let c α β = log ( 1 + 4 ( 1 − α − β ) 2 ) c_{\alpha\beta} = \log(1 + 4(1 - \alpha- \beta)^2) c α β = log ( 1 + 4 ( 1 − α − β ) 2 ) .
Theorem 1 (Unaligned and aligned sample complexity). Let n ≥ 3 n \ge3 n ≥ 3 , p ∈ ( 0 , 1 ) p \in(0,1) p ∈ ( 0 , 1 ) , 0 < δ ≤ min { p , 1 − p } 0 < \delta\le\min\{p, 1 - p\} 0 < δ ≤ min { p , 1 − p } and t = n δ 2 / q t = n\delta^2/q t = n δ 2 / q .
(i) Unaligned, lower bound. For L = d P δ / d P 0 L = \mathrm{d}P_{\delta}/\mathrm{d}P_{0} L = d P δ / d P 0 and every m ≥ 1 m \ge1 m ≥ 1 ,
1 + χ 2 ( P δ ⊗ m ∥ P 0 ⊗ m ) = ( ∑ S ⊆ E ( K n ) even η ∣ S ∣ ) m ≤ e m g n ( t ) . 1 + \chi^{2}\left(P_{\delta}^{\otimes m} \mathbin\Vert P_{0}^{\otimes m}\right) = \left(\sum_{\substack{S\subseteq E(K_n)\\\text{even}}} \eta^{|S|}\right)^{m} \le e^{m g_n(t)}. 1 + χ 2 ( P δ ⊗ m ∥ P 0 ⊗ m ) = S ⊆ E ( K n ) even ∑ η ∣ S ∣ m ≤ e m g n ( t ) .
Hence a two-sample test with type I error at most α \alpha α and type II error at most β \beta β exists only if m ≥ c α β / g n ( t ) m \ge c_{\alpha\beta}/g_n(t) m ≥ c α β / g n ( t ) . For t < 1 t < 1 t < 1 this requires m ≥ 6 ( 1 − t ) c α β / t 3 m \ge6(1-t)c_{\alpha\beta}/t^{3} m ≥ 6 ( 1 − t ) c α β / t 3 .
(ii) Unaligned, upper bound. Let T p ( G ) = ∑ i < j < k ( A i j − p ) ( A j k − p ) ( A i k − p ) T_p(G) = \sum_{i<j<k}(A_{ij}-p)(A_{jk}-p)(A_{ik}-p) T p ( G ) = ∑ i < j < k ( A ij − p ) ( A j k − p ) ( A ik − p ) . The test that rejects when
∣ ∑ ℓ T p ( G ℓ ) − ∑ ℓ T p ( G ℓ ′ ) ∣ ≥ ( 2 m ( n 3 ) q 3 / α ) 1 / 2 \left|\sum_{\ell}T_p(G_{\ell})-\sum_{\ell}T_p(G'_{\ell})\right|\ge\left(2m\binom{n}{3}q^{3}/\alpha\right)^{1/2} ℓ ∑ T p ( G ℓ ) − ℓ ∑ T p ( G ℓ ′ ) ≥ ( 2 m ( 3 n ) q 3 / α ) 1/2
has size at most α \alpha α under P = Q = G ( n , p ) P=Q=\mathcal{G}(n,p) P = Q = G ( n , p ) . Its power is at least 1 − β 1-\beta 1 − β whenever
m t 3 ( n − 1 ) ( n − 2 ) 6 n 2 ≥ ( 2 / α + ( 2 + ε n ) / β ) 2 , m t^{3}\frac{(n-1)(n-2)}{6n^{2}}\ge\left(\sqrt{2/\alpha}+\sqrt{(2+\varepsilon_n)/\beta}\right)^{2}, m t 3 6 n 2 ( n − 1 ) ( n − 2 ) ≥ ( 2/ α + ( 2 + ε n ) / β ) 2 ,
where ε n → 0 \varepsilon_n\to0 ε n → 0 is explicit (Section A.2).
(iii) Aligned. Suppose the m m m graphs of the first sample share one σ \sigma σ . With x α β ∈ ( 0 , 1 ) x_{\alpha\beta}\in(0,1) x α β ∈ ( 0 , 1 ) the root of x 2 / 4 + g ( x ) = c α β x^{2}/4+g(x)=c_{\alpha\beta} x 2 /4 + g ( x ) = c α β , no test has errors ( α , β ) (\alpha,\beta) ( α , β ) if m t artanh ( η ) / η < x α β mt\operatorname{artanh}(\eta)/\eta<x_{\alpha\beta} m t artanh ( η ) / η < x α β , where x 0.05 , 0.5 ≈ 0.87 x_{0.05,0.5}\approx0.87 x 0.05 , 0.5 ≈ 0.87 . The cross-graph statistic Q = ∑ ℓ < ℓ ′ ∑ i < j ( A i j ℓ − p ) ( A i j ℓ ′ − p ) Q=\sum_{\ell<\ell'}\sum_{i<j}(A_{ij}^{\ell}-p)(A_{ij}^{\ell'}-p) Q = ∑ ℓ < ℓ ′ ∑ i < j ( A ij ℓ − p ) ( A ij ℓ ′ − p ) gives errors ( α , β ) (\alpha,\beta) ( α , β ) against the null P = Q = G ( n , p ) P=Q=\mathcal{G}(n,p) P = Q = G ( n , p ) once m ( m − 1 ) t 2 ( n − 1 ) / ( 4 n ) ≥ ( α − 1 / 2 + ( ρ m / β ) 1 / 2 ) 2 m(m-1)t^{2}(n-1)/(4n)\ge(\alpha^{-1/2}+(\rho_m/\beta)^{1/2})^{2} m ( m − 1 ) t 2 ( n − 1 ) / ( 4 n ) ≥ ( α − 1/2 + ( ρ m / β ) 1/2 ) 2 , where ρ m → 1 \rho_m\to1 ρ m → 1 is explicit.
Parts (ii) and (iii) use the null edge density p p p . For the triangle test, the pooled edge density of all 2 m 2m 2 m graphs can replace p p p with no asymptotic loss when n p ( 1 − p ) → ∞ np(1-p)\to\infty n p ( 1 − p ) → ∞ (Proposition 3), and conditioning on the total number of edges gives an exactly valid Monte Carlo version.
Corollary 1. Fix α , β > 0 \alpha,\beta>0 α , β > 0 with α + β < 1 \alpha+\beta<1 α + β < 1 . Let m u n ∗ m_{\mathrm{un}}^{*} m un ∗ and m a l ∗ m_{\mathrm{al}}^{*} m al ∗ be the smallest numbers of graphs per group for which some test has errors ( α , β ) (\alpha,\beta) ( α , β ) in the unaligned and in the aligned problem. There are constants 0 < c 1 < c 2 0<c_{1}<c_{2} 0 < c 1 < c 2 , depending only on ( α , β ) (\alpha,\beta) ( α , β ) , such that for n ≥ n 0 ( α , β , p ) n\ge n_{0}(\alpha,\beta,p) n ≥ n 0 ( α , β , p ) and 0 < t ≤ 1 / 2 0<t\le1/2 0 < t ≤ 1/2
c 1 t − 2 ≤ m u n ∗ / m a l ∗ ≤ c 2 t − 2 . c_{1}t^{-2}\le m_{\mathrm{un}}^{*}/m_{\mathrm{al}}^{*}\le c_{2}t^{-2}. c 1 t − 2 ≤ m un ∗ / m al ∗ ≤ c 2 t − 2 . Misalignment multiplies the number of graphs needed by a factor of order t − 2 t^{-2} t − 2 .
Proof idea. With L = E σ ∏ i < j ( 1 + δ σ i σ j X i j ) L=\mathbb{E}_{\sigma}\prod_{i<j}(1+\delta\sigma_i\sigma_jX_{ij}) L = E σ ∏ i < j ( 1 + δ σ i σ j X ij ) and X i j = ( A i j − p ) / q X_{ij}=(A_{ij}-p)/q X ij = ( A ij − p ) / q , two independent partitions give E 0 [ L σ L τ ] = ∏ i < j ( 1 + η ω i ω j ) \mathbb{E}_{0}[L_{\sigma}L_{\tau}]=\prod_{i<j}(1+\eta\omega_i\omega_j) E 0 [ L σ L τ ] = ∏ i < j ( 1 + η ω i ω j ) with ω = σ ∘ τ \omega=\sigma\circ\tau ω = σ ∘ τ . Averaging over ω \omega ω removes every monomial with a vertex of odd degree. By Veblen’s theorem each remaining edge set is an edge-disjoint union of cycles, and the sum is at most ∏ ( 1 + η ∣ C ∣ ) ≤ e g n ( t ) \prod(1+\eta^{|C|})\le e^{g_n(t)} ∏ ( 1 + η ∣ C ∣ ) ≤ e g n ( t ) . Edges and 2-stars drop out, and the ( n 3 ) \binom{n}{3} ( 3 n ) triangles contribute the leading t 3 / 6 t^{3}/6 t 3 /6 . With aligned graphs each edge contributes ( 1 + η ω i ω j ) m (1+\eta\omega_i\omega_j)^m ( 1 + η ω i ω j ) m , whose even part leaves a second-order term of about m 2 t 2 / 4 m^{2}t^{2}/4 m 2 t 2 /4 , so aligned tests succeed at order t − 1 t^{-1} t − 1 .
Sign cancellation. In the following model, triangles carry no signal. Let σ , τ ∈ { ± 1 } n \sigma,\tau\in\{\pm1\}^{n} σ , τ ∈ { ± 1 } n be independent with uniform entries, and
P ( A i j = 1 ∣ σ , τ ) = p + δ ( σ i σ j − τ i τ j ) , 2 δ ≤ min { p , 1 − p } . (4) \mathbb{P}(A_{ij}=1\mid\sigma,\tau)=p+\delta(\sigma_i\sigma_j-\tau_i\tau_j),\qquad2\delta\le\min\{p,1-p\}. \tag*{(4)} P ( A ij = 1 ∣ σ , τ ) = p + δ ( σ i σ j − τ i τ j ) , 2 δ ≤ min { p , 1 − p } . (4)
The difference has eigenvalues ± δ \pm\delta ± δ , so tr H 3 = 0 \operatorname{tr}H^{3}=0 tr H 3 = 0 and tr H 4 = 2 δ 4 \operatorname{tr}H^{4}=2\delta^{4} tr H 4 = 2 δ 4 .
Proposition 1 (Sign cancellation). Under (4), with t = n δ 2 / q t=n\delta^{2}/q t = n δ 2 / q :
(i) E [ T p ( G ) ∣ σ , τ ] = 0 \mathbb{E}[T_p(G)\mid\sigma,\tau]=0 E [ T p ( G ) ∣ σ , τ ] = 0 , so triangles carry no signal. The two-sample triangle test has asymptotic power α \alpha α for fixed p p p , t t t and m m m .
(ii) For t < 1 / 2 t<1/2 t < 1/2 , a test with errors ( α , β ) (\alpha,\beta) ( α , β ) requires m ≥ ( 1 − 4 t 2 ) c α β / ( 4 t 4 ) m\ge(1-4t^{2})c_{\alpha\beta}/(4t^{4}) m ≥ ( 1 − 4 t 2 ) c α β / ( 4 t 4 ) .
(iii) The signed 4-cycle count S C 4 ( G ) = ∑ 4 -cycles ∏ ( A e − p ) S_{C_4}(G)=\sum_{4\text{-cycles}}\prod(A_e-p) S C 4 ( G ) = ∑ 4 -cycles ∏ ( A e − p ) has mean 6 ( n 4 ) δ 4 6\binom{n}{4}\delta^{4} 6 ( 4 n ) δ 4 and null variance 3 ( n 4 ) q 4 3\binom{n}{4}q^{4} 3 ( 4 n ) q 4 . Its per-graph squared signal-to-noise ratio tends to t 4 / 2 t^{4}/2 t 4 /2 , and the two-sample 4-cycle test has errors ( α , β ) (\alpha,\beta) ( α , β ) once n ≥ n 0 n\ge n_0 n ≥ n 0 and m t 4 ≥ C α β mt^{4}\ge C_{\alpha\beta} m t 4 ≥ C α β .
The lower bound rests on E ∏ e ∈ S ( σ i σ j − τ i τ j ) = 2 β ( S ) 1 { S even and bipartite } \mathbb{E}\prod_{e\in S}(\sigma_i\sigma_j-\tau_i\tau_j)=2^{\beta(S)}1_{\{S\text{ even and bipartite}\}} E ∏ e ∈ S ( σ i σ j − τ i τ j ) = 2 β ( S ) 1 { S even and bipartite } , where β ( S ) \beta(S) β ( S ) is the cyclomatic number, so odd cycles drop out of the second moment. It also explains why signed quadrilaterals can beat signed triangles [33 ] , and why the statistic t ( K 2 , G ) 4 − t ( C 4 , G ) t(K_2,G)^4-t(C_4,G) t ( K 2 , G ) 4 − t ( C 4 , G ) of Chatterjee et al. [2026] is slower than triangles when tr H 3 ≠ 0 \operatorname{tr}H^3\ne0 tr H 3 = 0 but cannot be cancelled.
Tree statistics and degree-preserving differences
The expansion (3) already suggests that statistics built from trees cannot detect degree-preserving differences, since every tree has a leaf and integrating the leaf of an H H H -edge returns the degree function of H H H , which is zero. The next theorem makes this exact and extends it to distributions.
Theorem 2 (Invariance of tree statistics). (i) Let W W W be a graphon with d W ≡ d d_W \equiv d d W ≡ d , and let H H H be bounded and symmetric with ∫ 0 1 H ( x , y ) d y = 0 \int_0^1 H(x,y)\,\mathrm{d}y=0 ∫ 0 1 H ( x , y ) d y = 0 for almost every x x x and 0 ≤ W + H ≤ 1 0 \le W+H \le1 0 ≤ W + H ≤ 1 . Then t ( T , W + H ) = t ( T , W ) = d e ( T ) t(T,W+H)=t(T,W)=d^{e(T)} t ( T , W + H ) = t ( T , W ) = d e ( T ) for every finite forest T T T . Consequently E t i n j ( T , G ) \mathbb{E}\,t_{\mathrm{inj}}(T,G) E t inj ( T , G ) is the same under G ( n , W ) G(n,W) G ( n , W ) and G ( n , W + H ) G(n,W+H) G ( n , W + H ) for every n n n .
(ii) In the planted-partition model (1), fix p ∈ ( 0 , 1 ) p \in(0,1) p ∈ ( 0 , 1 ) , t > 0 t>0 t > 0 , m ≥ 1 m \ge1 m ≥ 1 and finitely many trees T 1 , … , T r T_1,\ldots,T_r T 1 , … , T r . For each tree, let Z T ( G ) Z_T(G) Z T ( G ) be the signed count ∑ ∏ e ( A e − p ) \sum\prod_e(A_e-p) ∑ ∏ e ( A e − p ) over the copies of T T T in K n K_n K n , divided by its null standard deviation. As n → ∞ n \to\infty n → ∞ , the vector ( Z T j ( G ℓ ) , Z T j ( G ℓ ′ ) ) j , ℓ (Z_{T_j}(G_\ell),Z_{T_j}(G'_\ell))_{j,\ell} ( Z T j ( G ℓ ) , Z T j ( G ℓ ′ ) ) j , ℓ converges to N ( 0 , I 2 m r ) \mathcal{N}(0,I_{2mr}) N ( 0 , I 2 m r ) under both H 0 H_0 H 0 and H 1 H_1 H 1 . Hence every test that depends on the graphs only through these counts has asymptotic power equal to its asymptotic size. The signed triangle z z z -test has asymptotic power 1 − Φ ( z 1 − α − ( m t 3 / 12 ) 1 / 2 ) > α 1-\Phi\left(z_{1-\alpha}-(mt^3/12)^{1/2}\right)>\alpha 1 − Φ ( z 1 − α − ( m t 3 /12 ) 1/2 ) > α .
We prove part (i) by removing leaves one at a time, and part (ii) by a conditional central limit theorem given σ \sigma σ . A signed tree count has mean zero under P δ P_\delta P δ because every leaf has odd degree, and its covariances change only through pairs of trees whose union contains a cycle, which contribute a relative change of order 1 / n 1/n 1/ n (Section A.4). Interestingly, the statement also holds above the one-graph threshold (t > 1 t>1 t > 1 ), where a single graph already reveals σ \sigma σ through its spectrum. Under P δ P_\delta P δ , every vertex degree is exactly Binomial ( n − 1 , p ) \operatorname{Binomial}(n-1,p) Binomial ( n − 1 , p ) , since the signs σ v σ j \sigma_v\sigma_j σ v σ j , j ≠ v j\ne v j = v , are independent and uniform, and the edge count has exactly the null mean and variance.
Consequences for invariant learned features. Colour refinement (the 1-dimensional Weisfeiler–Leman algorithm) and message-passing graph neural networks cannot distinguish graphons with equal tree homomorphism densities, since on graphons their expressive power is exactly that of tree densities [[28 , 9 ] (Böker 2023)], and the same holds for degree statistics. Theorem 2 therefore applies to many two-sample statistics in common use, including maximum mean discrepancies between degree distributions, Weisfeiler–Leman subtree kernels [[60 ] ], and features from randomly initialized or trained message-passing networks [[63 ] ]. Against a regular null their population targets coincide for every degree-preserving difference, and for finitely many tree statistics Theorem 2(ii) gives zero asymptotic power at any fixed m m m , whereas clustering coefficients, orbit counts and spectra involve cycles and are not affected. One consequence concerns the evaluation of graph generative models [[54 , 63 ] ]. Against a regular null, a model that reproduces the degree structure of its training graphs but gets their community or cycle structure wrong cannot be detected by metrics built from degrees or message passing, as § 7 shows. Weisfeiler–Leman tests of dimension at least two do not share this limitation, since they determine homomorphism counts of all graphs of treewidth two, cycles included [[20 , 50 ] ].
The limitation needs both a degree-preserving difference and a regular null. For a planted subgraph on top of G ( n , p ) G(n,p) G ( n , p ) , which always increases degrees, signed star counts are optimal among constant-degree tests [[67 ] ]. Under an irregular null, a vertex at position x x x has degree Binomial ( n − 1 , d W ( x ) ) \operatorname{Binomial}(n-1,d_W(x)) Binomial ( n − 1 , d W ( x )) under both hypotheses, so the expected degree histogram is the same. Trees with an internal edge acquire a first-order term, equal to ∬ H ( x , y ) d W ( x ) d W ( y ) d x d y \iint H(x,y)\,d_W(x)\,d_W(y)\,\mathrm{d}x\,\mathrm{d}y ∬ H ( x , y ) d W ( x ) d W ( y ) d x d y for the path with three edges and non-zero for generic H H H , and cycle refinement separates the graphons (§ 5 ).
Non-constant nulls and first-order visibility
The t − 3 t^{-3} t − 3 rate in Theorem 1 comes from a special feature of the Erdős–Rényi null. There every kernel W F , e W_{F,e} W F , e in (3) is constant, so a difference with zero degree function has ⟨ H , W F , e ⟩ = 0 \langle H,W_{F,e}\rangle=0 ⟨ H , W F , e ⟩ = 0 for every motif, and it cannot be seen before order three. For a non-constant null the first-order term is generically non-zero, and a simple motif test that does not need to know W W W already detects the difference.
Theorem 3 (First-order visibility). Let F F F be a fixed graph with v v v vertices and e ≥ 1 e \ge1 e ≥ 1 edges, and let W W W be a graphon. Let D D D be the difference between the two sample averages of t i n j ( F , ⋅ ) t_{\mathrm{inj}}(F,\cdot) t inj ( F , ⋅ ) .
(i) Var t i n j ( F , G ) ≤ v 2 / ( 4 n ) \operatorname{Var} t_{\mathrm{inj}}(F,G) \le v^2/(4n) Var t inj ( F , G ) ≤ v 2 / ( 4 n ) for G ∼ G ( n , W ) G \sim G(n,W) G ∼ G ( n , W ) , for every graphon W W W and n ≥ v n \ge v n ≥ v .
(ii) If 0 ≤ W + H ≤ 1 0 \le W + H \le1 0 ≤ W + H ≤ 1 , then Δ F : = t ( F , W + H ) − t ( F , W ) = ∑ e ∈ E ( F ) ⟨ H , W F , e ⟩ + R \Delta_F := t(F,W+H)-t(F,W)=\sum_{e\in E(F)}\langle H,W_{F,e}\rangle+R Δ F := t ( F , W + H ) − t ( F , W ) = ∑ e ∈ E ( F ) ⟨ H , W F , e ⟩ + R , with ∣ R ∣ ≤ ( 2 e − 1 − e ) ∥ H ∥ 2 2 |R|\le(2^e-1-e)\lVert H\rVert_2^2 ∣ R ∣ ≤ ( 2 e − 1 − e ) ∥ H ∥ 2 2 .
(iii) The test that rejects when ∣ D ∣ ≥ v / 2 n m α |D|\ge v/\sqrt{2nm\alpha} ∣ D ∣ ≥ v / 2 nm α has size at most α \alpha α under every graphon null P = Q = G ( n , W ) P=Q=\mathcal{G}(n,W) P = Q = G ( n , W ) . Its power against P = G ( n , W + H ) P=\mathcal{G}(n,W+H) P = G ( n , W + H ) , Q = G ( n , W ) Q=\mathcal{G}(n,W) Q = G ( n , W ) is at least 1 − β 1-\beta 1 − β whenever n m Δ F 2 ≥ v 2 ( 1 / α + 1 / β ) nm\Delta_F^2\ge v^2(1/\alpha+1/\beta) nm Δ F 2 ≥ v 2 ( 1/ α + 1/ β ) .
Part (i) is the Efron–Stein inequality applied to the independent blocks ( U i , ( V i j ) j < i ) (U_i,(V_{ij})_{j<i}) ( U i , ( V ij ) j < i ) , where A i j = 1 { V i j ≤ W ( U i , U j ) } A_{ij}=1\{V_{ij}\le W(U_i,U_j)\} A ij = 1 { V ij ≤ W ( U i , U j )} with i.i.d. uniform V i j V_{ij} V ij , since changing one block moves t i n j ( F , G ) t_{\mathrm{inj}}(F,G) t inj ( F , G ) by at most v / n v/n v / n , and part (iii) is Chebyshev’s inequality under both hypotheses. No constant depends on W W W .
Corollary 2 (Order of visibility). Let H = c H 0 H=cH_0 H = c H 0 , and suppose the first-order coefficient κ F = ∑ e ∈ E ( F ) ⟨ H 0 , W F , e ⟩ \kappa_F=\sum_{e\in E(F)}\langle H_0,W_{F,e}\rangle κ F = ∑ e ∈ E ( F ) ⟨ H 0 , W F , e ⟩ is non-zero. If 0 < c ≤ ∣ κ F ∣ / ( 2 ( 2 e − 1 − e ) ∥ H 0 ∥ 2 2 ) 0<c\le|\kappa_F|/(2(2^e-1-e)\lVert H_0\rVert_2^2) 0 < c ≤ ∣ κ F ∣/ ( 2 ( 2 e − 1 − e ) ∥ H 0 ∥ 2 2 ) , the test of Theorem 3(iii) has power at least 1 − β 1-\beta 1 − β as soon as m ≥ 4 v 2 ( 1 / α + 1 / β ) / ( n c 2 κ F 2 ) m\ge4v^2(1/\alpha+1/\beta)/(nc^2\kappa_F^2) m ≥ 4 v 2 ( 1/ α + 1/ β ) / ( n c 2 κ F 2 ) . With t H = n ∥ H ∥ 2 t_H=n\lVert H\rVert_2 t H = n ∥ H ∥ 2 , the unaligned sample size is therefore O ( 1 / t H ) O(1/t_H) O ( 1/ t H ) , the order of an aligned test under every null (Proposition 4 ) and at a constant null (Theorem 1(iii)). If W W W is constant and H 0 H_0 H 0 has zero degree function, then κ F = 0 \kappa_F=0 κ F = 0 for every F F F and the rate becomes t − 3 t^{-3} t − 3 or worse (Theorem 1 and Proposition 1).
The corollary is only an upper bound, since for a non-constant null we do not prove matching lower bounds for either aligned or unaligned tests (§ 9 ). Degeneracy of the null can improve the constant further. If W W W is F F F -regular, the variance in (i) drops from order n − 1 n^{-1} n − 1 to order n − 2 n^{-2} n − 2 [[6 , 16 ] ], and the test gains a factor of n n n .
Degree-corrected block models have finite rank. For a degree-preserving difference that is orthogonal to their eigenfunctions, every path density is unchanged and every cycle density moves by exactly t ( C k , H ) t(C_k,H) t ( C k , H ) , as under the Erdős–Rényi null (Proposition 5 ), so we expect the t − 3 t^{-3} t − 3 rate to persist. Other degree-preserving differences are generically visible at first order.
Testing with one to three graphs per group
The rates above matter most for small m m m , which is where standard calibrations fail. Permuting whole graphs is exact, but for a two-sided statistic its smallest p p p -value is 2 / ( 2 m m ) 2/\binom{2m}{m} 2/ ( m 2 m ) , which equals 1 1 1 , 1 / 3 1/3 1/3 and 1 / 10 1/10 1/10 for m = 1 , 2 , 3 m=1,2,3 m = 1 , 2 , 3 . Normal approximations estimate a variance from only 2 m − 2 2m-2 2 m − 2 degrees of freedom, and the network jackknife is conservative in expectation [[43 ] ]. However, graphon models have a simple structure that makes exact tests possible with a single graph per group.
Proposition 2 (Exact vertex-split permutation test). Partition [ n ] [n] [ n ] into fixed blocks V 1 , … , V B V_1,\ldots,V_B V 1 , … , V B . If G ∼ G ( n , W ) G\sim\mathcal{G}(n,W) G ∼ G ( n , W ) , the induced subgraphs G [ V 1 ] , … , G [ V B ] G[V_1],\ldots,G[V_B] G [ V 1 ] , … , G [ V B ] are independent, and G [ V b ] ∼ G ( ∣ V b ∣ , W ) G[V_b]\sim\mathcal{G}(|V_b|,W) G [ V b ] ∼ G ( ∣ V b ∣ , W ) . If both samples come from G ( n , W ) \mathcal{G}(n,W) G ( n , W ) and the blocks have equal size, the 2 m B 2mB 2 m B values of any statistic computed on the induced subgraphs are therefore independent and identically distributed. A permutation test over their group labels has level at most α \alpha α for every m m m and B B B , and a two-sided version can reject as soon as ( 2 m B m B ) ≥ 2 / α \binom{2mB}{mB}\ge2/\alpha ( m B 2 m B ) ≥ 2/ α , for instance when m = 1 m=1 m = 1 and B = 4 B=4 B = 4 .
This uses only motifs inside a block. For signed triangles under an Erdős–Rényi null, a block of size n / B n/B n / B has per-graph signal-to-noise ratio t / B t/B t / B , so the squared signal-to-noise ratio of a graph drops from about t 3 / 6 t^3/6 t 3 /6 to t 3 / ( 6 B 2 ) t^3/(6B^2) t 3 / ( 6 B 2 ) . With m = 1 m=1 m = 1 and B = 4 B=4 B = 4 its power in our experiments is only 0.06 for a first-order visible difference and 0.02 under the Erdős–Rényi null (Table 1 in Section B.3), so it mainly guarantees validity. For a mixture of graphons the blocks are only conditionally independent, so the test is not exact.
Table 1.
Experiments
Apart from one study of protein graphs, the experiments use simulated graphs, so the ground truth is known. Every number below is read from result files produced by the scripts in the arXiv ancillary files, which use only NumPy and SciPy. For each test we report m ∗ m^* m ∗ , the smallest number of graphs per group at which the power reaches 0.5 at level 0.05, interpolated on a geometric grid of m m m . Settings, replicate counts and run times are in Section B.
Sample sizes with and without alignment. Figure 1 uses the planted partition with n = 300 n=300 n = 300 , p = 1 / 2 p=1/2 p = 1/2 and t ∈ { 0.3 , … , 0.9 } t\in\{0.3,\ldots,0.9\} t ∈ { 0.3 , … , 0.9 } . The fitted slopes of log m ∗ \log m^* log m ∗ on log t \log t log t are − 3.04 ± 0.03 -3.04\pm0.03 − 3.04 ± 0.03 for signed triangles (theory − 3 -3 − 3 ), − 1.07 ± 0.03 -1.07 \pm0.03 − 1.07 ± 0.03 for the aligned spectral test (theory − 1 -1 − 1 ), − 0.91 ± 0.02 -0.91 \pm0.02 − 0.91 ± 0.02 for Q Q Q , whose signal-to-noise ratio grows like m ( m − 1 ) \sqrt{m(m-1)} m ( m − 1 ) at small m m m , and − 2.13 ± 0.04 -2.13 \pm0.04 − 2.13 ± 0.04 and − 1.97 ± 0.02 -1.97 \pm0.02 − 1.97 ± 0.02 for the unaligned-to-aligned ratio (theory − 2 -2 − 2 ). At t = 0.3 t = 0.3 t = 0.3 signed triangles need 1241 graphs per group, against 1215 predicted by the normal approximation. The aligned tests need 11.3 and 4.53, a ratio of 110 to 274, and the ratio is 10.4 to 31.6 at t = 0.9 t = 0.9 t = 0.9 .
Figure 1. Left: number of graphs per group at which each test reaches power 1/2 at level 0.05, for the planted partition (1) with n = 300 n = 300 n = 300 and p = 1 / 2 p = 1/2 p = 1/2 . Unaligned tests (signed triangles with known p p p , excess triangles with unknown p p p ) follow the slope − 3 -3 − 3 of Theorem 1. Aligned tests (cross-graph statistic Q Q Q , top eigenvalue of the averaged adjacency matrix) follow the slope − 1 -1 − 1 . Below the black curve, the information bound of Theorem 1(i) rules out power 1/2 for every test. Right: the ratio of unaligned to aligned sample sizes, with a reference line proportional to t − 2 t^{-2} t − 2 .
With a pooled edge density, an unknown p p p costs nothing, whereas the per-graph excess triangle density needs 4.0 times more graphs because it keeps the degree-variance fluctuation. The information bound lies a factor of 12.2 to 37.2 below the triangle test, a gap due to the constant in Le Cam’s inequality, the second sample and longer cycles, relevant near t = 1 t = 1 t = 1 (Remark 6). A sparse panel (n = 2000 n = 2000 n = 2000 , average degree 15) gives the same exponents, − 3.00 ± 0.03 -3.00 \pm0.03 − 3.00 ± 0.03 and − 2.15 ± 0.02 -2.15 \pm0.02 − 2.15 ± 0.02 (Section B.2).
Sign cancellation. Under the rank-two model (4), the triangle test never exceeds a rejection rate of 0.063 for any t t t and any m ≤ 16384 m \le16384 m ≤ 16384 . Signed 4-cycles detect the difference with slope − 3.98 ± 0.03 -3.98 \pm0.03 − 3.98 ± 0.03 (theory − 4 -4 − 4 ), from 1392 graphs at t = 0.3 t = 0.3 t = 0.3 to 17.4 at t = 0.9 t = 0.9 t = 0.9 (Section B.2).
Order of visibility under non-constant nulls. Figure 2 adds one degree-preserving difference c H 0 cH_0 c H 0 to three nulls. Its first-order coefficient κ = 3 ⟨ H 0 , W K 3 ⟩ \kappa= 3\langle H_0, W_{K_3}\rangle κ = 3 ⟨ H 0 , W K 3 ⟩ is zero under the Erdős–Rényi null and 8.33 ⋅ 10 − 4 8.33 \cdot10^{-4} 8.33 ⋅ 1 0 − 4 and 6.25 ⋅ 10 − 4 6.25 \cdot10^{-4} 6.25 ⋅ 1 0 − 4 under SBM2 and SMOOTH. At c = 0.3 c = 0.3 c = 0.3 the unaligned excess-triangle test needs 3991 graphs under the Erdős–Rényi null, against 11.1 under SBM2 and 83.7 under SMOOTH (360 and 48 times fewer). The aligned spectral test needs about 18 graphs under each null.
Figure 2. The same degree-preserving difference c H 0 cH_0 c H 0 added to three nulls (n = 128 n = 128 n = 128 ): Erdős–Rényi, a regular two-block model (SBM2) and an irregular smooth graphon (SMOOTH). The plots show m ∗ m^* m ∗ against the scale c c c for the unaligned excess-triangle test and for two aligned tests, with thin curves for the prediction 2 z 0 2 / Δ ( c ) 2 2z_0^2/\Delta(c)^2 2 z 0 2 /Δ ( c ) 2 from the exact shift. Under the constant null the sample size of the unaligned test grows like c − 6 c^{-6} c − 6 , while under the non-constant nulls it tracks the aligned tests, whose sample size grows like c − 2 c^{-2} c − 2 . Open markers extend the grid to small c c c , and arrows mark censored values.
Under the constant null the unaligned slope in c c c is − 5.99 ± 0.03 -5.99 \pm0.03 − 5.99 ± 0.03 (theory − 6 -6 − 6 ), whereas under the non-constant nulls it approaches the first-order value − 2 -2 − 2 as c → 0 c \to0 c → 0 , with local slopes − 2.21 -2.21 − 2.21 and − 2.17 -2.17 − 2.17 on c ∈ [ 0.1 , 0.15 ] c \in[0.1, 0.15] c ∈ [ 0.1 , 0.15 ] (s.e. at most 0.10 and 0.09). Over c ∈ [ 0.3 , 1 ] c \in[0.3, 1] c ∈ [ 0.3 , 1 ] the slopes are steeper, − 2.80 -2.80 − 2.80 and − 3.18 -3.18 − 3.18 , because higher-order terms of t ( K 3 , W + c H 0 ) t(K_3,W + cH_0) t ( K 3 , W + c H 0 ) are still comparable to κ c \kappa c κ c there. Every uncensored m ∗ m^* m ∗ agrees with the prediction 2 z 0 2 / Δ ( c ) 2 2z_0^2/\Delta(c)^2 2 z 0 2 /Δ ( c ) 2 within Monte Carlo error.
Graph evaluation metrics. We test descriptors used to evaluate graph generative models [66 , 54 , 63 ] , namely the degree histogram, the clustering histogram, six graphlet counts, the Laplacian spectrum and a randomly initialized graph isomorphism network (GIN) [65 ] , each compared by a Gaussian-kernel MMD [30 ] , together with signed triangles (Figure 3 ).
Figure 3. Power of two-sample tests on descriptors used to evaluate graph generative models. Descriptors are compared by a Gaussian-kernel MMD calibrated by permutation, and signed triangles by a permutation test on the mean difference (n = 200 n = 200 n = 200 , p = 0.1 p = 0.1 p = 0.1 , 200 replicates per point, horizontal line at level 0.05). Left and middle: planted partition (1) against G ( n , p ) G(n,p) G ( n , p ) . Right: planted-partition graphs against the same graphs after degree-preserving double-edge swaps. Tree-based descriptors (dashed) stay at the level, and the dotted curve is the normal-theory power of signed triangles.
Against the planted partition, the degree histogram and the random GIN reject at rates between 0.030 and 0.075 for every m m m up to 256, at both t = 0.9 t = 0.9 t = 0.9 and t = 1.5 t = 1.5 t = 1.5 , so they stay at the level, as Theorem 2 predicts. Both metrics have power 1.00 with m = 16 m = 16 m = 16 against a degree-heterogeneous graphon of the same edge density, where signed triangles have power 0.05.
Signed triangles reach power 0.5 at m = 65.5 m = 65.5 m = 65.5 for t = 0.9 t = 0.9 t = 0.9 and m = 16.2 m = 16.2 m = 16.2 for t = 1.5 t = 1.5 t = 1.5 , against 64.2 and 13.9 predicted by the normal approximation with the moments of Theorem 1(ii). The clustering histogram needs 196.8 and 40.3 graphs, and the graphlet vector needs > 256 > 256 > 256 because edge-density fluctuations, which move all counts together, dominate its kernel distance.
The right panel of Figure 3 models a generator that reproduces degrees exactly but destroys cycle structure, with group 2 consisting of planted-partition graphs with t = 2 t = 2 t = 2 after degree-preserving double-edge swaps. Signed triangles detect the change with m = 7.4 m = 7.4 m = 7.4 graphs, clustering with 19.3 and the spectrum with 61.2, but the degree and GIN metrics never exceed a rejection rate of 0.090.
Irregular nulls and protein graphs. Under two irregular nulls, SMOOTH and a rank-one graphon, the random GIN detects a degree-preserving difference that is correlated with the degree profile, with power 0.80 and 1.00 at m = 64 m = 64 m = 64 , through the first-order term of the 3-edge path (Section B.5, where the signal is above the one-graph threshold). It stays at the level, with rejection rates between 0.015 and 0.095 up to m = 256 m = 256 m = 256 (Monte Carlo s.e. 0.015), when the difference is orthogonal to the eigenfunctions of the null, which leaves every graph density unchanged (Proposition 5 ). On protein graphs from two generative-model benchmarks (Section B.6), rewiring 5% of the edges of each graph by degree-preserving swaps removes about a quarter of its triangles. The degree histogram and the random GIN never exceed a rejection rate of 0.075 for m ≤ 64 m \le64 m ≤ 64 , whereas degree-corrected signed triangles reach power 0.83 with m = 4 m = 4 m = 4 on D&D and signed 4-cycles need m ∗ = 5.7 m^* = 5.7 m ∗ = 5.7 on ENZYMES. We chose their normalization in a pilot on D&D (Section B.6).
Calibration with few graphs. With one to three graphs per group (Table 1 in Section B.3), whole-graph permutation never rejects, the Welch normal approximation reaches size 0.21 at m = 2 m = 2 m = 2 , and only the vertex-split test (Proposition 2) has a finite-sample guarantee at m = 1 m = 1 m = 1 . Conservative variance estimates keep power for first-order visible differences (SBM2 null). Under the Erdős–Rényi null, where the difference is third-order visible, the best method valid for all three nulls reaches power 0.15, so with few graphs only first-order differences appear testable without strong assumptions.
Related work
With aligned vertices, minimax rates for two-sample testing of inhomogeneous random graphs are known [27 , 17 ] . Without alignment, tests compare network statistics of one graph per group [26 ] , latent positions [62 ] , subgraph counts and cumulants [49 , 12 , 59 ] , or estimated block models and graphons [53 , 57 , 55 ] , and our excess triangle statistic is the T 3 T_3 T 3 of Gao and Lafferty [2017]. Subgraph counts are the classical moments of network models [7 ] , and populations of unlabeled networks have been studied through graph distances [37 ] (Lunagómez et al. 2021).
Misalignment has been studied for aligned tests with shuffled labels [58 ] and for changepoints [19 ] . The choice of cycle order for one graph is studied for signed polygons, latent geometry and planted subgraphs [33 , 13 , 4 , 67 ] , and low-degree analyses of invariant tests treat one graph [41 , 14 , 56 , 61 ] , whereas our lower bounds are information-theoretic and use independence across graphs. Section C discusses more work.
Discussion and limitations
Our results suggest that the number of unaligned graphs needed is set by the lowest order at which the difference is visible to invariant statistics. A motif test attains the aligned order of sample size for differences visible at first order, whereas degree-preserving differences from a constant null, first visible through cycles, cost a power of the signal-to-noise ratio and are invisible to tree statistics.
A recommendation for evaluation pipelines. Metrics built from degrees or message passing should be complemented by cycle statistics. A cheap choice is the signed triangle and 4-cycle counts of B = A − d d T / ( 2 ∣ E ∣ ) B = A - dd^{\mathsf{T}}/(2|E|) B = A − d d T / ( 2∣ E ∣ ) , the degree-corrected centring of Jin et al. [2021], divided by the number of 2-paths, which depends only on the degrees. They need one matrix product per graph, and permuting whole graphs makes the test exact. In our experiments they detected every degree-preserving difference under irregular nulls and the unrestricted rewiring of the protein graphs (Sections B.5 and B.6).
Limitations. The sharp rates of § 3 are for an Erdős–Rényi null and two explicit alternatives. For non-constant nulls we prove upper bounds only, since matching lower bounds would need a second-moment method for nulls that are mixtures over latent positions, which we leave open. Theorem 2 needs a regular null, and part (ii) covers finitely many tree statistics in the dense regime, so message-passing architectures at finite n n n remain open. Partially aligned samples, such as networks registered to a common atlas, and tests that first estimate the partition of each graph when t > 1 t > 1 t > 1 are outside our analysis. Apart from the protein graphs, whose alternative is a synthetic rewiring, our experiments are simulations, and the exact small-m m m test gives up motifs that cross blocks.
Broader impact. This methodological work mainly bears on the evaluation of generative models of networks, where metrics that ignore cycles can report a good fit for a model that is wrong in ways they cannot detect. We do not foresee negative societal consequences.
Proofs
This appendix proves the results of § 3 to § 6 in the order of the main text. Twelve numerical checks, numbered (i)–(xii), test identities and bounds below by exact enumeration on small graphs or by simulation. Their scripts and outputs are part of the code released with the paper.
Conventions. We write [ n ] = { 1 , … , n } [n] = \{1,\ldots,n\} [ n ] = { 1 , … , n } , let E n E_n E n be the set of unordered pairs e = { i , j } ⊂ [ n ] e = \{i,j\} \subset[n] e = { i , j } ⊂ [ n ] , and put N = ∣ E n ∣ = ( n 2 ) N = |E_n| = \binom{n}{2} N = ∣ E n ∣ = ( 2 n ) . A graph on [ n ] [n] [ n ] is identified with its adjacency vector A ∈ { 0 , 1 } E n A \in\{0,1\}^{E_n} A ∈ { 0 , 1 } E n .
For S ⊆ E n S \subseteq E_n S ⊆ E n , V ( S ) V(S) V ( S ) is the set of endpoints of edges in S S S , deg S ( i ) \deg_S(i) deg S ( i ) the degree of i i i in S S S , Odd ( S ) = { i : deg S ( i ) odd } \operatorname{Odd}(S) = \{i : \deg_S(i)\text{ odd}\} Odd ( S ) = { i : deg S ( i ) odd } , c ( S ) c(S) c ( S ) the number of connected components of the graph ( V ( S ) , S ) (V(S),S) ( V ( S ) , S ) and β ( S ) = ∣ S ∣ − ∣ V ( S ) ∣ + c ( S ) \beta(S) = |S| - |V(S)| + c(S) β ( S ) = ∣ S ∣ − ∣ V ( S ) ∣ + c ( S ) its cyclomatic number. We call S S S even if Odd ( S ) = ∅ \operatorname{Odd}(S) = \varnothing Odd ( S ) = ∅ , and E n \mathcal{E}_n E n denotes the set of even S ⊆ E n S \subseteq E_n S ⊆ E n , including ∅ \varnothing ∅ . For a finite graph G G G , C ( G ) \mathcal{C}(G) C ( G ) is its set of cycles, viewed as edge sets.
For x ∈ R E n x \in\mathbb{R}^{E_n} x ∈ R E n we write x S = ∏ e ∈ S x e x^S = \prod_{e\in S} x_e x S = ∏ e ∈ S x e , with x ∅ = 1 x^\varnothing= 1 x ∅ = 1 . For σ ∈ { ± 1 } n \sigma\in\{\pm1\}^n σ ∈ { ± 1 } n and B ⊆ [ n ] B \subseteq[n] B ⊆ [ n ] we write σ B = ∏ i ∈ B σ i \sigma^B = \prod_{i\in B}\sigma_i σ B = ∏ i ∈ B σ i , so that
∏ { i , j } ∈ S σ i σ j = σ Odd ( S ) , E σ B = 1 [ B = ∅ ] for uniform σ . (5) \prod_{\{i,j\}\in S}\sigma_i\sigma_j = \sigma^{\operatorname{Odd}(S)}, \qquad\mathbb{E}\sigma^B = 1[B=\varnothing] \quad\text{for uniform }\sigma. \tag*{(5)} { i , j } ∈ S ∏ σ i σ j = σ Odd ( S ) , E σ B = 1 [ B = ∅ ] for uniform σ . (5)
For a graph F F F without isolated vertices, K n ( F ) \mathcal{K}_n(F) K n ( F ) is the set of copies of F F F , that is, of the S ⊆ E n S \subseteq E_n S ⊆ E n with ( V ( S ) , S ) ≅ F (V(S),S)\cong F ( V ( S ) , S ) ≅ F , and ∣ K n ( F ) ∣ = ( n ) v ( F ) / ∣ Aut ( F ) ∣ |\mathcal{K}_n(F)| = (n)_{v(F)}/|\operatorname{Aut}(F)| ∣ K n ( F ) ∣ = ( n ) v ( F ) /∣ Aut ( F ) ∣ . Throughout, p ∈ ( 0 , 1 ) p \in(0,1) p ∈ ( 0 , 1 ) , q = p ( 1 − p ) q = p(1-p) q = p ( 1 − p ) , η = δ 2 / q \eta= \delta^2/q η = δ 2 / q and t = n η t = n\eta t = n η . The null is P 0 = G ( n , p ) P_0 = G(n,p) P 0 = G ( n , p ) . The planted partition law P δ P_\delta P δ draws σ \sigma σ uniformly from { ± 1 } n \{\pm1\}^n { ± 1 } n and then, given σ \sigma σ , independent A i j ∼ Bern ( p + δ σ i σ j ) A_{ij} \sim\operatorname{Bern}(p+\delta\sigma_i\sigma_j) A ij ∼ Bern ( p + δ σ i σ j ) , where 0 < δ ≤ min ( p , 1 − p ) 0 < \delta\leq\min(p,1-p) 0 < δ ≤ min ( p , 1 − p ) . Tests may be randomized, so a test ψ \psi ψ takes values in [ 0 , 1 ] [0,1] [ 0 , 1 ] .
Preliminaries
Lemma A.1 (Tensorization, two-sample reduction and Le Cam). Let P , Q , R , P i , Q i P,Q,R,P_i,Q_i P , Q , R , P i , Q i be probability measures on finite sets with P ≪ Q P \ll Q P ≪ Q , P i ≪ Q i P_i \ll Q_i P i ≪ Q i .
(a)
1 + χ 2 ( ⨂ i = 1 m P i ∥ ⨂ i = 1 m Q i ) = ∏ i = 1 m ( 1 + χ 2 ( P i ∥ Q i ) ) . 1+\chi^2\left(\bigotimes_{i=1}^m P_i \mathbin{\Big\|} \bigotimes_{i=1}^m Q_i\right) = \prod_{i=1}^m \left(1+\chi^2(P_i\|Q_i)\right). 1 + χ 2 ( i = 1 ⨂ m P i i = 1 ⨂ m Q i ) = i = 1 ∏ m ( 1 + χ 2 ( P i ∥ Q i ) ) . (b)
d T V ( P ⊗ R , Q ⊗ R ) = d T V ( P , Q ) . d_{\mathrm{TV}}(P\otimes R,Q\otimes R) = d_{\mathrm{TV}}(P,Q). d TV ( P ⊗ R , Q ⊗ R ) = d TV ( P , Q ) . (c) For every test ψ \psi ψ , E P ψ + E Q ( 1 − ψ ) ≥ 1 − d T V ( P , Q ) \mathbb{E}_P\psi+\mathbb{E}_Q(1-\psi)\geq1-d_{\mathrm{TV}}(P,Q) E P ψ + E Q ( 1 − ψ ) ≥ 1 − d TV ( P , Q ) , and d T V ( P , Q ) ≤ 1 2 χ 2 ( P ∥ Q ) 1 / 2 d_{\mathrm{TV}}(P,Q)\leq\frac{1}{2}\chi^2(P\|Q)^{1/2} d TV ( P , Q ) ≤ 2 1 χ 2 ( P ∥ Q ) 1/2 .
(d) Let H 0 H_0 H 0 be a set of pairs of laws containing ( P 0 , P 0 ) (P_0,P_0) ( P 0 , P 0 ) and H 1 H_1 H 1 a set containing ( P 1 , P 0 ) (P_1,P_0) ( P 1 , P 0 ) . Then every test ψ \psi ψ of ( G 1 , … , G m , G 1 ′ , … , G m ′ ) (G_1,\ldots,G_m,G'_1,\ldots,G'_m) ( G 1 , … , G m , G 1 ′ , … , G m ′ ) , where G ℓ ∼ P G_\ell\sim P G ℓ ∼ P , G ℓ ′ ∼ Q G'_\ell\sim Q G ℓ ′ ∼ Q are independent, satisfies
sup ( P , Q ) ∈ H 0 E ψ + sup ( P , Q ) ∈ H 1 E ( 1 − ψ ) ≥ 1 − d T V ( P 1 ⊗ m , P 0 ⊗ m ) \sup_{(P,Q)\in H_0}\mathbb{E}\psi+\sup_{(P,Q)\in H_1}\mathbb{E}(1-\psi)\geq1-d_{\mathrm{TV}}(P_1^{\otimes m},P_0^{\otimes m}) ( P , Q ) ∈ H 0 sup E ψ + ( P , Q ) ∈ H 1 sup E ( 1 − ψ ) ≥ 1 − d TV ( P 1 ⊗ m , P 0 ⊗ m ) ≥ 1 − 1 2 ( ( 1 + χ 2 ( P 1 ∥ P 0 ) ) m − 1 ) 1 / 2 . \geq1-\frac{1}{2}\left((1+\chi^2(P_1\|P_0))^m-1\right)^{1/2}. ≥ 1 − 2 1 ( ( 1 + χ 2 ( P 1 ∥ P 0 ) ) m − 1 ) 1/2 .
Proof. (a) The likelihood ratio of the products is ∏ i L i \prod_i L_i ∏ i L i with L i = d P i / d Q i L_i=dP_i/dQ_i L i = d P i / d Q i , and under ⨂ Q i \bigotimes Q_i ⨂ Q i the factors are independent, so E ∏ i L i 2 = ∏ i E Q i L i 2 = ∏ i ( 1 + χ 2 ( P i ∥ Q i ) ) \mathbb{E}\prod_i L_i^2=\prod_i\mathbb{E}_{Q_i}L_i^2=\prod_i(1+\chi^2(P_i\|Q_i)) E ∏ i L i 2 = ∏ i E Q i L i 2 = ∏ i ( 1 + χ 2 ( P i ∥ Q i )) . (b) d T V ( P ⊗ R , Q ⊗ R ) = 1 2 ∑ x , y ∣ P ( x ) − Q ( x ) ∣ R ( y ) = d T V ( P , Q ) d_{\mathrm{TV}}(P\otimes R,Q\otimes R)=\frac{1}{2}\sum_{x,y}|P(x)-Q(x)|R(y)=d_{\mathrm{TV}}(P,Q) d TV ( P ⊗ R , Q ⊗ R ) = 2 1 ∑ x , y ∣ P ( x ) − Q ( x ) ∣ R ( y ) = d TV ( P , Q ) . (c) E P ψ + E Q ( 1 − ψ ) = 1 − ( E Q ψ − E P ψ ) ≥ 1 − d T V ( P , Q ) \mathbb{E}_P\psi+\mathbb{E}_Q(1-\psi)=1-(\mathbb{E}_Q\psi-\mathbb{E}_P\psi)\geq1-d_{\mathrm{TV}}(P,Q) E P ψ + E Q ( 1 − ψ ) = 1 − ( E Q ψ − E P ψ ) ≥ 1 − d TV ( P , Q ) because 0 ≤ ψ ≤ 1 0\leq\psi\leq1 0 ≤ ψ ≤ 1 . By Cauchy–Schwarz, 2 d T V ( P , Q ) = E Q ∣ d P / d Q − 1 ∣ ≤ ( E Q ( d P / d Q − 1 ) 2 ) 1 / 2 = χ 2 ( P ∥ Q ) 1 / 2 2d_{\mathrm{TV}}(P,Q)=\mathbb{E}_Q|dP/dQ-1|\leq(\mathbb{E}_Q(dP/dQ-1)^2)^{1/2}=\chi^2(P\|Q)^{1/2} 2 d TV ( P , Q ) = E Q ∣ d P / d Q − 1∣ ≤ ( E Q ( d P / d Q − 1 ) 2 ) 1/2 = χ 2 ( P ∥ Q ) 1/2 . (d) The left side is at least E P 0 ⊗ 2 m ψ + E P 1 ⊗ m ⊗ P 0 ⊗ m ( 1 − ψ ) \mathbb{E}_{P_0^{\otimes2m}}\psi+\mathbb{E}_{P_1^{\otimes m}\otimes P_0^{\otimes m}}(1-\psi) E P 0 ⊗ 2 m ψ + E P 1 ⊗ m ⊗ P 0 ⊗ m ( 1 − ψ ) , which by (c) and (b) is at least 1 − d T V ( P 1 ⊗ m ⊗ P 0 ⊗ m , P 0 ⊗ m ⊗ P 0 ⊗ m ) = 1 − d T V ( P 1 ⊗ m , P 0 ⊗ m ) 1-d_{\mathrm{TV}}(P_1^{\otimes m}\otimes P_0^{\otimes m},P_0^{\otimes m}\otimes P_0^{\otimes m})=1-d_{\mathrm{TV}}(P_1^{\otimes m},P_0^{\otimes m}) 1 − d TV ( P 1 ⊗ m ⊗ P 0 ⊗ m , P 0 ⊗ m ⊗ P 0 ⊗ m ) = 1 − d TV ( P 1 ⊗ m , P 0 ⊗ m ) . Finally apply (c) and (a). □ \square □
Remark 1. Lemma A.1(d) shows that a two-sample test is never better than a one-sample test that knows the null law. The lower bounds below therefore hold for the one-sample problem, for tests that know ( p , δ ) (p,\delta) ( p , δ ) , and for tests that use the vertex labels.
Lemma A.2 (Per-edge second moment). Let Λ \Lambda Λ be a random element with law π \pi π and h : supp π → R E n h:\operatorname{supp}\pi\to\mathbb{R}^{E_n} h : supp π → R E n with p + h e ( Λ ) ∈ [ 0 , 1 ] p+h_e(\Lambda)\in[0,1] p + h e ( Λ ) ∈ [ 0 , 1 ] . Let P h P_h P h be the law of A A A when, given Λ = λ \Lambda=\lambda Λ = λ , the A e A_e A e are independent
Bern( p + h e ( λ ) ) (p+h_e(\lambda)) ( p + h e ( λ )) . Put X e = ( A e − p ) / q X_e=(A_e-p)/q X e = ( A e − p ) / q and L λ ( A ) = ∏ e ∈ E n ( 1 + h e ( λ ) X e ) L_\lambda(A)=\prod_{e\in E_n}(1+h_e(\lambda)X_e) L λ ( A ) = ∏ e ∈ E n ( 1 + h e ( λ ) X e ) . Then P h ≪ P 0 P_h\ll P_0 P h ≪ P 0 , d P h / d P 0 = E Λ L Λ \mathrm{d}P_h/\mathrm{d}P_0=\mathbb{E}_\Lambda L_\Lambda d P h / d P 0 = E Λ L Λ , and for all λ , λ ′ \lambda,\lambda' λ , λ ′ ,
E 0 [ L λ L λ ′ ] = ∏ e ∈ E n ( 1 + h e ( λ ) h e ( λ ′ ) q ) , E 0 ( d P h d P 0 ) 2 = E ∏ e ∈ E n ( 1 + h e ( Λ ) h e ( Λ ′ ) q ) . \mathbb{E}_0[L_\lambda L_{\lambda'}]=\prod_{e\in E_n}\left(1+\frac{h_e(\lambda)h_e(\lambda')}{q}\right),\qquad\mathbb{E}_0\left(\frac{\mathrm{d}P_h}{\mathrm{d}P_0}\right)^2=\mathbb{E}\prod_{e\in E_n}\left(1+\frac{h_e(\Lambda)h_e(\Lambda')}{q}\right). E 0 [ L λ L λ ′ ] = e ∈ E n ∏ ( 1 + q h e ( λ ) h e ( λ ′ ) ) , E 0 ( d P 0 d P h ) 2 = E e ∈ E n ∏ ( 1 + q h e ( Λ ) h e ( Λ ′ ) ) .
where Λ ′ \Lambda' Λ ′ is an independent copy of Λ \Lambda Λ .
Proof. Let a ∈ { 0 , 1 } a\in\{0,1\} a ∈ { 0 , 1 } and x = ( a − p ) / q x=(a-p)/q x = ( a − p ) / q . If a = 1 a=1 a = 1 , then ( p + h ) / p = 1 + h ( 1 − p ) / q = 1 + h x (p+h)/p=1+h(1-p)/q=1+hx ( p + h ) / p = 1 + h ( 1 − p ) / q = 1 + h x , and if a = 0 a=0 a = 0 , then ( 1 − p − h ) / ( 1 − p ) = 1 − h p / q = 1 + h x (1-p-h)/(1-p)=1-hp/q=1+hx ( 1 − p − h ) / ( 1 − p ) = 1 − h p / q = 1 + h x . Multiplying over edges gives d P h ( ⋅ ∣ Λ = λ ) / d P 0 = L λ \mathrm{d}P_h(\cdot\mid\Lambda=\lambda)/\mathrm{d}P_0=L_\lambda d P h ( ⋅ ∣ Λ = λ ) / d P 0 = L λ and, averaging over λ \lambda λ , d P h / d P 0 = E Λ L Λ \mathrm{d}P_h/\mathrm{d}P_0=\mathbb{E}_\Lambda L_\Lambda d P h / d P 0 = E Λ L Λ . Under P 0 P_0 P 0 the X e X_e X e are independent with E 0 X e = 0 \mathbb{E}_0X_e=0 E 0 X e = 0 and E 0 X e 2 = q / q 2 = 1 / q \mathbb{E}_0X_e^2=q/q^2=1/q E 0 X e 2 = q / q 2 = 1/ q , so E 0 [ ( 1 + h e X e ) ( 1 + h e ′ X e ) ] = 1 + h e h e ′ / q \mathbb{E}_0[(1+h_eX_e)(1+h'_eX_e)]=1+h_eh'_e/q E 0 [( 1 + h e X e ) ( 1 + h e ′ X e )] = 1 + h e h e ′ / q and the product formula follows. The last identity follows from E 0 ( E Λ L Λ ) 2 = E Λ , Λ ′ E 0 [ L Λ L Λ ′ ] \mathbb{E}_0(\mathbb{E}_\Lambda L_\Lambda)^2=\mathbb{E}_{\Lambda,\Lambda'}\mathbb{E}_0[L_\Lambda L_{\Lambda'}] E 0 ( E Λ L Λ ) 2 = E Λ , Λ ′ E 0 [ L Λ L Λ ′ ] by Fubini’s theorem, since all quantities are finite sums. □
Lemma A.3 (Even-subgraph expansion). Let G = ( V , E ) G=(V,E) G = ( V , E ) be a finite graph, ω \omega ω uniform on { ± 1 } V \{\pm1\}^V { ± 1 } V and ( x e ) e ∈ E (x_e)_{e\in E} ( x e ) e ∈ E real. Then
E ω ∏ { i , j } ∈ E ( 1 + x i j ω i ω j ) = ∑ S ⊆ E , S e v e n x S . \mathbb{E}_\omega\prod_{\{i,j\}\in E}(1+x_{ij}\omega_i\omega_j)=\sum_{\substack{S\subseteq E,\ S\ \mathrm{even}}}x^S. E ω { i , j } ∈ E ∏ ( 1 + x ij ω i ω j ) = S ⊆ E , S even ∑ x S . In particular E ω ∏ i < j ( 1 + x ω i ω j ) = ∑ S ∈ E n x ∣ S ∣ \mathbb{E}_\omega\prod_{i<j}(1+x\omega_i\omega_j)=\sum_{S\in E_n}x^{|S|} E ω ∏ i < j ( 1 + x ω i ω j ) = ∑ S ∈ E n x ∣ S ∣ .
Proof. Expanding the product, ∏ { i , j } ∈ E ( 1 + x e ω i ω j ) = ∑ S ⊆ E x S ∏ { i , j } ∈ S ω i ω j = ∑ S ⊆ E x S ω Odd ( S ) \prod_{\{i,j\}\in E}(1+x_e\omega_i\omega_j)=\sum_{S\subseteq E}x^S\prod_{\{i,j\}\in S}\omega_i\omega_j=\sum_{S\subseteq E}x^S\omega^{\operatorname{Odd}(S)} ∏ { i , j } ∈ E ( 1 + x e ω i ω j ) = ∑ S ⊆ E x S ∏ { i , j } ∈ S ω i ω j = ∑ S ⊆ E x S ω Odd ( S ) , and E ω ω Odd ( S ) = 1 [ S e v e n ] \mathbb{E}_\omega\omega^{\operatorname{Odd}(S)}=\mathbf{1}[S\ \mathrm{even}] E ω ω Odd ( S ) = 1 [ S even ] by (5). □
Lemma A.4 (Veblen-type bound). Let G = ( V , E ) G=(V,E) G = ( V , E ) be a finite graph and x e ≥ 0 x_e\ge0 x e ≥ 0 . Then
∑ S ⊆ E , S e v e n x S ≤ ∏ C ∈ C ( G ) ( 1 + x C ) ≤ exp ( ∑ C ∈ C ( G ) x C ) . \sum_{\substack{S\subseteq E,\ S\ \mathrm{even}}}x^S\le\prod_{C\in\mathcal{C}(G)}(1+x^C)\le\exp\left(\sum_{C\in\mathcal{C}(G)}x^C\right). S ⊆ E , S even ∑ x S ≤ C ∈ C ( G ) ∏ ( 1 + x C ) ≤ exp C ∈ C ( G ) ∑ x C . For G = K n G=K_n G = K n and x e ≡ x = t / n ≥ 0 x_e\equiv x=t/n\ge0 x e ≡ x = t / n ≥ 0 this reads ∑ S ∈ E n x ∣ S ∣ ≤ exp ( g n ( t ) ) \sum_{S\in E_n}x^{|S|}\le\exp(g_n(t)) ∑ S ∈ E n x ∣ S ∣ ≤ exp ( g n ( t )) with g n ( t ) = ∑ k = 3 n ( n ) k 2 k n k t k g_n(t)=\sum_{k=3}^n\frac{(n)_k}{2k n^k}t^k g n ( t ) = ∑ k = 3 n 2 k n k ( n ) k t k .
Proof. Every even edge set is a union of pairwise edge-disjoint cycles (Veblen’s theorem). To see this, let S ≠ ∅ S\ne\varnothing S = ∅ be even. The graph ( V ( S ) , S ) (V(S),S) ( V ( S ) , S ) has minimum degree at least two and so contains a cycle C C C , and S ∖ C S\setminus C S ∖ C is again even, so induction on ∣ S ∣ |S| ∣ S ∣ applies. Fix for each even S S S one such decomposition D ( S ) ⊆ C ( G ) D(S)\subseteq\mathcal{C}(G) D ( S ) ⊆ C ( G ) . The cycles in D ( S ) D(S) D ( S ) are distinct and pairwise edge-disjoint, so x S = ∏ C ∈ D ( S ) x C x^S=\prod_{C\in D(S)}x^C x S = ∏ C ∈ D ( S ) x C , and S ↦ D ( S ) S\mapsto D(S) S ↦ D ( S ) is injective because S = ⋃ C ∈ D ( S ) C S=\bigcup_{C\in D(S)}C S = ⋃ C ∈ D ( S ) C . Since all terms are non-negative, ∑ S e v e n x S = ∑ S ∏ C ∈ D ( S ) x C ≤ ∑ D ⊆ C ( G ) ∏ C ∈ D x C = ∏ C ∈ C ( G ) ( 1 + x C ) \sum_{S\ \mathrm{even}}x^S=\sum_S\prod_{C\in D(S)}x^C\le\sum_{D\subseteq\mathcal{C}(G)}\prod_{C\in D}x^C=\prod_{C\in\mathcal{C}(G)}(1+x^C) ∑ S even x S = ∑ S ∏ C ∈ D ( S ) x C ≤ ∑ D ⊆ C ( G ) ∏ C ∈ D x C = ∏ C ∈ C ( G ) ( 1 + x C ) , and 1 + y ≤ e y 1+y\le e^y 1 + y ≤ e y . In K n K_n K n there are ( n ) k / ( 2 k ) (n)_k/(2k) ( n ) k / ( 2 k ) cycles of length k k k (sequences of k k k distinct vertices up to the k k k rotations and 2 reflections), which gives ∑ C x ∣ C ∣ = ∑ k = 3 n ( n ) k 2 k t k n k = g n ( t ) \sum_Cx^{|C|}=\sum_{k=3}^n\frac{(n)_k}{2k}\frac{t^k}{n^k}=g_n(t) ∑ C x ∣ C ∣ = ∑ k = 3 n 2 k ( n ) k n k t k = g n ( t ) . □
Lemma A.5 (The function g g g ). For 0 ≤ t < 1 0\le t<1 0 ≤ t < 1 and n ≥ 3 n\ge3 n ≥ 3 , g n ( t ) ≤ g ( t ) : = ∑ k ≥ 3 t k 2 k = − 1 2 log ( 1 − t ) − t 2 − t 2 4 ≤ t 3 6 ( 1 − t ) g_n(t)\le g(t):=\sum_{k\ge3}\frac{t^k}{2k}=-\frac12\log(1-t)-\frac{t}{2}-\frac{t^2}{4}\le\frac{t^3}{6(1-t)} g n ( t ) ≤ g ( t ) := ∑ k ≥ 3 2 k t k = − 2 1 log ( 1 − t ) − 2 t − 4 t 2 ≤ 6 ( 1 − t ) t 3 .
Proof. The bound ( n ) k ≤ n k (n)_k\le n^k ( n ) k ≤ n k gives g n ≤ g g_n\le g g n ≤ g , the closed form follows from − log ( 1 − t ) = ∑ k ≥ 1 t k / k -\log(1-t)=\sum_{k\ge1}t^k/k − log ( 1 − t ) = ∑ k ≥ 1 t k / k , and the last inequality from ∑ k ≥ 3 t k / ( 2 k ) ≤ 1 6 ∑ k ≥ 3 t k \sum_{k\ge3}t^k/(2k)\le\frac16\sum_{k\ge3}t^k ∑ k ≥ 3 t k / ( 2 k ) ≤ 6 1 ∑ k ≥ 3 t k . □
Lemma A.6 (Curie–Weiss form and asymptotic exactness of the bound). For 0 ≤ x < 1 0\le x<1 0 ≤ x < 1 let b = artanh x b=\operatorname{artanh}x b = artanh x and M = ∑ i = 1 n ω i M=\sum_{i=1}^n\omega_i M = ∑ i = 1 n ω i with ω \omega ω uniform on { ± 1 } n \{\pm1\}^n { ± 1 } n . Then
∑ S ∈ E n x ∣ S ∣ = cosh ( b ) − n e − b n / 2 E e b M 2 / 2 . \sum_{S\in E_n}x^{|S|}=\cosh(b)^{-n}e^{-bn/2}\mathbb{E}e^{bM^2/2}. S ∈ E n ∑ x ∣ S ∣ = cosh ( b ) − n e − bn /2 E e b M 2 /2 . If n → ∞ n\to\infty n → ∞ and n x → s ∈ [ 0 , 1 ) nx\to s\in[0,1) n x → s ∈ [ 0 , 1 ) , then ∑ S ∈ E n x ∣ S ∣ → e g ( s ) = e − s / 2 − s 2 / 4 ( 1 − s ) − 1 / 2 \sum_{S\in E_n}x^{|S|}\to e^{g(s)}=e^{-s/2-s^2/4}(1-s)^{-1/2} ∑ S ∈ E n x ∣ S ∣ → e g ( s ) = e − s /2 − s 2 /4 ( 1 − s ) − 1/2 .
Proof. For y ∈ { ± 1 } y \in\{\pm1\} y ∈ { ± 1 } , 1 + x y = ( cosh b + y sinh b ) / cosh b = e b y / cosh b 1+xy=(\cosh b+y\sinh b)/\cosh b=e^{by}/\cosh b 1 + x y = ( cosh b + y sinh b ) / cosh b = e b y / cosh b . Hence ∏ i < j ( 1 + x ω i ω j ) = cosh ( b ) − N exp ( b ∑ i < j ω i ω j ) \prod_{i<j}(1+x\omega_i\omega_j)=\cosh(b)^{-N}\exp\left(b\sum_{i<j}\omega_i\omega_j\right) ∏ i < j ( 1 + x ω i ω j ) = cosh ( b ) − N exp ( b ∑ i < j ω i ω j ) and ∑ i < j ω i ω j = ( M 2 − n ) / 2 \sum_{i<j}\omega_i\omega_j=(M^2-n)/2 ∑ i < j ω i ω j = ( M 2 − n ) /2 , so Lemma A.3 gives the identity. As n x → s nx\to s n x → s , b = x + O ( x 3 ) b=x+O(x^3) b = x + O ( x 3 ) , so b n → s bn\to s bn → s , b n / 2 → s / 2 bn/2\to s/2 bn /2 → s /2 and N log cosh b = N b 2 / 2 + O ( N b 4 ) → s 2 / 4 N\log\cosh b=Nb^2/2+O(Nb^4)\to s^2/4 N log cosh b = N b 2 /2 + O ( N b 4 ) → s 2 /4 . Finally E exp ( b M 2 / 2 ) = E exp ( b n 2 ( M / n ) 2 ) → ( 1 − s ) − 1 / 2 \mathbb{E}\exp(bM^2/2)=\mathbb{E}\exp\left(\frac{bn}{2}(M/\sqrt n)^2\right)\to(1-s)^{-1/2} E exp ( b M 2 /2 ) = E exp ( 2 bn ( M / n ) 2 ) → ( 1 − s ) − 1/2 because M / n → N ( 0 , 1 ) M/\sqrt n\to N(0,1) M / n → N ( 0 , 1 ) in law, E e s Z 2 / 2 = ( 1 − s ) − 1 / 2 \mathbb{E}e^{sZ^2/2}=(1-s)^{-1/2} E e s Z 2 /2 = ( 1 − s ) − 1/2 , and the family is uniformly integrable. For the last point take s < s ′ < 1 s<s'<1 s < s ′ < 1 . Then b n ≤ s ′ bn\le s' bn ≤ s ′ eventually, and Hoeffding’s inequality gives P ( e s ′ M 2 / ( 2 n ) ≥ K ) ≤ 2 K − 1 / s ′ \mathbb{P}(e^{s'M^2/(2n)}\ge K)\le2K^{-1/s'} P ( e s ′ M 2 / ( 2 n ) ≥ K ) ≤ 2 K − 1/ s ′ with 1 / s ′ > 1 1/s'>1 1/ s ′ > 1 [52 arXiv version, Lemma 5.5] . □ \square □
Lemma A.7 (Moments of signed sums under latent-variable models). In the setting of Lemma A.2, write μ e = h e ( Λ ) \mu_e=h_e(\Lambda) μ e = h e ( Λ ) , ξ e = A e − p − μ e \xi_e=A_e-p-\mu_e ξ e = A e − p − μ e and v e = ( p + μ e ) ( 1 − p − μ e ) v_e=(p+\mu_e)(1-p-\mu_e) v e = ( p + μ e ) ( 1 − p − μ e ) . Given Λ \Lambda Λ , the ξ e \xi_e ξ e are independent, centred, ∣ ξ e ∣ ≤ 1 |\xi_e|\le1 ∣ ξ e ∣ ≤ 1 and E [ ξ e 2 ∣ Λ ] = v e \mathbb{E}[\xi_e^2\mid\Lambda]=v_e E [ ξ e 2 ∣ Λ ] = v e . Let S S S be a finite set of edge sets and Y = ∑ φ ∈ S ( A − p ) φ Y=\sum_{\varphi\in S}(A-p)^\varphi Y = ∑ φ ∈ S ( A − p ) φ . For R ⊆ E n R\subseteq E_n R ⊆ E n put c R = ∑ φ ∈ S , φ ⊇ R μ φ ∖ R c_R=\sum_{\varphi\in S,\ \varphi\supseteq R}\mu^{\varphi\setminus R} c R = ∑ φ ∈ S , φ ⊇ R μ φ ∖ R . Then
Y = ∑ R c R ξ R , E [ Y ∣ Λ ] = c ∅ = ∑ φ ∈ S μ φ , Var ( Y ∣ Λ ) = ∑ R ≠ ∅ c R 2 v R , Y=\sum_R c_R\xi^R,\qquad\mathbb{E}[Y\mid\Lambda]=c_\varnothing=\sum_{\varphi\in S}\mu^\varphi,\qquad\operatorname{Var}(Y\mid\Lambda)=\sum_{R\ne\varnothing}c_R^2v^R, Y = R ∑ c R ξ R , E [ Y ∣ Λ ] = c ∅ = φ ∈ S ∑ μ φ , Var ( Y ∣ Λ ) = R = ∅ ∑ c R 2 v R ,
and
Var Y = Var ( ∑ φ ∈ S μ φ ) + ∑ R ≠ ∅ E [ c R 2 v R ] . \operatorname{Var}Y=\operatorname{Var}\left(\sum_{\varphi\in S}\mu^\varphi\right)+\sum_{R\ne\varnothing}\mathbb{E}\left[c_R^2v^R\right]. Var Y = Var φ ∈ S ∑ μ φ + R = ∅ ∑ E [ c R 2 v R ] .
Proof. ( A − p ) φ = ∏ e ∈ φ ( μ e + ξ e ) = ∑ R ⊆ φ μ φ ∖ R ξ R (A-p)^\varphi=\prod_{e\in\varphi}(\mu_e+\xi_e)=\sum_{R\subseteq\varphi}\mu^{\varphi\setminus R}\xi^R ( A − p ) φ = ∏ e ∈ φ ( μ e + ξ e ) = ∑ R ⊆ φ μ φ ∖ R ξ R , and collecting terms by R R R gives Y = ∑ R c R ξ R Y=\sum_Rc_R\xi^R Y = ∑ R c R ξ R . Given Λ \Lambda Λ , E [ ξ R ξ R ′ ∣ Λ ] = 1 [ R = R ′ ] v R \mathbb{E}[\xi^R\xi^{R'}\mid\Lambda]=1[R=R']v^R E [ ξ R ξ R ′ ∣ Λ ] = 1 [ R = R ′ ] v R by independence and centring, which gives the conditional mean and variance. The last identity is the law of total variance. □ \square □
Theorem 1: sample complexity under a constant null
Theorem (Restatement of Theorem 1). Let n ≥ 3 n\ge3 n ≥ 3 , m ≥ 1 m\ge1 m ≥ 1 , p ∈ ( 0 , 1 ) p\in(0,1) p ∈ ( 0 , 1 ) , 0 < δ ≤ min ( p , 1 − p ) 0<\delta\le\min(p,1-p) 0 < δ ≤ min ( p , 1 − p ) , L = d P δ / d P 0 L=dP_\delta/dP_0 L = d P δ / d P 0 , c α β = log ( 1 + 4 ( 1 − α − β ) 2 ) c_{\alpha\beta}=\log(1+4(1-\alpha-\beta)^2) c α β = log ( 1 + 4 ( 1 − α − β ) 2 ) for α + β < 1 \alpha+\beta<1 α + β < 1 .
(i) 1 + χ 2 ( P δ ⊗ m ∥ P 0 ⊗ m ) = ( E 0 L 2 ) m 1+\chi^2(P_\delta^{\otimes m}\Vert P_0^{\otimes m})=(\mathbb{E}_0L^2)^m 1 + χ 2 ( P δ ⊗ m ∥ P 0 ⊗ m ) = ( E 0 L 2 ) m with E 0 L 2 = ∑ S ∈ E n η ∣ S ∣ ≤ e g n ( t ) \mathbb{E}_0L^2=\sum_{S\in E_n}\eta^{|S|}\le e^{g_n(t)} E 0 L 2 = ∑ S ∈ E n η ∣ S ∣ ≤ e g n ( t ) . For t < 1 t<1 t < 1 , g n ( t ) ≤ g ( t ) ≤ t 3 / ( 6 ( 1 − t ) ) g_n(t)\le g(t)\le t^3/(6(1-t)) g n ( t ) ≤ g ( t ) ≤ t 3 / ( 6 ( 1 − t )) and E 0 L 2 → e g ( t ) \mathbb{E}_0L^2\to e^{g(t)} E 0 L 2 → e g ( t ) as n → ∞ n\to\infty n → ∞ . Every test of H 0 : P = Q H_0:P=Q H 0 : P = Q against H 1 ∋ ( P δ , P 0 ) H_1\ni(P_\delta,P_0) H 1 ∋ ( P δ , P 0 ) with m m m graphs per group has sup H 0 E ψ + sup H 1 E ( 1 − ψ ) ≥ 1 − 1 2 ( e m g n ( t ) − 1 ) 1 / 2 \sup_{H_0}\mathbb{E}\psi+\sup_{H_1}\mathbb{E}(1-\psi)\ge1-\frac12(e^{mg_n(t)}-1)^{1/2} sup H 0 E ψ + sup H 1 E ( 1 − ψ ) ≥ 1 − 2 1 ( e m g n ( t ) − 1 ) 1/2 , errors ( α , β ) (\alpha,\beta) ( α , β ) require m ≥ c α β / g n ( t ) m\ge c_{\alpha\beta}/g_n(t) m ≥ c α β / g n ( t ) , and for t < 1 t<1 t < 1 , m ≥ c α β / g ( t ) ≥ 6 ( 1 − t ) c α β / t 3 m\ge c_{\alpha\beta}/g(t)\ge6(1-t)c_{\alpha\beta}/t^3 m ≥ c α β / g ( t ) ≥ 6 ( 1 − t ) c α β / t 3 .
(ii) The moments of T p T_p T p are as in Lemma A.8. The test ψ 3 = 1 { ∣ D 3 ∣ ≥ λ 3 } \psi_3=1\{|D_3|\ge\lambda_3\} ψ 3 = 1 { ∣ D 3 ∣ ≥ λ 3 } , D 3 = ∑ ℓ ≤ m T p ( G ℓ ) − ∑ ℓ ≤ m T p ( G ℓ ′ ) D_3=\sum_{\ell\le m}T_p(G_\ell)-\sum_{\ell\le m}T_p(G'_\ell) D 3 = ∑ ℓ ≤ m T p ( G ℓ ) − ∑ ℓ ≤ m T p ( G ℓ ′ ) , λ 3 = ( 2 m ( n 3 ) q 3 / α ) 1 / 2 \lambda_3=(2m\binom{n}{3}q^3/\alpha)^{1/2} λ 3 = ( 2 m ( 3 n ) q 3 / α ) 1/2 , has size ≤ α \le\alpha ≤ α under P = Q = P 0 P=Q=P_0 P = Q = P 0 and type II error ≤ β \le\beta ≤ β under ( P δ , P 0 ) (P_\delta,P_0) ( P δ , P 0 ) whenever m s n 2 ≥ ( 2 / α + ( 2 + ε n ) / β ) 2 ms_n^2\ge(\sqrt{2/\alpha}+\sqrt{(2+\varepsilon_n)/\beta})^2 m s n 2 ≥ ( 2/ α + ( 2 + ε n ) / β ) 2 , where s n 2 = ( n 3 ) η 3 = t 3 ( n − 1 ) ( n − 2 ) / ( 6 n 2 ) s_n^2=\binom{n}{3}\eta^3=t^3(n-1)(n-2)/(6n^2) s n 2 = ( 3 n ) η 3 = t 3 ( n − 1 ) ( n − 2 ) / ( 6 n 2 ) and ε n \varepsilon_n ε n is as in Lemma A.8.
(iii) 1 + χ 2 ( P δ a l , m ∥ P 0 ⊗ m ) = A m N ∑ S ∈ E n ( B m / A m ) ∣ S ∣ ≤ exp ( ( m 2 ) N η 2 + g n ( u m ) ) 1+\chi^2(P_\delta^{\mathrm{al},m}\Vert P_0^{\otimes m})=A_m^N\sum_{S\in E_n}(B_m/A_m)^{|S|}\le\exp\left(\binom{m}{2}N\eta^2+g_n(u_m)\right) 1 + χ 2 ( P δ al , m ∥ P 0 ⊗ m ) = A m N ∑ S ∈ E n ( B m / A m ) ∣ S ∣ ≤ exp ( ( 2 m ) N η 2 + g n ( u m ) ) , ( m 2 ) N η 2 = m ( m − 1 ) ( n − 1 ) t 2 / ( 4 n ) \binom{m}{2}N\eta^2=m(m-1)(n-1)t^2/(4n) ( 2 m ) N η 2 = m ( m − 1 ) ( n − 1 ) t 2 / ( 4 n ) , u m = n B m / A m = n tanh ( m artanh η ) ≤ κ η m t u_m=nB_m/A_m=n\tanh(m\operatorname{artanh}\eta)\le\kappa_\eta mt u m = n B m / A m = n tanh ( m artanh η ) ≤ κ η m t with κ η = artanh ( η ) / η ≤ ( 1 − η 2 ) − 1 \kappa_\eta=\operatorname{artanh}(\eta)/\eta\le(1-\eta^2)^{-1} κ η = artanh ( η ) / η ≤ ( 1 − η 2 ) − 1 . If κ η m t < x α β \kappa_\eta mt<x_{\alpha\beta} κ η m t < x α β , where x α β ∈ ( 0 , 1 ) x_{\alpha\beta}\in(0,1) x α β ∈ ( 0 , 1 ) solves x 2 / 4 + g ( x ) = c α β x^2/4+g(x)=c_{\alpha\beta} x 2 /4 + g ( x ) = c α β , no test has errors ( α , β ) (\alpha,\beta) ( α , β ) . The test ψ Q = 1 { ∣ Q ∣ ≥ ( ( m 2 ) N q 2 / α ) 1 / 2 } \psi_Q=1\{|Q|\ge(\binom{m}{2}Nq^2/\alpha)^{1/2}\} ψ Q = 1 { ∣ Q ∣ ≥ ( ( 2 m ) N q 2 / α ) 1/2 } (m ≥ 2 m\ge2 m ≥ 2 ) has size ≤ α \le\alpha ≤ α under P 0 ⊗ m P_0^{\otimes m} P 0 ⊗ m and type II error ≤ β \le\beta ≤ β under P δ a l , m P_\delta^{\mathrm{al},m} P δ al , m whenever ( m 2 ) N η 2 ≥ ( α − 1 / 2 + ( ρ m / β ) 1 / 2 ) 2 \binom{m}{2}N\eta^2\ge(\alpha^{-1/2}+(\rho_m/\beta)^{1/2})^2 ( 2 m ) N η 2 ≥ ( α − 1/2 + ( ρ m / β ) 1/2 ) 2 , ρ m = 1 + ( 2 ( m − 1 ) + ( 1 − 2 p ) 2 / q ) t / n \rho_m=1+(2(m-1)+(1-2p)^2/q)t/n ρ m = 1 + ( 2 ( m − 1 ) + ( 1 − 2 p ) 2 / q ) t / n .
(iv) Let K ′ = α − 1 / 2 + ( 2 / β ) 1 / 2 K'=\alpha^{-1/2}+(2/\beta)^{1/2} K ′ = α − 1/2 + ( 2/ β ) 1/2 , K u n = 7 ( 2 / α + 3 / β ) 2 K_{\mathrm{un}}=7(\sqrt{2/\alpha}+\sqrt{3/\beta})^2 K un = 7 ( 2/ α + 3/ β ) 2 and n 0 = max { 21 , [ 1 / q ] , [ 2 + 6 K ′ + 1 / ( 2 q ) ] } n_0=\max\{21,[1/q],[2+6K'+1/(2q)]\} n 0 = max { 21 , [ 1/ q ] , [ 2 + 6 K ′ + 1/ ( 2 q )]} . For n ≥ n 0 n\ge n_0 n ≥ n 0 and 0 < t ≤ 1 / 2 0<t\le1/2 0 < t ≤ 1/2 ,
3 c α β t 3 ≤ m ∗ ≤ 1 + K u n t 3 , 3 x α β 4 t ≤ m a l ∗ ≤ 2 + 3 K ′ t , \frac{3c_{\alpha\beta}}{t^3}\le m_* \le1+\frac{K_{\mathrm{un}}}{t^3},\qquad
\frac{3x_{\alpha\beta}}{4t}\le m_{\mathrm{al}}^*\le2+\frac{3K'}{t}, t 3 3 c α β ≤ m ∗ ≤ 1 + t 3 K un , 4 t 3 x α β ≤ m al ∗ ≤ 2 + t 3 K ′ , 3 c α β ( 1 + 3 K ′ ) t 2 ≤ m u n ∗ m a l ∗ ≤ 4 ( 1 / 8 + K u n ) 3 x α β t 2 . \frac{3c_{\alpha\beta}}{(1+3K')t^2}\le\frac{m_{\mathrm{un}}^*}{m_{\mathrm{al}}^*}\le\frac{4(1/8+K_{\mathrm{un}})}{3x_{\alpha\beta}t^2}. ( 1 + 3 K ′ ) t 2 3 c α β ≤ m al ∗ m un ∗ ≤ 3 x α β t 2 4 ( 1/8 + K un ) .
Proof of (i). We compute E 0 L 2 \mathbb{E}_0L^2 E 0 L 2 exactly, bound it by a product over cycles, and tensorize over the m m m graphs. By Lemma A.2 with Λ = σ \Lambda=\sigma Λ = σ and h i j = δ σ i σ j h_{ij}=\delta\sigma_i\sigma_j h ij = δ σ i σ j , E 0 [ L σ L τ ] = ∏ i < j ( 1 + η σ i σ j τ i τ j ) \mathbb{E}_0[L_\sigma L_\tau]=\prod_{i<j}(1+\eta\sigma_i\sigma_j\tau_i\tau_j) E 0 [ L σ L τ ] = ∏ i < j ( 1 + η σ i σ j τ i τ j ) and E 0 L 2 = E σ , τ ∏ i < j ( 1 + η ω i ω j ) \mathbb{E}_0L^2=\mathbb{E}_{\sigma,\tau}\prod_{i<j}(1+\eta\omega_i\omega_j) E 0 L 2 = E σ , τ ∏ i < j ( 1 + η ω i ω j ) with ω = σ ∘ τ \omega=\sigma\circ\tau ω = σ ∘ τ . For independent uniform σ , τ \sigma,\tau σ , τ , ω \omega ω is uniform on { ± 1 } n \{\pm1\}^n { ± 1 } n , so Lemma A.3 gives E 0 L 2 = ∑ S ∈ E n η ∣ S ∣ \mathbb{E}_0L^2=\sum_{S\in\mathcal{E}_n}\eta^{|S|} E 0 L 2 = ∑ S ∈ E n η ∣ S ∣ , and Lemma A.4 with x = η = t / n x=\eta=t/n x = η = t / n gives E 0 L 2 ≤ e g n ( t ) \mathbb{E}_0L^2\le e^{g_n(t)} E 0 L 2 ≤ e g n ( t ) . Lemma A.1(a) gives 1 + χ 2 ( P 0 ⊗ m ∥ P δ ⊗ m ) = ( E 0 L 2 ) m ≤ e m g n ( t ) 1+\chi^2(P_0^{\otimes m}\|P_\delta^{\otimes m})=(\mathbb{E}_0L^2)^m\le e^{mg_n(t)} 1 + χ 2 ( P 0 ⊗ m ∥ P δ ⊗ m ) = ( E 0 L 2 ) m ≤ e m g n ( t ) . Lemma A.5 gives the comparison with g g g , and Lemma A.6 (with x = η x=\eta x = η , n η = t n\eta=t n η = t ) the limit e g ( t ) e^{g(t)} e g ( t ) . The error bound is Lemma A.1(d) with P 1 = P δ P_1=P_\delta P 1 = P δ . If a test has errors ( α , β ) (\alpha,\beta) ( α , β ) , then α + β ≥ 1 − 1 2 ( e m g n ( t ) − 1 ) 1 / 2 \alpha+\beta\ge1-\frac12(e^{mg_n(t)}-1)^{1/2} α + β ≥ 1 − 2 1 ( e m g n ( t ) − 1 ) 1/2 , which rearranges to e m g n ( t ) ≥ 1 + 4 ( 1 − α − β ) 2 e^{mg_n(t)}\ge1+4(1-\alpha-\beta)^2 e m g n ( t ) ≥ 1 + 4 ( 1 − α − β ) 2 , that is, m ≥ c α β / g n ( t ) m\ge c_{\alpha\beta}/g_n(t) m ≥ c α β / g n ( t ) .
Remark 2 (Exact evaluation). Lemma A.6 gives E 0 L 2 \mathbb{E}_0L^2 E 0 L 2 exactly as a sum of n + 1 n+1 n + 1 terms. For the E11 settings (n = 300 n=300 n = 300 , t ∈ { 0.3 , … , 0.9 } t\in\{0.3,\ldots,0.9\} t ∈ { 0.3 , … , 0.9 } ) the exact log E 0 L 2 \log\mathbb{E}_0L^2 log E 0 L 2 , g n ( t ) g_n(t) g n ( t ) and g ( t ) g(t) g ( t ) agree to within 10% (numerical check (ii)). The lower-bound curve m L B ( t ) = c α β / g ( t ) m_{\mathrm{LB}}(t)=c_{\alpha\beta}/g(t) m LB ( t ) = c α β / g ( t ) with α = 0.05 \alpha=0.05 α = 0.05 , β = 0.5 \beta=0.5 β = 0.5 is 101.6, 17.4, 4.58 at t = 0.3 , 0.5 , 0.7 t=0.3,0.5,0.7 t = 0.3 , 0.5 , 0.7 .
Lemma A.8 (Signed triangles and signed cherries under the planted partition). Let a = q − δ 2 a=q-\delta^2 a = q − δ 2 and b = δ ( 1 − 2 p ) b=\delta(1-2p) b = δ ( 1 − 2 p ) . Then E 0 T p = 0 \mathbb{E}_0T_p=0 E 0 T p = 0 , Var 0 T p = ( n 3 ) q 3 \operatorname{Var}_0T_p=\binom{n}{3}q^3 Var 0 T p = ( 3 n ) q 3 , E [ T p ∣ σ ] = ( n 3 ) δ 3 \mathbb{E}[T_p\mid\sigma]=\binom{n}{3}\delta^3 E [ T p ∣ σ ] = ( 3 n ) δ 3 for every σ \sigma σ , and
Var δ T p = ( n 3 ) ( a 3 + b 3 + 3 δ 2 a 2 ) + N ( n − 2 ) 2 δ 4 a ≤ ( n 3 ) q 3 ( 1 + ε n ) , \operatorname{Var}_\delta T_p=\binom{n}{3}(a^3+b^3+3\delta^2a^2)+N(n-2)^2\delta^4a\le\binom{n}{3}q^3(1+\varepsilon_n), Var δ T p = ( 3 n ) ( a 3 + b 3 + 3 δ 2 a 2 ) + N ( n − 2 ) 2 δ 4 a ≤ ( 3 n ) q 3 ( 1 + ε n ) ,
ε n : = ∣ 1 − 2 p ∣ 3 ( η q ) 3 / 2 + 3 η + 3 ( n − 2 ) η 2 ≤ ∣ 1 − 2 p ∣ 3 ( t n ) 3 / 2 + 3 t ( 1 + t ) n . \varepsilon_n:=|1-2p|^3\left(\frac{\eta}{q}\right)^{3/2}+3\eta+3(n-2)\eta^2\le|1-2p|^3\left(\frac{t}{n}\right)^{3/2}+\frac{3t(1+t)}{n}. ε n := ∣1 − 2 p ∣ 3 ( q η ) 3/2 + 3 η + 3 ( n − 2 ) η 2 ≤ ∣1 − 2 p ∣ 3 ( n t ) 3/2 + n 3 t ( 1 + t ) .
For the signed cherry count S 2 = ∑ j ∑ { i , k } ∌ j ( A i j − p ) ( A j k − p ) S_2=\sum_j\sum_{\{i,k\}\not\ni j}(A_{ij}-p)(A_{jk}-p) S 2 = ∑ j ∑ { i , k } ∋ j ( A ij − p ) ( A j k − p ) (sum over paths i − j − k i-j-k i − j − k ):
E 0 S 2 = E δ S 2 = 0 , E 0 S 2 2 = 3 ( n 3 ) q 2 and E δ S 2 2 = N ( n − 2 ) [ ( n − 2 ) δ 4 + a 2 + 2 δ 2 ( a + b ) ] . \mathbb{E}_0S_2=\mathbb{E}_\delta S_2=0,\quad\mathbb{E}_0S_2^2=3\binom{n}{3}q^2\quad\text{and}\quad\mathbb{E}_\delta S_2^2=N(n-2)\left[(n-2)\delta^4+a^2+2\delta^2(a+b)\right]. E 0 S 2 = E δ S 2 = 0 , E 0 S 2 2 = 3 ( 3 n ) q 2 and E δ S 2 2 = N ( n − 2 ) [ ( n − 2 ) δ 4 + a 2 + 2 δ 2 ( a + b ) ] .
Proof. We expand T p T_p T p and S 2 S_2 S 2 in the orthogonal basis of Lemma A.7 and add up the squared coefficients.
Signed triangles. Apply Lemma A.7 with Λ = σ \Lambda=\sigma Λ = σ , μ i j = δ σ i σ j \mu_{ij}=\delta\sigma_i\sigma_j μ ij = δ σ i σ j and S S S the set of triangles. Since ( p + x ) ( 1 − p − x ) = q + x ( 1 − 2 p ) − x 2 (p+x)(1-p-x)=q+x(1-2p)-x^2 ( p + x ) ( 1 − p − x ) = q + x ( 1 − 2 p ) − x 2 and μ ~ 2 = δ 2 \tilde{\mu}^2=\delta^2 μ ~ 2 = δ 2 , we have v i j = a + b σ i σ j v_{ij}=a+b\sigma_i\sigma_j v ij = a + b σ i σ j . By (5), μ Δ = δ 3 σ Odd ( Δ ) = δ 3 \mu^\Delta=\delta^3\sigma_{\operatorname{Odd}(\Delta)}=\delta^3 μ Δ = δ 3 σ Odd ( Δ ) = δ 3 for every triangle Δ \Delta Δ , so c ∅ = ( n 3 ) δ 3 c_\varnothing=\binom{n}{3}\delta^3 c ∅ = ( 3 n ) δ 3 is non-random. The non-empty R R R contained in a triangle are of three kinds:
the triangle itself, with c R = 1 c_R=1 c R = 1 ;
a path { i j , j k } \{ij,jk\} { ij , j k } , contained only in the triangle i j k ijk ij k , with c R = μ i k c_R=\mu_{ik} c R = μ ik and c R 2 = δ 2 c_R^2=\delta^2 c R 2 = δ 2 ;
a single edge i j ij ij , contained in the n − 2 n-2 n − 2 triangles i j k ijk ij k , with c R = ∑ k ≠ i , j μ i k μ j k = ( n − 2 ) δ 2 σ i σ j c_R=\sum_{k\ne i,j}\mu_{ik}\mu_{jk}=(n-2)\delta^2\sigma_i\sigma_j c R = ∑ k = i , j μ ik μ j k = ( n − 2 ) δ 2 σ i σ j and c R 2 = ( n − 2 ) 2 δ 4 c_R^2=(n-2)^2\delta^4 c R 2 = ( n − 2 ) 2 δ 4 .
By (5), E ∏ e ∈ R ( a + b σ i σ j ) = ∑ S ⊆ R a ∣ R ∣ − ∣ S ∣ b ∣ S ∣ 1 [ S even ] \mathbb{E}\prod_{e\in R}(a+b\sigma_i\sigma_j)=\sum_{S\subseteq R}a^{|R|-|S|}b^{|S|}\mathbf{1}[S\text{ even}] E ∏ e ∈ R ( a + b σ i σ j ) = ∑ S ⊆ R a ∣ R ∣ − ∣ S ∣ b ∣ S ∣ 1 [ S even ] , which equals a 3 + b 3 a^3+b^3 a 3 + b 3 for a triangle, a 2 a^2 a 2 for a path and a a a for an edge. There are ( n 3 ) \binom{n}{3} ( 3 n ) triangles, 3 ( n 3 ) 3\binom{n}{3} 3 ( 3 n ) paths and N N N edges, which gives the formula for Var δ T p \operatorname{Var}_\delta T_p Var δ T p . Setting δ = 0 \delta=0 δ = 0 gives Var 0 T p = ( n 3 ) q 3 \operatorname{Var}_0T_p=\binom{n}{3}q^3 Var 0 T p = ( 3 n ) q 3 and E 0 T p = 0 \mathbb{E}_0T_p=0 E 0 T p = 0 . For the bound we use 0 < a ≤ q 0<a\le q 0 < a ≤ q , ∣ b ∣ 3 = ∣ 1 − 2 p ∣ 3 ( η q ) 3 / 2 |b|^3=|1-2p|^3(\eta q)^{3/2} ∣ b ∣ 3 = ∣1 − 2 p ∣ 3 ( η q ) 3/2 , 3 δ 2 a 2 ≤ 3 η q 3 3\delta^2a^2\le3\eta q^3 3 δ 2 a 2 ≤ 3 η q 3 and N ( n − 2 ) 2 δ 4 a ≤ ( n 3 ) q 3 ⋅ 3 ( n − 2 ) η 2 N(n-2)^2\delta^4a\le\binom{n}{3}q^3\cdot3(n-2)\eta^2 N ( n − 2 ) 2 δ 4 a ≤ ( 3 n ) q 3 ⋅ 3 ( n − 2 ) η 2 , which holds because N ( n − 2 ) 2 = 3 ( n − 2 ) ( n 3 ) N(n-2)^2=3(n-2)\binom{n}{3} N ( n − 2 ) 2 = 3 ( n − 2 ) ( 3 n ) . Finally, 3 ( n − 2 ) η 2 ≤ 3 t 2 / n 3(n-2)\eta^2\le3t^2/n 3 ( n − 2 ) η 2 ≤ 3 t 2 / n .
Signed cherries. For S 2 S_2 S 2 take S S S the set of paths of length two. Now μ ϕ = δ 2 σ i σ k \mu^\phi=\delta^2\sigma_i\sigma_k μ ϕ = δ 2 σ i σ k for the path i − j − k i-j-k i − j − k , so c ∅ = δ 2 ( n − 2 ) ∑ k ≠ σ i , σ k c_\varnothing=\delta^2(n-2)\sum_{k\ne\sigma_i,\sigma_k} c ∅ = δ 2 ( n − 2 ) ∑ k = σ i , σ k , with mean 0 0 0 and second moment δ 4 ( n − 2 ) 2 N \delta^4(n-2)^2N δ 4 ( n − 2 ) 2 N . The non-empty R R R are the paths themselves, with c R = 1 c_R=1 c R = 1 and E v R = a 2 \mathbb{E}v_R=a^2 E v R = a 2 , and single edge i j ij ij . An edge i j ij ij lies in the paths i j , j k ij,jk ij , j k and i j , i k ij,ik ij , ik (k ≠ i , j k\ne i,j k = i , j ), so c R = δ ( σ i + σ j ) M ′ c_R=\delta(\sigma_i+\sigma_j)M' c R = δ ( σ i + σ j ) M ′ with M ′ = ∑ k ≠ i , j σ k M'=\sum_{k\ne i,j}\sigma_k M ′ = ∑ k = i , j σ k . As M ′ M' M ′ is independent of ( σ i , σ j ) (\sigma_i,\sigma_j) ( σ i , σ j ) , E M ′ 2 = n − 2 \mathbb{E}M'^2=n-2 E M ′2 = n − 2 and E [ ( σ i + σ j ) 2 ( a + b σ i σ j ) ] = 2 ( a + b ) \mathbb{E}[(\sigma_i+\sigma_j)^2(a+b\sigma_i\sigma_j)]=2(a+b) E [( σ i + σ j ) 2 ( a + b σ i σ j )] = 2 ( a + b ) , we get E [ c R 2 v i j ] = 2 δ 2 ( a + b ) ( n − 2 ) \mathbb{E}[c_R^2v_{ij}]=2\delta^2(a+b)(n-2) E [ c R 2 v ij ] = 2 δ 2 ( a + b ) ( n − 2 ) . Summing over the 3 ( n 3 ) = N ( n − 2 ) 3\binom{n}{3}=N(n-2) 3 ( 3 n ) = N ( n − 2 ) paths and the N N N edges gives the claim, and δ = 0 \delta=0 δ = 0 gives E 0 S 2 2 \mathbb{E}_0S_2^2 E 0 S 2 2 .
Proof of (ii). Write V 0 = ( n 3 ) q 3 V_0=\binom{n}{3}q^3 V 0 = ( 3 n ) q 3 and V δ = Var δ T p V_\delta=\operatorname{Var}_\delta T_p V δ = Var δ T p . Under P = Q = P 0 P=Q=P_0 P = Q = P 0 , E D 3 = 0 \mathbb{E}D_3=0 E D 3 = 0 and Var D 3 = 2 m V 0 \operatorname{Var}D_3=2mV_0 Var D 3 = 2 m V 0 , so Chebyshev’s inequality gives P ( ∣ D 3 ∣ ≥ λ 3 ) ≤ 2 m V 0 / λ 3 2 = α \mathbb{P}(|D_3|\ge\lambda_3)\le2mV_0/\lambda_3^2=\alpha P ( ∣ D 3 ∣ ≥ λ 3 ) ≤ 2 m V 0 / λ 3 2 = α . Under ( P δ , P 0 ) (P_\delta,P_0) ( P δ , P 0 ) , E D 3 = m ( n 3 ) δ 3 \mathbb{E}D_3=m\binom{n}{3}\delta^3 E D 3 = m ( 3 n ) δ 3 and Var D 3 = m ( V δ + V 0 ) \operatorname{Var}D_3=m(V_\delta+V_0) Var D 3 = m ( V δ + V 0 ) . If E D 3 ≥ λ 3 + ( m ( V δ + V 0 ) / β ) 1 / 2 \mathbb{E}D_3\ge\lambda_3+(m(V_\delta+V_0)/\beta)^{1/2} E D 3 ≥ λ 3 + ( m ( V δ + V 0 ) / β ) 1/2 , then P ( ∣ D 3 ∣ < λ 3 ) ≤ P ( ∣ D 3 − E D 3 ∣ > E D 3 − λ 3 ) ≤ β \mathbb{P}(|D_3|<\lambda_3)\le\mathbb{P}(|D_3-\mathbb{E}D_3|>\mathbb{E}D_3-\lambda_3)\le\beta P ( ∣ D 3 ∣ < λ 3 ) ≤ P ( ∣ D 3 − E D 3 ∣ > E D 3 − λ 3 ) ≤ β . Dividing by ( m V 0 ) 1 / 2 (mV_0)^{1/2} ( m V 0 ) 1/2 and using ( n 3 ) δ 3 / V 0 1 / 2 = s n \binom{n}{3}\delta^3/V_0^{1/2}=s_n ( 3 n ) δ 3 / V 0 1/2 = s n and V δ / V 0 ≤ 1 + ε n V_\delta/V_0\le1+\varepsilon_n V δ / V 0 ≤ 1 + ε n (Lemma A.8), this holds when m 1 / 2 s n ≥ 2 / α + ( 2 + ε n ) / β m^{1/2}s_n\ge\sqrt{2/\alpha}+\sqrt{(2+\varepsilon_n)/\beta} m 1/2 s n ≥ 2/ α + ( 2 + ε n ) / β .
Remark 3 (Size of the constants). s n 2 = ( n 3 ) n 3 s_n^2 = \binom{n}{3}n^3 s n 2 = ( 3 n ) n 3 equals the k = 3 k=3 k = 3 term of g n ( t ) g_n(t) g n ( t ) exactly, so the signed triangle count captures the leading term of the one-graph χ 2 \chi^2 χ 2 divergence. With a normal approximation (justified in Theorem 2(ii), Remark 9) the one-sided two-sample test has power 1 − Φ ( z α − ( m s n 2 / 2 ) 1 / 2 ) 1-\Phi(z_\alpha-(ms_n^2/2)^{1/2}) 1 − Φ ( z α − ( m s n 2 /2 ) 1/2 ) , which reaches 1 / 2 1/2 1/2 at m ≈ 2 z α 2 / s n 2 ≈ 12 z α 2 / t 3 = 32.5 / t 3 m\approx2z_\alpha^2/s_n^2\approx12z_\alpha^2/t^3=32.5/t^3 m ≈ 2 z α 2 / s n 2 ≈ 12 z α 2 / t 3 = 32.5/ t 3 for α = 0.05 \alpha=0.05 α = 0.05 . A cruder bound, ( n 3 ) ( q + δ ) 3 + N ( n − 2 ) ( n − 3 ) ( q + δ ) δ 4 \binom{n}{3}(q+\delta)^3+N(n-2)(n-3)(q+\delta)\delta^4 ( 3 n ) ( q + δ ) 3 + N ( n − 2 ) ( n − 3 ) ( q + δ ) δ 4 , is also valid, since it exceeds the exact value by at least N ( n − 2 ) q δ ( q − δ 3 ) ≥ 0 N(n-2)q\delta(q-\delta^3)\geq0 N ( n − 2 ) q δ ( q − δ 3 ) ≥ 0 .
Proposition 3 (Unknown p p p : the pooled plug-in statistic). Let p ^ \hat p p ^ be the edge density of the pooled sample of 2 m 2m 2 m graphs, D ^ 3 = ∑ ℓ T p ^ ( G ℓ ) − ∑ ℓ T p ^ ( G ℓ ′ ) \widehat D_3=\sum_\ell T_{\hat p}(G_\ell)-\sum_\ell T_{\hat p}(G'_\ell) D 3 = ∑ ℓ T p ^ ( G ℓ ) − ∑ ℓ T p ^ ( G ℓ ′ ) , and ε = p ^ − p \varepsilon=\hat p-p ε = p ^ − p .
(a) Under every null P = Q P=Q P = Q (any law of random graphs), D ^ 3 \widehat D_3 D 3 has the same law as − D ^ 3 -\widehat D_3 − D 3 ; in particular E D ^ 3 = 0 \mathbb{E}\widehat D_3=0 E D 3 = 0 .
(b) T p + ε = T p − ε S 2 + ε 2 ( n − 2 ) ∑ e ( A e − p ) − ε 3 ( n 3 ) T_{p+\varepsilon}=T_p-\varepsilon S_2+\varepsilon^2(n-2)\sum_e(A_e-p)-\varepsilon^3\binom{n}{3} T p + ε = T p − ε S 2 + ε 2 ( n − 2 ) ∑ e ( A e − p ) − ε 3 ( 3 n ) identically, hence D ^ 3 − D 3 = − ε Δ S 2 + ε 2 ( n − 2 ) Δ E \widehat D_3-D_3=-\varepsilon\Delta S_2+\varepsilon^2(n-2)\Delta E D 3 − D 3 = − ε Δ S 2 + ε 2 ( n − 2 ) Δ E , where Δ S 2 \Delta S_2 Δ S 2 and Δ E \Delta E Δ E are the between-group differences of ∑ ℓ S 2 \sum_\ell S_2 ∑ ℓ S 2 and ∑ ℓ ∑ e ( A e − p ) \sum_\ell\sum_e(A_e-p) ∑ ℓ ∑ e ( A e − p ) .
(c) Under P = Q = P 0 P=Q=P_0 P = Q = P 0 and under ( P δ , P 0 ) (P_\delta,P_0) ( P δ , P 0 ) : E ε = 0 \mathbb{E}\varepsilon=0 E ε = 0 , E ε 2 = q / ( 2 m N ) \mathbb{E}\varepsilon^2=q/(2mN) E ε 2 = q / ( 2 m N ) , E ( Δ E ) 2 = 2 m N q \mathbb{E}(\Delta E)^2=2mNq E ( Δ E ) 2 = 2 m N q and E ( Δ S 2 ) 2 ≤ 2 m Σ 2 \mathbb{E}(\Delta S_2)^2\leq2m\Sigma_2 E ( Δ S 2 ) 2 ≤ 2 m Σ 2 with Σ 2 = max ( E 0 S 2 2 , E δ S 2 2 ) \Sigma_2=\max(\mathbb{E}_0S_2^2,\mathbb{E}_\delta S_2^2) Σ 2 = max ( E 0 S 2 2 , E δ S 2 2 ) . Consequently, for every γ ∈ ( 0 , 1 ) \gamma\in(0,1) γ ∈ ( 0 , 1 ) , with probability at least 1 − γ 1-\gamma 1 − γ ,
∣ D ^ 3 − D 3 ∣ ≤ 3 γ ( q Σ 2 N ) 1 / 2 + 3 6 2 ( n − 2 ) q 3 / 2 γ 3 / 2 ( m N ) 1 / 2 . \lvert\widehat D_3-D_3\rvert\leq\frac{3}{\gamma}\left(\frac{q\Sigma_2}{N}\right)^{1/2}+\frac{3\sqrt{6}}{2}\frac{(n-2)q^{3/2}}{\gamma^{3/2}(mN)^{1/2}}. ∣ D 3 − D 3 ∣ ≤ γ 3 ( N q Σ 2 ) 1/2 + 2 3 6 γ 3/2 ( m N ) 1/2 ( n − 2 ) q 3/2 . In particular, if n q → ∞ nq\to\infty n q → ∞ and t t t is bounded, ∣ D ^ 3 − D 3 ∣ = O P ( n 1 / 2 q 3 / 2 ) = o P ( ( m V 0 ) 1 / 2 ) \lvert\widehat D_3-D_3\rvert=O_P(n^{1/2}q^{3/2})=o_P((mV_0)^{1/2}) ∣ D 3 − D 3 ∣ = O P ( n 1/2 q 3/2 ) = o P (( m V 0 ) 1/2 ) , and the test 1 { ∣ D ^ 3 ∣ ≥ ( 2 m ( n 3 ) q ^ 3 / α ) 1 / 2 } 1\{\lvert\widehat D_3\rvert\geq(2m\binom{n}{3}\hat q^3/\alpha)^{1/2}\} 1 {∣ D 3 ∣ ≥ ( 2 m ( 3 n ) q ^ 3 / α ) 1/2 } with q ^ = p ^ ( 1 − p ^ ) \hat q=\hat p(1-\hat p) q ^ = p ^ ( 1 − p ^ ) has asymptotic size at most α \alpha α and the power guarantee of Theorem 1(ii) up to o ( 1 ) o(1) o ( 1 ) .
Proof. (a) Under P = Q P=Q P = Q the 2 m 2m 2 m graphs are i.i.d. Exchanging the two groups leaves p ^ \hat p p ^ unchanged and maps D ^ 3 \widehat D_3 D 3 to − D ^ 3 -\widehat D_3 − D 3 .
(b) For a triangle with centred entries x 1 , x 2 , x 3 x_1,x_2,x_3 x 1 , x 2 , x 3 , ∏ i ( x i − ε ) = x 1 x 2 x 3 − ε ( x 1 x 2 + x 1 x 3 + x 2 x 3 ) + ε 2 ( x 1 + x 2 + x 3 ) − ε 3 \prod_i(x_i-\varepsilon)=x_1x_2x_3-\varepsilon(x_1x_2+x_1x_3+x_2x_3)+\varepsilon^2(x_1+x_2+x_3)-\varepsilon^3 ∏ i ( x i − ε ) = x 1 x 2 x 3 − ε ( x 1 x 2 + x 1 x 3 + x 2 x 3 ) + ε 2 ( x 1 + x 2 + x 3 ) − ε 3 . Summing over triangles, every path of length two lies in exactly one triangle and every edge in n − 2 n-2 n − 2 triangles. The ε 3 \varepsilon^3 ε 3 terms cancel between the groups because both have m m m graphs.
(c) We bound the random quantities ε \varepsilon ε , Δ S 2 \Delta S_2 Δ S 2 and Δ E \Delta E Δ E of (b) and then compare the error with the threshold λ 3 \lambda_3 λ 3 .
Moments. By Theorem 2(i), applied to the planted partition as G ( n , W + H ) G(n,W+H) G ( n , W + H ) with W ≡ p W\equiv p W ≡ p and H = δ s ⊗ s H=\delta s\otimes s H = δ s ⊗ s of zero degree, the edge count of one graph has mean N p Np N p and variance N q Nq N q under both P 0 P_0 P 0 and P δ P_\delta P δ . The 2 m 2m 2 m graphs are independent, which gives the moments of ε \varepsilon ε and Δ E \Delta E Δ E . Since E 0 S 2 = E δ S 2 = 0 \mathbb{E}_0S_2=\mathbb{E}_\delta S_2=0 E 0 S 2 = E δ S 2 = 0 , E ( Δ S 2 ) 2 \mathbb{E}(\Delta S_2)^2 E ( Δ S 2 ) 2 is the sum of the 2 m 2m 2 m second moments.
Concentration. Chebyshev’s inequality with thresholds a = ( 3 q / ( 2 m N γ ) ) 1 / 2 a=(3q/(2mN\gamma))^{1/2} a = ( 3 q / ( 2 m N γ ) ) 1/2 , b = ( 6 m Σ 2 / γ ) 1 / 2 b=(6m\Sigma_2/\gamma)^{1/2} b = ( 6 m Σ 2 / γ ) 1/2 , c = ( 6 m N q / γ ) 1 / 2 c=(6mNq/\gamma)^{1/2} c = ( 6 m N q / γ ) 1/2 for ∣ ε ∣ , ∣ Δ S 2 ∣ , ∣ Δ E ∣ \lvert\varepsilon\rvert,\lvert\Delta S_2\rvert,\lvert\Delta E\rvert ∣ ε ∣ , ∣ Δ S 2 ∣ , ∣ Δ E ∣ shows that all three bounds hold with probability at least 1 − γ 1-\gamma 1 − γ . On this event ∣ D ^ 3 − D 3 ∣ ≤ a b + ( n − 2 ) a c \lvert\widehat D_3-D_3\rvert\leq ab+(n-2)ac ∣ D 3 − D 3 ∣ ≤ ab + ( n − 2 ) a c , which is the displayed.
Order of the error. By Lemma A.8, Σ 2 ≤ N ( n − 2 ) q 2 ( 1 + ( n − 2 ) η 2 + 2 η ( 1 + δ / q ) ) \Sigma_2\leq N(n-2)q^2(1+(n-2)\eta^2+2\eta(1+\delta/q)) Σ 2 ≤ N ( n − 2 ) q 2 ( 1 + ( n − 2 ) η 2 + 2 η ( 1 + δ / q )) , so the first term is O ( n 1 / 2 q 3 / 2 ) O(n^{1/2}q^{3/2}) O ( n 1/2 q 3/2 ) when t t t is bounded and the second is O ( q 3 / 2 m − 1 / 2 ) O(q^{3/2}m^{-1/2}) O ( q 3/2 m − 1/2 ) . Since λ 3 = ( 2 m V 0 / α ) 1 / 2 ≍ m 1 / 2 n 3 / 2 q 3 / 2 \lambda_3=(2mV_0/\alpha)^{1/2}\asymp m^{1/2}n^{3/2}q^{3/2} λ 3 = ( 2 m V 0 / α ) 1/2 ≍ m 1/2 n 3/2 q 3/2 , we get ∣ D ^ 3 − D 3 ∣ / λ 3 → 0 \lvert\widehat D_3-D_3\rvert/\lambda_3\to0 ∣ D 3 − D 3 ∣ / λ 3 → 0 in probability.
Size and power. When n q → ∞ nq\to\infty n q → ∞ , q ^ / q → 1 \hat q/q\to1 q ^ / q → 1 in probability because E ε 2 = q / ( 2 m N ) \mathbb{E}\varepsilon^2=q/(2mN) E ε 2 = q / ( 2 m N ) , so λ ^ 3 : = ( 2 m ( n 3 ) q ^ 3 / α ) 1 / 2 \hat\lambda_3:=(2m\binom{n}{3}\hat q^3/\alpha)^{1/2} λ ^ 3 := ( 2 m ( 3 n ) q ^ 3 / α ) 1/2 satisfies λ ^ 3 / λ 3 → 1 \hat\lambda_3/\lambda_3\to1 λ ^ 3 / λ 3 → 1 . Fix ζ ∈ ( 0 , 1 ) \zeta\in(0,1) ζ ∈ ( 0 , 1 ) . On the event { D ^ 3 ≥ λ ^ 3 } ∩ { λ ^ 3 > ( 1 − ζ / 2 ) λ 3 } ∩ { ∣ D ^ 3 − D 3 ∣ < ζ λ 3 / 2 } \{\widehat D_3\geq\hat\lambda_3\}\cap\{\hat\lambda_3>(1-\zeta/2)\lambda_3\}\cap\{\lvert\widehat D_3-D_3\rvert<\zeta\lambda_3/2\} { D 3 ≥ λ ^ 3 } ∩ { λ ^ 3 > ( 1 − ζ /2 ) λ 3 } ∩ {∣ D 3 − D 3 ∣ < ζ λ 3 /2 } we have ∣ D 3 ∣ > ( 1 − ζ ) λ 3 \lvert D_3\rvert>(1-\zeta)\lambda_3 ∣ D 3 ∣ > ( 1 − ζ ) λ 3 . Hence under H 0 H_0 H 0 , P ( ∣ D ^ 3 ∣ ≥ λ ^ 3 ) ≤ α ( 1 − ζ ) − 2 + o ( 1 ) \mathbb{P}(\lvert\widehat D_3\rvert\geq\hat\lambda_3)\leq\alpha(1-\zeta)^{-2}+o(1) P (∣ D 3 ∣ ≥ λ ^ 3 ) ≤ α ( 1 − ζ ) − 2 + o ( 1 ) by Chebyshev, and letting ζ ↓ 0 \zeta\downarrow0 ζ ↓ 0 gives asymptotic size at most α \alpha α . The power statement follows in the same way from the proof of (ii), with λ 3 \lambda_3 λ 3 replaced by ( 1 + ζ ) λ 3 (1+\zeta)\lambda_3 ( 1 + ζ ) λ 3 . □ \square □
Remark 4 (Exact validity for the composite Erdős–Rényi null). Under H 0 : P = Q = G ( n , p ) H_0:P=Q=G(n,p) H 0 : P = Q = G ( n , p ) with p p p unknown, the total number of edges E t o t E_{\mathrm{tot}} E tot of the 2 m 2m 2 m graphs is sufficient, and conditionally on E t o t = k E_{\mathrm{tot}}=k E tot = k the 2 m 2m 2 m adjacency vectors are uniform over the ( 2 m N k ) \binom{2mN}{k} ( k 2 m N ) configurations. A Monte Carlo test that compares D ^ 3 \widehat{D}_3 D 3 with its law under uniform redistribution of the k k k edges is therefore exactly valid for every p p p . We do not use this test elsewhere.
Lemma A.9 (Aligned second moment). Let P δ a l , m P_{\delta}^{\mathrm{al},m} P δ al , m be the law of ( G 1 , … , G m ) (G_1,\ldots,G_m) ( G 1 , … , G m ) when one σ \sigma σ is drawn and the G ℓ G_\ell G ℓ are i.i.d. planted-partition graphs given σ \sigma σ . Then, with A m , B m A_m,B_m A m , B m as in Theorem 1(iii),
1 + χ 2 ( P δ a l , m ∥ P 0 ⊗ m ) = E ω ∏ i < j ( 1 + η ω i ω j ) m = A m N ∑ S ∈ E n ( B m A m ) ∣ S ∣ . 1+\chi^2\left(P_{\delta}^{\mathrm{al},m}\mathbin\Vert P_0^{\otimes m}\right)=\mathbb{E}_{\omega}\prod_{i<j}(1+\eta\omega_i\omega_j)^m=A_m^N\sum_{S\in\mathcal{E}_n}\left(\frac{B_m}{A_m}\right)^{|S|}. 1 + χ 2 ( P δ al , m ∥ P 0 ⊗ m ) = E ω i < j ∏ ( 1 + η ω i ω j ) m = A m N S ∈ E n ∑ ( A m B m ) ∣ S ∣ . Moreover 1 ≤ A m ≤ exp ( ( m 2 ) η 2 ) 1\le A_m\le\exp\left(\binom{m}{2}\eta^2\right) 1 ≤ A m ≤ exp ( ( 2 m ) η 2 ) and B m / A m = tanh ( m artanh η ) ≤ m artanh η B_m/A_m=\tanh(m\operatorname{artanh}\eta)\le m\operatorname{artanh}\eta B m / A m = tanh ( m artanh η ) ≤ m artanh η .
Proof. The likelihood ratio is L a l = E σ ∏ ℓ = 1 m L σ ( G ℓ ) L^{\mathrm{al}}=\mathbb{E}_{\sigma}\prod_{\ell=1}^m L_{\sigma}(G_\ell) L al = E σ ∏ ℓ = 1 m L σ ( G ℓ ) with L σ L_\sigma L σ as in Lemma A.2, so by independence of the G ℓ G_\ell G ℓ under P 0 ⊗ m P_0^{\otimes m} P 0 ⊗ m and Lemma A.2, E 0 ( L a l ) 2 = E σ , τ ∏ ℓ E 0 [ L σ ( G ℓ ) L τ ( G ℓ ) ] = E ω ∏ i < j ( 1 + η ω i ω j ) m \mathbb{E}_0(L^{\mathrm{al}})^2=\mathbb{E}_{\sigma,\tau}\prod_{\ell}\mathbb{E}_0[L_\sigma(G_\ell)L_\tau(G_\ell)]=\mathbb{E}_{\omega}\prod_{i<j}(1+\eta\omega_i\omega_j)^m E 0 ( L al ) 2 = E σ , τ ∏ ℓ E 0 [ L σ ( G ℓ ) L τ ( G ℓ )] = E ω ∏ i < j ( 1 + η ω i ω j ) m with ω = σ ∘ τ \omega=\sigma\circ\tau ω = σ ∘ τ uniform. For y ∈ { ± 1 } y\in\{\pm1\} y ∈ { ± 1 } , ( 1 + η y ) m = A m + B m y = A m ( 1 + ( B m / A m ) y ) (1+\eta y)^m=A_m+B_my=A_m(1+(B_m/A_m)y) ( 1 + η y ) m = A m + B m y = A m ( 1 + ( B m / A m ) y ) , and Lemma A.3 with x = B m / A m x=B_m/A_m x = B m / A m gives the identity.
For the bounds, A m = ∑ j ≥ 0 ( m 2 j ) η 2 j A_m=\sum_{j\ge0}\binom{m}{2j}\eta^{2j} A m = ∑ j ≥ 0 ( 2 j m ) η 2 j , and ( m 2 j ) ≤ ( m j ) / j ! \binom{m}{2j}\le\binom{m}{j}/j! ( 2 j m ) ≤ ( j m ) / j ! because ( m 2 j ) ( 2 j − 1 ) ! ! \binom{m}{2j}(2j-1)!! ( 2 j m ) ( 2 j − 1 )!! is the number of sets of j j j pairwise disjoint pairs in [ m ] [m] [ m ] , which is at most ( m 2 ) j / j ! \binom{m}{2}^j/j! ( 2 m ) j / j ! . Hence A m ≤ exp ( ( m 2 ) η 2 ) A_m\le\exp\left(\binom{m}{2}\eta^2\right) A m ≤ exp ( ( 2 m ) η 2 ) .
With η = tanh a \eta=\tanh a η = tanh a , ( 1 ± η ) m = ( 1 − η 2 ) m / 2 e ± m a (1\pm\eta)^m=(1-\eta^2)^{m/2}e^{\pm ma} ( 1 ± η ) m = ( 1 − η 2 ) m /2 e ± ma , so B m / A m = tanh ( m a ) ≤ m a B_m/A_m=\tanh(ma)\le ma B m / A m = tanh ( ma ) ≤ ma .
Lemma A.10 (Moments of the aligned statistic). For m ≥ 2 m\ge2 m ≥ 2 , E 0 Q = 0 \mathbb{E}_0Q=0 E 0 Q = 0 , Var 0 Q = ( m 2 ) N q 2 \operatorname{Var}_0Q=\binom{m}{2}Nq^2 Var 0 Q = ( 2 m ) N q 2 , E a l Q = ( m 2 ) N δ 2 \mathbb{E}_{\mathrm{al}}Q=\binom{m}{2}N\delta^2 E al Q = ( 2 m ) N δ 2 , and Var a l Q = N [ m ( m − 1 ) 2 δ 2 a + ( m 2 ) ( a 2 + b 2 ) ] \operatorname{Var}_{\mathrm{al}}Q=N\left[m(m-1)^2\delta^2a+\binom{m}{2}(a^2+b^2)\right] Var al Q = N [ m ( m − 1 ) 2 δ 2 a + ( 2 m ) ( a 2 + b 2 ) ] with a , b a,b a , b as in Lemma A.8. In particular Var a l Q ≤ ρ m Var 0 Q \operatorname{Var}_{\mathrm{al}}Q\le\rho_m\operatorname{Var}_0Q Var al Q ≤ ρ m Var 0 Q with ρ m = 1 + ( 2 ( m − 1 ) + ( 1 − 2 p ) 2 / q ) t / n \rho_m=1+\left(2(m-1)+(1-2p)^2/q\right)t/n ρ m = 1 + ( 2 ( m − 1 ) + ( 1 − 2 p ) 2 / q ) t / n .
Proof. Given σ \sigma σ , A i j ℓ − p = μ i j + ξ i j ℓ A_{ij}^{\ell}-p=\mu_{ij}+\xi_{ij}^{\ell} A ij ℓ − p = μ ij + ξ ij ℓ with μ i j = δ σ i σ j \mu_{ij}=\delta\sigma_i\sigma_j μ ij = δ σ i σ j and the ξ i j ℓ \xi_{ij}^{\ell} ξ ij ℓ independent, centred, with variance v i j = a + b σ i σ j v_{ij}=a+b\sigma_i\sigma_j v ij = a + b σ i σ j . Then
Q = ∑ i < j [ ( m 2 ) μ i j 2 + ( m − 1 ) μ i j ∑ ℓ ξ i j ℓ + ∑ ℓ < ℓ ′ ξ i j ℓ ξ i j ℓ ′ ] . Q=\sum_{i<j}\left[\binom{m}{2}\mu_{ij}^2+(m-1)\mu_{ij}\sum_{\ell}\xi_{ij}^{\ell}+\sum_{\ell<\ell'}\xi_{ij}^{\ell}\xi_{ij}^{\ell'}\right]. Q = i < j ∑ [ ( 2 m ) μ ij 2 + ( m − 1 ) μ ij ℓ ∑ ξ ij ℓ + ℓ < ℓ ′ ∑ ξ ij ℓ ξ ij ℓ ′ ] .
The three kinds of terms are conditionally uncorrelated and different pairs are independent, so E [ Q ∣ σ ] = ( m 2 ) N δ 2 \mathbb{E}[Q\mid\sigma]=\binom{m}{2}N\delta^2 E [ Q ∣ σ ] = ( 2 m ) N δ 2 and
Var ( Q ∣ σ ) = ∑ i < j [ ( m − 1 ) 2 m δ 2 v i j + ( m 2 ) v i j 2 ] . \operatorname{Var}(Q\mid\sigma)=\sum_{i<j}\left[(m-1)^2m\delta^2v_{ij}+\binom{m}{2}v_{ij}^2\right]. Var ( Q ∣ σ ) = i < j ∑ [ ( m − 1 ) 2 m δ 2 v ij + ( 2 m ) v ij 2 ] .
Taking expectations with E v i j = a \mathbb{E}v_{ij}=a E v ij = a and E v i j 2 = a 2 + b 2 \mathbb{E}v_{ij}^2=a^2+b^2 E v ij 2 = a 2 + b 2 gives the moments, and δ = 0 \delta=0 δ = 0 gives the null moments. For the ratio, a ≤ q a\le q a ≤ q and b 2 = ( 1 − 2 p ) 2 η q b^2=(1-2p)^2\eta q b 2 = ( 1 − 2 p ) 2 η q give Var a l Q / Var 0 Q ≤ 1 + 2 ( m − 1 ) η + ( 1 − 2 p ) 2 η / q \operatorname{Var}_{\mathrm{al}}Q/\operatorname{Var}_0Q\le1+2(m-1)\eta+(1-2p)^2\eta/q Var al Q / Var 0 Q ≤ 1 + 2 ( m − 1 ) η + ( 1 − 2 p ) 2 η / q .
Proof of (iii). The identity is Lemma A.9. By Lemma A.4 with x = B m / A m x=B_m/A_m x = B m / A m (so n x = u m nx=u_m n x = u m ) and A m N ≤ exp ( ( m 2 ) N η 2 ) A_m^N\le\exp\left(\binom{m}{2}N\eta^2\right) A m N ≤ exp ( ( 2 m ) N η 2 ) we get the bound, where ( m 2 ) N η 2 = m ( m − 1 ) 2 n ( n − 1 ) 2 t 2 n 2 \binom{m}{2}N\eta^2=\frac{m(m-1)}{2}\frac{n(n-1)}{2}\frac{t^2}{n^2} ( 2 m ) N η 2 = 2 m ( m − 1 ) 2 n ( n − 1 ) n 2 t 2 . If x : = κ η m t < x α β < 1 x:=\kappa\eta mt<x_{\alpha\beta}<1 x := κ η m t < x α β < 1 then ( m 2 ) N η 2 ≤ m 2 t 2 / 4 ≤ x 2 / 4 \binom{m}{2}N\eta^2\le m^2t^2/4\le x^2/4 ( 2 m ) N η 2 ≤ m 2 t 2 /4 ≤ x 2 /4 and u m ≤ x u_m\le x u m ≤ x , so g n ( u m ) ≤ g ( x ) g_n(u_m)\le g(x) g n ( u m ) ≤ g ( x ) (Lemma A.5, g g g increasing) and
1 + χ 2 ≤ e x 2 / 4 + g ( x ) < e c α β = 1 + 4 ( 1 − α − β ) 2 , 1+\chi^2\le e^{x^2/4+g(x)}<e^{c_{\alpha\beta}}=1+4(1-\alpha-\beta)^2, 1 + χ 2 ≤ e x 2 /4 + g ( x ) < e c α β = 1 + 4 ( 1 − α − β ) 2 ,
which by Lemma A.1(c),(d) rules out errors ( α , β ) (\alpha,\beta) ( α , β ) . The bound κ η ≤ ( 1 − η 2 ) − 1 \kappa\eta\le(1-\eta^2)^{-1} κ η ≤ ( 1 − η 2 ) − 1 follows from artanh η = ∑ k ≥ 0 η 2 k + 1 / ( 2 k + 1 ) ≤ η / ( 1 − η 2 ) \operatorname{artanh}\eta=\sum_{k\ge0}\eta^{2k+1}/(2k+1)\le\eta/(1-\eta^2) artanh η = ∑ k ≥ 0 η 2 k + 1 / ( 2 k + 1 ) ≤ η / ( 1 − η 2 ) .
For the test, Lemma A.10 and Chebyshev’s inequality give size ≤ α \le\alpha ≤ α , and type II error ≤ β \le\beta ≤ β once
E a l Q ≥ ( Var 0 Q / α ) 1 / 2 + ( Var a l Q / β ) 1 / 2 . \mathbb{E}_{\mathrm{al}}Q\ge(\operatorname{Var}_0Q/\alpha)^{1/2}+(\operatorname{Var}_{\mathrm{al}}Q/\beta)^{1/2}. E al Q ≥ ( Var 0 Q / α ) 1/2 + ( Var al Q / β ) 1/2 .
Dividing by ( Var 0 Q ) 1 / 2 (\operatorname{Var}_0Q)^{1/2} ( Var 0 Q ) 1/2 gives ( ( m 2 ) N η 2 ) 1 / 2 ≥ α − 1 / 2 + ( ρ m / β ) 1 / 2 \left(\binom{m}{2}N\eta^2\right)^{1/2}\ge\alpha^{-1/2}+(\rho_m/\beta)^{1/2} ( ( 2 m ) N η 2 ) 1/2 ≥ α − 1/2 + ( ρ m / β ) 1/2 .
Remark 5 (Sharp aligned threshold). By Lemma A.6 applied with x = B m / A m x=B_m/A_m x = B m / A m (n x → m t nx\to mt n x → m t ) and N log A m → ( m 2 t 2 ) / 2 N\log A_m\to(m^2t^2)/2 N log A m → ( m 2 t 2 ) /2 , for fixed m m m and t t t with m t < 1 mt<1 m t < 1 one gets 1 + χ 2 ( P δ a l , m ∥ P 0 ⊗ m ) → e − m t / 2 − m 2 t 2 / 4 ( 1 − m t ) − 1 / 2 1+\chi^2(P_{\delta}^{\mathrm{al},m}\mathbin\Vert P_0^{\otimes m})\to e^{-mt/2-m^2t^2/4}(1-mt)^{-1/2} 1 + χ 2 ( P δ al , m ∥ P 0 ⊗ m ) → e − m t /2 − m 2 t 2 /4 ( 1 − m t ) − 1/2 , which is finite exactly when m t < 1 mt<1 m t < 1 . This is consistent with the sharp aligned threshold m t = 1 mt=1 m t = 1 of Chatterjee et al. [ [15 ] . Their setting has m m m layers sharing one planted bipartition, in the sparse regime with fixed a k , b k a_k,b_k a k , b k and average degree > 1 >1 > 1 . They prove contiguity if ∑ k λ k 2 + μ 2 / γ < 1 \sum_k\lambda_k^2+\mu^2/\gamma<1 ∑ k λ k 2 + μ 2 / γ < 1 and asymptotic singularity if it > 1 >1 > 1 , where λ k 2 = ( a k − b k ) 2 / ( 2 ( a k + b k ) ) \lambda_k^2=(a_k-b_k)^2/(2(a_k+b_k)) λ k 2 = ( a k − b k ) 2 / ( 2 ( a k + b k )) . Identical layers and no covariates give λ k 2 = t \lambda_k^2=t λ k 2 = t and μ = 0 \mu=0 μ = 0 . We cite this result for the sharp constant and do not reprove it. In the dense regime we only claim the bounds of Theorem 1(iii).
Proof of (iv). Let n ≥ n 0 n \ge n_0 n ≥ n 0 and 0 < t ≤ 1 / 2 0 < t \le1/2 0 < t ≤ 1/2 . Then η = t / n ≤ 1 / 42 \eta= t/n \le1/42 η = t / n ≤ 1/42 , so κ η ≤ 4 / 3 \kappa\eta\le4/3 κ η ≤ 4/3 , and n q ≥ 1 nq \ge1 n q ≥ 1 .
Unaligned lower bound. By (i), m u n ∗ ≥ c α β / g ( t ) ≥ 6 ( 1 − t ) c α β / t 3 ≥ 3 c α β / t 3 m_{\mathrm{un}}^* \ge c_{\alpha\beta}/g(t) \ge6(1-t)c_{\alpha\beta}/t^3 \ge3c_{\alpha\beta}/t^3 m un ∗ ≥ c α β / g ( t ) ≥ 6 ( 1 − t ) c α β / t 3 ≥ 3 c α β / t 3 .
Unaligned upper bound. Since t ≤ 1 / 2 t \le1/2 t ≤ 1/2 , n q ≥ 1 nq \ge1 n q ≥ 1 and n ≥ 21 n \ge21 n ≥ 21 , we have ε n ≤ ( 2 n q ) − 3 / 2 + 2.25 / n ≤ 1 \varepsilon_n \le(2nq)^{-3/2}+2.25/n \le1 ε n ≤ ( 2 n q ) − 3/2 + 2.25/ n ≤ 1 , and 6 n 2 / ( ( n − 1 ) ( n − 2 ) ) ≤ 7 6n^2/((n-1)(n-2)) \le7 6 n 2 / (( n − 1 ) ( n − 2 )) ≤ 7 for n ≥ 21 n \ge21 n ≥ 21 . So the condition of (ii) holds for every m ≥ K u n / t 3 m \ge K_{\mathrm{un}}/t^3 m ≥ K un / t 3 , and m u n ∗ ≤ 1 + K u n / t 3 m_{\mathrm{un}}^* \le1+K_{\mathrm{un}}/t^3 m un ∗ ≤ 1 + K un / t 3 .
Aligned lower bound. By (iii), no test exists when 4 3 m t < x α β \frac{4}{3}mt < x_{\alpha\beta} 3 4 m t < x α β , so m a l ∗ ≥ 3 x α β / ( 4 t ) m_{\mathrm{al}}^* \ge3x_{\alpha\beta}/(4t) m al ∗ ≥ 3 x α β / ( 4 t ) .
Aligned upper bound. Let m = ⌈ 1 + 3 K ′ / t ⌉ ≤ 2 + 3 K ′ / t m=\lceil1+3K'/t\rceil\le2+3K'/t m = ⌈ 1 + 3 K ′ / t ⌉ ≤ 2 + 3 K ′ / t . Then m ≥ 2 m\ge2 m ≥ 2 , m − 1 ≥ 3 K ′ / t m-1\ge3K'/t m − 1 ≥ 3 K ′ / t , and
because ( 2 ( m − 1 ) + ( 1 − 2 p ) 2 / q ) t ≤ 2 t + 6 K ′ + t / q ≤ 1 + 6 K ′ + 1 / ( 2 q ) ≤ n \left(2(m-1)+(1-2p)^2/q\right)t \le2t+6K'+t/q \le1+6K'+1/(2q)\le n ( 2 ( m − 1 ) + ( 1 − 2 p ) 2 / q ) t ≤ 2 t + 6 K ′ + t / q ≤ 1 + 6 K ′ + 1/ ( 2 q ) ≤ n by the choice of n 0 n_0 n 0 . Hence
( m 2 ) n η 2 ≥ ( m − 1 ) 2 ( n − 1 ) t 2 4 n ≥ 9 ( n − 1 ) 4 n K ′ 2 ≥ K ′ 2 ≥ ( α − 1 / 2 + ( ρ m / β ) 1 / 2 ) 2 , \binom{m}{2}n\eta^2 \ge\frac{(m-1)^2(n-1)t^2}{4n} \ge\frac{9(n-1)}{4n}K'^2 \ge K'^2 \ge\left(\alpha^{-1/2}+(\rho_m/\beta)^{1/2}\right)^2, ( 2 m ) n η 2 ≥ 4 n ( m − 1 ) 2 ( n − 1 ) t 2 ≥ 4 n 9 ( n − 1 ) K ′2 ≥ K ′2 ≥ ( α − 1/2 + ( ρ m / β ) 1/2 ) 2 ,
so (iii) gives a test with errors ( α , β ) (\alpha,\beta) ( α , β ) and m a l ∗ ≤ 2 + 3 K ′ / t m_{\mathrm{al}}^* \le2+3K'/t m al ∗ ≤ 2 + 3 K ′ / t .
Ratio. Since 2 t ≤ 1 2t\le1 2 t ≤ 1 , m u n ∗ / m a l ∗ ≥ ( 3 c α β / t 3 ) / ( 2 + 3 K ′ / t ) ≥ 3 c α β / ( ( 1 + 3 K ′ ) t 2 ) m_{\mathrm{un}}^*/m_{\mathrm{al}}^* \ge(3c_{\alpha\beta}/t^3)/(2+3K'/t) \ge3c_{\alpha\beta}/((1+3K')t^2) m un ∗ / m al ∗ ≥ ( 3 c α β / t 3 ) / ( 2 + 3 K ′ / t ) ≥ 3 c α β / (( 1 + 3 K ′ ) t 2 ) . In the other direction, m u n ∗ / m a l ∗ ≤ ( 1 + K u n / t 3 ) ⋅ 4 t / ( 3 x α β ) = 4 ( t 3 + K u n ) / ( 3 x α β t 2 ) ≤ 4 ( 1 / 8 + K u n ) / ( 3 x α β t 2 ) m_{\mathrm{un}}^*/m_{\mathrm{al}}^* \le(1+K_{\mathrm{un}}/t^3)\cdot4t/(3x_{\alpha\beta}) = 4(t^3+K_{\mathrm{un}})/(3x_{\alpha\beta}t^2) \le4(1/8+K_{\mathrm{un}})/(3x_{\alpha\beta}t^2) m un ∗ / m al ∗ ≤ ( 1 + K un / t 3 ) ⋅ 4 t / ( 3 x α β ) = 4 ( t 3 + K un ) / ( 3 x α β t 2 ) ≤ 4 ( 1/8 + K un ) / ( 3 x α β t 2 ) .
Remark 6 (Asymptotically sharp constants). The constants in (iv) come from Chebyshev and χ 2 \chi^2 χ 2 -to-TV conversions and are loose. For fixed t < 1 t<1 t < 1 , dense p ∈ ( 0 , 1 ) p\in(0,1) p ∈ ( 0 , 1 ) and fixed m m m , sharp constants follow from the likelihood-ratio limit of Banerjee [2018, arXiv version, Theorem 2.2 with Proposition 3.4, display (3.2)]. Under P 0 P_0 P 0 , d P δ / d P 0 → exp ( ∑ i > 3 ( 2 t i / 2 Z i − t i ) / ( 4 i ) ) dP_\delta/dP_0\to\exp\left(\sum_{i>3}(2t^{i/2}Z_i-t^i)/(4i)\right) d P δ / d P 0 → exp ( ∑ i > 3 ( 2 t i /2 Z i − t i ) / ( 4 i ) ) in law, with independent Z i ∼ N ( 0 , 2 i ) Z_i\sim N(0,2i) Z i ∼ N ( 0 , 2 i ) . The hypotheses of that theorem are a n / n → p ∈ ( 0 , 1 ) a_n/n\to p\in(0,1) a n / n → p ∈ ( 0 , 1 ) and ( a n − b n ) 2 / ( a n + b n ) → c (a_n-b_n)^2/(a_n+b_n)\to c ( a n − b n ) 2 / ( a n + b n ) → c with t = c / ( 2 ( 1 − p ) ) < 1 t=c/(2(1-p))<1 t = c / ( 2 ( 1 − p )) < 1 , which is our dense regime with a n = n ( p + δ ) a_n=n(p+\delta) a n = n ( p + δ ) and b n = n ( p − δ ) b_n=n(p-\delta) b n = n ( p − δ ) . Thus log ∏ ℓ ≤ m L ( G ℓ ) → N ( − m g ( t ) / 2 , m g ( t ) ) \log\prod_{\ell\le m}L(G_\ell)\to N(-mg(t)/2,mg(t)) log ∏ ℓ ≤ m L ( G ℓ ) → N ( − m g ( t ) /2 , m g ( t )) under P 0 ⊗ m P_0^{\otimes m} P 0 ⊗ m , and by Le Cam’s third lemma the most powerful level-α \alpha α test of P 0 ⊗ m P_0^{\otimes m} P 0 ⊗ m against P δ ⊗ m P_\delta^{\otimes m} P δ ⊗ m has asymptotic power 1 − Φ ( z α − ( m g ( t ) ) 1 / 2 ) 1-\Phi(z_\alpha-(mg(t))^{1/2}) 1 − Φ ( z α − ( m g ( t ) ) 1/2 ) . The one-sample signed-triangle test with known p p p has asymptotic power 1 − Φ ( z α − ( m t 3 / 6 ) 1 / 2 ) 1-\Phi(z_\alpha-(mt^3/6)^{1/2}) 1 − Φ ( z α − ( m t 3 /6 ) 1/2 ) (Remark 9). Since g ( t ) = t 3 / 6 + O ( t 4 ) g(t)=t^3/6+O(t^4) g ( t ) = t 3 /6 + O ( t 4 ) , this test is asymptotically optimal including the constant as t → 0 t\to0 t → 0 . The two-sample version, which does not use the knowledge of P 0 P_0 P 0 , pays a factor 2 in m m m .
Proposition 1: sign cancellation
Throughout this subsection σ , τ \sigma,\tau σ , τ are independent and uniform on { ± 1 } n \{\pm1\}^n { ± 1 } n , ρ = σ ∘ τ \rho=\sigma\circ\tau ρ = σ ∘ τ , h i j = δ ( σ i σ j − τ i τ j ) = δ σ i σ j ( 1 − ρ i ρ j ) ∈ { 0 , ± 2 δ } h_{ij}=\delta(\sigma_i\sigma_j-\tau_i\tau_j)=\delta\sigma_i\sigma_j(1-\rho_i\rho_j)\in\{0,\pm2\delta\} h ij = δ ( σ i σ j − τ i τ j ) = δ σ i σ j ( 1 − ρ i ρ j ) ∈ { 0 , ± 2 δ } , 0 < 2 δ ≤ min ( p , 1 − p ) 0<2\delta\le\min(p,1-p) 0 < 2 δ ≤ min ( p , 1 − p ) , and P δ ( 2 ) P_\delta^{(2)} P δ ( 2 ) is the law of A A A when the A i j A_{ij} A ij are independent Bern ( p + h i j ) \operatorname{Bern}(p+h_{ij}) Bern ( p + h ij ) given ( σ , τ ) (\sigma,\tau) ( σ , τ ) . Put v ˉ = q + 2 δ ∣ 1 − 2 p ∣ \bar v=q+2\delta|1-2p| v ˉ = q + 2 δ ∣1 − 2 p ∣ , r = v ˉ / q = 1 + 2 ∣ 1 − 2 p ∣ ( η / q ) 1 / 2 r=\bar v/q=1+2|1-2p|(\eta/q)^{1/2} r = v ˉ / q = 1 + 2∣1 − 2 p ∣ ( η / q ) 1/2 and v min = q − 2 δ ∣ 1 − 2 p ∣ − 4 δ 2 v_{\min}=q-2\delta|1-2p|-4\delta^2 v m i n = q − 2 δ ∣1 − 2 p ∣ − 4 δ 2 . Every conditional edge variance v i j = ( p + h i j ) ( 1 − p − h i j ) = q + h i j ( 1 − 2 p ) − h i j 2 v_{ij}=(p+h_{ij})(1-p-h_{ij})=q+h_{ij}(1-2p)-h_{ij}^2 v ij = ( p + h ij ) ( 1 − p − h ij ) = q + h ij ( 1 − 2 p ) − h ij 2 lies in [ v min , v ˉ ] [v_{\min},\bar v] [ v m i n , v ˉ ] .
Proposition (Restatement of Proposition 1).
(i) For every S ⊆ E n S\subseteq E_n S ⊆ E n , t S : = E ∏ { i , j } ∈ S ( σ i σ j − τ i τ j ) = 2 β ( S ) 1 [ S even and bipartite ] t_S:=\mathbb{E}\prod_{\{i,j\}\in S}(\sigma_i\sigma_j-\tau_i\tau_j)=2^{\beta(S)}\mathbf{1}[S\ \text{even and bipartite}] t S := E ∏ { i , j } ∈ S ( σ i σ j − τ i τ j ) = 2 β ( S ) 1 [ S even and bipartite ] .
(ii) E [ T p ∣ σ , τ ] = 0 \mathbb{E}[T_p\mid\sigma,\tau]=0 E [ T p ∣ σ , τ ] = 0 ; E S C 4 = 6 ( n 4 ) δ 4 \mathbb{E}S_{C_4}=6\binom{n}{4}\delta^4 E S C 4 = 6 ( 4 n ) δ 4 , Var 0 S C 4 = 3 ( n 4 ) q 4 \operatorname{Var}_0S_{C_4}=3\binom{n}{4}q^4 Var 0 S C 4 = 3 ( 4 n ) q 4 , and Var S C 4 ≤ ρ 4 Var 0 S C 4 \operatorname{Var}S_{C_4}\le\rho_4\operatorname{Var}_0S_{C_4} Var S C 4 ≤ ρ 4 Var 0 S C 4 under P δ ( 2 ) P_\delta^{(2)} P δ ( 2 ) , with ρ 4 \rho_4 ρ 4 as in Lemma A.12 . With s 2 2 = 12 ( n 4 ) η 4 = t 4 ( n − 1 ) ( n − 2 ) ( n − 3 ) / ( 4 n ) s_2^2=12\binom{n}{4}\eta^4=t^4(n-1)(n-2)(n-3)/(4n) s 2 2 = 12 ( 4 n ) η 4 = t 4 ( n − 1 ) ( n − 2 ) ( n − 3 ) / ( 4 n ) , the test 1 { ∣ D 4 ∣ ≥ ( 6 m ( n 4 ) q 4 / α ) 1 / 2 } \mathbf{1}\{|D_4|\ge(6m\binom{n}{4}q^4/\alpha)^{1/2}\} 1 { ∣ D 4 ∣ ≥ ( 6 m ( 4 n ) q 4 / α ) 1/2 } , D 4 = ∑ ℓ S C 4 ( G ℓ ) − ∑ ℓ S C 4 ( G ℓ ′ ) D_4=\sum_\ell S_{C_4}(G_\ell)-\sum_\ell S_{C_4}(G'_\ell) D 4 = ∑ ℓ S C 4 ( G ℓ ) − ∑ ℓ S C 4 ( G ℓ ′ ) , has size ≤ α \le\alpha ≤ α under P = Q = P 0 P=Q=P_0 P = Q = P 0 and type II error ≤ β \le\beta ≤ β under ( P δ ( 2 ) , P 0 ) (P_\delta^{(2)},P_0) ( P δ ( 2 ) , P 0 ) whenever m s 2 2 ≥ ( 2 / α + ( 1 + ρ 4 ) / β ) 2 ms_2^2\ge(\sqrt{2/\alpha}+\sqrt{(1+\rho_4)/\beta})^2 m s 2 2 ≥ ( 2/ α + ( 1 + ρ 4 ) / β ) 2 .
(iii) E 0 ( d P δ ( 2 ) / d P 0 ) 2 = ∑ S ∈ E n , S b i p a r t i t e η ∣ S ∣ 4 β ( S ) \mathbb{E}_0(dP_\delta^{(2)}/dP_0)^2=\sum_{S\in E_n,\ S\ \mathrm{bipartite}}\eta^{|S|}4^{\beta(S)} E 0 ( d P δ ( 2 ) / d P 0 ) 2 = ∑ S ∈ E n , S bipartite η ∣ S ∣ 4 β ( S ) . If t < 1 / 2 t<1/2 t < 1/2 this is at most E S ∼ Bin ( n , η ) exp { G ( 2 n − s ) η } ≤ exp { G ( 2 t ) } \mathbb{E}_{S\sim\operatorname{Bin}(n, \eta)}\exp\{G(2n-s)\eta\}\le\exp\{G(2t)\} E S ∼ Bin ( n , η ) exp { G ( 2 n − s ) η } ≤ exp { G ( 2 t )} , where G ( x ) = ∑ ℓ ≥ 2 x ℓ / ( 2 ℓ ) = − 1 2 log ( 1 − x 2 ) − x 2 / 2 G(x)=\sum_{\ell\ge2}x^\ell/(2\ell)=-\frac12\log(1-x^2)-x^2/2 G ( x ) = ∑ ℓ ≥ 2 x ℓ / ( 2 ℓ ) = − 2 1 log ( 1 − x 2 ) − x 2 /2 ; the middle quantity tends to exp { 2 G ( t ) } = e − t 2 / 2 / ( 1 − t 2 ) \exp\{2G(t)\}=e^{-t^2/2}/(1-t^2) exp { 2 G ( t )} = e − t 2 /2 / ( 1 − t 2 ) . Errors ( α , β ) (\alpha,\beta) ( α , β ) require m ≥ c α β / G ( 2 t ) ≥ ( 1 − 4 t 2 ) c α β / ( 4 t 4 ) m\ge c_{\alpha\beta}/G(2t)\ge(1-4t^2)c_{\alpha\beta}/(4t^4) m ≥ c α β / G ( 2 t ) ≥ ( 1 − 4 t 2 ) c α β / ( 4 t 4 ) .
(iv) Under ( P δ ( 2 ) , P 0 ) (P_\delta^{(2)},P_0) ( P δ ( 2 ) , P 0 ) the triangle test ψ 3 \psi_3 ψ 3 of Theorem 1(ii) has power at most α ( 1 + ρ 3 ) / 2 \alpha(1+\rho_3)/2 α ( 1 + ρ 3 ) /2 , with ρ 3 \rho_3 ρ 3 as in Lemma A.12 ; for fixed p , m p,m p , m , the statistic D 3 / ( 2 m ( n 3 ) q 3 ) 1 / 2 D_3/(2m\binom{n}{3}q^3)^{1/2} D 3 / ( 2 m ( 3 n ) q 3 ) 1/2 converges in law to N ( 0 , 1 ) N(0,1) N ( 0 , 1 ) under both hypotheses, so the triangle z z z -test has asymptotic power exactly $\alpha.
Lemma A.11 (Sign-cancellation identity). For every S ⊆ E n S \subseteq E_n S ⊆ E n , t S = 2 β ( S ) 1 [ S even and bipartite ] t_S = 2^{\beta(S)}1[S\text{ even and bipartite}] t S = 2 β ( S ) 1 [ S even and bipartite ] . In particular t S = 0 t_S=0 t S = 0 for every triangle, t S = 2 t_S=2 t S = 2 for every 4 4 4 -cycle and t S = 0 t_S=0 t S = 0 whenever S S S has a vertex of odd degree.
Proof. Expanding the product and using independence of σ \sigma σ and τ \tau τ and (5),
t S = ∑ S 1 ⊆ S ( − 1 ) ∣ S ∖ S 1 ∣ E σ O d d ( S 1 ) E τ O d d ( S ∖ S 1 ) = ∑ S 1 ⊆ S ( − 1 ) ∣ S ∖ S 1 ∣ 1 [ S 1 even ] 1 [ S ∖ S 1 even ] . t_S=\sum_{S_1\subseteq S}(-1)^{|S\setminus S_1|}\mathbb{E}_{\sigma}^{\mathrm{Odd}(S_1)}\mathbb{E}_{\tau}^{\mathrm{Odd}(S\setminus S_1)}
=\sum_{S_1\subseteq S}(-1)^{|S\setminus S_1|}1[S_1\text{ even}]1[S\setminus S_1\text{ even}]. t S = S 1 ⊆ S ∑ ( − 1 ) ∣ S ∖ S 1 ∣ E σ Odd ( S 1 ) E τ Odd ( S ∖ S 1 ) = S 1 ⊆ S ∑ ( − 1 ) ∣ S ∖ S 1 ∣ 1 [ S 1 even ] 1 [ S ∖ S 1 even ] . Since deg S = deg S 1 + deg S ∖ S 1 \deg_S=\deg_{S_1}+\deg_{S\setminus S_1} deg S = deg S 1 + deg S ∖ S 1 , both indicators can equal one only if S S S is even, so t S = 0 t_S=0 t S = 0 unless S S S is even.
If S S S is even, S ∖ S 1 S\setminus S_1 S ∖ S 1 is even iff S 1 S_1 S 1 is, and t S = ( − 1 ) ∣ S ∣ ∑ Z ∈ Z ( S ) ( − 1 ) ∣ Z ∣ t_S=(-1)^{|S|}\sum_{Z\in\mathcal{Z}(S)}(-1)^{|Z|} t S = ( − 1 ) ∣ S ∣ ∑ Z ∈ Z ( S ) ( − 1 ) ∣ Z ∣ , where Z ( S ) \mathcal{Z}(S) Z ( S ) is the set of even subsets of S S S . Under symmetric difference Z ( S ) \mathcal{Z}(S) Z ( S ) is the cycle space of the graph ( V ( S ) , S ) (V(S),S) ( V ( S ) , S ) , a vector space over GF ( 2 ) \operatorname{GF}(2) GF ( 2 ) of dimension β ( S ) \beta(S) β ( S ) , and χ ( Z ) = ( − 1 ) ∣ Z ∣ \chi(Z)=(-1)^{|Z|} χ ( Z ) = ( − 1 ) ∣ Z ∣ is a group homomorphism into { ± 1 } \{\pm1\} { ± 1 } because ∣ Z △ Z ′ ∣ ≡ ∣ Z ∣ + ∣ Z ′ ∣ ( m o d 2 ) |Z\triangle Z'|\equiv|Z|+|Z'|\pmod2 ∣ Z △ Z ′ ∣ ≡ ∣ Z ∣ + ∣ Z ′ ∣ ( mod 2 ) . The sum of a homomorphism over a finite group is the group order if it is trivial and 0 0 0 otherwise (if χ ( Z 0 ) = − 1 \chi(Z_0)=-1 χ ( Z 0 ) = − 1 , substituting Z ↦ Z △ Z 0 Z\mapsto Z\triangle Z_0 Z ↦ Z △ Z 0 changes the sign of the sum). χ \chi χ is trivial iff every even subset of S S S has even size iff every cycle of S S S has even length (cycles span Z ( S ) \mathcal{Z}(S) Z ( S ) ) iff ( V ( S ) , S ) (V(S),S) ( V ( S ) , S ) is bipartite. In that case ∣ S ∣ |S| ∣ S ∣ is even because S ∈ Z ( S ) S\in\mathcal{Z}(S) S ∈ Z ( S ) , and t S = 2 β ( S ) t_S=2^{\beta(S)} t S = 2 β ( S ) .
Lemma A.12 (Moments under the rank-two model). Under P δ ( 2 ) P_\delta^{(2)} P δ ( 2 ) :
(a) E [ T p ∣ σ , τ ] = 0 \mathbb{E}[T_p\mid\sigma,\tau]=0 E [ T p ∣ σ , τ ] = 0 , and ( n 3 ) v ‾ 3 ≤ Var T p ≤ ( n 3 ) v ‾ 3 + 6 ( n 2 ) δ 2 v ‾ 2 + 2 N ( n − 1 ) ( n − 2 ) δ 4 v ‾ \binom{n}{3}\underline{v}^{3}\leq\operatorname{Var}T_p\leq\binom{n}{3}\overline{v}^{3}+6\binom{n}{2}\delta^2\overline{v}^{2}+2N(n-1)(n-2)\delta^4\overline{v} ( 3 n ) v 3 ≤ Var T p ≤ ( 3 n ) v 3 + 6 ( 2 n ) δ 2 v 2 + 2 N ( n − 1 ) ( n − 2 ) δ 4 v ; hence Var T p ≤ ρ 3 Var 0 T p \operatorname{Var}T_p\leq\rho_3\operatorname{Var}_0T_p Var T p ≤ ρ 3 Var 0 T p with ρ 3 = r 3 + 6 η r 2 + 6 ( n − 1 ) η 2 r ≤ r 3 + 6 t ( r 2 + t r ) / n \rho_3=r^3+6\eta r^2+6(n-1)\eta^2r\leq r^3+6t(r^2+tr)/n ρ 3 = r 3 + 6 η r 2 + 6 ( n − 1 ) η 2 r ≤ r 3 + 6 t ( r 2 + t r ) / n .
(b) E [ S C 4 ∣ σ , τ ] = 16 δ 4 K \mathbb{E}[SC_4\mid\sigma,\tau]=16\delta^4K E [ S C 4 ∣ σ , τ ] = 16 δ 4 K , where K K K is the number of 4 4 4 -cycles whose vertices alternate between { ρ = 1 } \{\rho=1\} { ρ = 1 } and { ρ = − 1 } \{\rho=-1\} { ρ = − 1 } ; E K = 3 ( n 4 ) / 8 \mathbb{E}K=3\binom{n}{4}/8 E K = 3 ( 4 n ) /8 , Var K ≤ 27 8 n 2 ( n 4 ) \operatorname{Var}K\leq\frac{27}{8}n^2\binom{n}{4} Var K ≤ 8 27 n 2 ( 4 n ) , E S C 4 = 6 ( n 4 ) δ 4 \mathbb{E}SC_4=6\binom{n}{4}\delta^4 E S C 4 = 6 ( 4 n ) δ 4 , and Var S C 4 ≤ ρ 4 Var 0 S C 4 \operatorname{Var}SC_4\leq\rho_4\operatorname{Var}_0SC_4 Var S C 4 ≤ ρ 4 Var 0 S C 4 with
ρ 4 = r 4 + 8 η r 3 + ( 8 n − 4 ) η 2 r 2 + 8 ( n 2 − 5 n + 8 ) η 3 r + 288 n η 4 \rho_4=r^4+8\eta r^3+(8n-4)\eta^2r^2+8(n^2-5n+8)\eta^3r+288n\eta^4 ρ 4 = r 4 + 8 η r 3 + ( 8 n − 4 ) η 2 r 2 + 8 ( n 2 − 5 n + 8 ) η 3 r + 288 n η 4 ≤ r 4 + 8 t ( r 3 + t r 2 + t 2 r ) n + 288 t 4 n 2 . \leq r^4+\frac{8t(r^3+tr^2+t^2r)}{n}+\frac{288t^4}{n^2}. ≤ r 4 + n 8 t ( r 3 + t r 2 + t 2 r ) + n 2 288 t 4 .
Proof. We apply Lemma A.7 with Λ = ( σ , τ ) \Lambda=(\sigma,\tau) Λ = ( σ , τ ) and μ = h \mu=h μ = h , and bound the variance class by class. Three facts are used repeatedly:
h S = δ ∣ S ∣ σ O d d ( S ) ∏ { i , j } ∈ S ( 1 − ρ i ρ j ) h^S=\delta^{|S|}\sigma^{\mathrm{Odd}(S)}\prod_{\{i,j\}\in S}(1-\rho_i\rho_j) h S = δ ∣ S ∣ σ Odd ( S ) ∏ { i , j } ∈ S ( 1 − ρ i ρ j ) and E h S = δ ∣ S ∣ t S \mathbb{E}h^S=\delta^{|S|}t_S E h S = δ ∣ S ∣ t S (Lemma A.11);
h i j 2 = 2 δ 2 ( 1 − ρ i ρ j ) h_{ij}^2=2\delta^2(1-\rho_i\rho_j) h ij 2 = 2 δ 2 ( 1 − ρ i ρ j ) , so E h i j 2 = 2 δ 2 \mathbb{E}h_{ij}^2=2\delta^2 E h ij 2 = 2 δ 2 ;
v R ≤ v ‾ ∣ R ∣ v^R\leq\overline{v}^{|R|} v R ≤ v ∣ R ∣ pointwise.
(a) For a triangle Δ \Delta Δ , σ O d d ( Δ ) = 1 \sigma^{\mathrm{Odd}(\Delta)}=1 σ Odd ( Δ ) = 1 and ∏ e ∈ Δ ( 1 − ρ i ρ j ) = 0 \prod_{e\in\Delta}(1-\rho_i\rho_j)=0 ∏ e ∈ Δ ( 1 − ρ i ρ j ) = 0 because two of the three values ρ i , ρ j , ρ k \rho_i,\rho_j,\rho_k ρ i , ρ j , ρ k coincide. Hence c ∅ = ∑ Δ h Δ ≡ 0 c_\varnothing=\sum_\Delta h^\Delta\equiv0 c ∅ = ∑ Δ h Δ ≡ 0 . The non-empty R R R are triangles (c R = 1 c_R=1 c R = 1 ), paths i − j − k i-j-k i − j − k (c R = h i k c_R=h_{ik} c R = h ik , E c R 2 = 2 δ 2 \mathbb{E}c_R^2=2\delta^2 E c R 2 = 2 δ 2 ) and edges i j ij ij (c R = ∑ k ≠ i , j h i k h j k c_R=\sum_{k\ne i,j}h_{ik}h_{jk} c R = ∑ k = i , j h ik h j k ). For an edge,
E c R 2 = ∑ k E h i k 2 h j k 2 + ∑ k ≠ k ′ E [ h i k h j k h i k ′ h j k ′ ] = 4 δ 4 ( n − 2 ) + 2 δ 4 ( n − 2 ) ( n − 3 ) = 2 δ 4 ( n − 1 ) ( n − 2 ) , \mathbb{E}c_R^2=\sum_k\mathbb{E}h_{ik}^2h_{jk}^2+\sum_{k\ne k'}\mathbb{E}[h_{ik}h_{jk}h_{ik'}h_{jk'}]
=4\delta^4(n-2)+2\delta^4(n-2)(n-3)=2\delta^4(n-1)(n-2), E c R 2 = k ∑ E h ik 2 h j k 2 + k = k ′ ∑ E [ h ik h j k h i k ′ h j k ′ ] = 4 δ 4 ( n − 2 ) + 2 δ 4 ( n − 2 ) ( n − 3 ) = 2 δ 4 ( n − 1 ) ( n − 2 ) ,
using E h i k 2 h j k 2 = 4 δ 4 E ( 1 − ρ i ρ k ) ( 1 − ρ j ρ k ) = 4 δ 4 \mathbb{E}h_{ik}^2h_{jk}^2=4\delta^4\mathbb{E}(1-\rho_i\rho_k)(1-\rho_j\rho_k)=4\delta^4 E h ik 2 h j k 2 = 4 δ 4 E ( 1 − ρ i ρ k ) ( 1 − ρ j ρ k ) = 4 δ 4 and Lemma A.11 for the 4 4 4 -cycle i k j k ′ ikjk' ik j k ′ .
With ( n 3 ) \binom{n}{3} ( 3 n ) triangles, 3 ( n 3 ) 3\binom{n}{3} 3 ( 3 n ) paths, N N N edges and v R ≤ v ‾ ∣ R ∣ v^R\leq\overline{v}^{|R|} v R ≤ v ∣ R ∣ we get the upper bound. The lower bound keeps only the triangle terms and uses v e ≥ v min v_e\geq v_{\min} v e ≥ v m i n . Dividing by ( n 3 ) q 3 \binom{n}{3}q^3 ( 3 n ) q 3 gives ρ 3 \rho_3 ρ 3 , since 2 N ( n − 1 ) ( n − 2 ) = 6 ( n − 1 ) ( n 3 ) 2N(n-1)(n-2)=6(n-1)\binom{n}{3} 2 N ( n − 1 ) ( n − 2 ) = 6 ( n − 1 ) ( 3 n ) .
(b) Mean. For a 4 4 4 -cycle C C C , σ O d d ( C ) = 1 \sigma^{\mathrm{Odd}(C)}=1 σ Odd ( C ) = 1 and ∏ e ∈ C ( 1 − ρ i ρ j ) ∈ { 0 , 16 } \prod_{e\in C}(1-\rho_i\rho_j)\in\{0,16\} ∏ e ∈ C ( 1 − ρ i ρ j ) ∈ { 0 , 16 } , with value 16 16 16 iff ρ \rho ρ alternates around C C C . So c ∅ = 16 δ 4 K c_\varnothing=16\delta^4K c ∅ = 16 δ 4 K . Each 4 4 4 -cycle alternates with probability 2 / 16 2/16 2/16 , which gives E K \mathbb{E}K E K and E S C 4 = 16 δ 4 E K = 6 ( n 4 ) δ 4 \mathbb{E}SC_4=16\delta^4\mathbb{E}K=6\binom{n}{4}\delta^4 E S C 4 = 16 δ 4 E K = 6 ( 4 n ) δ 4 .
::: The variance Var K \operatorname{Var} K Var K . The indicators of two 4-cycles sharing at most one vertex x x x are conditionally independent given ρ x \rho_x ρ x , with conditional means 1 / 8 1/8 1/8 not depending on ρ x \rho_x ρ x , hence uncorrelated. A 4-cycle meets at most 3 ⋅ 3 n 2 3\cdot3n^2 3 ⋅ 3 n 2 4-cycles in two or more vertices, and each covariance is at most 1 / 8 1/8 1/8 . So Var K ≤ 1 8 ⋅ 3 ( n 4 ) ⋅ 9 n 2 \operatorname{Var} K \le\frac{1}{8}\cdot3\binom{n}{4}\cdot9n^2 Var K ≤ 8 1 ⋅ 3 ( 4 n ) ⋅ 9 n 2 .
Coefficients. The non-empty R R R contained in a 4-cycle fall into five classes.
The 4-cycles themselves, with c R = 1 c_R=1 c R = 1 .
Paths with 3 edges. Here c R c_R c R is the closing edge and E c R 2 = 2 δ 2 \mathbb{E}c_R^2=2\delta^2 E c R 2 = 2 δ 2 , and there are 12 ( n 4 ) 12\binom{n}{4} 12 ( 4 n ) of them.
Paths i − j − k i-j-k i − j − k with 2 edges, contained in the cycles i j k l ijkl ij k l with l ∉ { i , j , k } l\notin\{i,j,k\} l ∈ / { i , j , k } . Here c R = ∑ l h k l h l i c_R=\sum_l h_{kl}h_{li} c R = ∑ l h k l h l i and, as in (a), E c R 2 = 4 δ 4 ( n − 3 ) + 2 δ 4 ( n − 3 ) ( n − 4 ) = 2 δ 4 ( n − 2 ) ( n − 3 ) \mathbb{E}c_R^2=4\delta^4(n-3)+2\delta^4(n-3)(n-4)=2\delta^4(n-2)(n-3) E c R 2 = 4 δ 4 ( n − 3 ) + 2 δ 4 ( n − 3 ) ( n − 4 ) = 2 δ 4 ( n − 2 ) ( n − 3 ) . There are 3 ( n 3 ) 3\binom{n}{3} 3 ( 3 n ) of them.
Pairs of disjoint edges { i j , k l } \{ij,kl\} { ij , k l } , contained in the cycles i j k l ijkl ij k l and i j l k ijlk ij l k . Here c R = h j k h l i + h j l h k i c_R=h_{jk}h_{li}+h_{jl}h_{ki} c R = h j k h l i + h j l h k i and E c R 2 = 4 δ 4 + 4 δ 4 + 2 ⋅ 2 δ 4 = 12 δ 4 \mathbb{E}c_R^2=4\delta^4+4\delta^4+2\cdot2\delta^4=12\delta^4 E c R 2 = 4 δ 4 + 4 δ 4 + 2 ⋅ 2 δ 4 = 12 δ 4 . There are 3 ( n 4 ) 3\binom{n}{4} 3 ( 4 n ) of them.
Single edges i j ij ij , contained in the cycles i j k l ijkl ij k l with ( k , l ) (k,l) ( k , l ) ordered, distinct and outside { i , j } \{i,j\} { i , j } . Here c R = ∑ ( k , l ) h j k h k l h l i c_R=\sum_{(k,l)}h_{jk}h_{kl}h_{li} c R = ∑ ( k , l ) h j k h k l h l i .
For class (5) we expand E c R 2 \mathbb{E}c_R^2 E c R 2 over pairs ( ( k , l ) , ( k ′ , l ′ ) ) ((k,l),(k',l')) (( k , l ) , ( k ′ , l ′ )) .
Pairs with { k , l } ∩ { k ′ , l ′ } = ∅ \{k,l\}\cap\{k',l'\}=\varnothing { k , l } ∩ { k ′ , l ′ } = ∅ form a 6-cycle and give 2 δ 6 2\delta^6 2 δ 6 , with ( n − 2 ) ( n − 3 ) ( n − 4 ) ( n − 5 ) (n-2)(n-3)(n-4)(n-5) ( n − 2 ) ( n − 3 ) ( n − 4 ) ( n − 5 ) terms.
Pairs with k = k ′ , l ≠ l ′ k=k',l\ne l' k = k ′ , l = l ′ (or l = l ′ , k ≠ k ′ l=l',k\ne k' l = l ′ , k = k ′ ) give E [ h j k 2 h k l h k l ′ h l ′ i ] \mathbb{E}[h_{jk}^2h_{kl}h_{kl'}h_{l'i}] E [ h j k 2 h k l h k l ′ h l ′ i ] , where C ′ C' C ′ is the 4-cycle k l i l ′ klil' k l i l ′ . This equals 2 δ 2 ⋅ 16 δ 4 E [ ( 1 − ρ j ρ k ) 1 { ρ alternates on C ′ } ] = 4 δ 6 2\delta^2\cdot16\delta^4\mathbb{E}[(1-\rho_j\rho_k)1\{\rho\text{ alternates on }C'\}]=4\delta^6 2 δ 2 ⋅ 16 δ 4 E [( 1 − ρ j ρ k ) 1 { ρ alternates on C ′ }] = 4 δ 6 , with 2 ( n − 2 ) ( n − 3 ) ( n − 4 ) 2(n-2)(n-3)(n-4) 2 ( n − 2 ) ( n − 3 ) ( n − 4 ) terms.
Pairs with k = l ′ , l ≠ k ′ k=l',l\ne k' k = l ′ , l = k ′ (or l = k ′ , k ≠ l ′ l=k',k\ne l' l = k ′ , k = l ′ ) consist of six distinct edges containing the triangle j k k ′ jkk' j k k ′ (or j k l jkl j k l ), so they give 0 by Lemma A.11.
The swapped pair ( k , l ) , ( l , k ) (k,l),(l,k) ( k , l ) , ( l , k ) gives E [ h k l 2 h k ′ l h l ′ k ′ ′ ] \mathbb{E}[h_{kl}^2h_{k'l}h_{l'k''}] E [ h k l 2 h k ′ l h l ′ k ′′ ] , where C ′ ′ C'' C ′′ is the 4-cycle j k i l jkil j k i l . It vanishes because h C ′ ′ ≠ 0 h_{C''}\ne0 h C ′′ = 0 forces alternation on C ′ ′ C'' C ′′ , hence ρ k = ρ l \rho_k=\rho_l ρ k = ρ l and h k l = 0 h_{kl}=0 h k l = 0 .
Altogether E c R 2 = 2 δ 6 ( n − 2 ) ( n − 3 ) ( n 2 − 5 n + 8 ) \mathbb{E}c_R^2=2\delta^6(n-2)(n-3)(n^2-5n+8) E c R 2 = 2 δ 6 ( n − 2 ) ( n − 3 ) ( n 2 − 5 n + 8 ) .
Conclusion. Summing the five contributions with v R ≤ v ˉ ∣ R ∣ v^R\le\bar v^{|R|} v R ≤ v ˉ ∣ R ∣ , adding Var c ∅ = 256 δ 8 Var K \operatorname{Var}c_\varnothing=256\delta^8\operatorname{Var}K Var c ∅ = 256 δ 8 Var K , and dividing by Var 0 S C 4 = 3 ( n 4 ) q 4 \operatorname{Var}_0 S_{C_4}=3\binom{n}{4}q^4 Var 0 S C 4 = 3 ( 4 n ) q 4 gives
ρ 4 = r 4 + 8 η r 3 + 8 ( n − 2 ) η 2 r 2 + 12 n η 2 r 2 + 8 ( n 2 − 5 n + 8 ) η 3 r + 288 n 2 η 4 , \rho_4=r^4+8\eta r^3+8(n-2)\eta^2r^2+12n\eta^2r^2+8(n^2-5n+8)\eta^3r+288n^2\eta^4, ρ 4 = r 4 + 8 η r 3 + 8 ( n − 2 ) η 2 r 2 + 12 n η 2 r 2 + 8 ( n 2 − 5 n + 8 ) η 3 r + 288 n 2 η 4 ,
using ( n 3 ) / ( n 4 ) = 4 / ( n − 3 ) \binom{n}{3}/\binom{n}{4}=4/(n-3) ( 3 n ) / ( 4 n ) = 4/ ( n − 3 ) and N / ( n 4 ) = 12 / ( ( n − 2 ) ( n − 3 ) ) N/\binom{n}{4}=12/((n-2)(n-3)) N / ( 4 n ) = 12/ (( n − 2 ) ( n − 3 )) . The final inequality uses η = t / n \eta=t/n η = t / n , ( 8 n − 4 ) η 2 ≤ 8 t 2 / n (8n-4)\eta^2\le8t^2/n ( 8 n − 4 ) η 2 ≤ 8 t 2 / n and n 2 − 5 n + 8 ≤ n 2 n^2-5n+8\le n^2 n 2 − 5 n + 8 ≤ n 2 .
Remark 7. We verified the exact values of all coefficients E c R 2 \mathbb{E}c_R^2 E c R 2 in this proof by enumeration over ( σ , τ ) (\sigma,\tau) ( σ , τ ) for n = 6 , 7 n=6,7 n = 6 , 7 , and compared the resulting variance bounds with exact variances for n = 5 n=5 n = 5 (numerical check (vi), parts (c) and (d)).
Lemma A.13 (Second moment under the rank-two model). E 0 ( d P ( 2 ) / d P 0 ) 2 = ∑ S ∈ E n , S bipartite η ∣ S ∣ 4 β ( S ) \mathbb{E}_0(dP^{(2)}/dP_0)^2=\sum_{S\in\mathcal{E}_n,\ S\text{ bipartite}}\eta^{|S|}4^{\beta(S)} E 0 ( d P ( 2 ) / d P 0 ) 2 = ∑ S ∈ E n , S bipartite η ∣ S ∣ 4 β ( S ) , and the bounds of Proposition 1(iii) hold.
Proof. By Lemma A.2 with Λ = ( σ , τ ) \Lambda=(\sigma,\tau) Λ = ( σ , τ ) , E 0 ( d P δ ( 2 ) / d P 0 ) 2 = E ∏ i < j ( 1 + η z i j z i j ′ ) \mathbb{E}_0(dP_\delta^{(2)}/dP_0)^2=\mathbb{E}\prod_{i<j}(1+\eta z_{ij}z'_{ij}) E 0 ( d P δ ( 2 ) / d P 0 ) 2 = E ∏ i < j ( 1 + η z ij z ij ′ ) , where z i j = σ i σ j − τ i τ j z_{ij}=\sigma_i\sigma_j-\tau_i\tau_j z ij = σ i σ j − τ i τ j and z ′ z' z ′ is built from an independent copy ( σ ′ , τ ′ ) (\sigma',\tau') ( σ ′ , τ ′ ) . Expanding, E ∏ i < j ( 1 + η z i j z i j ′ ) = ∑ S η ∣ S ∣ E z S E z S ′ \mathbb{E}\prod_{i<j}(1+\eta z_{ij}z'_{ij})=\sum_{S}\eta^{|S|}\mathbb{E}z_S\mathbb{E}z'_S E ∏ i < j ( 1 + η z ij z ij ′ ) = ∑ S η ∣ S ∣ E z S E z S ′ , and Lemma A.11 gives the first formula. For the bound, let ρ ′ = σ ′ ∘ τ ′ \rho'=\sigma'\circ\tau' ρ ′ = σ ′ ∘ τ ′ and ω = σ ∘ σ ′ \omega=\sigma\circ\sigma' ω = σ ∘ σ ′ . The map ( σ , τ , σ ′ , τ ′ ) ↦ ( σ , ρ , ρ ′ , ω ) (\sigma,\tau,\sigma',\tau')\mapsto(\sigma,\rho,\rho',\omega) ( σ , τ , σ ′ , τ ′ ) ↦ ( σ , ρ , ρ ′ , ω ) is a bijection of { ± 1 } n 4 \{\pm1\}^{n\,4} { ± 1 } n 4 , so ρ , ρ ′ , ω \rho,\rho',\omega ρ , ρ ′ , ω are independent and uniform. Since z i j = σ i σ j ( 1 − ρ i ρ j ) z_{ij}=\sigma_i\sigma_j(1-\rho_i\rho_j) z ij = σ i σ j ( 1 − ρ i ρ j ) ,
E 0 ( d P ( 2 ) d P 0 ) 2 = E ρ , ρ ′ ∑ S ⊆ A S e v e n ( 4 η ) ∣ S ∣ ≤ E ρ , ρ ′ exp ( ∑ C ∈ C ( [ n ] , A ) ( 4 η ) ∣ C ∣ ) . \mathbb{E}_0\left(\frac{dP^{(2)}}{dP_0}\right)^2=\mathbb{E}_{\rho,\rho'}\sum_{\substack{S\subseteq A\\S\ {\rm even}}}(4\eta)^{|S|}\leq\mathbb{E}_{\rho,\rho'}\exp\left(\sum_{C\in\mathcal{C}([n],A)}(4\eta)^{|C|}\right). E 0 ( d P 0 d P ( 2 ) ) 2 = E ρ , ρ ′ S ⊆ A S even ∑ ( 4 η ) ∣ S ∣ ≤ E ρ , ρ ′ exp C ∈ C ([ n ] , A ) ∑ ( 4 η ) ∣ C ∣ .
Cycle structure. Classify vertices by the type ( ρ i , ρ i ′ ) (\rho_i,\rho'_i) ( ρ i , ρ i ′ ) , with class sizes a = ∣ { + + } ∣ a=|\{++\}| a = ∣ { + + } ∣ , d = ∣ { − − } ∣ d=|\{--\}| d = ∣ { − − } ∣ , b = ∣ { + − } ∣ b=|\{+-\}| b = ∣ { + − } ∣ , c = ∣ { − + } ∣ c=|\{-+\}| c = ∣ { − + } ∣ . Then { i , j } ∈ A \{i,j\}\in A { i , j } ∈ A iff the types are opposite, so A A A is the disjoint union of the complete bipartite graphs K a , d K_{a,d} K a , d and K b , c K_{b,c} K b , c . All their cycles have even length 2 l ≥ 4 2l\geq4 2 l ≥ 4 , and K a , d K_{a,d} K a , d has ( a l ) ( d l ) / ( 2 l ) ≤ ( a d ) l / ( 2 l ) \binom{a}{l}\binom{d}{l}/(2l)\leq(ad)^l/(2l) ( l a ) ( l d ) / ( 2 l ) ≤ ( a d ) l / ( 2 l ) cycles of length 2 l 2l 2 l .
The bound. With s = a + d ∼ Bin ( n , 1 / 2 ) s=a+d\sim\operatorname{Bin}(n,1/2) s = a + d ∼ Bin ( n , 1/2 ) (the events ρ i ρ i ′ = 1 \rho_i\rho'_i=1 ρ i ρ i ′ = 1 are independent with probability 1 / 2 1/2 1/2 ), a d ≤ s 2 / 4 ad\leq s^2/4 a d ≤ s 2 /4 and b c ≤ ( n − s ) 2 / 4 bc\leq(n-s)^2/4 b c ≤ ( n − s ) 2 /4 . Hence
∑ C ( 4 η ) ∣ C ∣ ≤ ∑ l ≥ 2 ( 2 s η ) 2 l + ( 2 ( n − s ) η ) 2 l 2 l = G ( 2 s η ) + G ( 2 ( n − s ) η ) , \sum_C(4\eta)^{|C|}\leq\sum_{l\geq2}\frac{(2s\eta)^{2l}+(2(n-s)\eta)^{2l}}{2l}=G(2s\eta)+G(2(n-s)\eta), C ∑ ( 4 η ) ∣ C ∣ ≤ l ≥ 2 ∑ 2 l ( 2 sη ) 2 l + ( 2 ( n − s ) η ) 2 l = G ( 2 sη ) + G ( 2 ( n − s ) η ) ,
which is finite because 2 n η = 2 t < 1 2n\eta=2t<1 2 n η = 2 t < 1 . This is the middle bound. Since x 2 l + y 2 l ≤ ( x + y ) 2 l x^{2l}+y^{2l}\leq(x+y)^{2l} x 2 l + y 2 l ≤ ( x + y ) 2 l for x , y ≥ 0 x,y\geq0 x , y ≥ 0 , G ( x ) + G ( y ) ≤ G ( x + y ) G(x)+G(y)\leq G(x+y) G ( x ) + G ( y ) ≤ G ( x + y ) , which gives exp G ( 2 t ) \exp G(2t) exp G ( 2 t ) .
The limit and the sample size. As n → ∞ n\to\infty n → ∞ , s / n → 1 / 2 s/n\to1/2 s / n → 1/2 almost surely along the obvious coupling, so G ( 2 s η ) + G ( 2 ( n − s ) η ) → 2 G ( t ) G(2s\eta)+G(2(n-s)\eta)\to2G(t) G ( 2 sη ) + G ( 2 ( n − s ) η ) → 2 G ( t ) , and dominated convergence (the integrand is at most e G ( 2 t ) e^{G(2t)} e G ( 2 t ) ) gives the limit. Finally G ( 2 t ) = ∑ l ≥ 2 ( 4 t 2 ) l / ( 2 l ) ≤ ( 4 t 2 ) 2 / ( 4 ( 1 − 4 t 2 ) ) G(2t)=\sum_{l\geq2}(4t^2)^l/(2l)\leq(4t^2)^2/(4(1-4t^2)) G ( 2 t ) = ∑ l ≥ 2 ( 4 t 2 ) l / ( 2 l ) ≤ ( 4 t 2 ) 2 / ( 4 ( 1 − 4 t 2 )) , and Lemma A.1(d) gives the sample-size bound exactly as in Theorem 1(i).
Proof of Proposition 1. (i) is Lemma A.11, and (iii) is Lemma A.13.
(ii) The moments are Lemma A.12(b) and, for δ = 0 \delta=0 δ = 0 , the orthogonality of distinct 4-cycles under P 0 P_0 P 0 . The test analysis is that of Theorem 1(ii) with V 0 = 3 ( n 4 ) q 4 V_0=3\binom{n}{4}q^4 V 0 = 3 ( 4 n ) q 4 , mean shift m ⋅ 6 ( n 4 ) δ 4 m\cdot6\binom{n}{4}\delta^4 m ⋅ 6 ( 4 n ) δ 4 and 6 ( n 4 ) δ 4 / V 0 1 / 2 = s 4 6\binom{n}{4}\delta^4/V_0^{1/2}=s_4 6 ( 4 n ) δ 4 / V 0 1/2 = s 4 .
(iv) Under ( P δ ( 2 ) , P 0 ) (P_\delta^{(2)},P_0) ( P δ ( 2 ) , P 0 ) , E D 3 = 0 \mathbb{E}D_3=0 E D 3 = 0 by Lemma A.12(a), so by Chebyshev’s inequality P ( ∣ D 3 ∣ ≥ λ 3 ) ≤ Var D 3 / λ 3 2 = α m ( Var T p + V 0 ) / ( 2 m V 0 ) ≤ α ( 1 + ρ 3 ) / 2 \mathbb{P}(|D_3|\geq\lambda_3)\leq\operatorname{Var}D_3/\lambda_3^2=\alpha m(\operatorname{Var}T_p+V_0)/(2mV_0)\leq\alpha(1+\rho_3)/2 P ( ∣ D 3 ∣ ≥ λ 3 ) ≤ Var D 3 / λ 3 2 = α m ( Var T p + V 0 ) / ( 2 m V 0 ) ≤ α ( 1 + ρ 3 ) /2 , and ρ 3 → 1 \rho_3\to1 ρ 3 → 1 when η / q → 0 \eta/q\to0 η / q → 0 and t 2 / n → 0 t^2/n\to0 t 2 / n → 0 . The central limit statement is proved in Remark 9.
Theorem 2: invariance of tree statistics
For a graph F F F with at least one edge let K n ( F ) \mathcal{K}_n(F) K n ( F ) be its set of copies in K n K_n K n , N F = ∣ K n ( F ) ∣ N_F=|\mathcal{K}_n(F)| N F = ∣ K n ( F ) ∣ , and define the normalized signed count Z F ( G ) = ( N F q e ( F ) ) − 1 / 2 ∑ φ ∈ K n ( F ) ( A − p ) φ Z_F(G)=(N_Fq^{e(F)})^{-1/2}\sum_{\varphi\in\mathcal{K}_n(F)}(A-p)^\varphi Z F ( G ) = ( N F q e ( F ) ) − 1/2 ∑ φ ∈ K n ( F ) ( A − p ) φ .
Theorem (Restatement of Theorem 2). (i) Let W W W be a graphon with d W ( x ) = ∫ 0 1 W ( x , y ) d y = d d_W(x)=\int_0^1W(x,y)\,dy=d d W ( x ) = ∫ 0 1 W ( x , y ) d y = d for a.e. x x x , and H H H a bounded symmetric measurable function with d H ≡ 0 d_H\equiv0 d H ≡ 0 a.e. and 0 ≤ W + H ≤ 1 0\leq W+H\leq1 0 ≤ W + H ≤ 1 . Then t ( T , W + H ) = t ( T , W ) = d e ( T ) t(T,W+H)=t(T,W)=d^{e(T)} t ( T , W + H ) = t ( T , W ) = d e ( T ) for every finite forest T T T . Consequently, for all n ≥ v ( T ) n\geq v(T) n ≥ v ( T ) , E t i n j ( T , G ( n , W + H ) ) = E t i n j ( T , G ( n , W ) ) = d e ( T ) \mathbb{E}\,t_{\mathrm{inj}}(T,G(n,W+H))=\mathbb{E}\,t_{\mathrm{inj}}(T,G(n,W))=d^{e(T)} E t inj ( T , G ( n , W + H )) = E t inj ( T , G ( n , W )) = d e ( T ) ; under both G ( n , W ) G(n,W) G ( n , W ) and G ( n , W + H ) G(n,W+H) G ( n , W + H ) every vertex degree has law Bin ( n − 1 , d ) \operatorname{Bin}(n-1,d) Bin ( n − 1 , d ) and the edge count has mean N d N d N d and variance N d ( 1 − d ) N d(1-d) N d ( 1 − d ) .
(ii) Fix p ∈ ( 0 , 1 ) p\in(0,1) p ∈ ( 0 , 1 ) , t > 0 t>0 t > 0 , m ≥ 1 m\geq1 m ≥ 1 , pairwise non-isomorphic trees T 1 , … , T r T_1,\ldots,T_r T 1 , … , T r with at least one edge, and let δ = δ n = ( t q / n ) 1 / 2 \delta=\delta_n=(tq/n)^{1/2} δ = δ n = ( tq / n ) 1/2 (admissible for n ≥ t / q n\geq t/q n ≥ t / q ). Under P 0 P_0 P 0 and under P δ P_\delta P δ , ( Z T 1 , … , Z T r ) → N ( 0 , I r ) (Z_{T_1},\ldots,Z_{T_r})\to N(0,I_r) ( Z T 1 , … , Z T r ) → N ( 0 , I r ) in law. Moreover, under P δ P_\delta P δ , ( Z T 1 , … , Z T r , Z K 3 ) → N ( 0 , … , 0 , t 3 / 6 , I r + 1 ) (Z_{T_1},\ldots,Z_{T_r},Z_{K_3})\to N(0,\ldots,0,\sqrt{t^3/6},I_{r+1}) ( Z T 1 , … , Z T r , Z K 3 ) → N ( 0 , … , 0 , t 3 /6 , I r + 1 ) . Hence for 2 m 2m 2 m independent graphs the vector ( Z T i ( G ℓ ) , Z T i ( G ℓ ′ ) ) i , ℓ (Z_{T_i}(G_\ell),Z_{T_i}(G'_\ell))_{i,\ell} ( Z T i ( G ℓ ) , Z T i ( G ℓ ′ ) ) i , ℓ converges to N ( 0 , I 2 m r ) N(0,I_{2mr}) N ( 0 , I 2 m r ) under H 0 H_0 H 0 and H 1 H_1 H 1 , every test 1 { Z ∈ A } 1\{Z\in A\} 1 { Z ∈ A } with ∂ A \partial A ∂ A Lebesgue-null has the same limiting rejection probability under both, and the one-sided signed-triangle z z z -test 1 { D 3 ≥ z α ( 2 m ( n 3 ) q 3 ) 1 / 2 } 1\{D_3\geq z_\alpha(2m\binom{n}{3}q^3)^{1/2}\} 1 { D 3 ≥ z α ( 2 m ( 3 n ) q 3 ) 1/2 } has asymptotic power 1 − Φ ( z α − m t 3 / 12 ) 1-\Phi(z_\alpha-\sqrt{mt^3/12}) 1 − Φ ( z α − m t 3 /12 ) .
Lemma A.14 (Leaf removal). If U U U is a graphon with d U ≡ d d_U\equiv d d U ≡ d a.e., then t ( T , U ) = d e ( T ) t(T,U)=d^{e(T)} t ( T , U ) = d e ( T ) for every finite forest $T.
Proof. Induction on e ( T ) e(T) e ( T ) . If e ( T ) = 0 e(T)=0 e ( T ) = 0 , t ( T , U ) = 1 t(T,U)=1 t ( T , U ) = 1 . Otherwise T T T has a leaf l l l with unique neighbour w w w . By Fubini, integrating x l x_l x l first, ∫ U ( x w , x l ) d x l = d U ( x w ) = d \int U(x_w,x_l)\,\mathrm{d}x_l=d_U(x_w)=d ∫ U ( x w , x l ) d x l = d U ( x w ) = d for a.e. x w x_w x w , so t ( T , U ) = d ⋅ t ( T − l , U ) t(T,U)=d\cdot t(T-l,U) t ( T , U ) = d ⋅ t ( T − l , U ) , where T − l T-l T − l is the forest obtained by deleting l l l and its edge.
Proof of (i). U : = W + H U:=W+H U := W + H is a graphon and d U = d W + d H = d d_U=d_W+d_H=d d U = d W + d H = d a.e., so Lemma A.14 applies to W W W and to U U U . For n ≥ v ( T ) n\ge v(T) n ≥ v ( T ) and an injective ϕ : V ( T ) → [ n ] \phi:V(T)\to[n] ϕ : V ( T ) → [ n ] , the latent values ( U ϕ ( u ) ) u (U_{\phi(u)})_u ( U ϕ ( u ) ) u are i.i.d. uniform, so E ∏ u v ∈ E ( T ) A ϕ ( u ) ϕ ( v ) = t ( T , U ) \mathbb{E}\prod_{uv\in E(T)}A_{\phi(u)\phi(v)}=t(T,U) E ∏ uv ∈ E ( T ) A ϕ ( u ) ϕ ( v ) = t ( T , U ) and E t i n j ( T , G ( n , U ) ) = t ( T , U ) \mathbb{E}\,t_{\mathrm{inj}}(T,G(n,U))=t(T,U) E t inj ( T , G ( n , U )) = t ( T , U ) . For the degree of vertex i i i , condition on U i = x U_i=x U i = x . Then the pairs ( U j , A i j ) j ≠ i (U_j,A_{ij})_{j\ne i} ( U j , A ij ) j = i are i.i.d. with P ( A i j = 1 ∣ U i = x ) = d U ( x ) = d \mathbb{P}(A_{ij}=1\mid U_i=x)=d_U(x)=d P ( A ij = 1 ∣ U i = x ) = d U ( x ) = d , so deg ( i ) ∼ Bin ( n − 1 , d ) \deg(i)\sim\operatorname{Bin}(n-1,d) deg ( i ) ∼ Bin ( n − 1 , d ) independently of U i U_i U i . For the edge count, Var A e = d ( 1 − d ) \operatorname{Var} A_e=d(1-d) Var A e = d ( 1 − d ) , Cov ( A e , A f ) = t ( P 3 , U ) − d 2 = 0 \operatorname{Cov}(A_e,A_f)=t(P_3,U)-d^2=0 Cov ( A e , A f ) = t ( P 3 , U ) − d 2 = 0 if e , f e,f e , f share one vertex (P 3 P_3 P 3 , the path with two edges, is a tree), and A e , A f A_e,A_f A e , A f are independent if e ∩ f = ∅ e\cap f=\varnothing e ∩ f = ∅ .
Remark 8. (a) The planted partition is G ( n , W + H ) G(n,W+H) G ( n , W + H ) with W ≡ p W\equiv p W ≡ p and H = δ s ⊗ s H=\delta\,s\otimes s H = δ s ⊗ s , s = 1 [ 0 , 1 / 2 ) − 1 [ 1 / 2 , 1 ) s=\mathbf{1}_{[0,1/2)}-\mathbf{1}_{[1/2,1)} s = 1 [ 0 , 1/2 ) − 1 [ 1/2 , 1 ) , so (i) contains the identities E δ ( # e d g e s ) = N p \mathbb{E}_\delta(\#\mathrm{edges})=Np E δ ( # edges ) = N p and Var δ ( # e d g e s ) = N q \operatorname{Var}_\delta(\#\mathrm{edges})=Nq Var δ ( # edges ) = N q , which numerical check (ix) confirms by enumeration. The first difference in the moments of the edge count appears in the third central moment, 6 ( n 3 ) δ 3 6\binom{n}{3}\delta^3 6 ( 3 n ) δ 3 , and for the rank-two model only in the fourth, 144 ( n 4 ) δ 4 144\binom{n}{4}\delta^4 144 ( 4 n ) δ 4 .
(b) Only injective densities are invariant. Homomorphism densities of the sampled graph include non-injective maps whose images may contain cycles (for example, a path with three edges whose endpoints coincide), and joint laws of several degrees are not invariant. For irregular W W W , trees may detect a zero-degree H H H at first order. For the path P 4 P_4 P 4 with three edges the first-order coefficient is ⟨ H , d W ⊗ d W ⟩ \langle H,d_W\otimes d_W\rangle ⟨ H , d W ⊗ d W ⟩ , which is 1.56 ⋅ 10 − 4 1.56\cdot10^{-4} 1.56 ⋅ 1 0 − 4 for the SMOOTH null and the H 0 H_0 H 0 of the experiments (numerical check (xi)).
(c) Message-passing networks and colour refinement on graphons are characterized by tree homomorphism densities [9 ] (Böker 2023). By (i), the graphons W W W and W + H W+H W + H have identical tree homomorphism densities, so by that characterization no message-passing network and no colour-refinement statistic separates them at the level of graphons.
Lemma A.15 (Method of moments for signed subgraph chaoses). Let F 1 , … , F r F_1,\ldots,F_r F 1 , … , F r be pairwise non-isomorphic connected graphs with at least one edge, v j = v ( F j ) v_j=v(F_j) v j = v ( F j ) , e j = e ( F j ) e_j=e(F_j) e j = e ( F j ) , and let q > 0 q>0 q > 0 . Let ( ξ e ) e ∈ E n (\xi_e)_{e\in E_n} ( ξ e ) e ∈ E n be independent with E ξ e = 0 \mathbb{E}\xi_e=0 E ξ e = 0 , ∣ ξ e ∣ ≤ 1 |\xi_e|\le1 ∣ ξ e ∣ ≤ 1 and E ξ e 2 = v e \mathbb{E}\xi_e^2=v_e E ξ e 2 = v e . Put
W j = ( N F j q e j ) − 1 / 2 ∑ φ ∈ K n ( F j ) ξ φ , s j = ( N F j q e j ) − 1 ∑ φ ∈ K n ( F j ) v φ . W_j=(N_{F_j}q^{e_j})^{-1/2}\sum_{\varphi\in K_n(F_j)}\xi^\varphi,\qquad s_j=(N_{F_j}q^{e_j})^{-1}\sum_{\varphi\in K_n(F_j)}v^\varphi. W j = ( N F j q e j ) − 1/2 φ ∈ K n ( F j ) ∑ ξ φ , s j = ( N F j q e j ) − 1 φ ∈ K n ( F j ) ∑ v φ . For every k = ( k 1 , … , k r ) ∈ N r \mathbf{k}=(k_1,\ldots,k_r)\in\mathbb{N}^r k = ( k 1 , … , k r ) ∈ N r there is C < ∞ C<\infty C < ∞ depending only on F 1 , … , F r F_1,\ldots,F_r F 1 , … , F r , k \mathbf{k} k and q q q (not on n n n or on the law of ξ \xi ξ ) such that for n ≥ 2 max j v j n\ge2\max_jv_j n ≥ 2 max j v j ,
∣ E ∏ j W j k j − ∏ j M k j s j k j / 2 ∣ ≤ C n − 1 / 2 , \left|\mathbb{E}\prod_j W_j^{k_j}-\prod_j M_{k_j}s_j^{k_j/2}\right|\le Cn^{-1/2}, E j ∏ W j k j − j ∏ M k j s j k j /2 ≤ C n − 1/2 , where M k = E Z k M_k=\mathbb{E}Z^k M k = E Z k for Z ∼ N ( 0 , 1 ) Z\sim N(0,1) Z ∼ N ( 0 , 1 ) (M k = ( k − 1 ) ! ! M_k=(k-1)!! M k = ( k − 1 )!! for even k k k and M k = 0 M_k=0 M k = 0 for odd k k k ).
Proof. We expand the mixed moment as a sum over tuples of copies, show that only tuples whose copies coincide in pairs contribute at leading order, and count the remaining tuples. Let K = ∑ j k j K=\sum_j k_j K = ∑ j k j , list the factors as i = 1 , … , K i=1,\ldots,K i = 1 , … , K with shapes j ( i ) j(i) j ( i ) , and let V = ∑ i v j ( i ) V=\sum_i v_{j(i)} V = ∑ i v j ( i ) . Then
E ∏ j W j k j = ∏ j ( N F j q e j ) − k j / 2 ∑ E ∏ i = 1 K ξ φ i , \mathbb{E}\prod_j W_j^{k_j}
=\prod_j(N_{F_j}q^{e_j})^{-k_j/2}\sum\mathbb{E}\prod_{i=1}^K\xi^{\varphi_i}, E j ∏ W j k j = j ∏ ( N F j q e j ) − k j /2 ∑ E i = 1 ∏ K ξ φ i ,
the sum over tuples ( φ 1 , … , φ K ) (\varphi_1,\ldots,\varphi_K) ( φ 1 , … , φ K ) with φ i ∈ K n ( F j ( i ) ) \varphi_i\in K_n(F_{j(i)}) φ i ∈ K n ( F j ( i ) ) . For a tuple let U = ⋃ i φ i U=\bigcup_i\varphi_i U = ⋃ i φ i and m e = ∣ { i : e ∈ φ i } ∣ m_e=|\{i:e\in\varphi_i\}| m e = ∣ { i : e ∈ φ i } ∣ . By independence E ∏ i ξ φ i = ∏ e ∈ U E ξ e m e \mathbb{E}\prod_i\xi^{\varphi_i}=\prod_{e\in U}\mathbb{E}\xi_e^{m_e} E ∏ i ξ φ i = ∏ e ∈ U E ξ e m e , which vanishes unless m e ≥ 2 m_e\ge2 m e ≥ 2 for all e ∈ U e\in U e ∈ U (call such tuples admissible). For admissible tuples
∣ E ∏ i ξ φ i ∣ ≤ ∏ e ∈ U E ξ e 2 ≤ ∏ e ∈ U v e ≤ 1 , \left|\mathbb{E}\prod_i\xi^{\varphi_i}\right|\le\prod_{e\in U}\mathbb{E}\xi_e^2\le\prod_{e\in U}v_e\le1, E i ∏ ξ φ i ≤ e ∈ U ∏ E ξ e 2 ≤ e ∈ U ∏ v e ≤ 1 ,
using ∣ ξ e ∣ ≤ 1 |\xi_e|\le1 ∣ ξ e ∣ ≤ 1 (so v e ≤ 1 v_e\le1 v e ≤ 1 ).
Claim. For an admissible tuple, ∣ V ( U ) ∣ ≤ V / 2 |V(U)|\le V/2 ∣ V ( U ) ∣ ≤ V /2 , with equality iff the tuple is paired: [ K ] [K] [ K ] splits into pairs { i , i ′ } \{i,i'\} { i , i ′ } with φ i = φ i ′ \varphi_i=\varphi_{i'} φ i = φ i ′ and the vertex sets of different pairs are disjoint. To see this, let x ∈ V ( φ i ) x\in V(\varphi_i) x ∈ V ( φ i ) . As F j ( i ) F_{j(i)} F j ( i ) has no isolated vertex, some e ∋ x e\ni x e ∋ x lies in φ i \varphi_i φ i , and as m e ≥ 2 m_e\ge2 m e ≥ 2 , e e e lies in some other φ i ′ \varphi_{i'} φ i ′ , i ′ ≠ i i'\ne i i ′ = i . So every vertex of U U U lies in at least two of the φ i \varphi_i φ i , whence V = ∑ i ∣ V ( φ i ) ∣ ≥ 2 ∣ V ( U ) ∣ V=\sum_i|V(\varphi_i)|\ge2|V(U)| V = ∑ i ∣ V ( φ i ) ∣ ≥ 2∣ V ( U ) ∣ . In case of equality every vertex lies in exactly two copies. Take i i i and x ∈ V ( φ i ) x\in V(\varphi_i) x ∈ V ( φ i ) , and let φ i ′ \varphi_{i'} φ i ′ be the other copy containing x x x . Every edge x y ∈ φ i xy\in\varphi_i x y ∈ φ i lies in a second copy, which contains x x x and hence is φ i ′ \varphi_{i'} φ i ′ . So y ∈ V ( φ i ′ ) y\in V(\varphi_{i'}) y ∈ V ( φ i ′ ) , and the two copies containing y y y are again φ i , φ i ′ \varphi_i,\varphi_{i'} φ i , φ i ′ . By connectedness of F j ( i ) F_{j(i)} F j ( i ) , E ( φ i ) ⊆ E ( φ i ′ ) E(\varphi_i)\subseteq E(\varphi_{i'}) E ( φ i ) ⊆ E ( φ i ′ ) , and symmetrically E ( φ i ′ ) ⊆ E ( φ i ) E(\varphi_{i'})\subseteq E(\varphi_i) E ( φ i ′ ) ⊆ E ( φ i ) . So φ i = φ i ′ \varphi_i=\varphi_{i'} φ i = φ i ′ , their common vertex set meets no other copy, and j ( i ) = j ( i ′ ) j(i)=j(i') j ( i ) = j ( i ′ ) because the F j F_j F j are non-isomorphic. The converse is clear. Counting. A tuple is determined by K K K injective maps from the vertex sets of the F j ( i ) F_j(i) F j ( i ) into [ n ] [n] [ n ] . Grouping these maps by the partition of the disjoint union of the vertex sets that they induce, we see that the number of tuples with ∣ V ( U ) ∣ = u |V(U)|=u ∣ V ( U ) ∣ = u is at most c n u c n^u c n u with c c c depending only on the F j F_j F j and k k k . Since N F j = ( n ) v j / ∣ Aut F j ∣ ≥ ( n / 2 ) v j / v j ! N_{F_j}=(n)_{v_j}/|\operatorname{Aut}F_j|\ge(n/2)^{v_j}/v_j! N F j = ( n ) v j /∣ Aut F j ∣ ≥ ( n /2 ) v j / v j ! for n ≥ 2 v j n\ge2v_j n ≥ 2 v j , the normalizing factor is at most c ′ n − V / 2 ∏ j k j e j / 2 c'n^{-V/2}\prod_j k_j^{e_j/2} c ′ n − V /2 ∏ j k j e j /2 .
Admissible tuples that are not paired have ∣ V ( U ) ∣ ≤ ( V − 1 ) / 2 |V(U)|\le(V-1)/2 ∣ V ( U ) ∣ ≤ ( V − 1 ) /2 and contribute at most c c ′ n − 1 / 2 ∏ j k j e j / 2 cc'n^{-1/2}\prod_j k_j^{e_j/2} c c ′ n − 1/2 ∏ j k j e j /2 in total. For a perfect matching π \pi π of [ K ] [K] [ K ] pairing indices of equal shape, the paired tuples with pairing π \pi π contribute ∏ P ∈ π E ( ξ φ P ) 2 = ∏ P ∈ π ν φ P \prod_{P\in\pi}\mathbb{E}(\xi^{\varphi_P})^2=\prod_{P\in\pi}\nu^{\varphi_P} ∏ P ∈ π E ( ξ φ P ) 2 = ∏ P ∈ π ν φ P each (the pairs have disjoint edge sets), and different π \pi π give disjoint sets of tuples. Dropping the disjointness constraint between different pairs adds tuples with at most V / 2 − 1 V/2-1 V /2 − 1 vertices, which after normalization contribute O ( n − 1 ) O(n^{-1}) O ( n − 1 ) . Without the constraint the sum over tuples factorizes and equals ∏ P ∈ π N F j ( P ) q e j ( P ) s j ( P ) \prod_{P\in\pi}N_{F_{j(P)}}q^{e_{j(P)}}s_{j(P)} ∏ P ∈ π N F j ( P ) q e j ( P ) s j ( P ) . After normalization the paired contribution is therefore ∑ π ∏ P ∈ π s j ( P ) + O ( n − 1 ) \sum_{\pi}\prod_{P\in\pi}s_{j(P)}+O(n^{-1}) ∑ π ∏ P ∈ π s j ( P ) + O ( n − 1 ) , and ∑ π ∏ P ∈ π s j ( P ) = ∏ j M k j s j k j / 2 \sum_{\pi}\prod_{P\in\pi}s_{j(P)}=\prod_j M_{k_j}s_j^{k_j/2} ∑ π ∏ P ∈ π s j ( P ) = ∏ j M k j s j k j /2 because a set of size k j k_j k j has M k j M_{k_j} M k j perfect matchings.
Lemma A.16 (Reduction to the chaos under the planted partition). Let G ∼ P δ G\sim P_\delta G ∼ P δ , μ i j = δ σ i σ j \mu_{ij}=\delta\sigma_i\sigma_j μ ij = δ σ i σ j , ξ e = A e − p − μ e \xi_e=A_e-p-\mu_e ξ e = A e − p − μ e and v ˉ 1 = q + δ ∣ 1 − 2 p ∣ \bar v_1=q+\delta|1-2p| v ˉ 1 = q + δ ∣1 − 2 p ∣ . For a graph F F F with at least one edge let
W F = ( N F q e ( F ) ) − 1 / 2 ∑ φ ∈ K n ( F ) ξ φ . W_F=(N_Fq^{e(F)})^{-1/2}\sum_{\varphi\in\mathcal{K}_n(F)}\xi^\varphi. W F = ( N F q e ( F ) ) − 1/2 φ ∈ K n ( F ) ∑ ξ φ . (a) Let φ \varphi φ be a tree with at least one edge and R ⊊ E ( φ ) R\subsetneq E(\varphi) R ⊊ E ( φ ) , and let O ( φ , R ) = Odd ( φ ∖ R ) ∖ V ( R ) O(\varphi,R)=\operatorname{Odd}(\varphi\setminus R)\setminus V(R) O ( φ , R ) = Odd ( φ ∖ R ) ∖ V ( R ) . Then c ( R ) + ∣ O ( φ , R ) ∣ ≥ 2 c(R)+|O(\varphi,R)|\ge2 c ( R ) + ∣ O ( φ , R ) ∣ ≥ 2 (with c ( ∅ ) = 0 c(\varnothing)=0 c ( ∅ ) = 0 ).
(b) For a tree T T T with e ≥ 1 e\ge1 e ≥ 1 edges and v = e + 1 v=e+1 v = e + 1 vertices, E δ Z T = 0 \mathbb{E}_\delta Z_T=0 E δ Z T = 0 and
E δ ( Z T − W T ) 2 ≤ 2 e v v e max ( 1 , v ˉ 1 / q ) e max ( 1 , t ) e n − 1 . \mathbb{E}_\delta(Z_T-W_T)^2\le2^{ev}v^e\max(1,\bar v_1/q)^e\max(1,t)^e n^{-1}. E δ ( Z T − W T ) 2 ≤ 2 e v v e max ( 1 , v ˉ 1 / q ) e max ( 1 , t ) e n − 1 . (c) For the cycle C k C_k C k (k ≥ 3 k\ge3 k ≥ 3 ), E δ Z C k = ( N C k η k ) 1 / 2 \mathbb{E}_\delta Z_{C_k}=(N_{C_k}\eta^k)^{1/2} E δ Z C k = ( N C k η k ) 1/2 and
E δ ( Z C k − E δ Z C k − W C k ) 2 ≤ 2 k k k max ( 1 , v ˉ 1 / q ) k max ( 1 , t ) k n − 1 . \mathbb{E}_\delta(Z_{C_k}-\mathbb{E}_\delta Z_{C_k}-W_{C_k})^2\le2^kk^k\max(1,\bar v_1/q)^k\max(1,t)^k n^{-1}. E δ ( Z C k − E δ Z C k − W C k ) 2 ≤ 2 k k k max ( 1 , v ˉ 1 / q ) k max ( 1 , t ) k n − 1 .
Proof. Part (a) is a combinatorial fact about the subforests of a tree. Parts (b) and (c) bound the terms of the expansion in Lemma A.7 that lie outside the chaos W F W_F W F , and each of these terms carries a factor of order 1 / n 1/n 1/ n , by (a) for trees and because c ( R ) ≥ 1 c(R)\ge1 c ( R ) ≥ 1 for cycles.
(a) If c ( R ) ≥ 2 c(R)\ge2 c ( R ) ≥ 2 there is nothing to prove. If R = ∅ R=\varnothing R = ∅ , O = Odd ( φ ) O=\operatorname{Odd}(\varphi) O = Odd ( φ ) contains the leaves of φ \varphi φ , of which there are at least two. If c ( R ) = 1 c(R)=1 c ( R ) = 1 , let K K K be a connected component of the forest φ ∖ R \varphi\setminus R φ ∖ R (non-empty since R ≠ E ( φ ) R\ne E(\varphi) R = E ( φ ) ). K K K meets V ( R ) V(R) V ( R ) : otherwise K K K would be vertex-disjoint from R R R and from the other components, contradicting connectedness of φ \varphi φ . K K K meets V ( R ) V(R) V ( R ) in at most one vertex: two common vertices would be joined by a path in K K K and an edge-disjoint path in the connected R R R , creating a cycle in the tree φ \varphi φ . K K K is a tree with at least one edge, so it has at least two leaves, one of which, say y y y , is not in V ( R ) V(R) V ( R ) . Since y y y has degree one in φ ∖ R \varphi\setminus R φ ∖ R , y ∈ O ( φ , R ) y\in O(\varphi,R) y ∈ O ( φ , R ) .
(b) By Lemma A.7 with S = K n ( T ) S=\mathcal{K}_n(T) S = K n ( T ) , Z T − W T = ( N T q e ) − 1 / 2 ∑ R c R ξ R Z_T-W_T=(N_Tq^e)^{-1/2}\sum_R c_R\xi^R Z T − W T = ( N T q e ) − 1/2 ∑ R c R ξ R over edge sets R R R strictly contained in some copy (R = ∅ R=\varnothing R = ∅ included), and these terms are conditionally orthogonal to each other and to W T W_T W T (no proper subset of a copy is itself a copy). Here
c R = ∑ φ ⊃ R μ φ ∖ R = δ e − ∣ R ∣ ∑ φ ⊃ R σ Odd ( φ ∖ R ) c_R=\sum_{\varphi\supset R}\mu^{\varphi\setminus R}=\delta^{e-|R|}\sum_{\varphi\supset R}\sigma^{\operatorname{Odd}(\varphi\setminus R)} c R = φ ⊃ R ∑ μ φ ∖ R = δ e − ∣ R ∣ φ ⊃ R ∑ σ Odd ( φ ∖ R )
by (5). In particular E [ Z T ∣ σ ] = ( N T q e ) − 1 / 2 c ∅ \mathbb{E}[Z_T\mid\sigma]=(N_Tq^e)^{-1/2}c_\varnothing E [ Z T ∣ σ ] = ( N T q e ) − 1/2 c ∅ has mean 0 0 0 because Odd ( φ ) ≠ ∅ \operatorname{Odd}(\varphi)\ne\varnothing Odd ( φ ) = ∅ . By (5),
E c R 2 = δ 2 ( e − ∣ R ∣ ) ∣ { ( φ , φ ′ ) : φ , φ ′ ⊃ R , Odd ( φ ∖ R ) = Odd ( φ ′ ∖ R ) } ∣ , \mathbb{E}c_R^2=\delta^{2(e-|R|)}\bigl|\{(\varphi,\varphi'):\varphi,\varphi'\supset R,\ \operatorname{Odd}(\varphi\setminus R)=\operatorname{Odd}(\varphi'\setminus R)\}\bigr|, E c R 2 = δ 2 ( e − ∣ R ∣ ) {( φ , φ ′ ) : φ , φ ′ ⊃ R , Odd ( φ ∖ R ) = Odd ( φ ′ ∖ R )} ,
and ν R 2 ≤ v ˉ 1 \nu_R^2\le\bar v_1 ν R 2 ≤ v ˉ 1 . Fix φ \varphi φ and R ⊊ φ R\subsetneq\varphi R ⊊ φ . Every admissible φ ′ \varphi' φ ′ contains the ∣ V ( R ) ∣ + ∣ O ( φ , R ) ∣ |V(R)|+|O(\varphi,R)| ∣ V ( R ) ∣ + ∣ O ( φ , R ) ∣ vertices of B = V ( R ) ∪ O ( φ , R ) B=V(R)\cup O(\varphi,R) B = V ( R ) ∪ O ( φ , R ) (as O ( φ , R ) ⊆ Odd ( φ ′ ∖ R ) ⊆ V ( φ ′ ) O(\varphi,R)\subseteq\operatorname{Odd}(\varphi'\setminus R)\subseteq V(\varphi') O ( φ , R ) ⊆ Odd ( φ ′ ∖ R ) ⊆ V ( φ ′ ) ), so there are at most v v − ∣ B ∣ v^{v-|B|} v v − ∣ B ∣ of them. Hence
E δ ( Z T − W T ) 2 ≤ 1 N T ∑ φ ∈ K n ( T ) ∑ R ⊊ φ v v n v − ∣ V ( R ) ∣ − ∣ O ( φ , R ) ∣ ( v ˉ 1 q ) ∣ R ∣ η e − ∣ R ∣ . \mathbb{E}_\delta(Z_T-W_T)^2\le\frac{1}{N_T}\sum_{\varphi\in\mathcal{K}_n(T)}\sum_{R\subsetneq\varphi}v^v n^{v-|V(R)|-|O(\varphi,R)|}\left(\frac{\bar v_1}{q}\right)^{|R|}\eta^{e-|R|}. E δ ( Z T − W T ) 2 ≤ N T 1 φ ∈ K n ( T ) ∑ R ⊊ φ ∑ v v n v − ∣ V ( R ) ∣ − ∣ O ( φ , R ) ∣ ( q v ˉ 1 ) ∣ R ∣ η e − ∣ R ∣ .
With η = t / n \eta=t/n η = t / n , v − e = 1 v-e=1 v − e = 1 and ∣ V ( R ) ∣ − ∣ R ∣ = c ( R ) |V(R)|-|R|=c(R) ∣ V ( R ) ∣ − ∣ R ∣ = c ( R ) (valid for forests, including R = ∅ R=\varnothing R = ∅ ), the power of n n n is 1 − c ( R ) − ∣ O ( φ , R ) ∣ ≤ − 1 1-c(R)-|O(\varphi,R)|\le-1 1 − c ( R ) − ∣ O ( φ , R ) ∣ ≤ − 1 by (a). There are at most 2 e 2^e 2 e sets R R R , which gives (b).
(c) We repeat the computation with S = K n ( C k ) S=\mathcal{K}_n(C_k) S = K n ( C k ) . Now c ∅ = ∑ C μ C = N C k δ k c_\varnothing=\sum_C\mu^C=N_{C_k}\delta^k c ∅ = ∑ C μ C = N C k δ k is non-random, because every vertex of the cycle has even degree, and this gives the mean. For ∅ ≠ R ⊂ C \varnothing\ne R\subset C ∅ = R ⊂ C , R R R is a union of c ( R ) ≥ 1 c(R)\ge1 c ( R ) ≥ 1 paths and the power of n n n is v − ∣ V ( R ) ∣ − ∣ O ∣ − ( k − ∣ R ∣ ) = − c ( R ) − ∣ O ∣ ≤ − 1 v-|V(R)|-|O|-(k-|R|)=-c(R)-|O|\le-1 v − ∣ V ( R ) ∣ − ∣ O ∣ − ( k − ∣ R ∣ ) = − c ( R ) − ∣ O ∣ ≤ − 1 since v = k v=k v = k .
Proof of (ii). We prove a conditional central limit theorem given σ \sigma σ by the method of moments, transfer it from W T W_T W T to Z T Z_T Z T , and then add the triangle.
Conditional moments. Condition on σ \sigma σ . The ξ e \xi_e ξ e are independent, centred, bounded by one, with variances v e = q + μ e ( 1 − 2 p ) − δ 2 ∈ [ q − 2 δ , q + δ ] v_e=q+\mu_e(1-2p)-\delta^2\in[q-2\delta,q+\delta] v e = q + μ e ( 1 − 2 p ) − δ 2 ∈ [ q − 2 δ , q + δ ] . With s j s_j s j as in Lemma A.15, ∣ s j − 1 ∣ ≤ ( 1 + 2 δ / q ) e j − 1 → 0 |s_j-1|\le(1+2\delta/q)^{e_j}-1\to0 ∣ s j − 1∣ ≤ ( 1 + 2 δ / q ) e j − 1 → 0 deterministically, because δ = ( t q / n ) 1 / 2 → 0 \delta=(tq/n)^{1/2}\to0 δ = ( tq / n ) 1/2 → 0 with q q q fixed. Lemma A.15, whose constant does not depend on the v e v_e v e , gives E [ ∏ j W T j k j ∣ σ ] = ∏ j M k j + o ( 1 ) \mathbb{E}[\prod_j W_{T_j}^{k_j}\mid\sigma]=\prod_j M_{k_j}+o(1) E [ ∏ j W T j k j ∣ σ ] = ∏ j M k j + o ( 1 ) uniformly in σ \sigma σ , hence E δ ∏ j W T j k j → ∏ j M k j \mathbb{E}_\delta\prod_j W_{T_j}^{k_j}\to\prod_j M_{k_j} E δ ∏ j W T j k j → ∏ j M k j for all k k k .
Limit law. These are the mixed moments of N ( 0 , I r ) N(0,I_r) N ( 0 , I r ) , which is determined by its moments, so ( W T 1 , … , W T r ) → N ( 0 , I r ) (W_{T_1},\ldots,W_{T_r})\to N(0,I_r) ( W T 1 , … , W T r ) → N ( 0 , I r ) in law. By Lemma A.16(b) and Slutsky’s lemma the same holds for ( Z T 1 , … , Z T r ) (Z_{T_1},\ldots,Z_{T_r}) ( Z T 1 , … , Z T r ) . The case δ = 0 \delta=0 δ = 0 is the null (Z T = W T Z_T=W_T Z T = W T , s j = 1 s_j=1 s j = 1 ).
Adding the triangle. Adding F r + 1 = K 3 F_{r+1}=K_3 F r + 1 = K 3 (connected and containing a cycle, hence non-isomorphic to the T j T_j T j ) and using Lemma A.16(c) with E δ Z K 3 = ( n 3 ) 1 / 2 → ( t 3 / 6 ) 1 / 2 \mathbb{E}_\delta Z_{K_3}=\binom{n}{3}^{1/2}\to(t^3/6)^{1/2} E δ Z K 3 = ( 3 n ) 1/2 → ( t 3 /6 ) 1/2 gives the joint statement.
Several graphs and tests. The 2 m 2m 2 m graphs are independent, so the vectors of the individual graphs converge jointly to independent limits. The portmanteau theorem gives the statement on tests. For the triangle test, D 3 / ( 2 m ( n / 2 ) 3 / 2 ) = ( 2 m ) − 1 / 2 ( ∑ ℓ Z K 3 ( G ℓ ) − ∑ ℓ Z K 3 ( G ℓ ′ ) ) → N ( ( m / 2 ) 1 / 2 ( t 3 / 6 ) 1 / 2 , 1 ) D_3/(2m(n/2)^{3/2})=(2m)^{-1/2}\left(\sum_\ell Z_{K_3}(G_\ell)-\sum_\ell Z_{K_3}(G'_\ell)\right)\to N((m/2)^{1/2}(t^3/6)^{1/2},1) D 3 / ( 2 m ( n /2 ) 3/2 ) = ( 2 m ) − 1/2 ( ∑ ℓ Z K 3 ( G ℓ ) − ∑ ℓ Z K 3 ( G ℓ ′ ) ) → N (( m /2 ) 1/2 ( t 3 /6 ) 1/2 , 1 ) under H 1 H_1 H 1 and N ( 0 , 1 ) N(0,1) N ( 0 , 1 ) under H 0 H_0 H 0 . □
Remark 9 (The triangle statistic under the alternatives). The proof shows Z K 3 − E δ Z K 3 → N ( 0 , 1 ) Z_{K_3}-\mathbb{E}_\delta Z_{K_3}\to N(0,1) Z K 3 − E δ Z K 3 → N ( 0 , 1 ) under P δ P_\delta P δ , which justifies the normal calibration used in Remark 6 and in the experiments. Under the rank-two model the same argument applies conditionally on ( σ , τ ) (\sigma,\tau) ( σ , τ ) , because E [ T p ∣ σ , τ ] = 0 \mathbb{E}[T_p\mid\sigma,\tau]=0 E [ T p ∣ σ , τ ] = 0 , the non-chaos terms have relative variance at most 6 η r 2 + 6 ( n − 1 ) η 2 r → 0 6\eta r^2+6(n-1)\eta^2r\to0 6 η r 2 + 6 ( n − 1 ) η 2 r → 0 (Lemma A.12(a)), and the conditional variances satisfy ∣ v e − q ∣ ≤ 2 δ + 4 δ 2 → 0 |v_e-q|\le2\delta+4\delta^2\to0 ∣ v e − q ∣ ≤ 2 δ + 4 δ 2 → 0 . Hence Z K 3 → N ( 0 , 1 ) Z_{K_3}\to N(0,1) Z K 3 → N ( 0 , 1 ) under P δ ( 2 ) P_\delta^{(2)} P δ ( 2 ) , which completes the proof of Proposition 1(iv).
Remark 10 (Scope of (ii)). (a) The result holds for every fixed t > 0 t>0 t > 0 , including t > 1 t>1 t > 1 , where a single graph suffices to detect the planted partition by cycle statistics, so tree statistics fail to detect the difference even above the one-graph threshold. It requires η = t / n → 0 \eta=t/n\to0 η = t / n → 0 . For fixed δ \delta δ the edge count has the non-Gaussian limit 1 − η N ( 0 , 1 ) + η / 2 ( χ 1 2 − 1 ) \sqrt{1-\eta}N(0,1)+\sqrt{\eta}/2(\chi_1^2-1) 1 − η N ( 0 , 1 ) + η /2 ( χ 1 2 − 1 ) under P δ P_\delta P δ , although its mean and variance are exactly those of the null.
(b) The proof uses p p p fixed only through the constant of Lemma A.15, which grows like q ∑ j k j e j / 2 q^{\sum_j k_je_j/2} q ∑ j k j e j /2 . Extending (ii) to sparse graphs (q → 0 q\to0 q → 0 , n q → ∞ nq\to\infty n q → ∞ ) requires a sharper count of non-paired tuples, as in Banerjee [2018, arXiv version, Proposition 4.1] for signed cycles. We do not claim it.
(c) Part (ii) concerns fixed finite families of signed tree counts. Unsigned tree counts, degree moments and colour-refinement histograms are polynomials in signed forest counts, and in the dense regime their centred and normalized versions are dominated by the edge count. We expect, but do not prove, that every fixed finite family of such statistics also has the same limit under H 0 H_0 H 0 and H 1 H_1 H 1 , and that the same holds for fixed-depth message-passing embeddings with Lipschitz readouts.
Theorem 3: non-constant nulls and first-order visibility
A graphon is a symmetric measurable W : [ 0 , 1 ] 2 → [ 0 , 1 ] W:[0,1]^2\to[0,1] W : [ 0 , 1 ] 2 → [ 0 , 1 ] . We realize G ( n , W ) G(n,W) G ( n , W ) with independent uniform variables U 1 , … , U n U_1,\ldots,U_n U 1 , … , U n and ( V i j ) i < j (V_{ij})_{i<j} ( V ij ) i < j , setting A i j = 1 { V i j ≤ W ( U i , U j ) } A_{ij}=\mathbf{1}\{V_{ij}\le W(U_i,U_j)\} A ij = 1 { V ij ≤ W ( U i , U j )} . For a graph F F F with v v v vertices, t i n j ( F , G ) = ( n ) v ∑ ϕ : V ( F ) ↪ [ n ] ∏ w ∈ E ( F ) A ϕ ( u ) ϕ ( w ) t_{\mathrm{inj}}(F,G)= (n)_v\sum_{\phi:V(F)\hookrightarrow[n]}\prod_{w\in E(F)} A_{\phi(u)\phi(w)} t inj ( F , G ) = ( n ) v ∑ ϕ : V ( F ) ↪ [ n ] ∏ w ∈ E ( F ) A ϕ ( u ) ϕ ( w ) , the sum over injective ϕ : V ( F ) → [ n ] \phi:V(F)\to[n] ϕ : V ( F ) → [ n ] .
For an edge e = { a , b } ∈ E ( F ) e=\{a,b\}\in E(F) e = { a , b } ∈ E ( F ) (with a fixed orientation ( a , b ) (a,b) ( a , b ) ) the edge-rooted kernel is
W F , e ( x , y ) = ∫ [ 0 , 1 ] V ( F ) ∖ { a , b } ∏ f ∈ E ( F ) ∖ { e } W ( x f ) ∏ w ≠ a , b d x w ∣ x a = x , x b = y , W_{F,e}(x,y)=\int_{[0,1]^{V(F)\setminus\{a,b\}}}\prod_{f\in E(F)\setminus\{e\}}W(x_f)\prod_{w\ne a,b}dx_w\bigg|_{x_a=x,\ x_b=y}, W F , e ( x , y ) = ∫ [ 0 , 1 ] V ( F ) ∖ { a , b } f ∈ E ( F ) ∖ { e } ∏ W ( x f ) w = a , b ∏ d x w x a = x , x b = y ,
where W ( x f ) = W ( x u , x w ) W(x_f)=W(x_u,x_w) W ( x f ) = W ( x u , x w ) for f = { u , w } f=\{u,w\} f = { u , w } . For symmetric H H H , ⟨ H , W F , e ⟩ \langle H,W_{F,e}\rangle ⟨ H , W F , e ⟩ does not depend on the orientation. For F = K 3 F=K_3 F = K 3 , W F , e ( x , y ) = ∫ W ( x , z ) W ( z , y ) d z W_{F,e}(x,y)=\int W(x,z)W(z,y)\,dz W F , e ( x , y ) = ∫ W ( x , z ) W ( z , y ) d z for each edge. This kernel differs from the symmetrized two-point conditional kernel W H W_H W H of Chatterjee et al. [2026], which includes the factor W ( x , y ) W(x,y) W ( x , y ) of the rooted edge.
Theorem (Restatement of Theorem 3). Let F F F have v v v vertices and e ≥ 1 e\ge1 e ≥ 1 edges.
Theorem. (Restatement of Theorem 3). Let F F F have v v v vertices and e ≥ 1 e\ge1 e ≥ 1 edges.
(i) *For every graphon W W W and n ≥ v n\ge v n ≥ v : E t i n j ( F , G ( n , W ) ) = t ( F , W ) \mathbb{E}\,t_{\mathrm{inj}}(F,G(n,W))=t(F,W) E t inj ( F , G ( n , W )) = t ( F , W ) and Var t i n j ( F , G ( n , W ) ) ≤ v 2 / ( 4 n ) \operatorname{Var}\,t_{\mathrm{inj}}(F,G(n,W))\le v^2/(4n) Var t inj ( F , G ( n , W )) ≤ v 2 / ( 4 n ) .
(ii) For every graphon W W W and symmetric measurable H H H with 0 ≤ W + H ≤ 1 0 \le W+H \le1 0 ≤ W + H ≤ 1 : t ( F , W + H ) − t ( F , W ) = ∑ e ∈ E ( F ) ⟨ H , W F , e ⟩ + R t(F,W+H)-t(F,W)=\sum_{e\in E(F)}\langle H,W_{F,e}\rangle+R t ( F , W + H ) − t ( F , W ) = ∑ e ∈ E ( F ) ⟨ H , W F , e ⟩ + R with ∣ R ∣ ≤ ( 2 e − 1 − e ) ∥ H ∥ 2 2 |R|\le(2^{e}-1-e)\lVert H\rVert_{2}^{2} ∣ R ∣ ≤ ( 2 e − 1 − e ) ∥ H ∥ 2 2 .
(iii) With D = 1 m ∑ ℓ t i n j ℓ ( F , G ℓ ) − 1 m ∑ ℓ t i n j ( F , G ℓ ′ ) D=\frac{1}{m}\sum_{\ell}t_{\mathrm{inj}}^{\ell}(F,G_{\ell})-\frac{1}{m}\sum_{\ell}t_{\mathrm{inj}}(F,G_{\ell}^{\prime}) D = m 1 ∑ ℓ t inj ℓ ( F , G ℓ ) − m 1 ∑ ℓ t inj ( F , G ℓ ′ ) and λ = v / 2 n m α \lambda=v/\sqrt{2nm\alpha} λ = v / 2 nm α , the test 1 { ∣ D ∣ ≥ λ } 1\{|D|\ge\lambda\} 1 { ∣ D ∣ ≥ λ } has size at most α \alpha α under P = Q = G ( n , W ) P=Q=G(n,W) P = Q = G ( n , W ) for every graphon W W W , and type II error at most β \beta β under P = G ( n , W + H ) P=G(n,W+H) P = G ( n , W + H ) , Q = G ( n , W ) Q=G(n,W) Q = G ( n , W ) whenever ∣ Δ F ∣ ≥ v 2 n m ( α − 1 / 2 + β − 1 / 2 ) |\Delta_{F}|\ge\frac{v}{\sqrt{2nm}}(\alpha^{-1/2}+\beta^{-1/2}) ∣ Δ F ∣ ≥ 2 nm v ( α − 1/2 + β − 1/2 ) , in particular whenever n m Δ F 2 ≥ v 2 ( 1 / α + 1 / β ) nm\Delta_{F}^{2}\ge v^{2}(1/\alpha+1/\beta) nm Δ F 2 ≥ v 2 ( 1/ α + 1/ β ) ; here Δ F = t ( F , W + H ) − t ( F , W ) \Delta_{F}=t(F,W+H)-t(F,W) Δ F = t ( F , W + H ) − t ( F , W ) . (The threshold v 2 / ( n m α ) \sqrt{v^{2}/(nm\alpha)} v 2 / ( nm α ) is also valid; it requires n m Δ F 2 ≥ v 2 ( 2 / α + 1 / β ) nm\Delta_{F}^{2}\ge v^{2}(2/\alpha+1/\beta) nm Δ F 2 ≥ v 2 ( 2/ α + 1/ β ) .)
(iv) Let H 0 H_{0} H 0 be symmetric and bounded with 0 ≤ W + c H 0 ≤ 1 0\le W+cH_{0}\le1 0 ≤ W + c H 0 ≤ 1 for c ∈ ( 0 , c 0 ] c\in(0,c_{0}] c ∈ ( 0 , c 0 ] , and κ F = ∑ e ∈ E ( F ) ⟨ H 0 , W F , e ⟩ ≠ 0 \kappa_{F}=\sum_{e\in E(F)}\langle H_{0},W_{F,e}\rangle\ne0 κ F = ∑ e ∈ E ( F ) ⟨ H 0 , W F , e ⟩ = 0 . For 0 < c ≤ min { c 0 , ∣ κ F ∣ / ( 2 ( 2 e − 1 − e ) ∥ H 0 ∥ 2 2 ) } 0<c\le\min\{c_{0},|\kappa_{F}|/(2(2^{e}-1-e)\lVert H_{0}\rVert_{2}^{2})\} 0 < c ≤ min { c 0 , ∣ κ F ∣/ ( 2 ( 2 e − 1 − e ) ∥ H 0 ∥ 2 2 )} , ∣ Δ F ∣ ≥ c ∣ κ F ∣ / 2 |\Delta_{F}|\ge c|\kappa_{F}|/2 ∣ Δ F ∣ ≥ c ∣ κ F ∣/2 , and the test of (iii) has errors at most ( α , β ) (\alpha,\beta) ( α , β ) against W + c H 0 W+cH_{0} W + c H 0 as soon as m ≥ 4 v 2 ( 1 / α + 1 / β ) / ( n c 2 κ F 2 ) m\ge4v^{2}(1/\alpha+1/\beta)/(nc^{2}\kappa_{F}^{2}) m ≥ 4 v 2 ( 1/ α + 1/ β ) / ( n c 2 κ F 2 ) . With t H = n ∥ c H 0 ∥ 2 2 t_{H}=n\lVert cH_{0}\rVert_{2}^{2} t H = n ∥ c H 0 ∥ 2 2 , m u n ∗ ≤ 1 + 4 v 2 ( 1 / α + 1 / β ) ∥ H 0 ∥ 2 2 / ( κ F 2 t H ) m_{\mathrm{un}}^{*}\le1+4v^{2}(1/\alpha+1/\beta)\lVert H_{0}\rVert_{2}^{2}/(\kappa_{F}^{2}t_{H}) m un ∗ ≤ 1 + 4 v 2 ( 1/ α + 1/ β ) ∥ H 0 ∥ 2 2 / ( κ F 2 t H ) . If W W W is constant and d H 0 ≡ 0 d_{H_{0}}\equiv0 d H 0 ≡ 0 , then κ F = 0 \kappa_{F}=0 κ F = 0 for every F F F .
Lemma A.17 (Efron–Stein with vertex blocks). For every graphon W W W , graph F F F with v v v vertices and n ≥ v n\ge v n ≥ v : E t i n j ( F , G ( n , W ) ) = t ( F , W ) \mathbb{E}\,t_{\mathrm{inj}}(F,G(n,W))=t(F,W) E t inj ( F , G ( n , W )) = t ( F , W ) and Var t i n j ( F , G ( n , W ) ) ≤ v 2 / ( 4 n ) \operatorname{Var}t_{\mathrm{inj}}(F,G(n,W))\le v^{2}/(4n) Var t inj ( F , G ( n , W )) ≤ v 2 / ( 4 n ) .
Proof. For injective ϕ \phi ϕ the variables U ϕ ( u ) U_{\phi(u)} U ϕ ( u ) are i.i.d. uniform, so E ∏ u w A ϕ ( u ) ϕ ( w ) = E ∏ u w W ( U ϕ ( u ) , U ϕ ( w ) ) = t ( F , W ) \mathbb{E}\prod_{uw}A_{\phi(u)\phi(w)}=\mathbb{E}\prod_{uw}W(U_{\phi(u)},U_{\phi(w)})=t(F,W) E ∏ u w A ϕ ( u ) ϕ ( w ) = E ∏ u w W ( U ϕ ( u ) , U ϕ ( w ) ) = t ( F , W ) . For the variance, let X j = ( U j , ( V i j ) i < j ) X_{j}=(U_{j},(V_{ij})_{i<j}) X j = ( U j , ( V ij ) i < j ) , j = 1 , … , n j=1,\ldots,n j = 1 , … , n . The X j X_{j} X j are independent and G G G is a function of ( X 1 , … , X n ) (X_{1},\ldots,X_{n}) ( X 1 , … , X n ) . Moreover, A i k A_{ik} A ik (i < k i<k i < k ) depends only on ( U i , U k , V i k ) (U_{i},U_{k},V_{ik}) ( U i , U k , V ik ) , hence only on X i X_{i} X i and X k X_{k} X k . So when X j X_{j} X j varies and the other blocks are fixed, only the terms of t i n j t_{\mathrm{inj}} t inj with j ∈ ϕ ( V ( F ) ) j\in\phi(V(F)) j ∈ ϕ ( V ( F )) change. There are v ( n − 1 ) v − 1 = v ( n ) v / n v(n-1)_{v-1}=v(n)_{v}/n v ( n − 1 ) v − 1 = v ( n ) v / n such ϕ \phi ϕ and each term lies in [ 0 , 1 ] [0,1] [ 0 , 1 ] . Hence, as a function of X j X_{j} X j alone, t i n j t_{\mathrm{inj}} t inj ranges in an interval of length at most v / n v/n v / n and its conditional variance given ( X i ) i ≠ j (X_{i})_{i\ne j} ( X i ) i = j is at most ( v / n ) 2 / 4 (v/n)^{2}/4 ( v / n ) 2 /4 . The Efron–Stein inequality Var f ( X ) ≤ ∑ j = 1 n E Var ( f ( X ) ∣ ( X i ) i ≠ j ) \operatorname{Var}f(X)\le\sum_{j=1}^{n}\mathbb{E}\operatorname{Var}(f(X)\mid(X_{i})_{i\ne j}) Var f ( X ) ≤ ∑ j = 1 n E Var ( f ( X ) ∣ ( X i ) i = j ) [23 , 11 ] gives Var t i n j ≤ n ⋅ v 2 / ( 4 n 2 ) \operatorname{Var}t_{\mathrm{inj}}\le n\cdot v^{2}/(4n^{2}) Var t inj ≤ n ⋅ v 2 / ( 4 n 2 ) .
Lemma A.18 (First-order expansion). For every graphon W W W and symmetric measurable H H H with 0 ≤ W + H ≤ 1 0\le W+H\le1 0 ≤ W + H ≤ 1 , t ( F , W + H ) = t ( F , W ) + ∑ e ∈ E ( F ) ⟨ H , W F , e ⟩ + R t(F,W+H)=t(F,W)+\sum_{e\in E(F)}\langle H,W_{F,e}\rangle+R t ( F , W + H ) = t ( F , W ) + ∑ e ∈ E ( F ) ⟨ H , W F , e ⟩ + R with ∣ R ∣ ≤ ( 2 e ( F ) − 1 − e ( F ) ) ∥ H ∥ 2 2 |R|\le(2^{e(F)}-1-e(F))\lVert H\rVert_{2}^{2} ∣ R ∣ ≤ ( 2 e ( F ) − 1 − e ( F )) ∥ H ∥ 2 2 .
Proof. Note ∣ H ∣ ≤ 1 |H|\le1 ∣ H ∣ ≤ 1 since W , W + H ∈ [ 0 , 1 ] W,W+H\in[0,1] W , W + H ∈ [ 0 , 1 ] . Expanding the product over edges, t ( F , W + H ) = ∑ S ⊆ E ( F ) ∫ ∏ f ∈ S H ( x f ) ∏ f ∉ S W ( x f ) d x t(F,W+H)=\sum_{S\subseteq E(F)}\int\prod_{f\in S}H(x_{f})\prod_{f\notin S}W(x_{f})\,dx t ( F , W + H ) = ∑ S ⊆ E ( F ) ∫ ∏ f ∈ S H ( x f ) ∏ f ∈ / S W ( x f ) d x . The term S = ∅ S=\varnothing S = ∅ is t ( F , W ) t(F,W) t ( F , W ) , and the term S = { e } S=\{e\} S = { e } is ⟨ H , W F , e ⟩ \langle H,W_{F,e}\rangle ⟨ H , W F , e ⟩ by Fubini. For ∣ S ∣ ≥ 2 |S|\ge2 ∣ S ∣ ≥ 2 pick two edges e 1 ≠ e 2 e_{1}\ne e_{2} e 1 = e 2 in S S S and bound all other factors by one in absolute value: the term is at most ∫ ∣ H ( x e 1 ) ∣ ∣ H ( x e 2 ) ∣ d x \int|H(x_{e_{1}})||H(x_{e_{2}})|\,dx ∫ ∣ H ( x e 1 ) ∣∣ H ( x e 2 ) ∣ d x . If e 1 , e 2 e_{1},e_{2} e 1 , e 2 share a vertex a a a this is ∫ ( ∫ ∣ H ( x a , y ) ∣ d y ) 2 d x a ≤ ∥ H ∥ 2 2 \int(\int|H(x_{a},y)|\,dy)^{2}\,dx_{a}\le\lVert H\rVert_{2}^{2} ∫ ( ∫ ∣ H ( x a , y ) ∣ d y ) 2 d x a ≤ ∥ H ∥ 2 2 by Cauchy–Schwarz, and if they are disjoint it is ( ∫ ∣ H ∣ ) 2 ≤ ∥ H ∥ 2 2 (\int|H|)^{2}\le\lVert H\rVert_{2}^{2} ( ∫ ∣ H ∣ ) 2 ≤ ∥ H ∥ 2 2 . There are 2 e − 1 − e 2^{e}-1-e 2 e − 1 − e sets with ∣ S ∣ ≥ 2 |S|\ge2 ∣ S ∣ ≥ 2 .
Proof of Theorem 3. (i) and (ii) are Lemmas A.17 and A.18.
(iii) The 2 m 2m 2 m graphs are independent, so Var D = ( Var P t i n j + Var Q t i n j ) / m ≤ v 2 / ( 2 n m ) \operatorname{Var}D=(\operatorname{Var}_{P}t_{\mathrm{inj}}+\operatorname{Var}_{Q}t_{\mathrm{inj}})/m\le v^{2}/(2nm) Var D = ( Var P t inj + Var Q t inj ) / m ≤ v 2 / ( 2 nm ) by (i), for every P , Q P,Q P , Q of graphon type. Under P = Q P=Q P = Q , E D = 0 \mathbb{E}D=0 E D = 0 and Chebyshev's inequality gives P ( ∣ D ∣ ≥ λ ) ≤ v 2 / ( 2 n m λ 2 ) = α \mathbb{P}(|D|\ge\lambda)\le v^{2}/(2nm\lambda^{2})=\alpha P ( ∣ D ∣ ≥ λ ) ≤ v 2 / ( 2 nm λ 2 ) = α . Under the alternative E D = Δ F \mathbb{E}D=\Delta_{F} E D = Δ F by (i). If ∣ Δ F ∣ ≥ λ + ( v 2 / ( 2 n m β ) ) 1 / 2 |\Delta_{F}|\ge\lambda+(v^{2}/(2nm\beta))^{1/2} ∣ Δ F ∣ ≥ λ + ( v 2 / ( 2 nm β ) ) 1/2 , then P ( ∣ D ∣ < λ ) ≤ P ( ∣ D − Δ F ∣ > ∣ Δ F ∣ − λ ) ≤ β \mathbb{P}(|D|<\lambda)\le\mathbb{P}(|D-\Delta_{F}|>|\Delta_{F}|-\lambda)\le\beta P ( ∣ D ∣ < λ ) ≤ P ( ∣ D − Δ F ∣ > ∣ Δ F ∣ − λ ) ≤ β . The sufficient condition follows from ( a + b ) 2 ≤ 2 a 2 + 2 b 2 (a+b)^{2}\le2a^{2}+2b^{2} ( a + b ) 2 ≤ 2 a 2 + 2 b 2 . The variant with threshold 2 λ \sqrt{2}\lambda 2 λ is analogous.
(iv) By (ii), ∣ Δ F − c κ F ∣ ≤ ( 2 e − 1 − e ) c 2 ∥ H 0 ∥ 2 2 ≤ c ∣ κ F ∣ / 2 |\Delta_{F}-c\kappa_{F}|\le(2^{e}-1-e)c^{2}\lVert H_{0}\rVert_{2}^{2}\le c|\kappa_{F}|/2 ∣ Δ F − c κ F ∣ ≤ ( 2 e − 1 − e ) c 2 ∥ H 0 ∥ 2 2 ≤ c ∣ κ F ∣/2 under the stated restriction on c c c , so ∣ Δ F ∣ ≥ c ∣ κ F ∣ / 2 |\Delta_{F}|\ge c|\kappa_{F}|/2 ∣ Δ F ∣ ≥ c ∣ κ F ∣/2 , and (iii) applies once n m c 2 κ F 2 / 4 ≥ v 2 ( 1 / α + 1 / β ) nmc^{2}\kappa_{F}^{2}/4\ge v^{2}(1/\alpha+1/\beta) nm c 2 κ F 2 /4 ≥ v 2 ( 1/ α + 1/ β ) . If W ≡ w W\equiv w W ≡ w is constant, W F , e = w e − 1 W_{F,e}=w^{e-1} W F , e = w e − 1 and ⟨ H 0 , W F , e ⟩ = w e − 1 ∬ H 0 = w e − 1 d H 0 \langle H_{0},W_{F,e}\rangle=w^{e-1}\iint H_{0}=w^{e-1}d_{H_{0}} ⟨ H 0 , W F , e ⟩ = w e − 1 ∬ H 0 = w e − 1 d H 0 .
For SMOOTH, W ∘ W = 0.09 + 0.06 ( x + y ) + 0.16 3 x y W \circ W = 0.09 + 0.06(x+y) + \frac{0.16}{3}xy W ∘ W = 0.09 + 0.06 ( x + y ) + 3 0.16 x y and κ K 3 = 0.16 ⟨ H 0 , x y ⟩ = 0.16 / 256 = 1 / 1600 \kappa_{K_3} = 0.16\langle H_0,xy\rangle= 0.16/256 = 1/1600 κ K 3 = 0.16 ⟨ H 0 , x y ⟩ = 0.16/256 = 1/1600 .
For c ∈ { 0.3 , … , 1 } c \in\{0.3,\ldots,1\} c ∈ { 0.3 , … , 1 } the remainder of Lemma A.18 is well within its bound (numerical check (xi)). At c = 1 c=1 c = 1 the second-order terms are of the same size as c κ K 3 c\kappa_{K_3} c κ K 3 for these nulls.
Remark 12 (Regular nulls and calibration). The bound in (i) holds for every W W W and is tight in order when W W W is F F F -irregular. If W W W is F F F -regular in the sense of Bhattacharya et al. [ [6 ] , the count of F F F fluctuates on the smaller scale n v − 1 n^{v-1} n v − 1 (compared with n v − 1 / 2 n^{v-1/2} n v − 1/2 in the irregular case), so that Var t i n j ( F , G ( n , W ) ) = O ( n − 2 ) \operatorname{Var} t_{\mathrm{inj}}(F,G(n,W))=O(n^{-2}) Var t inj ( F , G ( n , W )) = O ( n − 2 ) , and its limit law may contain weighted χ 2 \chi^2 χ 2 components. Chatterjee et al. [ [16 ] give the joint limits and a multiplier bootstrap that is consistent in both regimes. The W W W -agnostic threshold of (iii) is then conservative by a factor of order n n n , and a two-sample test calibrated at the n − 1 n^{-1} n − 1 scale would need only m n 2 Δ F 2 ≳ 1 mn^2\Delta_F^2 \gtrsim1 m n 2 Δ F 2 ≳ 1 . We do not prove the two-sample version.
Remark 13 (Scope of (iv)). (iv) is an upper bound. A first-order visible difference is detected by an unaligned motif test with m = O ( 1 / t H ) m=O(1/t_H) m = O ( 1/ t H ) graphs. This is the order reached by an aligned test under the same null (Proposition 4 below) and the order of the aligned sample size at a constant null (Theorem 1(iii), where t = t H / q t=t_H/q t = t H / q ), compared with m ≍ t − 3 m\asymp t^{-3} m ≍ t − 3 for the first-order invisible difference of Theorem 1. We do not prove a matching lower bound for non-constant nulls (the null is then itself a mixture over latent positions, and the second-moment method of Section A.2 does not apply directly), nor an aligned lower bound for non-constant nulls. The oracle that knows all latent positions gives only m ∗ ≳ 1 / ( n t H ) m^* \gtrsim1/(nt_H) m ∗ ≳ 1/ ( n t H ) .
Proposition 4 (An aligned test under every null). Let W W W be a graphon and H H H symmetric with 0 ≤ W + H ≤ 1 0\leq W+H\leq1 0 ≤ W + H ≤ 1 , and suppose that all 2 m 2m 2 m graphs share the latent positions U = ( U 1 , … , U n ) U=(U_1,\ldots,U_n) U = ( U 1 , … , U n ) . Given U U U , the edges A i j ℓ A^\ell_{ij} A ij ℓ of G ℓ G^\ell G ℓ are independent Bern ( ( W + H ) ( U i , U j ) ) \operatorname{Bern}((W+H)(U_i,U_j)) Bern (( W + H ) ( U i , U j )) , and the edges A i j ′ ℓ A^{\prime\ell}_{ij} A ij ′ ℓ of G ′ ℓ G^{\prime\ell} G ′ ℓ are independent Bern ( W ( U i , U j ) ) \operatorname{Bern}(W(U_i,U_j)) Bern ( W ( U i , U j )) , ℓ = 1 , … , m \ell=1,\ldots,m ℓ = 1 , … , m , m ≥ 2 m\geq2 m ≥ 2 . Let D ℓ = A ℓ − A ′ ℓ D^\ell=A^\ell-A^{\prime\ell} D ℓ = A ℓ − A ′ ℓ , S = ∑ i < j ∑ ℓ ≠ ℓ ′ D i j ℓ D i j ℓ ′ S=\sum_{i<j}\sum_{\ell\ne\ell'}D^\ell_{ij}D^{\ell'}_{ij} S = ∑ i < j ∑ ℓ = ℓ ′ D ij ℓ D ij ℓ ′ , t H = n ∥ H ∥ 2 2 t_H=n\lVert H\rVert_2^2 t H = n ∥ H ∥ 2 2 and r H = sup x ∫ H ( x , y ) 2 d y / ∥ H ∥ 2 2 r_H=\sup_x\int H(x,y)^2\,dy/\lVert H\rVert_2^2 r H = sup x ∫ H ( x , y ) 2 d y / ∥ H ∥ 2 2 .
(i) If H = 0 H=0 H = 0 , then E [ S ∣ U ] = 0 \mathbb{E}[S\mid U]=0 E [ S ∣ U ] = 0 and Var ( S ∣ U ) ≤ N m ( m − 1 ) / 2 \operatorname{Var}(S\mid U)\leq Nm(m-1)/2 Var ( S ∣ U ) ≤ N m ( m − 1 ) /2 for every W W W , so the test 1 { S ≥ λ } \mathbf{1}\{S\geq\lambda\} 1 { S ≥ λ } with λ = ( N m ( m − 1 ) / ( 2 α ) ) 1 / 2 \lambda=(Nm(m-1)/(2\alpha))^{1/2} λ = ( N m ( m − 1 ) / ( 2 α ) ) 1/2 has size at most α \alpha α under every null. The test that compares S S S with its law under independent random signs of D 1 , … , D m D^1,\ldots,D^m D 1 , … , D m is exact.
(ii) If ( m − 1 ) t H ≥ 4 2 ( α − 1 / 2 + β − 1 / 2 ) (m-1)t_H\geq4\sqrt{2}(\alpha^{-1/2}+\beta^{-1/2}) ( m − 1 ) t H ≥ 4 2 ( α − 1/2 + β − 1/2 ) and m ( n − 1 ) t H ≥ 32 / β m(n-1)t_H\geq32/\beta m ( n − 1 ) t H ≥ 32/ β , the test of (i) has power at least 1 − β − 8 / ( ( n − 1 ) t H ) − 16 r H / n 1-\beta-8/((n-1)t_H)-16r_H/n 1 − β − 8/ (( n − 1 ) t H ) − 16 r H / n .
In particular an aligned test needs m = O ( 1 / t H ) m=O(1/t_H) m = O ( 1/ t H ) graphs per group under every null.
Proof. Given U U U , the variables D e ℓ D^\ell_e D e ℓ are independent over edges and over ℓ \ell ℓ . Fix an edge e = { i , j } e=\{i,j\} e = { i , j } and write D e ℓ = μ + Z ℓ D^\ell_e=\mu+Z^\ell D e ℓ = μ + Z ℓ with μ = H ( U i , U j ) \mu=H(U_i,U_j) μ = H ( U i , U j ) and centred Z ℓ Z^\ell Z ℓ of variance s 2 ≤ 1 / 2 s^2\leq1/2 s 2 ≤ 1/2 . Then
Y e : = ∑ ℓ ≠ ℓ ′ D e ℓ D e ℓ ′ = m ( m − 1 ) μ 2 + 2 ( m − 1 ) μ ∑ ℓ Z ℓ + ∑ ℓ ≠ ℓ ′ Z ℓ Z ℓ ′ . Y_e:=\sum_{\ell\ne\ell'}D^\ell_eD^{\ell'}_e=m(m-1)\mu^2+2(m-1)\mu\sum_\ell Z^\ell+\sum_{\ell\ne\ell'}Z^\ell Z^{\ell'}. Y e := ℓ = ℓ ′ ∑ D e ℓ D e ℓ ′ = m ( m − 1 ) μ 2 + 2 ( m − 1 ) μ ℓ ∑ Z ℓ + ℓ = ℓ ′ ∑ Z ℓ Z ℓ ′ .
and the last two terms are uncorrelated. Hence E Y e = m ( m − 1 ) μ 2 \mathbb{E}Y_e=m(m-1)\mu^2 E Y e = m ( m − 1 ) μ 2 and Var Y e = 4 m ( m − 1 ) μ 2 s 2 + 2 m ( m − 1 ) s 4 ≤ 2 m ( m − 1 ) 2 μ 2 + m ( m − 1 ) / 2 \operatorname{Var}Y_e=4m(m-1)\mu^2s^2+2m(m-1)s^4\leq2m(m-1)^2\mu^2+m(m-1)/2 Var Y e = 4 m ( m − 1 ) μ 2 s 2 + 2 m ( m − 1 ) s 4 ≤ 2 m ( m − 1 ) 2 μ 2 + m ( m − 1 ) /2 . Summing over the N N N edges, with Σ U = ∑ i < j H ( U i , U j ) 2 \Sigma_U=\sum_{i<j}H(U_i,U_j)^2 Σ U = ∑ i < j H ( U i , U j ) 2 ,
E [ S ∣ U ] = m ( m − 1 ) Σ U , Var ( S ∣ U ) ≤ 2 m ( m − 1 ) 2 Σ U + N m ( m − 1 ) / 2. \mathbb{E}[S\mid U]=m(m-1)\Sigma_U,\qquad\operatorname{Var}(S\mid U)\leq2m(m-1)^2\Sigma_U+Nm(m-1)/2. E [ S ∣ U ] = m ( m − 1 ) Σ U , Var ( S ∣ U ) ≤ 2 m ( m − 1 ) 2 Σ U + N m ( m − 1 ) /2.
(i) For H = 0 H=0 H = 0 these are the stated moments, and Chebyshev’s inequality gives the size. Given U U U and H = 0 H=0 H = 0 , A ℓ A^\ell A ℓ and A ′ ℓ A^{\prime\ell} A ′ ℓ are exchangeable, so the law of ( D 1 , … , D m ) (D^1,\ldots,D^m) ( D 1 , … , D m ) does not change when the D ℓ D^\ell D ℓ are multiplied by independent random signs. This makes the sign-change test exact.
(ii) The variable Σ U \Sigma_U Σ U has mean N ∥ H ∥ 2 2 N\lVert H\rVert_2^2 N ∥ H ∥ 2 2 . Two edges without a common vertex are independent. For two edges with one common vertex the covariance is at most E [ h ( U 1 ) 2 ] ≤ r H ∥ H ∥ 2 4 \mathbb{E}[h(U_1)^2]\leq r_H\lVert H\rVert_2^4 E [ h ( U 1 ) 2 ] ≤ r H ∥ H ∥ 2 4 , where h ( x ) = ∫ H ( x , y ) 2 d y h(x)=\int H(x,y)^2\,dy h ( x ) = ∫ H ( x , y ) 2 d y , and Var H ( U 1 , U 2 ) 2 ≤ ∥ H ∥ 2 2 \operatorname{Var}H(U_1,U_2)^2\leq\lVert H\rVert_2^2 Var H ( U 1 , U 2 ) 2 ≤ ∥ H ∥ 2 2 because ∣ H ∣ ≤ 1 |H|\leq1 ∣ H ∣ ≤ 1 . Hence Var Σ U ≤ N ∥ H ∥ 2 2 + 2 ( n − 2 ) N r H ∥ H ∥ 2 4 \operatorname{Var}\Sigma_U\leq N\lVert H\rVert_2^2+2(n-2)Nr_H\lVert H\rVert_2^4 Var Σ U ≤ N ∥ H ∥ 2 2 + 2 ( n − 2 ) N r H ∥ H ∥ 2 4 , and Chebyshev’s inequality gives
P ( Σ U < N ∥ H ∥ 2 2 / 2 ) ≤ 8 ( n − 1 ) t H + 16 r H n . \mathbb{P}\left(\Sigma_U<N\lVert H\rVert_2^2/2\right)\leq\frac{8}{(n-1)t_H}+\frac{16r_H}{n}. P ( Σ U < N ∥ H ∥ 2 2 /2 ) ≤ ( n − 1 ) t H 8 + n 16 r H .
On the complementary event, let x = m ( m − 1 ) ∑ U ≥ m ( m − 1 ) N ∥ H ∥ 2 2 / 2 x = m(m-1)\sum_U \ge m(m-1)N\lVert H\rVert_2^2/2 x = m ( m − 1 ) ∑ U ≥ m ( m − 1 ) N ∥ H ∥ 2 2 /2 . The second condition gives x ≥ 8 ( m − 1 ) / β x \ge8(m-1)/\beta x ≥ 8 ( m − 1 ) / β , so ( 2 ( m − 1 ) x / β ) 1 / 2 ≤ x / 2 \left(2(m-1)x/\beta\right)^{1/2} \le x/2 ( 2 ( m − 1 ) x / β ) 1/2 ≤ x /2 . Since ( m ( m − 1 ) N ) 1 / 2 ∥ H ∥ 2 2 = t H ( m ( m − 1 ) ( n − 1 ) / ( 2 n ) ) 1 / 2 ≥ ( m − 1 ) t H / 2 \left(m(m-1)N\right)^{1/2}\lVert H\rVert_2^2 = t_H\left(m(m-1)(n-1)/(2n)\right)^{1/2} \ge(m-1)t_H/2 ( m ( m − 1 ) N ) 1/2 ∥ H ∥ 2 2 = t H ( m ( m − 1 ) ( n − 1 ) / ( 2 n ) ) 1/2 ≥ ( m − 1 ) t H /2 , the first condition gives x / 2 ≥ K : = ( N m ( m − 1 ) / 2 ) 1 / 2 ( α − 1 / 2 + β − 1 / 2 ) x/2 \ge K := \left(Nm(m-1)/2\right)^{1/2}\left(\alpha^{-1/2}+\beta^{-1/2}\right) x /2 ≥ K := ( N m ( m − 1 ) /2 ) 1/2 ( α − 1/2 + β − 1/2 ) . Therefore
x − λ ≥ x 2 + ( N m ( m − 1 ) 2 β ) 1 / 2 ≥ ( 2 ( m − 1 ) x β ) 1 / 2 + ( N m ( m − 1 ) 2 β ) 1 / 2 ≥ ( Var ( S ∣ U ) β ) 1 / 2 . x-\lambda\ge\frac{x}{2}+\left(\frac{Nm(m-1)}{2\beta}\right)^{1/2} \ge\left(\frac{2(m-1)x}{\beta}\right)^{1/2}+\left(\frac{Nm(m-1)}{2\beta}\right)^{1/2} \ge\left(\frac{\operatorname{Var}(S\mid U)}{\beta}\right)^{1/2}. x − λ ≥ 2 x + ( 2 β N m ( m − 1 ) ) 1/2 ≥ ( β 2 ( m − 1 ) x ) 1/2 + ( 2 β N m ( m − 1 ) ) 1/2 ≥ ( β Var ( S ∣ U ) ) 1/2 .
and Chebyshev’s inequality gives P ( S < λ ∣ U ) ≤ β \mathbb{P}(S<\lambda\mid U)\le\beta P ( S < λ ∣ U ) ≤ β . Adding the probability of the exceptional event proves (ii). □ \square □
Proposition 5 (Differences orthogonal to a null of finite rank). Let W ( x , y ) = ∑ k = 1 r λ k ϕ k ( x ) ϕ k ( y ) W(x,y)=\sum_{k=1}^{r}\lambda_k\phi_k(x)\phi_k(y) W ( x , y ) = ∑ k = 1 r λ k ϕ k ( x ) ϕ k ( y ) be a graphon of finite rank, and let H H H be bounded and symmetric with 0 ≤ W + H ≤ 1 0\le W+H\le1 0 ≤ W + H ≤ 1 , zero degree function and ∫ H ( x , y ) ϕ k ( y ) d y = 0 \int H(x,y)\phi_k(y)\,dy=0 ∫ H ( x , y ) ϕ k ( y ) d y = 0 for almost every x x x and k = 1 , … , r k=1,\ldots,r k = 1 , … , r . Then t ( P , W + H ) = t ( P , W ) t(P,W+H)=t(P,W) t ( P , W + H ) = t ( P , W ) for every path P P P , and t ( C k , W + H ) = t ( C k , W ) + t ( C k , H ) t(C_k,W+H)=t(C_k,W)+t(C_k,H) t ( C k , W + H ) = t ( C k , W ) + t ( C k , H ) for every cycle C k C_k C k , k ≥ 3 k\ge3 k ≥ 3 . In particular the first-order coefficient ∑ F ⟨ H , W F , e ⟩ \sum_F\langle H,W_{F,e}\rangle ∑ F ⟨ H , W F , e ⟩ vanishes for every path and every cycle F F F , and every cycle density moves by exactly t ( C k , H ) t(C_k,H) t ( C k , H ) , as under a constant null.
Proof. Let T W T_W T W and T H T_H T H be the integral operators of W W W and H H H on L 2 [ 0 , 1 ] L^2[0,1] L 2 [ 0 , 1 ] . The range of T W T_W T W is spanned by ϕ 1 , … , ϕ r \phi_1,\ldots,\phi_r ϕ 1 , … , ϕ r , so T H T W = 0 T_HT_W=0 T H T W = 0 , and T W T H = ( T H T W ) ∗ = 0 T_WT_H=(T_HT_W)^*=0 T W T H = ( T H T W ) ∗ = 0 because both kernels are symmetric. The zero degree function gives T H 1 = d H = 0 T_H1=d_H=0 T H 1 = d H = 0 .
For a path with j j j edges, t ( P , W + H ) = ⟨ 1 , ( T W + T H ) j 1 ⟩ t(P,W+H)=\langle1,(T_W+T_H)^j1\rangle t ( P , W + H ) = ⟨ 1 , ( T W + T H ) j 1 ⟩ . In a product of the factors T W T_W T W and T H T_H T H that contains T H T_H T H , the rightmost T H T_H T H acts either on 1 1 1 or on the range of T W T_W T W , so the product annihilates 1 1 1 . Hence ( T W + T H ) j 1 = T W j 1 (T_W+T_H)^j1=T_W^j1 ( T W + T H ) j 1 = T W j 1 .
For a cycle, t ( C k , W + H ) = tr ( T W + T H ) k t(C_k,W+H)=\operatorname{tr}(T_W+T_H)^k t ( C k , W + H ) = tr ( T W + T H ) k . A product of k k k factors that contains both operators has, after a cyclic rotation that does not change its trace, a factor T H T W T_HT_W T H T W or T W T H T_WT_H T W T H , so its trace is zero, and tr ( T W + T H ) k = tr T W k + tr T H k \operatorname{tr}(T_W+T_H)^k=\operatorname{tr}T_W^k+\operatorname{tr}T_H^k tr ( T W + T H ) k = tr T W k + tr T H k .
The hypotheses also hold for c H cH cH , c ∈ [ 0 , 1 ] c\in[0,1] c ∈ [ 0 , 1 ] , so t ( P , W + c H ) t(P,W+cH) t ( P , W + cH ) does not depend on c c c and t ( C k , W + c H ) = t ( C k , W ) + c k t ( C k , H ) t(C_k,W+cH)=t(C_k,W)+c^kt(C_k,H) t ( C k , W + cH ) = t ( C k , W ) + c k t ( C k , H ) . Both derivatives vanish at c = 0. □ c=0. \square c = 0. □
Proposition 2: exact calibration by vertex splitting
Proposition (Restatement of Proposition 2). Let V 1 , … , V B ⊂ [ n ] V_1,\ldots,V_B\subset[n] V 1 , … , V B ⊂ [ n ] be fixed, pairwise disjoint, of equal size n B n_B n B .
Under G ( n , W ) G(n,W) G ( n , W ) with a fixed graphon W W W , the induced subgraphs G [ V 1 ] , … , G [ V B ] G[V_1],\ldots,G[V_B] G [ V 1 ] , … , G [ V B ] (relabeled increasingly by [ n B ] [n_B] [ n B ] ) are independent with law G ( n B , W ) G(n_B,W) G ( n B , W ) .
Let Y 1 , … , Y K Y_1,\ldots,Y_K Y 1 , … , Y K , K = 2 m B K=2mB K = 2 m B , be the induced subgraphs of the 2 m 2m 2 m graphs. I 0 ⊂ [ K ] I_0\subset[K] I 0 ⊂ [ K ] the m B mB m B indices from group one, and S ( y ; I ) S(y;I) S ( y ; I ) a statistic satisfying S ( y ∘ π ; I ) = S ( y ; π ( I ) ) S(y\circ\pi;I)=S(y;\pi(I)) S ( y ∘ π ; I ) = S ( y ; π ( I )) for all permutations π \pi π of [ K ] [K] [ K ] (e.g. a difference of group means of a graph functional). With p ^ = ( K m B ) − 1 ∑ ∣ I ∣ = m B 1 { S ( Y ; I ) ≥ S ( Y ; I 0 ) } \hat p=\binom{K}{m_B}^{-1}\sum_{|I|=m_B}1\{S(Y;I)\ge S(Y;I_0)\} p ^ = ( m B K ) − 1 ∑ ∣ I ∣ = m B 1 { S ( Y ; I ) ≥ S ( Y ; I 0 )} , P H 0 ( p ^ ≤ α ) ≤ α \mathbb{P}_{H_0}(\hat p\le\alpha)\le\alpha P H 0 ( p ^ ≤ α ) ≤ α for all α ∈ [ 0 , 1 ] \alpha\in[0,1] α ∈ [ 0 , 1 ] under every null P = Q = G ( n , W ) P=Q=G(n,W) P = Q = G ( n , W ) ; the randomized p p p -value is exactly uniform. Since p ^ ≥ ( K m B ) − 1 \hat p\ge\binom{K}{m_B}^{-1} p ^ ≥ ( m B K ) − 1 , a rejection at level α \alpha α requires ( K m B ) ≥ 1 / α \binom{K}{m_B}\ge1/\alpha ( m B K ) ≥ 1/ α .
(iii) Under the planted partition, ∑ b T p ( G [ V b ] ) \sum_b T_p(G[V_b]) ∑ b T p ( G [ V b ]) has mean B ( n B 3 ) δ 3 B\binom{n_B}{3}\delta^3 B ( 3 n B ) δ 3 and null variance B ( n B 3 ) q 3 B\binom{n_B}{3}q^3 B ( 3 n B ) q 3 ; its squared signal-to-noise ratio is B ( n B 3 ) η 3 = ( n B − 1 ) ( n B − 2 ) 6 n 2 t 3 ≈ t 3 / ( 6 B 2 ) B\binom{n_B}{3}\eta^3 = \frac{(n_B-1)(n_B-2)}{6n^2}t^3 \approx t^3/(6B^2) B ( 3 n B ) η 3 = 6 n 2 ( n B − 1 ) ( n B − 2 ) t 3 ≈ t 3 / ( 6 B 2 ) .
(iv) If the common null law is a mixture of graphon laws (a graphon drawn at random for each graph), the Y i Y_i Y i need not be exchangeable and the test in (ii) need not be valid.
Lemma A.19 (Induced subgraphs on disjoint vertex sets). Statement (i) holds.
Proof. G [ V b ] G[V_b] G [ V b ] is a function of ( U i ) i ∈ V b (U_i)_{i\in V_b} ( U i ) i ∈ V b and ( V i j ) i < j , i , j ∈ V b (V_{ij})_{i<j,\,i,j\in V_b} ( V ij ) i < j , i , j ∈ V b . These collections are disjoint for different b b b , hence independent. The law of G [ V b ] G[V_b] G [ V b ] is that of G ( n B , W ) G(n_B,W) G ( n B , W ) by definition.
Lemma A.20 (Validity of permutation p-values). Let Y = ( Y 1 , … , Y K ) Y=(Y_1,\ldots,Y_K) Y = ( Y 1 , … , Y K ) be exchangeable, 1 ≤ k < K 1\le k<K 1 ≤ k < K , I 0 = { 1 , … , k } I_0=\{1,\ldots,k\} I 0 = { 1 , … , k } , and S S S as in (ii). Then p ^ = ( K k ) − 1 ∑ ∣ I ∣ = k 1 { S ( Y ; I ) ≥ S ( Y ; I 0 ) } \hat p=\binom{K}{k}^{-1}\sum_{|I|=k}1\{S(Y;I)\ge S(Y;I_0)\} p ^ = ( k K ) − 1 ∑ ∣ I ∣ = k 1 { S ( Y ; I ) ≥ S ( Y ; I 0 )} satisfies P ( p ^ ≤ α ) ≤ α \mathbb{P}(\hat p\le\alpha)\le\alpha P ( p ^ ≤ α ) ≤ α . With ζ ∼ U ( 0 , 1 ) \zeta\sim U(0,1) ζ ∼ U ( 0 , 1 ) independent of Y Y Y , the randomized p-value p ~ = ( K k ) − 1 ( ∣ { I : S ( Y ; I ) > S ( Y ; I 0 ) } ∣ + ζ ∣ { I : S ( Y ; I ) = S ( Y ; I 0 ) } ∣ ) \tilde p=\binom{K}{k}^{-1}(\lvert\{I:S(Y;I)>S(Y;I_0)\}\rvert+\zeta\lvert\{I:S(Y;I)=S(Y;I_0)\}\rvert) p ~ = ( k K ) − 1 (∣{ I : S ( Y ; I ) > S ( Y ; I 0 )}∣ + ζ ∣{ I : S ( Y ; I ) = S ( Y ; I 0 )}∣) is uniform on [ 0 , 1 ] [0,1] [ 0 , 1 ] .
Proof. Let J J J be a uniform k k k -subset of [ K ] [K] [ K ] independent of Y Y Y and π J \pi_J π J a permutation with π J ( I 0 ) = J \pi_J(I_0)=J π J ( I 0 ) = J . By exchangeability Y ∘ π J Y\circ\pi_J Y ∘ π J has the law of Y Y Y , so p ^ ( Y ) \hat p(Y) p ^ ( Y ) has the law of p ^ ( Y ∘ π J ) = ( K k ) − 1 ∑ I 1 { S ( Y ; π J ( I ) ) ≥ S ( Y ; J ) } = ( K k ) − 1 ∣ { I ′ : S ( Y ; I ′ ) ≥ S ( Y ; J ) } ∣ \hat p(Y\circ\pi_J)=\binom{K}{k}^{-1}\sum_I1\{S(Y;\pi_J(I))\ge S(Y;J)\}=\binom{K}{k}^{-1}\lvert\{I':S(Y;I')\ge S(Y;J)\}\rvert p ^ ( Y ∘ π J ) = ( k K ) − 1 ∑ I 1 { S ( Y ; π J ( I )) ≥ S ( Y ; J )} = ( k K ) − 1 ∣{ I ′ : S ( Y ; I ′ ) ≥ S ( Y ; J )}∣ , because π J \pi_J π J permutes the k k k -subsets.
Given Y Y Y , write s I = S ( Y ; I ) s_I=S(Y;I) s I = S ( Y ; I ) . For any finite list of reals, the number of indices J J J with ∣ { I ′ : s I ′ ≥ s J } ∣ ≤ a \lvert\{I':s_{I'}\ge s_J\}\rvert\le a ∣{ I ′ : s I ′ ≥ s J }∣ ≤ a is at most a a a (if J ∗ J^* J ∗ has the smallest value among them, all of them satisfy s J ≥ s J ∗ s_J\ge s_{J^*} s J ≥ s J ∗ ). Hence P ( p ^ ≤ α ∣ Y ) ≤ ⌊ α ( K k ) ⌋ / ( K k ) ≤ α \mathbb{P}(\hat p\le\alpha\mid Y)\le\lfloor\alpha\binom{K}{k}\rfloor/\binom{K}{k}\le\alpha P ( p ^ ≤ α ∣ Y ) ≤ ⌊ α ( k K ) ⌋ / ( k K ) ≤ α .
For p ~ \tilde p p ~ the same substitution shows that, given Y Y Y , p ~ \tilde p p ~ has the law of ( K k ) − 1 ( ∣ { s I ′ > s J } ∣ + ζ ∣ { s I ′ = s J } ∣ ) \binom{K}{k}^{-1}(\lvert\{s_{I'}>s_J\}\rvert+\zeta\lvert\{s_{I'}=s_J\}\rvert) ( k K ) − 1 (∣{ s I ′ > s J }∣ + ζ ∣{ s I ′ = s J }∣) with J J J uniform, which is uniform on [ 0 , 1 ] [0,1] [ 0 , 1 ] (the ranks of s J s_J s J among the ( K k ) \binom{K}{k} ( k K ) values, randomized within ties).
Proof of Proposition 2. (i) is Lemma A.19 .
(ii) Under P = Q = G ( n , W ) P=Q=G(n,W) P = Q = G ( n , W ) the 2 m 2m 2 m graphs are i.i.d. By (i) the 2 m B 2mB 2 m B induced subgraphs are i.i.d., hence exchangeable, and Lemma A.20 applies with k = m B k=mB k = m B . Also p ^ ≥ ( K m B ) − 1 \hat p\ge\binom{K}{mB}^{-1} p ^ ≥ ( m B K ) − 1 , because I = I 0 I=I_0 I = I 0 is counted.
(iii) Given σ \sigma σ , the edges inside V b V_b V b are independent Bern ( p + δ σ i σ j ) \operatorname{Bern}(p+\delta\sigma_i\sigma_j) Bern ( p + δ σ i σ j ) with ( σ i ) i ∈ V b (\sigma_i)_{i\in V_b} ( σ i ) i ∈ V b i.i.d. uniform. So each G [ V b ] G[V_b] G [ V b ] is a planted partition on n B n_B n B vertices with the same ( p , δ ) (p,\delta) ( p , δ ) , and the B B B blocks are independent. Lemma A.8 with n B n_B n B in place of n n n gives the moments, and finally B ( n B 3 ) η 3 = n ( n B − 1 ) ( n B − 2 ) 6 ⋅ t 3 n 3 B\binom{n_B}{3}\eta^3=\frac{n(n_B-1)(n_B-2)}{6}\cdot\frac{t^3}{n^3} B ( 3 n B ) η 3 = 6 n ( n B − 1 ) ( n B − 2 ) ⋅ n 3 t 3 .
(iv) Take P = Q P=Q P = Q the law of G ( n , p Θ ) G(n,p_\Theta) G ( n , p Θ ) with Θ \Theta Θ drawn afresh for each graph and Var p Θ > 0 \operatorname{Var}p_\Theta>0 Var p Θ > 0 . The edge densities of two blocks of the same graph have covariance Var ( p Θ ) > 0 \operatorname{Var}(p_\Theta)>0 Var ( p Θ ) > 0 , while blocks of different graphs are independent, so ( Y 1 , … , Y K ) (Y_1,\ldots,Y_K) ( Y 1 , … , Y K ) is not exchangeable. In a simulation with p Θ ∼ U [ 0.3 , 0.7 ] p_\Theta\sim U[0.3,0.7] p Θ ∼ U [ 0.3 , 0.7 ] , m = 1 m=1 m = 1 , B = 4 B=4 B = 4 , n = 32 n=32 n = 32 and the edge-density statistic (numerical check (xii)), the level-0.05 test rejects with probability 0.22. Permuting whole graphs remains valid.
What is not proved
Sharp constants. Theorem 1(iv) holds with explicit but loose constants. The sharp aligned threshold m t = 1 mt=1 m t = 1 is cited from Chatterjee et al. [2022] (sparse regime) and not reproved, and in the dense regime we only prove $0.87/t\lesssim m_a^*\lesssim C/t$. The asymptotically sharp unaligned constant ({xref}`Remark 6`) relies on the likelihood-ratio limit of {citet}`Banerjee {citep}`[2018].
General finite-rank differences. Only the rank-one and the specific rank-two model are treated. The formula log ( 1 + χ 1 2 ) ≈ ∑ j ≥ 3 ( ∑ i ν i j ) 2 / ( 2 j ) \log(1+\chi_1^2)\approx\sum_{j\ge3}(\sum_i\nu_i^j)^2/(2j) log ( 1 + χ 1 2 ) ≈ ∑ j ≥ 3 ( ∑ i ν i j ) 2 / ( 2 j ) for a general zero-degree finite-rank H H H with normalized eigenvalues ν i \nu_i ν i is consistent with both cases but is not proved. The Veblen argument needs the positivity of the coefficients t S t_S t S , which fails in general.
Sparse graphs. Theorem 1(i)–(iii) and Proposition 1(i)–(iii) are non-asymptotic and hold for all p p p . The distributional statements (Theorem 2(ii), Proposition 1(iv) central limit part) are proved for fixed p p p only.
Beyond fixed families of signed tree counts. The distributional statement for unsigned tree counts, for degree and colour-refinement histograms with growing support, and for message-passing embeddings at finite n n n remains a conjecture (Remark 10). Only the graphon-level statement (Remark 8(c)) follows from Theorem 2(i) and the cited characterization.
Non-constant nulls. There is no lower bound for non-constant W W W , aligned or unaligned. For differences that are visible at first order we prove upper bounds of the same order 1 / t H 1/t_H 1/ t H for unaligned and aligned tests (Theorem 3(iv) and Proposition 4 ). For degree-preserving differences orthogonal to a null of finite rank, the t − 3 t^{-3} t − 3 rate is a conjecture (Remark 14 ). The improved n − 2 n^{-2} n − 2 variance for F F F -regular nulls is cited.
Experimental details
Common settings
All experiments ran with NumPy and SciPy on one laptop CPU (10 cores, 16 GB memory), with four worker processes for E11–E14, seven for E15 and three for E16. All data are simulated, except the protein graphs of E16. Wall-clock times were about 24 minutes for E11 and E11b together (E11b reuses the graph pools of E11), 11 minutes for E12 at n = 128 n = 128 n = 128 and 66 minutes at n = 256 n = 256 n = 256 , and 19 minutes for the sparse panel. E13, E14 and E14b took 2, 5 and 2.5 minutes, E15 took 14 minutes and E16 took 8 minutes. The numerical checks of the proofs take about 2 minutes in total. Seeds are fixed and recorded with the results. For every reported rejection rate r ^ \hat r r ^ based on R R R replicates, the Monte Carlo standard error is ( r ^ ( 1 − r ^ ) / R ) 1 / 2 (\hat r(1-\hat r)/R)^{1/2} ( r ^ ( 1 − r ^ ) / R ) 1/2 , which is at most 0.016 for R = 1000 R = 1000 R = 1000 and 0.035 for R = 200 R = 200 R = 200 . The sample size m ∗ m^* m ∗ is the smallest m m m at which the power reaches 0.5. It is obtained by log-linear interpolation of the running maximum of the power curve on the grid of m m m values, and is reported as > m max >m_{\max} > m m a x when the power never reaches 0.5 on the grid.
Sample complexity, sign cancellation and visibility (E11, E11b, E12)
E11 (sample sizes with and without alignment).
Model. The null is G ( 300 , 1 / 2 ) \mathcal{G}(300,1/2) G ( 300 , 1/2 ) , and the alternative is the planted partition with δ = ( t q / n ) 1 / 2 \delta= (tq/n)^{1/2} δ = ( tq / n ) 1/2 and t ∈ { 0.3 , 0.4 , … , 0.9 } t \in\{0.3, 0.4, \ldots, 0.9\} t ∈ { 0.3 , 0.4 , … , 0.9 } . All tests are one-sided at level 0.05, because every signal is positive.
Aligned tests (one σ \sigma σ shared by the first sample, known p p p ): the statistic Q Q Q with its exact null variance, and the top eigenvalue of ( m n q ) − 1 / 2 ∑ ℓ ( A ℓ − p ( J − I ) ) (mnq)^{-1/2}\sum_{\ell}(A^\ell-p(J-I)) ( mn q ) − 1/2 ∑ ℓ ( A ℓ − p ( J − I )) calibrated by simulation.
Pool bootstrap. Unaligned statistics are sums of independent per-graph terms. Their sampling distribution at each m m m is approximated by resampling m m m per-graph records with replacement from pools of 5 ⋅ 10 5 5\cdot10^5 5 ⋅ 1 0 5 simulated graphs per model, with 4000 resamples per m m m . Pools of different models share random numbers. Each pool is still an independent sample from its own model, and sharing reduces the variance of the Monte Carlo error in the pool-mean difference by a factor of 6 to 11.
Checks. All sizes lie in [ 0.035 , 0.066 ] [0.035, 0.066] [ 0.035 , 0.066 ] . The exact null variances of T p T_p T p and S C 4 SC_4 S C 4 are confirmed to within 0.3%, and every simulated mean shift agrees with its closed form to within 2.1 standard errors.
The sparse panel repeats E11 with n = 2000 n = 2000 n = 2000 and n p = 15 np = 15 n p = 15 (Figure 5 ).
Figure 5. E11 in the sparse regime (n = 2000 n = 2000 n = 2000 , average degree 15). The layout is as in Figure 1 .
E11b (sign cancellation). The setting is that of E11, with the rank-two model (4) and the same values of t t t . Tests are two-sample z z z -tests with exact null variances for signed triangles and signed 4-cycles. S C 4 SC_4 S C 4 is computed from tr B 4 \operatorname{tr} B^4 tr B 4 , ∑ i ( ( B 2 ) i i ) 2 \sum_i ((B^2)_{ii})^2 ∑ i (( B 2 ) ii ) 2 and ∑ i j B i j 4 \sum_{ij} B_{ij}^4 ∑ ij B ij 4 , where B = A − p ( J − I ) B = A - p(J - I) B = A − p ( J − I ) . Figure 4 shows the results. Under the rank-one model, 4-cycles also detect the difference, but they need more graphs than triangles (slope − 4.02 ± 0.02 -4.02 \pm0.02 − 4.02 ± 0.02 ).
Figure 4. Sign cancellation (E11b), n = 300 n = 300 n = 300 , p = 1 / 2 p = 1/2 p = 1/2 . Left: m ∗ m^* m ∗ against t t t for signed triangles and signed 4-cycles under the rank-one planted partition, and for 4-cycles under the rank-two model (4), where triangles never reach power 0.5. Right: power against m m m at t = 0.6 t = 0.6 t = 0.6 .
E12 (order of visibility).
Model. The nulls are ER( 1 / 2 ) (1/2) ( 1/2 ) , SBM2 and SMOOTH, and the alternative is W + c H 0 W + cH_0 W + c H 0 with H 0 H_0 H 0 as in E13 and c ∈ { 0.1 , 0.15 , 0.2 , 0.3 , 0.4 , 0.5 , 0.7 , 1 } c \in\{0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 0.7, 1\} c ∈ { 0.1 , 0.15 , 0.2 , 0.3 , 0.4 , 0.5 , 0.7 , 1 } . We use n = 128 n = 128 n = 128 and repeat the experiment at n = 256 n = 256 n = 256 (Figure 6 ).
Figure 6. E12 repeated with n = 256 n = 256 n = 256 . The layout is as in Figure 2 .
Coefficients. First-order coefficients and exact shifts of t ( K 3 , ⋅ ) t(K_3,\cdot) t ( K 3 , ⋅ ) are computed by Gauss–Legendre quadrature, which is exact for these piecewise bilinear graphons.
Calibration with few graphs (E13)
Models. The nulls are ER( 1 / 2 ) (1/2) ( 1/2 ) , SBM2 with W = 0.6 W = 0.6 W = 0.6 within the two halves of [ 0 , 1 ] [0,1] [ 0 , 1 ] and 0.4 0.4 0.4 across (regular, non-constant), and SMOOTH with W ( x , y ) = 0.3 + 0.4 x y W(x,y) = 0.3 + 0.4xy W ( x , y ) = 0.3 + 0.4 x y (irregular). The alternative adds H 0 H_0 H 0 to the null of the first group, where H 0 = 0.25 H_0 = 0.25 H 0 = 0.25 on [ 0 , 1 4 ] 2 [0,\frac{1}{4}]^2 [ 0 , 4 1 ] 2 , − 1 2 -\frac{1}{2} − 2 1 on [ 0 , 1 4 ] × [ 1 4 , 1 ] [0,\frac{1}{4}] \times[\frac{1}{4},1] [ 0 , 4 1 ] × [ 4 1 , 1 ] and its reflection, and 1 36 \frac{1}{36} 36 1 on [ 1 4 , 1 ] 2 [\frac{1}{4},1]^2 [ 4 1 , 1 ] 2 . Its degree function is zero. We use n ∈ { 64 , 128 } n \in\{64, 128\} n ∈ { 64 , 128 } and m ∈ { 1 , 2 , 3 , 5 , 10 } m \in\{1, 2, 3, 5, 10\} m ∈ { 1 , 2 , 3 , 5 , 10 } , with 1000 replicates for size and 500 for power.
Statistic. The per-graph statistic is K 3 R ( G ) = 6 T / n 3 − ( 2 E / n 2 ) 3 \mathrm{K3R}(G) = 6T/n^3 - (2E/n^2)^3 K3R ( G ) = 6 T / n 3 − ( 2 E / n 2 ) 3 (with T T T triangles and E E E edges), the negative of the T 3 T_3 T 3 statistic of Gao and Lafferty [2017]. The test statistic is the difference of the group means, and all tests are two-sided at level 0.05.
Methods
Graph-label permutation: all ( 2 m m ) \binom{2m}{m} ( m 2 m ) splits, enumerated.
Welch: normal and Student-t t t (Satterthwaite) calibration.
Vertex jackknife: leave-one-vertex-out, closed form, normal calibration.
Vertex split (Proposition 2): contiguous blocks, B ∈ { 2 , 4 } B \in\{2,4\} B ∈ { 2 , 4 } , enumeration when there are at most 5000 splits and 999 random splits otherwise.
Rate-extrapolated variance: block variances at sizes n / 4 n/4 n /4 and n / 2 n/2 n /2 , a fitted exponent clipped to [ 1 , 3 ] [1,3] [ 1 , 3 ] , and extrapolation to size n n n (in the spirit of Bertail et al., [5 ] ).
ER plug-in: the exact variance of K3R under G ( n , p ^ ) \mathcal{G}(n,\hat{p}) G ( n , p ^ ) , derived from its orthogonal expansion in A e − p A_e - p A e − p .
CDB: the graphon multiplier bootstrap of Chatterjee et al. [ [16 ] for t ( K 2 ) t(K_2) t ( K 2 ) and t ( K 3 ) t(K_3) t ( K 3 ) . It is applied to each graph with independent Gaussian multipliers and combined by the delta method, with 999 draws. The regular or irregular form is chosen by their test n R ^ > 1 \sqrt{n}\,\hat{R} > 1 n R ^ > 1 .
Table 1 summarizes the case n = 128 n = 128 n = 128 , m ≤ 3 m \le3 m ≤ 3 . When the difference is visible at first order (SBM2 null), two conservative variance estimates keep useful power, namely the jackknife and a two-sample version of the multiplier bootstrap of Chatterjee et al. [ [16 ] (CDB). A parametric Erdős–Rényi calibration has more power under the Erdős–Rényi null but size up to 0.49 under SMOOTH, and the Student-t t t version of the Welch test is valid.
Table 1: Calibration of the two-sample excess-triangle test with m ≤ 3 m \le3 m ≤ 3 graphs per group (n = 128 n = 128 n = 128 , two-sided level 0.05). Size is the largest rejection rate under the three nulls ER(1/2), SBM2 and SMOOTH (1000 replicates, Monte Carlo s.e. 0.007 at 0.05). Power is under W + H 0 W + H_0 W + H 0 (500 replicates). Parentheses mark tests whose size in that cell exceeds 0.064. Figure 7 shows all n ∈ { 64 , 128 } n \in\{64, 128\} n ∈ { 64 , 128 } and m ≤ 10 m \le10 m ≤ 10 .
Figure 7. Size (left two columns, on a square-root axis with a grey band at 0.05 ± 2 Monte Carlo s.e.) and power under W + H 0 W + H_0 W + H 0 (right two columns) of the calibration methods, for the three nulls (rows), n ∈ { 64 , 128 } n \in\{64, 128\} n ∈ { 64 , 128 } and m ∈ { 1 , 2 , 3 , 5 , 10 } m \in\{1, 2, 3, 5, 10\} m ∈ { 1 , 2 , 3 , 5 , 10 } . Open markers in the power panels flag methods whose size in that cell exceeds 0.064.
Two caveats about CDB. First, K3R lies outside the theory of Chatterjee et al. [ [16 ] under an Erdős–Rényi null. There its n − 1 n^{-1} n − 1 components cancel, and the bootstrap overestimates the variance of the test statistic by a factor of 4.3–5.1, so the test is valid but conservative. Second, at n ≤ 128 n \le128 n ≤ 128 the regularity test never flagged a graph as irregular, even under the irregular SMOOTH null. The bootstrap applied to t ( K 3 ) t(K_3) t ( K 3 ) alone is then anti-conservative under SMOOTH (size 0.18–0.36). With the correct regime its size is 0.023–0.039. This caveat concerns the pre-test at finite n n n , and the asymptotic theorem is unaffected. Figure 7 shows size and power for all methods, nulls, n n n and m m m .
Graph evaluation metrics (E14, E14b)
Models. In E14 the null is G ( 200 , 0.1 ) \mathcal{G}(200, 0.1) G ( 200 , 0.1 ) , and the alternative is the planted partition with t ∈ { 0.9 , 1.5 } t \in\{0.9, 1.5\} t ∈ { 0.9 , 1.5 } (δ = 0.0201 \delta= 0.0201 δ = 0.0201 and 0.0260). In E14b, group 1 is the planted partition with t = 2 t = 2 t = 2 and group 2 consists of independent planted-partition graphs, each rewired by 10 ∣ E ∣ 10|E| 10∣ E ∣ successful degree-preserving double-edge swaps (swaps creating loops or multiple edges are rejected). Fresh graphs are drawn in every replicate. We use 200 replicates per point, and sizes are checked at m ∈ { 8 , 64 } m \in\{8, 64\} m ∈ { 8 , 64 } .
Descriptors.
Degree histogram (degrees 0–60).
Local clustering histogram (50 bins).
Counts of edges, 2-paths, triangles, 3-stars, 3-paths and 4-cycles, each divided by its expectation under G ( n , p ^ ) \mathcal{G}(n,\hat{p}) G ( n , p ^ ) .
Normalized-Laplacian eigenvalue histogram (100 bins on [ 0 , 2 ] [0, 2] [ 0 , 2 ] ).
A random GIN [Xu et al., [65 ] ] with three layers of width 32, constant input and sum readout of all layers. Without biases, a ReLU GIN with constant input is positively homogeneous, and its features are exact linear functions of three walk counts. We therefore add fixed N ( 0 , 1 ) N(0,1) N ( 0 , 1 ) biases and scale the input by 1 / ( 1 + ( n − 1 ) p ) 1/(1 + (n - 1)p) 1/ ( 1 + ( n − 1 ) p ) , in the spirit of Thompson et al. [ [63 ] .
The MMD uses the unbiased estimator with a Gaussian kernel whose bandwidth is the median pairwise distance of the pooled sample, and is calibrated by 200 label permutations. Signed triangles with the pooled edge density use the same permutations.
Positive controls. Every descriptor rejects in 20/20 replicates against a 6% change of edge density with m = 32 m = 32 m = 32 . Against a degree-heterogeneous graphon 0.1 θ ( x ) θ ( y ) 0.1\theta(x)\theta(y) 0.1 θ ( x ) θ ( y ) with θ ( x ) = 1 + 0.3 ( 2 x − 1 ) \theta(x) = 1 + 0.3(2x - 1) θ ( x ) = 1 + 0.3 ( 2 x − 1 ) and the same density, the degree histogram and the random GIN have power 1.00 and 1.00 with m = 16 m = 16 m = 16 , and signed triangles have power 0.05. The low power in Figure 3 is therefore caused by the difference itself, since the same embeddings detect a degree-heterogeneous difference.
Evaluation metrics under irregular nulls (E15)
Models. We use three nulls with edge density 0.4 on n = 200 n = 200 n = 200 vertices, namely ER with W ≡ 0.4 W \equiv0.4 W ≡ 0.4 , SMOOTH with W ( x , y ) = 0.3 + 0.4 x y W(x, y) = 0.3 + 0.4xy W ( x , y ) = 0.3 + 0.4 x y (the irregular null of E12) and the degree-heterogeneous rank-one graphon W ( x , y ) = 0.4 θ ( x ) θ ( y ) W(x, y) = 0.4\theta(x)\theta(y) W ( x , y ) = 0.4 θ ( x ) θ ( y ) with θ ( x ) = 0.5 + x \theta(x) = 0.5 + x θ ( x ) = 0.5 + x , which we call the rank-one null. Their degree functions are 0.4 0.4 0.4 , 0.3 + 0.2 x 0.3 + 0.2x 0.3 + 0.2 x and 0.4 θ ( x ) 0.4\theta(x) 0.4 θ ( x ) . The alternative adds H = δ s ⊗ s H = \delta\,s \otimes s H = δ s ⊗ s with δ = 0.07 \delta= 0.07 δ = 0.07 , where either s A = 1 [ 1 / 2 , 1 ) − 1 [ 0 , 1 / 2 ) s_A = 1_{[1/2,1)} - 1_{[0,1/2)} s A = 1 [ 1/2 , 1 ) − 1 [ 0 , 1/2 ) , which is correlated with the degree profile of the two irregular nulls, or s O = 1 [ 0 , 1 / 4 ) ∪ [ 3 / 4 , 1 ) − 1 [ 1 / 4 , 3 / 4 ) s_O = 1_{[0,1/4)\cup[3/4,1)} - 1_{[1/4,3/4)} s O = 1 [ 0 , 1/4 ) ∪ [ 3/4 , 1 ) − 1 [ 1/4 , 3/4 ) , which is orthogonal to 1 1 1 and x x x and hence to every eigenfunction of the three nulls. Both differences have zero degree function, and under the Erdős–Rényi null both are the planted partition with t = 4.1 t = 4.1 t = 4.1 . For H A H_A H A , exact quadrature gives first-order coefficients κ P 4 = 2.5 ⋅ 10 − 3 \kappa_{P4} = 2.5 \cdot10^{-3} κ P 4 = 2.5 ⋅ 1 0 − 3 under SMOOTH and 10 − 2 10^{-2} 1 0 − 2 under the rank-one null, and κ K 3 = 10 − 2 \kappa_{K3} = 10^{-2} κ K 3 = 1 0 − 2 and 3.25 ⋅ 10 − 2 3.25 \cdot10^{-2} 3.25 ⋅ 1 0 − 2 . For H O H_O H O , every path density is unchanged and the triangle and 4-cycle densities move by exactly δ 3 \delta^3 δ 3 and δ 4 \delta^4 δ 4 under all three nulls (Proposition 5 ).
Descriptors and tests. The descriptors and tests are those of E14 (Section B.4), with one histogram bin per degree and the GIN input scaled by 1 / ( 1 + 0.4 ( n − 1 ) ) 1/(1 + 0.4(n - 1)) 1/ ( 1 + 0.4 ( n − 1 )) . We add the degree-corrected signed triangle and 4-cycle counts per wedge. With B = A − d d ⊤ / ( 2 ∣ E ∣ ) B = A - dd^\top/(2|E|) B = A − d d ⊤ / ( 2∣ E ∣ ) , set to zero on the diagonal, and P 2 = ∑ i ( d i 2 ) P_2 = \sum_i \binom{d_i}{2} P 2 = ∑ i ( 2 d i ) the number of paths of length two, they are tr ( B 3 ) / ( 6 P 2 ) \operatorname{tr}(B^3)/(6P_2) tr ( B 3 ) / ( 6 P 2 ) and ( tr ( B 4 ) − 2 ∑ i ( B 2 ) i i 2 + ∑ i , j B i j 4 ) / ( 8 P 2 ) \left(\operatorname{tr}(B^4) - 2\sum_i (B^2)_{ii}^2 + \sum_{i,j} B_{ij}^4\right)/(8P_2) ( tr ( B 4 ) − 2 ∑ i ( B 2 ) ii 2 + ∑ i , j B ij 4 ) / ( 8 P 2 ) , compared by the permutation test of the mean difference. We use m ∈ { 8 , 16 , … , 256 } m \in\{8, 16, \ldots, 256\} m ∈ { 8 , 16 , … , 256 } , 200 replicates per point, and sizes at m ∈ { 8 , 64 } m \in\{8, 64\} m ∈ { 8 , 64 } , which lie between 0.005 and 0.090 for all descriptors and nulls. The value of δ \delta δ was chosen in a pilot run with δ ∈ { 0.04 , 0.07 , 0.1 } \delta\in\{0.04, 0.07, 0.1\} δ ∈ { 0.04 , 0.07 , 0.1 } .
Results. Table 2 gives m ∗ m^* m ∗ , and the top row of Figure 8 shows power curves. The random GIN detects H A H_A H A under both irregular nulls, with m ∗ = 44.3 m^* = 44.3 m ∗ = 44.3 under SMOOTH and 25.7 under the rank-one null, through the first-order term of the path with three edges. It stays at the level for H O H_O H O under every null and for H A H_A H A under the Erdős–Rényi null, with rejection rates between 0.015 and 0.095 over the 24 cells up to m = 256 m = 256 m = 256 (Monte Carlo s.e. 0.015 at 0.05). The degree histogram has the same expected value under both hypotheses for every null, and its rejection rates are at most 0.115. The largest of them, at m = 256 m = 256 m = 256 under SMOOTH with H A H_A H A , reflects the joint law of the degrees, which changes at first order when the difference is correlated with the degree profile. Degree-corrected signed triangles and 4-cycles detect every alternative, with power at least 1.00 already at m = 8 m = 8 m = 8 . Signed triangles centred at the pooled edge density, the statistic of Theorem 1, lose power under the rank-one null, where they need m ∗ = 37.6 m^* = 37.6 m ∗ = 37.6 graphs for H O H_O H O , because the degree heterogeneity of the null enters their variance at first order.
Figure 8. Top (E15): rejection rates against m m m for the degree-preserving differences H A H_A H A , aligned with the degree profile of the null, and H O H_O H O , orthogonal to its eigenfunctions, under SMOOTH and the rank-one null (n = 200 n = 200 n = 200 , δ = 0.07 \delta= 0.07 δ = 0.07 ). Bottom (E16): D&D and ENZYMES graphs against copies with 5% of their edges rewired by unrestricted swaps (deg) or by swaps between vertices of equal degree (wl1). Dashed curves are tree statistics, and the grey band is 0.05 ± 2 0.05 \pm2 0.05 ± 2 Monte Carlo s.e.
Table 2. E15: graphs per group needed for power 0.5 (m ∗ m^* m ∗ , interpolated on m ∈ { 8 , … , 256 } m \in\{8,\ldots,256\} m ∈ { 8 , … , 256 } , with ≤ 8 \le8 ≤ 8 when reached at m = 8 m = 8 m = 8 and > 256 >256 > 256 when not reached), and the largest rejection rate under the three nulls (m ∈ { 8 , 64 } m \in\{8,64\} m ∈ { 8 , 64 } , 200 replicates each).
Protein graphs against rewired copies (E16)
Data. The TUDataset collection [51 ] provides the D&D protein structures [22 ] , in which two amino acids are joined when they are less than 6 Å apart, and the ENZYMES tertiary structures [10 ] . As in the Proteins benchmark of graph generative models [66 , 42 ] we keep the 918 D&D graphs with 100 to 500 vertices, and as in Jo et al. [ [34 ] the 587 ENZYMES graphs with 10 to 125 vertices after removing isolated vertices. The graphs of a dataset differ in size and shape, and both groups are drawn from the same dataset.
Design. Each replicate draws 2 m 2m 2 m distinct graphs at random. The first m m m form group 1, and the other m m m form group 2 after 5% of their edges have been rewired by successful degree-preserving double-edge swaps. The three kinds of swaps differ in the pairs of edges they allow. Unrestricted swaps (deg) pick any two edges. Swaps of type w1 pick two edges whose endpoints have equal degrees, and they preserve the colour of every vertex after two rounds of colour refinement. Swaps of type w2 pick two edges whose endpoints have equal colours after two rounds, and they preserve the colours after three rounds. Sequences of such swaps preserve these colours, so under w2 the three-layer GIN returns exactly the embedding of the original graph, which we checked for every rewired graph. Without rewiring the 2 m 2m 2 m graphs are exchangeable and all tests are exact. In 1200 replicates at m ∈ { 8 , 64 } m \in\{8,64\} m ∈ { 8 , 64 } their sizes lie between 0.037 and 0.063. The descriptors are those of E14, adapted to graphs of different sizes. We add a GIN with mean readout, and centre the first signed triangle statistic at each graph’s own edge density. With m = 2 m = 2 m = 2 no two-sided permutation test can reject at level 0.05, since the smallest attainable p p p -value is 1 / 3 1/3 1/3 , so we report m ≥ 4 m \ge4 m ≥ 4 .
Results. Table 3 gives m ∗ m^* m ∗ , and the bottom row of Figure 8 shows power curves. Unrestricted rewiring removes 25% of the triangles of the D&D graphs and 23% of those of ENZYMES. The degree histogram and both random GINs stay at the level under deg and w1, with rejection rates of at most 0.075 for all m ≤ 64 m \le64 m ≤ 64 . The signed cycle statistics detect the rewiring with a few graphs. Triangles are the most sensitive on D&D, whose contact graphs are highly clustered, and 4-cycles on ENZYMES. The clustering histogram and the spectrum also detect it on D&D, but need more graphs on ENZYMES. On D&D the z z z -scores of the same signed counts, which grow with the size of the graph, are much weaker, with power 0.28 against 1.00 at m = 8 m = 8 m = 8 for triangles, while on ENZYMES the two normalizations perform alike. We chose the normalization per wedge after comparing the two on rewired D&D graphs in a pilot, which also fixed the rewiring fraction among { 2 , 5 , 25 } % \{2, 5, 25\}\% { 2 , 5 , 25 } % , so the D&D results favour it by construction. Under wl2 only 4% and 6% of the triangles are removed, because two rounds of colour refinement nearly identify the vertices of these graphs. The degree histogram and the random GINs then stay at the level, with rejection rates of at most 0.080, and the signed triangles reach power 0.50 at m = 64 m = 64 m = 64 on D&D.
Table 3. E16: graphs per group needed for power 0.5 (m ∗ m^* m ∗ , interpolated on m ∈ { 4 , … , 64 } m \in\{4, \ldots, 64\} m ∈ { 4 , … , 64 } , with ≤ 4 \le4 ≤ 4 when reached at m = 4 m = 4 m = 4 and > 64 >64 > 64 when not reached) for the three kinds of rewiring, the largest rejection rate without rewiring (m ∈ { 8 , 64 } m \in\{8, 64\} m ∈ { 8 , 64 } , 1200 replicates each), and the share of triangles removed.
Extended related work
Two-sample testing for graphs. With aligned vertices, minimax rates are known for two-sample testing of inhomogeneous random graphs [27 , 17 ] . Without alignment, the existing tests compare different kinds of summaries:
network statistics of one graph per group [26 ] ;
latent positions of random dot product graphs [62 ] ;
average subgraph counts, with n n n fixed and m → ∞ m \to\infty m → ∞ [49 ] ;
graph cumulants, which remove lower-order effects and improve power at small sample sizes [12 ] ;
Edgeworth-corrected motif statistics for two networks [59 ] ;
block-model and graphon estimates [53 , 57 , 18 ] ;
joint laws of subsampled moments [55 ] .
Ghoshdastidar et al. [ [26 ] prove minimax optimality for tests built on a given statistic, with a single graph per group. Our lower bounds cover all tests and any number of graphs. Their hard instance (Theorem 10 of Ghoshdastidar et al. [ [26 ] ) is essentially our alternative. It compares the Erdős–Rényi graph with a uniform mixture of two-block models over exactly balanced labellings, with edge probabilities p + γ p + \gamma p + γ within and p − γ p - \gamma p − γ between the blocks, which is the planted partition (1) with δ = γ \delta= \gamma δ = γ up to the balancing of the labels. They show that the total variation distance between the two models tends to zero when γ = o ( ( p ( 1 − p ) / n ) 1 / 2 ) \gamma= o\left(\left(p(1-p)/n\right)^{1/2}\right) γ = o ( ( p ( 1 − p ) / n ) 1/2 ) , that is, when t → 0 t \to0 t → 0 , so that no test with one graph per group has a small total error. Theorem 1(i) makes this quantitative for m m m graphs per group, since for every graph size and every t < 1 t < 1 t < 1 a test with errors ( α , β ) (\alpha,\beta) ( α , β ) needs m ≥ 6 ( 1 − t ) c α β / t 3 m \ge6(1-t)c_{\alpha\beta}/t^3 m ≥ 6 ( 1 − t ) c α β / t 3 graphs, and signed triangles attain this order (Theorem 1(ii)). The excess triangle statistic in our experiments is the T 3 T_3 T 3 statistic of Gao and Lafferty [ [25 ] . We use existing statistics and characterize when they are optimal and what they cost. The effect of shuffled labels on the power of aligned tests is studied by Saxena and Lyzinski [ [58 ] . Chen et al. [ [19 ] observe that misalignment hurts changepoint localization when the change lies in the joint law of the latent positions, and is nearly harmless when it lies in their marginal law. This is close in spirit to our distinction between orders of visibility.
Detection thresholds and small subgraphs. Contiguity of block models and Erdős–Rényi graphs below the Kesten–Stigum threshold, and the role of cycle counts, are due to Mossel et al. [ [52 ] , Banerjee [2018] and Banerjee and Ma [ [3 ] , building on small subgraph conditioning Janson [ [32 ] . The multilayer, aligned analogue is treated by Chatterjee et al. [ [15 ] . Other one-graph problems where the choice of cycle order matters include:
signed polygons for degree-corrected models [33 ] ;
latent geometry, where signed triangles can be optimal [13 ] or suboptimal compared with 4-cycles [4 ] ;
planted subgraphs [67 , 24 ] .
Correlation detection between unlabeled graphs [64 , 48 , 21 , 1 ] asks whether two graphs share a hidden alignment, which is a different problem from ours.
Invariant polynomials and low-degree methods. Low-degree lower bounds exploit invariance under relabelling, and invariant polynomials are combinations of subgraph counts [40 , 41 , 14 ] . Testing between two structured models has recently been studied in this framework for one graph [56 , 61 ] . Our lower bounds are information-theoretic and exploit independence across graphs.
Fluctuations of subgraph counts. The fluctuations of subgraph counts in graphon models are Gaussian at scale n − 1 / 2 n^{-1/2} n − 1/2 when the graphon is irregular with respect to the motif. When it is regular, they are of smaller order and possibly non-Gaussian [31 , 6 , 35 , 16 ] . Resampling methods for network moments include Green and Shalizi [2022], Lin et al. [2020] and Zhang and Xia [2022].
Learned two-sample tests and graph neural networks. Kernel and learned two-sample tests [30 , 44 , 45 , 36 , 39 ] become permutation-invariant graph tests once the features are invariant. The expressive power of message passing on graphons is characterized by tree densities [28 , 9 ] (Böker 2023). The same features are used to evaluate graph generative models [66 , 54 , 63 , 38 ] .