Phase transition in noisy high-dimensional random geometric graphs

We study the problem of detecting latent geometric structure in random graphs. To this end, we consider the soft high-dimensional random geometric graph $\mathcal{G}(n,p,d,q)$, where each of the $n$ vertices corresponds to an independent random point distributed uniformly on the sphere $\mathbb{S}^{d-1}$, and the probability that two vertices are connected by an edge is a decreasing function of the Euclidean distance between the points. The probability of connection is parametrized by $q \in [0,1]$, with smaller $q$ corresponding to weaker dependence on the geometry; this can also be interpreted as the level of noise in the geometric graph. In particular, the model smoothly interpolates between the spherical hard random geometric graph $\mathcal{G}(n,p,d)$ (corresponding to $q = 1$) and the Erd\H{o}s-R\'enyi model $\mathcal{G}(n,p)$ (corresponding to $q = 0$). We focus on the dense regime (i.e., $p$ is a constant). We show that if $nq \to 0$ or $d \gg n^{3} q^{2}$, then geometry is lost: $\mathcal{G}(n,p,d,q)$ is asymptotically indistinguishable from $\mathcal{G}(n,p)$. On the other hand, if $d \ll n^{3} q^{6}$, then the signed triangle statistic provides an asymptotically powerful test for detecting geometry. These results generalize those of Bubeck, Ding, Eldan, and R\'acz (2016) for $\mathcal{G}(n,p,d)$, and give quantitative bounds on how the noise level affects the dimension threshold for losing geometry. We also prove analogous results under a related but different distributional assumption, and we further explore generalizations of signed triangles in order to understand the intermediate regime left open by our results.


Introduction
Random graphs emerge as canonical models for many real-life applications, including social networks, wireless communications, and in the biological sciences.Among them, the simplest yet structurally rich model is the Erdős-Rényi random graph, which has been studied extensively (e.g., [6,17]).However, in many scenarios the independence of edges is an oversimplified assumption and is often insufficient to capture the subtle relations in complex networks.
A natural extension is to assume an underlying geometric structure.The graph is then generated according to some dependency over this structure.Due to their wide applicability, random graphs of this kind have various incarnations in different fields: random geometric graphs, latent space models, spatial networks, random connection models, to name a few.We refer the reader to [28] for a comprehensive theoretical treatment of the subject.
In real-world networks, the geometric space is often latent, not visible.Most of the time, only the graph structure is observable rather than the latent variables that generated the graph.For example, in a communication network, we can only observe the connections but not the reasons behind links.This brings up the natural question of understanding the extent to which a latent space model is an accurate description.As a first step, it is crucial to understand when it is possible to even detect the presence of geometry, which is necessary for justifying the underlying geometric structure assuming a generating process.Mathematically this was first studied by Devroye, György, Lugosi, and Udina [14] for a particular random geometric graph equipped with a spherical geometry.They showed that this random geometric graph becomes indistinguishable from an Erdős-Rényi graph when the dimension of the sphere goes to infinity.In other words, geometry is lost in high dimensions.Subsequently, Bubeck, Ding, Eldan, and Rácz [10] pinpointed the phase transition for testing high-dimensional geometry in dense random graphs.Our paper builds upon and generalizes this result.
A caveat of the aforementioned results is that the model is restricted to a "hard geometry" setting, where the existence of an edge is a deterministic function of the distance between the latent variables corresponding to the two vertices.This assumption overlooks the fact that in reality connections often bear a stochastic dependence on the latent variables.Consequently, the phase transition in the hard geometry setting happens at dimensions as high as the cube of the number of vertices, seemingly much larger than what many high-dimensional statistics theories would consider [37].
Our focus in this paper is to understand the above question in the setting of soft random geometric graphs, in which the softness can be viewed as noise in the geometric graph.We are particularly interested in the interplay between dimensionality and noise in affecting the phenomenon of losing geometry in random graphs.To this end, we study a particular type of soft random geometric graph where there is a parameter q ∈ [0, 1] that naturally reflects the level of noise, corresponding to the strength of geometry.This model is an interpolation between the hard spherical random geometric graph (corresponding to q = 1) and the Erdős-Rényi model (corresponding to q = 0).Our main results provide bounds, as a function of both dimension and geometry strength, of where the phase transition lies.In particular, these quantitatively demonstrate the qualitative phenomenon that the dimension threshold for losing geometry is smaller for soft random geometric graphs and decreases as a function of geometry strength.We next specify the precise setting of our work, before describing our main results.

Random geometric graphs
We first describe the spherical random geometric graph model G(n, p, d) [10,14].For a set of n vertices V = [n] := {1, 2, . . ., n}, associate each vertex i with a point represented by a d-dimensional random vector x i .We assume that x 1 , . . ., x n are independently uniformly distributed on the sphere S d−1 := {x ∈ R d : x = 1}, where • stands for the Euclidean norm.For a fixed value of p ∈ [0, 1], referred to as the edge probability, the edge set of the graph is defined as follows: There is an undirected edge between distinct vertices i and j if and only if where •, • denotes the inner product of two vectors.Equivalently, i and j are connected by an edge if and only if their Euclidean distance satisfies x i − x j ≤ 2(1 − t p,d ).The threshold t p,d , which may depend on p and d, is determined by the equation P( x i , x j ≥ t p,d ) = p, so that the probability of an edge existing between any pair of distinct vertices is p.Conditioning on the vectors x 1 , . . ., x n , the edges in the graph are deterministic.The only source of randomness in G(n, p, d) comes from the random points.For this reason, the random graph defined above is referred to as a hard random geometric graph.
More generally, the model above may be extended by adding additional randomness to the edge generation process, given the latent positions.That is, for any connection function φ : R → [0, 1], we may connect i and j with probability φ( x i , x j ).Formally, let i ∼ j denote the event that there exists an undirected edge between i and j.Then, P(i ∼ j | x 1 , . . ., x n ) = φ( x i , x j ).
(1.2) This is equivalent to connecting i and j with probability φ(1 − x i − x j 2 /2).When the connection function is an indicator function φ(x) = ½{x ≥ t p,d }, we obtain the hard random geometric graph defined previously.For general connection functions, which are typically nondecreasing, 1 such random graphs are referred to as soft random geometric graphs.
Denote by K = [k i,j ] the connection matrix defined by k i,j := φ( x i , x j ).For a simple graph G = (V, E), where V is the set of vertices and E is the set of edges, let A = [a i,j ] be its adjacency matrix, where a i,j = 1 if i ∼ j and a i,j = 0 otherwise for all i, j ∈ V .Denote by X ∈ R n×d the matrix whose rows are the random vectors x 1 , . . ., x n .For a soft random geometric graph with connection matrix K, conditioning on X, ½{i ∼ j} is an independent Bernoulli random variable with parameter k i,j .The distribution of the soft random geometric graph is then specified by We focus on a particular family of soft random geometric graphs which are parametrized by the strength of the underlying geometry.The connection function in these models is a linear interpolation between a constant p ∈ [0, 1] and a step function s t : R → {0, 1} defined as s t (x) := ½{x ≥ t}.Concretely, we consider the following connection function with parameter q ∈ [0, 1]: φ q (x) := (1 − q)p + qs t (x), (1.4) where q controls the strength of the geometry.The threshold t is similarly determined by forcing the edge probability to be p: P(i ∼ j) = E[φ q ( x i , x j )] = p, which gives t = t p,d equal to the threshold in the definition of G(n, p, d).We denote by G(n, p, d, q) the soft random geometric graph equipped with the connection function φ q .When q = 1, the graph becomes the hard random geometric graph G(n, p, d).When q = 0, each edge of the graph is generated independently with probability p, corresponding to the well-known Erdős-Rényi graph G(n, p) that does not possess geometry.As an illustration, φ q (x) is plotted against the connection functions of G(n, p) and G(n, p, d) in Figure 1.
Another view of G(n, p, d, q) is as a hard random geometric graph with independently resampled edges.Starting with a sample graph from G(n, p, d), for each pair of vertices in the graph, we flip a biased coin with head probability q.If the coin shows head, we keep the edge/non-edge between them; otherwise, we resample the connection, creating an edge independently with probability p.

Main results
We are interested in whether it is possible to detect the underlying geometric structure, which we formulate as the following hypothesis testing problem.The null hypothesis is that the observed graph G is a sample from the Erdős-Rényi model with probability p: The alternative hypothesis is that the graph is a soft random geometric graph with dimension d and geometry strength q: The hypothesis testing problem can be understood through the guarantees for the total variation distance between the two distributions.Our findings are summarized in the following theorem.
Theorem 1.1(a) specifies a lower bound for detection: If nq → 0 or d ≫ n 3 q 2 , then no test can detect geometry; G(n, p, d, q) is asymptotically indistinguishable from G(n, p).On the other hand, Theorem 1.1(b) provides an upper bound: If d ≪ n 3 q 6 , then there exists an asymptotically powerful test for detecting geometry.Specifically, we will show that the signed triangle statistic of Bubeck et al. [10] (which in particular is computationally efficient) works in this regime to distinguish the two models.
Recall that G(n, p, d, q) becomes G(n, p, d) in the special case when q = 1.In this case Theorem 1.1 recovers the results of Bubeck et al. [10], showing that d ≍ n 3 is the dimension threshold for losing geometry.
In general, both the impossibility and possibility results in Theorem 1.1 depict a polynomial dependency on q.However, the polynomials have different powers of q, which means there exists a gap between the lower and upper bounds.We believe that the phase transition for losing geometry in G(n, p, d, q) happens at a certain power of q; currently we do not have a good conjecture for the critical power.
In the impossibility statement, the bound behaves differently in two regimes: d ≫ n and d ≪ n.The result is a kink at d ≍ n in the phase diagram (see Figure 2).This may be due to the Wishart matrix being singular when d < n.
Theorem 1.1 can be displayed graphically by a phase diagram of when geometry can be detected and when it cannot in the space of dimension d and geometry strength q.We further introduce a more convenient parametrization that allows us to visualize the phase diagram.
The resulting phase diagram is plotted in the two-dimensional space of α and β in Figure 2.Here d = n α and q = n −β for some α, β > 0.

Related work
The study of high-dimensional random geometric graphs originates in the work of [14], who showed via the multivariate central limit theorem that geometry is lost in high dimensions.Subsequently, Bubeck et al. [10] determined that the phase transition of losing geometry happens asymptotically at dimension d ≍ n 3 in the dense setting (for a fixed p ∈ (0, 1)).This work also pointed out connections to classical random matrix ensembles, showing that the Wishart to GOE transition also happens at d ≍ n 3 (see also [9,12,21,31,32]).Eldan and Mikulincer [15] further extended the results to an anisotropic setting of the underlying distribution of points.In the sparse setting, when p vanishes as a function of n, it is conjectured in [10] that geometry should be lost at much lower dimensions.Progress towards this conjecture, which in particular breaks the n 3 barrier, was made by Brennan, Bresler, and Nagaraj [7].This is an active line of research; after we finished this work, we learned about a new preprint by Brennan, Bresler, and Huang [8] on understanding the Wishart to GOE transition when only a subset of entries are revealed.Soft random geometric graphs arise as natural models in many areas, including wireless communication [18], social networks [20], and biological networks [35].Penrose [29] studied the connectivity of soft random geometric graphs from a modern probability-theoretic perspective, determining the asymptotic probability of connectivity in fixed dimensions and for a broad class of connection functions.Dettmann and Georgiou [13] discussed the same questions from a statistical physics viewpoint in two and three dimensions, and provided a comprehensive list of connection functions widely used in practice.Connectivity in one-dimensional soft random geometric graphs was considered in [39], where the authors showed that the reason for connectivity is vastly different from the hard case.Parthasarathy et al. [27] studied a model of perturbed networks, which is similar to the setting under consideration in our work.A phase transition in soft random geometric graphs with a critical value of chemical potential was demonstrated in [26], where a related model was also considered.Our paper can be viewed as a first step towards understanding the questions described in the previous paragraph for soft random geometric graphs.
Following up detecting geometry, a natural next question is to recover it; indeed, a line of research focuses on recovering the underlying latent positions of soft random geometric graphs.In [34], it is shown that latent positions for random dot product graphs can be estimated consistently using the eigendecomposition of the adjacency matrix, when the dimension d is fixed.Several subsequent works [2,3,16] applied similar approaches to kernels and general connection functions on spheres satisfying certain eigengap conditions.

Open problems
The most immediate problem that our work leaves open is to understand the intermediate region not covered by Theorem 1.1.Specifically, the main question is to determine the exact boundary between the two phases where the limiting total variation distance transitions from 1 to 0. The existence of an intermediate phase where detection is information-theoretically possible while no efficient algorithm exists is also worth studying.
More broadly, a natural direction of future research is to consider these questions for other connection functions or underlying latent spaces, in order to understand how the dimension threshold for losing geometry depends on them.

Outline of the paper
The rest of the paper is organized as follows.In Section 2, we introduce some notations used throughout the paper and several standard definitions.The impossibility of detection is presented afterwards in Section 3, where the two regimes of Theorem 1.1(a) are proved.Section 4 consists of the proof of Theorem 1.1(b) using the signed triangle statistic.Generalizations of signed triangles are also discussed.Finally, in Section 5 we show that similar results also hold under a different distributional assumption, when the underlying latent vectors are i.i.d.standard normal, and we consider the corresponding random dot product graph.

Notations and preliminaries
We use boldface capitals to denote matrices, and their corresponding lower cases with subscript indices separated by a comma to denote the entries.For example, a matrix A = [a i,j ] has entry a i,j in its ith row and jth column.We use • to denote the Hadamard product, which is the entrywise product of two matrices.Boldface lowercase letters represent vectors, and their corresponding lower cases with a subscript index denote the entries of the vector.All vectors are treated as columns.
Definition 2.1 (f -divergence).Let P and Q be two probability measures on the same measurable space (Ω, F).Suppose that P is absolutely continuous with respect to Q.For a convex function f such that f (1) = 0, the f -divergence of P and Q is defined as where dP dQ is the Radon-Nikodym derivative of P with respect to Q.In Definition 2.1, by choosing f (t) = t log t, we have the Kullback-Leibler (KL) divergence, which we simply refer to as the divergence.Throughout the paper, log stands for the natural logarithm.Definition 2.2 (Kullback-Leibler (KL) divergence).Let P and Q be two probability measures on the same measurable space (Ω, F).Suppose that P is absolutely continuous with respect to Q.The (KL) divergence of P and Q is defined as Definition 2.3 (Total variation distance).Let P and Q be two probability measures on a measurable space (Ω, F).The total variation distance between P and Q is defined as The total variation distance can also be viewed as an f -divergence with f (x) = 1 2 |x − 1|.The total variation distance is simply referred to as the distance where no confusion is caused.From the definition, it is clear that the distance between P and Q is symmetric.That is, We use several inequalities concerning f -divergences in the proofs; we state these later before they are applied.The divergence and the distance are connected through Pinsker's inequality.Proposition 2.4 (Pinsker's inequality).For probability measures P and Q, we have that

Impossibility of detecting geometry
In this section we prove the impossibility results stated in Theorem 1.1(a).We start our discussion with some weaker bounds obtained through a simple mixture argument, before proceeding to the proof of the main impossibility results.We may view the soft random geometric graph G(n, p, d, q) as an edge-wise mixture between G(n, p) and G(n, p, d), in the following way.First, we draw two sample graphs G 1 ∼ G(n, p) and G 2 ∼ G(n, p, d).We next construct a graph G using G 1 , G 2 , and additional coin flips.Specifically, for every pair of distinct vertices i and j, we flip an independent biased coin which comes up heads with probability q.If the coin flip is heads, connect i and j with an edge in G if and only if they are connected with an edge in G 2 ; otherwise, connect i and j with an edge in G if and only if they are connected with an edge in G 1 .This construction guarantees that G ∼ G(n, p, d, q).
We can obtain two simple bounds directly from this construction.Bubeck et al. [10, Theorem 1(c)] showed that G(n, p) and G(n, p, d) become indistinguishable when d ≫ n 3 .Thus, as an edge-wise mixture of these two models, G(n, p, d, q) also cannot be distinguished from G(n, p) in this regime.
Meanwhile, when q ≪ 1/n 2 , for any pair (i, j) the probability that the connection between i and j is sampled from G 2 is o(1/n 2 ).This implies that the expected number of edges that are sampled from G 2 is o(1).Therefore, by Markov's inequality, the probability that there exists an edge which is sampled from G 2 is o(1).Hence, with probability 1 − o(1) we have that G = G 1 in the construction above.Therefore, G(n, p) and G(n, p, d, q) are indistinguishable when q ≪ 1/n 2 .These two arguments are summarized in the following claim.TV(G(n, p), G(n, p, d, q)) → 0.
Our main result in Theorem 1.1(a) improves on Claim 3.1 by relaxing both of the conditions and thus proving the impossibility result for a larger parameter regime.First, notice that the condition n 3 /d → 0 does not take q into consideration at all; we improve this to the condition n 3 q 2 /d → 0. We also improve the condition n 2 q → 0 to nq → 0.
As before, if we set d = n α and q = 1/n β for some α, β > 0, then Claim 3.1 translates into the following corollary picturing a region of a phase diagram.

Impossibility of detection under large noise
In this subsection we show that G(n, p) and G(n, p, d, q) are asymptotically indistinguishable when nq → 0, thus proving Theorem 1.1(a) under this regime.This shows that when the noise is large enough (i.e., q is small enough), detecting geometry becomes impossible, regardless of the dimensionality.
For a graph G with adjacency matrix A = [a i,j ], the density P G(n,p,d,q) (G) is given in (1.3) with k i,j = φ q ( x i , x j ).We can write the density of G(n, p) similarly: The divergence of G(n, p) and G(n, p, d, q) can then be written as , where the a i,j 's are independent Bernoulli random variables with parameter p since the expectation is taken under G ∼ G(n, p).Since − log is convex, by Jensen's inequality we have that where the last line is due to linearity of expectation and independence.
Since a i,j ∼ Bern(p), we have E[a i,j ] = p and E[1 − a i,j ] = 1 − p.By the definition of the connection function in (1.2) and (1.4), we have that Recall that t p,d is chosen such that P( x i , x j ≥ t p,d ) = p.Hence, the marginal distribution of k i,j satisfies k i,j = (1 − q)p + q with probability p and k i,j = (1 − q)p with probability 1 − p.Therefore, we have that and By the elementary inequality log(1 + x) ≥ x − x 2 for x ≥ −1/2, we obtain that for 0 ≤ q ≤ 1/2, Inserting the above estimates into (3.2),we conclude that for To be consistent with the main discussion, we turn this upper bound on the divergence into an upper bound on the distance.An application of Pinsker's inequality (Proposition 2.4) combined with (3.5) proves the following theorem.Theorem 3.3.For 0 ≤ q ≤ 1/2 we have that The nq → 0 regime of Theorem 1.1(a) directly follows from Theorem 3.3.

Impossibility of detecting weak high-dimensional geometry
In this subsection we show that G(n, p) and G(n, p, d, q) are asymptotically indistinguishable when n 3 q 2 /d → 0, proving Theorem 1.1(a) under this regime.This result thus highlights the interplay between noise and dimensionality in determining when it is possible to detect geometry.
In order to capture this interplay between noise and dimensionality, we use several inequalities concerning f -divergences, and we start by recalling these.The distance (divergence) between two random variables is understood as the distance (divergence) between their corresponding probability measures.Since we focus our attention on random graphs without self-loops, the diagonal entries of real symmetric matrices are usually set to zero unless specified.For the distance (divergence) between two real symmetric random matrices, only the lower triangular part is considered.We also place notations for distributions inside the operators E, Var to denote a sample from the corresponding distribution.Proposition 3.4 (Conditioning increases divergence).Let P X and Q X be two probability measures.Let Y be a random variable on the same space and denote by P X|Y and Q X|Y the conditional laws.Then, the f -divergence satisfies Proposition 3.4 is usually referred to as "conditioning increases divergence" in standard texts (e.g., Theorem 2.2(5) and Remark 4.2 in [30]).Following the convention widely adopted in the information theory community, we write KL(P X|Y Q X|Y | P Y ) := E Y KL(P X|Y Q X|Y ) and call it the conditional divergence.Proposition 3.5 (Data processing inequality).For two probability distributions P X and Q X , consider the joint distributions A simple proof of Proposition 3.5 using Jensen's inequality can be found in most texts (see, e.g., [30,Theorem 6.2]).For a measurable function g : E → F , by choosing we have the following corollary.
Corollary 3.6 (Data processing inequality).Let X, Y ∈ E be two random variables and let g : E → F be a measurable function.Then, the f -divergence of the pushforward measures satisfies With these preliminaries in place, we now turn to our question of interest.Let Z ∈ R n×d be a random matrix with independent standard normal entries.Then, W := ZZ ⊤ ∈ R n×n has a Wishart distribution W n (I, d).Let Y contain the off-diagonals of W scaled by the square root of the dimension, that is, y i,j := w i,j / √ d.By the central limit theorem, y i,j converges to a standard normal random variable as d → ∞.Let V := 1 d diag(W ) consist of the scaled diagonals; by the law of large numbers, each nonzero entry v i,i converges to 1.For compactness of presentation, denote by v the vectorized diagonal of V , that is, v i := w i,i /d.Let M = [m i,j ] be a zero-diagonal symmetric random matrix with off-diagonal entries m i,j following independent standard normal distributions for 1 ≤ i < j ≤ n.Let M ′ and M ′′ be two independent copies of M .
A standard method to create uniform random vectors on the sphere (which goes back to [23] and before) is as follows: If z is a standard normal vector, then ẑ := z/ z is uniformly distributed in S d−1 .Thus, we can create the random vectors {x i } n i=1 using {z i } n i=1 .With the random matrices defined above, the inner product of x i and x j can be expressed as Define the step function s tp (x) := ½{x ≥ t p }, where t p is determined by E[s tp (N (0, 1))] = p.
That is, if we denote the cumulative distribution function of the standard normal distribution by Φ, then In what follows, when we apply a univariate function to a matrix, it is applied entrywise, resulting in a matrix of the same shape.With this convention, let By the definition of G(n, p) and the independence of entries of M ′ , where we use the standard convention that 0 0 = 1.By (1.4) and the definition of m i,j , we can write Then, by (1.3) and the independence of the m i,j , Since G(n, p) and G(n, p, d, q) have the same conditional law given P and Q, respectively, by Proposition 3.5 we have that TV(G(n, p), G(n, p, d, q)) ≤ TV(P , Q).
Define the zero-diagonal symmetric random matrix B = [b i,j ] with b i,j , 1 ≤ i < j ≤ n, following an independent Bernoulli distribution with parameter q; the matrix B is also independent of everything else defined previously.We can then rewrite Q as For step functions with parameters t and t ′ , we have the simple relation: Hence, we can further express Q as Applying Proposition 3.4 gives Further, by Corollary 3.6 we have that . By the triangle inequality of the distance (see, e.g., [22, (4.6)]), For a fixed value of B, both H and H ′ consist of entries from two matrices.For the (i, j)th entry, if b i,j = 0, the entries are from M ′′ and M respectively; if b i,j = 1, they come from respectively.In the latter case, when V is fixed, we can multiply both entries by √ v i,i v j,j , and the distance between the new matrices stays the same by definition.That is, if we let Putting the bounds from above together, we obtain that (3.9) The first term on the right depicts the distance caused by normalization, while the second one characterizes the level of independence between edges.We deal with the two expectations E 1 and E 2 in (3.9) separately in the following two parts.Subsequently, we bring our estimates together to conclude at the end of the section.

Upper bound for the first expectation
By Pinsker's inequality and Proposition 3.4, where the last inequality is by Jensen's inequality.Given B and V , the entries of H ′ are independent.Since the entries of M ′ are also independent, we have that where we use the facts that m ′ i,j and m ′′ i,j are identically distributed and that the divergence of identical distributions is zero.Therefore, ).The divergence of two normal distributions has an explicit formula given by the following proposition, which appears in most standard texts (see, e.g., [5, exercise 1.30]).Proposition 3.7.For two normal distributions with means µ 1 , µ 2 and variances Applying Proposition 3.7, we have that Since the z i,j 's are independent standard normal random variables, We utilize a lower bound on the expected logarithm of a chi-square random variable shown by the following proposition.
Proof.We have the following explicit formula for the expected logarithm of X (see, e.g., [5, (B.30)]): where ψ is the digamma function defined by ψ(x) := Γ ′ (x)/Γ(x).The digamma function has the well-known upper and lower bounds (see [1, (2.2)] and references therein): By the lower bound in (3.10), and the estimate in Proposition 3.8, we have that Therefore, we conclude that

Upper bound for the second expectation
We now turn to estimating E 2 from (3.9).We first bound the divergence of M ′′ and H ′′ , assuming that B and V are fixed, and then provide an estimate for the distance between them through Pinsker's inequality (Proposition 2.4).The benefit of resorting to the divergence is the chain rule property.Our strategy resembles that of Bubeck and Ganguly [9].We state the chain rule for the divergence as the following proposition.
Proposition 3.9 (Chain rule).For joint distributions P X,Y = P X|Y P Y and Q X,Y = Q X|Y Q Y , the chain rule for the divergence reads For an n × n matrix A = [a i,j ], denote its kth order leading principal submatrix by A k and let a k = (a k,1 , . . ., a k,k−1 ) be the vector of the first k − 1 entries in the kth row.We also use Z k to denote the matrix composed of the first k rows of Z ∈ R n×d and z k to denote the kth row of Z.
Until the end of this section, we assume that B and V are fixed.Applying the chain rule to the divergence of H ′′ k+1 and M ′′ k+1 , we obtain ).The equality holds since h ′′ k+1 only depends on Z k and is independent of other randomness in ) be the diagonal matrix whose entries are the elements of b k+1 .Since As a general form of Proposition 3.7, we have an explicit formula for the divergence of two d-dimensional normal distributions (see, e.g., [37, Exercise 15.13(b)]), stated as follows.
Proposition 3.10.For two d-dimensional multivariate normal distributions with means µ 1 , µ 2 and covariance matrices Σ 1 , Σ 2 , we have that Since m ′′ k+1 ∼ N (0, I k ), applying Proposition 3.10, we have that Further, since V and D are independent, by linearity of expectation we have that Additionally, Therefore, we obtain that However, the log d factor above is an artifact due to the use of concentration inequalities; if we were to apply the lemma directly, it would show up in our final bounds.To address this, we present an improved result, which not only removes the log d factor in the upper bound but also tightens the upper bound such that it decays as 1/d instead of 1/ √ d.
Lemma 3.12.Assume 0 < p ≤ 1/2.There exists a constant C p such that Proof.By rotational invariance, fixing x 1 = e 1 and letting x 2 = ẑ := z/ z with z ∼ N (0, I d ), we have that Then, by symmetry of the distribution, we have Therefore, For ease of presentation, we switch from dimension d to considering dimension d + 3.By the probability density function of the beta distribution we have that The change of variables x = z/d, and some rearranging, yields Wendel's double inequality (see [38, equation (7)]) states that for 0 < s < 1, Then, by setting s = 1/2 and z = d/2, we have that Thus, where the last inequality is due to the fact that we have where F (x; a, b) is the cumulative distribution function of the gamma distribution Gamma(a, b).Therefore, putting these inequalities back into (3.14),we obtain that ) is also the distribution of a squared standard normal random variable, By the monotonicity of the cumulative distribution function, we have that Let ϕ be the probability density function of the standard normal distribution.Then, Additionally, for d ≥ 2, Therefore, for d ≥ 2 we have that Then, .
By assuming d ≥ 6, where ).Similarly, we also have dx.
Employing (3.15) and (3.16) again, we have Then, Therefore, we have that Hence, by assuming d ≥ 6, where Remark 3.13.From the proof of Lemma 3.12, we see that the lemma actually specifies a convergence rate for the quantile function of a scaled beta distribution to that of a gamma distribution.More general claims and a Berry-Esséen type result can be derived with the same techniques.
Corollary 3.14.For p ∈ (0, 1), there exists a constant C p such that Proof.Applying Lemma 3.12 for 0 < p ≤ 1/2, we have that there exists a constant C ′ p such that As before, by fixing x 1 = e 1 and letting x 2 = ẑ := z/ z with z ∼ N (0, I d ), we have Since z 1 / z has a symmetric distribution, we have t p,d ≥ 0 for 0 < p ≤ 1/2 and t p,d ≤ 0 for Applying Lemma 3.12 again, we obtain that there exists a constant C ′′ p such that By taking C p = C ′ p + C ′′ p , the claim directly follows.
We now return to bounding the two terms in (3.13), starting with the first one.Let ℓ := Tr(D k ) be the number of nonzero entries in b k+1 .Then, ℓ is a function of B, is independent of everything else, and has a binomial distribution.Corollary 3.14 gives (3.17) Next, we turn to the upper bound for the second term in (3.13).Let Π be a permutation matrix such that b k+1 Π = (1, . . ., 1, 0, . . ., 0) becomes a vector with its first ℓ entries equal to 1 and the remaining k − ℓ entries equal to 0. Then, where O is the all-zero matrix and S is distributed the same as Z ℓ Z ⊤ ℓ /d.Recall that Z ℓ ∈ R ℓ×d is the matrix of the first ℓ rows of Z, which has independent standard normal entries.Since Π is a permutation matrix, its determinant is either 1 or −1.Therefore, we have that (3.18)So our main focus is bounding (3.18) from above.
The study of covariance matrices has attracted broad interests in probability and statistics communities.As an example, Cai, Liang, and Zhou [11] showed a central limit theorem (CLT) for the log-determinant of such matrices.An upper bound of the expected negative log-determinant is given in [9] under a general log-concave measure assumption, serving as the major step towards an entropic CLT.We first state their result as the following lemma.Lemma 3.15 ([9, Lemma 2]).Let Z be an n×d random matrix with i.i.d.entries from a log-concave probability measure µ with zero mean and unit variance.There exists an absolute constant C > 0 such that for d ≥ Cn 2 , A direct application of Lemma 3.15 results in an upper bound that is loose for our analysis.It is possible to leverage the normal distribution assumption to obtain an improved estimate, which we implement in Lemma 3.16 below.Applying the lemma results in a better upper bound on the distance.
Lemma 3.16.Consider an n × d matrix Z with independent standard normal entries.For d ≥ 2n, Remark 3.17.Compared to Lemma 3.15, the improvement thanks to Lemma 3.16 is twofold.First, the upper bound removes the n/d term, which would be the leading term in our analysis, replacing it with an n/d term.Second, the inequality holds for d ≥ 2n rather than d ≥ Cn 2 .We shall see how this improvement is reflected in the upper bound on the distance in the final remarks.
Proof of Lemma 3.16.For a random matrix W following a Wishart distribution W n (Σ, d), the expectation of its log-determinant has an explicit formula (see, e.g., [5, (B.81)]): where ψ is the digamma function.Applying (3.19) to ZZ ⊤ , we obtain By the lower bound on the digamma function in (3.10), The rest of the proof is devoted to bounding the two sums S 1 and S 2 from above separately.By the elementary inequality x ≤ − log(1 − x), S 1 can be bounded from above by Further, by − log(1 − x) ≤ 2x for 0 ≤ x ≤ 1/2, we have that for d ≥ 2n, For S 2 , we show a lower bound by constructing a continuous integral.Since log(d As a consequence of Lemma 3.16, there is an absolute constant C > 0 (we can take C = 5), such that for d ≥ 2n ≥ 2k ≥ 2ℓ, Plugging the estimates in (3.17) and (3.23) into (3.13),we get that for d ≥ 2n, for constants C, C p .Since b i,j has an independent Bernoulli distribution, ℓ = k j=1 b k+1,j follows a binomial distribution Bin(k, q).Hence, we have E[ℓ] = kq, and E[ℓ 2 ] can be bounded from above by Therefore, by taking the expectation over B in (3.24), we obtain that for d ≥ 2n, An iterative application of the chain rule yields Therefore, for d ≥ 2n, for some C, C p < ∞.By Pinsker's inequality (Proposition 2.4) and Jensen's inequality, we have that Hence, using (3.25) we conclude that there exist C, C p < ∞ such that for d ≥ 2n, (3.26)

Concluding the proof
Plugging the estimates in (3.11) and (3.26) into (3.9),we have proven that there exist constants C, C p such that for d ≥ 2n, We now explain why the n 3 q 2 /d → 0 regime of Theorem 1.1(a) follows.First, note that n 3 q 2 /d = (nq) 2 n/d.Thus, if we were to have d < 2n, then n 3 q 2 /d → 0 implies that nq → 0, and under this assumption we have already shown in Section 3.1 that the conclusion of Theorem 1.1(a) holds.So we may assume that d ≥ 2n, in which case the bound in (3.27) holds.Then, n 3 q 2 /d → 0 implies that the last term in (3.27) goes to 0. For the second term, note that n 2 q/d = (n 4 q 2 /d 2 ) 1/2 ≤ (n 3 q 2 /d) 1/2 , where we used that d ≥ n, and so this term also vanishes.This implies that the first term vanishes as well.
Remark 3.18.Using Lemma 3.15 in the place of Lemma 3.16 and following the same derivations, we would similarly obtain that for constants In this case, the dominating term becomes 4 n 3 q/d, resulting in a worse bound than (3.27), and hence the conclusion follows only in a smaller parameter regime.
Remark 3.19.Utilizing Lemma 3.16, an upper bound of the total variation distance between Wishart and GOE is readily available.Applying chain rule directly to the divergence between Y and M , we conclude that for an absolute constant C > 0, This result removes the first term and log factors of Theorem 2 in [9] in this special case, and coincides with the exact formula given by Rácz and Richey [32] up to a multiplicative constant.

Detecting geometry using signed triangles and other statistics
In this section, we explore when detecting geometry in G(n, p, d, q) is possible and how to detect it.
In particular, we demonstrate that the signed triangle statistic, proposed by Bubeck et al. [10], can be used to detect latent geometric structure whenever n 3 q 6 /d → ∞, thus proving Theorem 1.1(b).We also provide evidence suggesting that this boundary cannot be improved with the family of signed cliques and of signed cycles, which are natural extensions of signed triangles.Consider a simple graph G = (V, E), where V is the set of vertices and E ⊂ V 2 is the set of edges.For a set S, we use S k to denote the collection of all subsets of S with cardinality k.Let A = [a i,j ] be the adjacency matrix of G and write a e := a i,j for any edge e = {i, j} ∈ V 2 .Let H = (S, F ) be another graph with S ⊂ V and F ⊂ S 2 .Define I H|G to be the indicator of H being a subgraph of G.When the graph G is clear from the context, we simply write I H instead of I H|G .Then, Further, for a constant p ∈ [0, 1], let be the signed indicator of the subgraph H.We first state a lemma that connects the expected signed indicator in G(n, p, d, q) to that in G(n, p, d).
Proof.By conditioning on X, where the last equality is by conditional independence of edges.
Given x i and x j , a i,j is a Bernoulli random variable with parameter Hence, Therefore, On the other hand, for a hard random geometric graph G(n, p, d), We first consider the graph H = (S, F ) being a complete graph on three vertices, namely a triangle.Since in this case the subgraph H is fully determined by its vertex set S, we denote T S := I H to emphasize the dependency.Given the adjacency matrix A of G, T S can be expressed as Then, the total number triangles in G, denoted by T 3 (G), can be written as The signed triangle and its count in G, following the proposal by Bubeck et al. [10], are defined as (a e − p) and τ 3 (G) := {i,j,k}⊂V τ {i,j,k} .
For a sample random graph G with edge probability p, τ 3 (G) is called the signed triangle statistic.
To simplify our presentation, for random graphs with edge probability p, we let a i,j := a i,j − E[a i,j ] = a i,j − p and s i,j := s t p,d ( x i , x j ) − p.
For G(n, p), by the analyses in [10, Section 3.1], we have that We analyze the expectation and variance of the signed triangle statistic in G(n, p, d, q) in the following two subsections.For expository purposes, we start with the special case when p = 1/2, and then proceed to the general case when p is fixed in (0, 1).

The case p = 1 2
In this case, due to the symmetry of the distribution, the threshold satisfies t 1/2,d = 0, which no longer depends on the dimension.As a result, the vectors that have an inner product greater than or equal to the threshold with a fixed vector lie in a half space instead of a cone, thus allowing a projection argument.Utilizing the explicit distribution function in the projected space, we are able to obtain asymptotically tight bounds for both the expectation and the variance of the signed triangle statistic.Some results can also be derived as corollaries from more general statements in [15].However, we include our much simplified proofs for completeness and as preparations for further claims.
Recall that the threshold t p,d is determined by E[s t p,d ( x i , x j )] = P( x i , x j ≥ t p,d ) = p.When p is set to 1/2, by symmetry of the distribution, we have t p,d = 0.Then, the connection probability becomes k i,j = 1 2 (1 − q) + qs 0 ( x i , x j ).(4.9) Let x 1 , x 2 , x 3 be independent random vectors uniformly in S d−1 .Consider the event We first give asymptotically tight bounds for P(E ∆ ) via a geometric argument.

Estimating the expectation
Before starting our main discussion, we present a proposition which gives an explicit probability density function for the angle between two uniform random vectors in S d−1 .Note that the probability density expressed by sin and gamma functions was also derived in [10,19] using different approaches.
If we further assume that x, y ∈ S d−1 , then θ(x, y) = arccos x, y .
Proposition 4.2.The angle between two uniformly random vectors in S d−1 has the probability density function where is the normalization factor.
Proof.Let z ∼ N (0, I d ).Then, ẑ := z/ z is a uniform random point in S d−1 (see [24], also [23,25]).By rotation invariance on the sphere, we can fix one vector to be e 1 , the first vector of the standard basis in R d .Then, the cumulative distribution function of the angle satisfies Since the z i 's are standard normal random variables, z 2 1 ∼ χ 2 (1) and . By the definition of the beta distribution, where B(x, y) = Γ(x)Γ(y)/Γ(x + y) is the beta function.Taking the derivative with respect to θ, we have that where the last equality is by symmetry of the distribution.Hence, Lemma 4.3.For E ∆ defined in (4.10), we have Proof.We fix the plane determined by x 1 and x 2 , and then project x 3 onto this plane.Since no direction in this plane is unique, the projected direction of x 3 is uniform on the circle centered at the origin.Conditioning on x 1 and x 2 , { x 1 , x 3 ≥ 0, x 2 , x 3 ≥ 0} happens if and only if the projection of x 3 falls into the intersection of two half spaces with normal vectors x 1 and x 2 .Therefore, Hence, the joint probability The density of θ(x 1 , x 2 ) is given by Proposition 4.2.Then, A simple calculation gives The above display together with the definition of ζ yields (4.12) Putting all the above together, we obtain With Lemma 4.3, we are able to estimate the expectation of the signed triangle statistic in G(n, 1/2, d, q).Lemma 4.4.There exist absolute constants C, C ′ > 0 such that Proof.By (4.4), the expectation of the signed triangle τ {1,2,3} satisfies By rotation invariance on the sphere, we may fix the direction of x 1 to be e 1 .Then, Thus, by expanding the product in (4.1.1)and using the linearity of expectation, we obtain Inserting Lemma 4.3 yields Since all signed triangle indicators are identically distributed, The claim directly follows.

Estimating the variance
The variance of Expanding the squares of sums and by linearity of expectation, we can decompose the variance into one summation of variances and three summations of covariances; they are grouped by the number of shared vertices.Since the variances or the covariances are identically distributed within each group, we can rewrite them as where and the coefficients arise from simple combinatorial computations.We bound the variance and covariances in the following parts respectively.Two signed triangles that do not share any vertices are independent, which implies that Thus, we have that V {1,2,3},{4,5,6} = 0.
For two signed triangles sharing a single vertex, by rotation invariance on the sphere, if we fix the direction of the shared vertex to be e 1 , they are also independent, which gives
For two signed triangles on exactly the same vertices, That is, V {1,2,3},{1,2,4} is bounded between absolute constants.As a last step, for a pair of triangles sharing exactly two vertices, the following lemma provides asymptotically tight bounds for the expectation of their product.G(n, p, d, q) satisfies Proof.By the definition of signed triangles and conditional independence of edges given X, Further by (4.3) and rotation invariance, we have The last equality holds since x 3 and x 4 are identically distributed.Recall that θ(x 1 , x 2 ) denotes the angle between x 1 and x 2 .The conditional expectation can be written as Therefore, we have (4.17) Using Proposition 4.2, we can write where the last line follows from a change of variables and the function inside the integral being even.Applying (4.11), we have By the definition of ζ, Putting them together, we obtain The claim directly follows from combining (4.17) and (4.19).
Lemma 4.5 together with (4.14) shows that when q ≤ 1/2, for absolute constants C, C ′ > 0, Putting the estimates together, we conclude with the following lemma.

Fixed p ∈ (0, 1)
We perform similar analyses as seen previously, but now for p ∈ (0, 1).Our strategy is again to estimate the expectation and variance of signed triangle statistic in G(n, p, d, q), and then apply Chebyshev's inequality.Various estimates in the previous work [10] largely simplify our calculations.
Recall that the threshold t p,d of G(n, p, d, q) is determined by E[s t p,d ( x i , x j )] = P( x i , x j ≥ t p,d ) = p.Different from when p = 1/2, for p ∈ (0, 1), t p,d is now a function of both p and d.The connection probability can be written as

Estimating the expectation
Consider the events and By rotation invariance on the sphere, we can fix x 1 = e 1 .Then, The following technical lemma from [10] provides a lower bound on the probability of E ∆ .
Lemma 4.7 ([10, Lemma 1]).For a fixed p ∈ (0, 1), there exists a C p > 0 such that for all d ≥ 1/C p , By (4.4), the expectation of a signed triangle can be written as Using Lemma 4.7, we have that Therefore, we conclude that there exists a C p > 0 depending only on p such that for

Estimating the variance
As in the case when p = 1/2, we bound the variance of the signed triangle count in G(n, p, d, q) by estimating the variance and covariances in (4.15) individually.
For two triangles with exactly the same vertices, As a last step, for two triangles sharing two vertices, Recall (4.16), which also holds for general p: An estimate in [10, Lemma 4] implies that Thus, we have that Therefore, we establish that Inserting the above estimates in (4.15), we conclude that for an absolute constant C > 0,

Concluding the proof for p ∈ (0, 1)
From the previous analyses, for a fixed p ∈ (0, 1), there exist constants C p > 0 and C < ∞ such that Repeating the steps in Section 4.1.3,we conclude that there exists a C p < ∞, such that for d ≥ C p , Theorem 1.1(b) for a fixed p ∈ (0, 1) is thus established.

Signed Cliques
The method introduced in the preceding subsections proves an upper bound for detecting the geometry in G(n, p, d, q), while providing an asymptotically powerful test that is computationally efficient.However, the upper bound for detection does not match the lower bound in Theorem 1.1(a).As a final remark, we explore whether the possibility results for detection can be improved via generalizations of the signed triangle statistic.Two families of extensions are studied: signed cliques and signed cycles.We show by special examples of subgraphs on four vertices, as well as those on a fixed number of vertices, that it is unlikely the detection boundary can be improved with them.
A first generalization of the signed triangle is by increasing the number of vertices in the set, resulting in the signed induced complete subgraphs of G, which we simply call signed cliques.Similar to the case of the signed triangle, let S ⊂ V be a subset of vertices of G with cardinality |S| = k, where k ≤ n is fixed.T S is again the indicator that the edges over the vertex set S form a clique; namely, the induced subgraph is complete.Given the adjacency matrix A of G, T S can be expressed by Then, the total number of cliques of size k in G, denoted by T k (G), can be written as For a constant p ∈ [0, 1], define the signed indicator and its count in G by We first compute the expectation and variance of the signed clique statistic in G(n, p).
For G(n, p), since all edges are independent, Then, the expectation of the signed clique statistic satisfies Consider two sets of vertices S and S ′ of size k.If S = S ′ , we have For S = S ′ , there is at least one signed edge that appears in τ S but not in τ S ′ .Suppose this edge is e.By the independence of edges in G(n, p), Therefore, the variance of the signed clique statistic in G(n, p) satisfies for some C k,p > 0 depending only on k and p.

Signed quadruples
For G(n, p, d, q), we start with the special case when p = 1/2 and consider the signed clique on four vertices, called the signed quadruple.
Theorem 4.8.There exists an absolute constant C such that Theorem 4.8 together with (4.28) shows that As we shall see, a lower bound on the variance of the signed quadruple statistic in G(n, 1/2, d, q) can be obtained from a more general argument in Lemma 4.15, which combined with (4.29) gives for some C k,p > 0. Therefore, there exists a constant C k,p < ∞ such that The above display implies that detecting geometry using the previous method with a signed quadruple statistic is only possible if n 2 q 6 /d → ∞.We see that this is stronger than the condition n 3 q 6 /d → ∞ given by the signed triangle.Note that we use the lower bound on the minimum of the variances instead of the maximum so that testing either hypothesis is not possible.We prove Theorem 4.8 in the following.A key estimation is that the expected signed quadruple in G(n, 1/2, d) is at most of order 1/d, formally stated as the following lemma.Lemma 4.9.There exists an absolute constant C such that The proof of Lemma 4.9 is divided into estimating several quantities.As computed before, for a sample from G(n, 1/2, d) with adjacency matrix A = [a i,j ], by conditioning on x 1 and rotation invariance, We also have E[a 1,2 ] = 1 2 by definition.The expected signed quadruple in G(n, 1/2, d) can be written as where the fractions are from simple combinatorial calculations.In the following we compute and estimate Q 1 , . . ., Q 5 .Following the definitions in the proof of Lemma 4.
Lemma 4.3 also shows that By conditional independence of a 1,4 and a 1,2 a 2,3 a 3,1 and rotation invariance, Hence, we have , The last equality is because x 3 and x 4 are identically distributed.Similar to the proof of Lemma 4.3, we can fix the space spanned by x 1 and x 2 .The angle between them has the density h(θ) given in Proposition 4.2.We have that a 1,3 a 2,3 = 1 if and only if the projection of x 3 onto this plane lies in [θ − π/2, π/2].Therefore, For the second integral, by the symmetry of the sin function, The claim directly follows by adding them.
By Lemma 4.10, we have that Since which equals the first integral in (4.33), we directly have the following lemma.Therefore, we have Plugging the previous estimates into (4.28),we obtain that An estimation for Q 1 is provided in the following lemma.
Lemma 4.12.Let γ and η be defined before.Then, The proof of Lemma 4.12 involves extending the argument in the proof of Lemma 4.3 to a threedimensional subspace.Before proving Lemma 4.12, we show the following claim concerning the distribution of the angle between a uniform random vector in R d and an arbitrary two-dimensional plane.
Proposition 4.13.Let x be a uniform random point in S d−1 .Let ϕ ∈ [0, π/2] be the angle between the vector x and any fixed 2-dimensional subspace.Then, the density g(ϕ) satisfies Proof.Let z ∼ N (0, I d ) be a d-dimensional random vector.Then, ẑ := z/ z is a uniform random point in S d−1 .By rotation invariance, we can fix the plane to be that spanned by the first two vectors of the standard basis.The projection of ẑ onto this plane is z = (z 1 , z 2 , 0, . . ., 0)/ z .Then, the angle between x and the plane is equal to the angle between ẑ and z.Hence, the cumulative distribution function satisfies Since the z i 's are standard normal random variables, we have z Taking the derivative with respect to ϕ, we obtain Proof of Lemma 4.10.Consider the space spanned by x 1 , x 2 , x 3 .Without loss of generality, we can fix the coordinates as follows: x 1 = (1, 0, 0, 0, . . ., 0), x 2 = (cos θ, sin θ, 0, . . ., 0), x 3 = (cos ϕ cos ψ, cos ϕ sin ψ, sin ϕ, 0, . . ., 0).
By symmetry on the sphere, we can constrain the parameters in the following space: Let f (θ, ψ, ϕ) be the probability density function.Then, by independence of the vectors, Denoting by θ(x, y) ∈ [0, π] the angle between two d-dimensional vectors, we also have ) cos θ(x 2 , x 3 ) = x 2 , x 3 = cos ϕ cos ψ cos θ + cos ϕ sin ψ sin θ = cos ϕ cos(ψ − θ). (4.37) The event 1 ∼ 2 happens if and only if θ ∈ [0, π].Vertex 3 is connected to both 1 and 2 if and only if the projection of x 3 onto the plane determined by x 1 and x 2 forms an angle no greater than π/2 with both x 1 and x 2 .Therefore, we have ψ ∈ [θ − π/2, π/2].The last vertex is connected to all of them if and only if the direction of x 4 falls in the spherical triangle determined by the three half planes with normal vectors x 1 , x 2 , x 3 respectively.As a well-known fact (see, e.g., [36, proposition 99]), the surface area of the spherical triangle equals the spherical excess defined by Since the surface area of the sphere is 4π, the probability that the four vertices form a clique is We deal with the three integrals separately as follows.
By integrating over ψ and ϕ, Plugging (4.36) into I 2 , we have  Inserting the expansion (4.40) into (4.39) and interchanging the summation and integration, we have the integral I 2 can also be split into two integrals accordingly: .
We deal with I 2(a) and I 2(b) separately.
Using the definition of g(ϕ) in Proposition 4.13 and by a change of variables x = sin 2 ϕ, we have where the last equality is due to the identity xΓ(x) = Γ(x + 1).By We can derive an upper bound on the above display by the upper bound in (4.11) And by a change of variables x = sin 2 ϕ and the definition of beta function, Therefore, I 2(b) can be upper bounded by where the last inequality is by (3.15).For the lower bound on I 2(b) , we have Hence, by the definition of beta function and a change of variables, Further, by the lower bound in (4.11), we obtain Inserting the definitions of ζ and the beta function gives Combining the estimates of I 1 , I 2 , I 3 given above proves the claim.
Plugging Lemma 4.12 into (4.34),we arrive at the claims in Lemma 4.9.Using Lemma 4.1 and Lemma 4.9, we have Then, Theorem 4.8 is hence proved.

General signed cliques
We next turn to general signed cliques in G(n, p, d, q).Similarly, we start with estimations in G(n, p, d).By the definition of the signed clique, The following corollary, derived from a result in Section 3.2, facilitates our calculations.
Proof.In (3.27), by setting q = 1, we have that By the definition of the distance, The claim directly follows.
For S = S ′ , let V ′ = S ∩ S ′ be the set of overlapping vertices.Then, we have that where the inequality is by Jensen's.Therefore, there exists a C k,p > 0, such that when d ≥ C k,p , Putting them together, we have that for some constant C k,p < ∞, The above display implies that the method used to derive the possibility of detection does not work when n k q k(k−1) /d → 0, which suggests a certain boundary of detection using general signed clique statistics.Note that for k ≥ 4 this does not rule out the whole region where signed triangles are not able to distinguish.However, based on the computation of the expected signed quadruple count, we see that the upper bound on the expectation in (4.44) is not precise; in particular, the dependence on d can be improved.In general, we do not expect the detection boundary to be improved by signed cliques.Towards this, we present the following conjecture.
We briefly argue why this bound should hold.In the proof of Theorem 1.1(b), we see that the dominating term comes from the ratio between the variance of the signed triangle count in G(n, p) and the squared expectation of the signed triangle count in G(n, p, d, q).Suppose this still holds for general signed cliques.Then, the dominating term if we use a signed clique statistic becomes d is the precise order for the phase transition in G(n, p, d), we must have k/(2α) ≤ 3, which gives α ≥ k/6.Note that this argument does not give a tight bound on the power of d, as witnessed by the case of k = 4, when we know from Lemma 4.9 that |E G(n,1/2,d) [τ [4] ]| decays as C/d.
In any case, assuming Conjecture 4.16 holds, and by the same arguments presented in this subsection, we obtain that detection is not possible with this method if n 3 q 3(k−1) /d → 0, and this bound gets worse as k grows.

Signed cycles
Let S be a subset of V and denote k := |S|.Consider a cycle C ⊂ S 2 , which is a set of edges forming a closed chain.There are (k − 1)!/2 possible Hamilton cycles (each vertex is visited exactly once) on S; they are distributed identically to C 0 := {{1, 2}, {2, 3}, . . ., {k − 1, k}, {k, 1}}.Denote by K C the indicator that the pairs in C form a cycle of G. Given the adjacency matrix A of G, K C can be expressed by

.45)
Then, the total number of length k cycles in G, denoted by K k (G), can be written as

.46)
We similarly define the signed cycle and its count by  For C = C ′ , there exists at least one edge e that is in C but not in C ′ .Hence, (a e ′ − p) = 0.
Therefore, for some C k,p > 0,  Hence, by (4.19), Therefore, for absolute constants C > 0 and C ′ < ∞, we have that This implies that if detection is possible using this method, then we should have n 2 q 4 /d → ∞.This is worse than the condition n 3 q 6 /d → ∞ under which signed triangles can detect.

General signed cycle
Next we estimate the signed length k cycle count in G(n, p, d, q) with the help of Lemma 4.17 The above display implies that detection is not possible using the previous method with a signed length k cycle statistic when n k q 2k /d → 0. Note that for k ≥ 4 this does not rule out all regions not detectable by signed triangles.However, based on the computations for signed quadrilaterals, we believe that the dependence on d in the bound in (4.51) is not tight.Analogously to Conjecture 4.16, we have the following conjecture.Assuming Conjecture 4.18 holds, detection is not possible with this method when n 3 q 6 /d → 0. This would imply that all signed cycles have the same detecting power.However, as witnessed by signed quadrilaterals, the above conjecture is not tight, suggesting that signed triangles yield the best bound.

Random dot product graphs
The starting point of this paper is the random geometric graph G(n, p, d), where the underlying points x 1 , . . ., x n ∈ R d are distributed uniformly on the unit sphere.Our main object of study, G(n, p, d, q), builds upon G(n, p, d).Note that in G(n, p, d) there is an edge between two nodes if and only if the dot product of the corresponding latent vectors is greater than some threshold (see (1.1)).Models with this property are known as random dot product graphs and have been widely studied [4,33].Plugging this estimate into the proof, we conclude that there exist constants C, C p , such that for d ≥ 2n, TV(G(n, p), Ġ(n, p, d, q)) ≤ C p n 2 q d + C n 2 q d + n 3 q 2 d , similarly to (3.27).The conclusion follows.

Proof of part (b)
In the case p = 1/2, the random dot product graph is essentially the same as the random geometric graph.Hence, the results directly carry over.For a fixed value of p ∈ (0, 1), the proofs are similar but require the estimation of several quantities under a different setting.
Repeating the same arguments as before, we conclude that there exists a constant C p < ∞ such that for d ≥ C p , TV(G(n, p), Ġ(n, p, d, q)) ≥ 1 − C p d n 3 q 6 + 1 n 2 q 2 + 1 n .

Figure 2 :
Figure 2: Phase diagram for detecting geometry in the soft random geometric graph G(n, p, d, q).Here d = n α and q = n −β for some α, β > 0.

Lemma 4 . 1 .
Let H = (S, F ) be a fixed graph.The signed indicator satisfies

Lemma 4 . 5 .
The expectation of two signed triangles sharing two vertices in

(4. 33 )
For the first integral in the above display,

Corollary 4 . 14 .
Let V = [k] be a set of vertices and E ⊂ V × V be a set of edges.Denote by |E| the cardinality of E.Then, we have that for a constant C k,p ,

Conjecture 4 . 16 .
There exists a constant C k,p such that .47)We again start with estimating the expectation and variance of the signed cycle statistic in G(n, p).

( 4 .
49)In order to estimate the mean and variance of the signed cycle statistic in G(n, p, d, q), we additionally need the following lemma concerning the probability of an open path (i.e., an open chain of edges) in G(n, p, d).

Lemma 4 . 17 . 4 .
In G(n, p, d), any open path of length k has probability p k .Proof.We prove the claim by induction on the length.For each edge in G(n, p, d), by definition we have P(i ∼ j) = E[a i,j ] = p.Suppose we have a path P k+1 := {{1, 2}, {2, 3}, . . ., {k, k + 1}} on vertices [k + 1].Then, the probability of the path isP(P k+1 ) = E k i=1 a i,i+1 .By conditional independence of the edges and rotation symmetry on sphere,i+1 x k E[a k,k+1 | x k ] = p E k−1 i=1 a i,i+1 = p P(P k ).Expanding the product of a signed cycle,E G(n,p,d) κ C = S∈2 C (−p) k−|S| E e∈S a e − p |S| .Since C is a cycle, all proper subsets of C are a union of independent paths.By Lemma 4.17, E e∈S a e = P(S) = p |S| for all S ⊂ C except for S = C. Hence, the expectation of a signed length k cycle in G(n, p, d) satisfies E G(n,p,d) [κ C ] = E e∈C a e − p k .(4.50)4.4.1 Signed quadrilateralsWe start with the expected number of signed cycles of length four, which are called signed quadrilaterals.By (4.50), the expectation of a signed quadrilateralC 0 in G(n, 1/2, d) is E[κ C 0 ] = E[a1,2 a 2,3 a 3,4 a 4,1 ] = E[a 1,2 a 2,3 a 3,4 a 4,1 ] − 1 2 Using Lemma 4.10, we have that E[κ C 0 ] = 2η.

Lemma 5 . 3 .
There exists a constant C p < ∞, depending only on p, such that |u p,d / √ d − t p | ≤ C p √ d .