# Injectivity of ReLU networks: Perspectives from statistical physics

Antoine Maillard, Afonso S Bandeira, David Belius, Ivan Dokmanić, Shuta Nakajima

► To cite this version:

Antoine Maillard, Afonso S Bandeira, David Belius, Ivan Dokmanić, Shuta Nakajima. Injectivity of ReLU networks: Perspectives from statistical physics. Applied and Computational Harmonic Analysis, 2025, 76, pp.101736. 10.1016/j.acha.2024.101736. hal-05495127

HAL Id: hal-05495127

https://inria.hal.science/hal-05495127v1

Submitted on 9 Feb 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
<figure><img src="image_2.png" /></figure>

ELSEVIER

Contents lists available at ScienceDirect

Applied and Computational Harmonic Analysis

journal homepage: www.elsevier.com/locate/acha

<figure><img src="image_3.png" /></figure>

Full Length Article

# Injectivity of ReLU networks: Perspectives from statistical physics

Antoine Maillard<sup>a,*</sup>, Afonso S. Bandeira<sup>a</sup>, David Belius<sup>b,e</sup>, Ivan Dokmanić<sup>b,c</sup>, Shuta Nakajima<sup>d</sup>

<figure><img src="image_4.png" /></figure>

Check for
updates

## ARTICLE INFO

Communicated by Götz Pfander

Keywords:

Random neural networks

Injective generative models

Statistical physics

Replica symmetry breaking

Spin glasses

Integral geometry

## ABSTRACT

When can the input of a ReLU neural network be inferred from its output? In other words, when is the network injective? We consider a single layer, $x \mapsto \text{ReLU}(W \times x)$, with a random Gaussian $m \times n$ matrix $W$, in a high-dimensional setting where $n, m \to \infty$. Recent work connects this problem to spherical integral geometry giving rise to a conjectured sharp injectivity threshold for $\alpha = m/n$ by studying the expected Euler characteristic of a certain random set. We adopt a different perspective and show that injectivity is equivalent to a property of the ground state of the spherical perceptron, an important spin glass model in statistical physics. By leveraging the (non-rigorous) replica symmetry-breaking theory, we derive analytical equations for the threshold whose solution is at odds with that from the Euler characteristic. Furthermore, we use Gordon's min-max theorem to prove that a replica-symmetric upper bound refutes the Euler characteristic prediction. Along the way we aim to give a tutorial-style introduction to key ideas from statistical physics in an effort to make the exposition accessible to a broad audience. Our analysis establishes a connection between spin glasses and integral geometry but leaves open the problem of explaining the discrepancies.

## Contents

<table><tr><td>1. Introduction</td><td>2</td></tr><tr><td>1.1. Injectivity and (random) neural networks</td><td>3</td></tr><tr><td>1.2. Injectivity and random geometry</td><td>3</td></tr><tr><td>1.3. Statistical physics and the spherical perceptron</td><td>3</td></tr><tr><td>1.4. Related work</td><td>5</td></tr><tr><td>1.5. Main results</td><td>5</td></tr><tr><td>1.6. Structure of the paper and open problems</td><td>9</td></tr><tr><td>2. The replica hierarchy of upper bounds</td><td>10</td></tr><tr><td>2.1. General principles of the replica method</td><td>10</td></tr><tr><td>2.2. First steps of the replica method</td><td>11</td></tr><tr><td>2.3. The replica-symmetric solution</td><td>12</td></tr></table>

<footnote><sup>a</sup> Department of Mathematics, ETH Zürich, Switzerland</footnote>

<footnote><sup>b</sup> Department of Mathematics and Computer Science, University of Basel, Switzerland</footnote>

<footnote><sup>c</sup> Department of Electrical and Computer Engineering, University of Illinois at Urbana-Champaign, USA</footnote>

<footnote><sup>d</sup> Graduate School of Science and Technology, Meiji University, Kanagawa, Japan</footnote>

<footnote><sup>e</sup> Faculty of Mathematics and Computer Science, UniDistance Suisse, Switzerland</footnote>

<footnote>* Corresponding author.</footnote>

<footnote>E-mail address: antoine.maillard@math.ethz.ch (A. Maillard).</footnote>
<table><tbody><tr><td>2.4.</td><td>The overlap distribution and replica symmetry breaking</td><td>14</td></tr><tr><td>2.5.</td><td>One-step replica symmetry breaking</td><td>16</td></tr><tr><td>3.</td><td>The full-RSB solution: exact injectivity threshold</td><td>17</td></tr><tr><td>3.1.</td><td>The full-RSB prediction for the free entropy</td><td>17</td></tr><tr><td>3.2.</td><td>Zero-temperature limit and algorithm for the injectivity threshold</td><td>18</td></tr><tr><td colspan="2">Declaration of competing interest</td><td>20</td></tr><tr><td>Appendix A.</td><td>Proofs</td><td>20</td></tr><tr><td>A.1.</td><td>Proof of Proposition 1.1</td><td>20</td></tr><tr><td>A.2.</td><td>Proof of Lemma 1.2</td><td>21</td></tr><tr><td>A.3.</td><td>Proof of Theorem 1.4</td><td>22</td></tr><tr><td>A.4.</td><td>Proof of Corollary 1.5</td><td>22</td></tr><tr><td>A.5.</td><td>Proof of Theorem 1.8</td><td>23</td></tr><tr><td>A.6.</td><td>Proof of Lemmas A.5, A.6 and A.7</td><td>25</td></tr><tr><td>A.7.</td><td>Improving over a standard use of Gordon's inequality?</td><td>27</td></tr><tr><td>Appendix B.</td><td>Replica-symmetric supplementary calculations</td><td>28</td></tr><tr><td>B.1.</td><td>Zero-temperature limit of the replica-symmetric solution</td><td>28</td></tr><tr><td>B.2.</td><td>Stability of the replica-symmetric solution</td><td>29</td></tr><tr><td>Appendix C.</td><td>A replica-symmetric lower bound</td><td>31</td></tr><tr><td>Appendix D.</td><td>One-step replica symmetry breaking</td><td>32</td></tr><tr><td>D.1.</td><td>Derivation of the 1-RSB free entropy</td><td>32</td></tr><tr><td>D.2.</td><td>Zero-temperature limit</td><td>33</td></tr><tr><td>D.3.</td><td>Numerical procedure</td><td>34</td></tr><tr><td>Appendix E.</td><td>Details of the FRSB computation</td><td>35</td></tr><tr><td>E.1.</td><td>Entropic contribution</td><td>35</td></tr><tr><td>E.2.</td><td>Energetic contribution</td><td>38</td></tr><tr><td>E.3.</td><td>Recovering the RS result from the full RSB equations</td><td>38</td></tr><tr><td>Appendix F.</td><td>Technicalities of the algorithmic FRSB procedure</td><td>39</td></tr><tr><td>F.1.</td><td>Technicalities of the derivation of the algorithmic procedure</td><td>39</td></tr><tr><td>F.2.</td><td>Numerical results of the procedure</td><td>40</td></tr><tr><td>F.3.</td><td>Some details on the implementation of convolutions</td><td>41</td></tr><tr><td>F.4.</td><td>Bounds on the injectivity threshold</td><td>42</td></tr><tr><td>Appendix G.</td><td>"Escape through a mesh" theorem: an alternative proof of Theorem 1.8</td><td>42</td></tr><tr><td>G.1.</td><td>Proof of Proposition G.3</td><td>43</td></tr><tr><td>G.2.</td><td>Proof of Lemma G.4</td><td>44</td></tr><tr><td colspan="2">Data availability</td><td>45</td></tr><tr><td colspan="2">References</td><td>45</td></tr></tbody></table>

# 1. Introduction

We ask the following question: when is a randomly-initialized ReLU neural network injective? For $n, m \ge 1$ we consider a single layer at initialization, that is the map $\varphi_W$ defined as

$$ \varphi_W(\mathbf{x})_{\mu} = \sigma\left[\left(\frac{\mathbf{W}\mathbf{x}}{\sqrt{n}}\right)_{\mu}\right], \qquad \mu = 1, \dots, m, \qquad (1) $$

with $\mathbf{x} \in \mathbb{R}^n$ and $\sigma(\mathbf{x}) := \max(0, \mathbf{x})$, the ReLU activation. The weights at initialization are random; concretely, we let $W_{\mu i} \sim N(0, 1)$ in what follows, although we expect some of our results to generalize to $W$ with independent entries with zero mean, unit variance, and uniformly bounded third moment; see the discussion on universality in Section 1.3.

Earlier work studied this question in the proportional growth asymptotics, where $n \to \infty$ and the aspect ratio $m/n \to \alpha > 0$. Puthawala et al. proved that there exist values $\alpha_l$ and $\alpha_h$, with $\alpha_l < \alpha_h$, such that the probability $p_{m,n}$ that the map $\varphi_W$ is injective converges to 1 for $\alpha > \alpha_h$ and to 0 for $\alpha < \alpha_l$, suggesting that interesting transitions may appear precisely in this proportional scaling [61]. Indeed, by studying the expected Euler characteristic of the intersection of a random subspace with a union of orthants with sufficiently many negative coordinates, Clum, Paleka, Bandeira, and Mixon conjectured a sharp injectivity threshold at the value $\alpha_{\text{Euler}}^{\text{inj}} \simeq 8.34$ [54,19, 21]. We adopt this setting and propose an alternative derivation of the injectivity threshold, by making a connection with a spin glass model known as the spherical perceptron.
## 1.1. Injectivity and (random) neural networks

Our focus is on framing injectivity as a statistical physics problem and exploring parallels and discrepancies with the mentioned conjecture based on integral geometry.<fnref n="1" /> But a study of injectivity has a variety of motivations in contemporary machine learning. Inferring $x$ from $\phi_W(x)$ is an ill-posed problem unless $\phi_W$ is injective. The question thus arises naturally when applying neural networks to model forward and inverse maps in inverse problems [61,4]. There has been considerable interest in inverting generative models on their range to regularize ill-posed inverse problems [9] and in building injective generative models [7,44,64]. Normalizing flows are designed to be invertible with efficiently computable inverses; similar feats can be achieved with injective maps, even with ReLU activations, while retaining favorable approximation-theoretic properties [61,62,44]. In finite dimension injective maps are (locally) Lipschitz [71]. There is significant work on estimating and controlling the Lipschitz constants of deep neural networks; see for example [32,43,36] and references therein.

Applications abound beyond inverse problems: certain injective generative models can provably be trained with sample complexity which is polynomial in image dimension [12]; a message-passing graph neural networks is as powerful as the Weisfeiler-Lehman test, but only if the aggregation function is injective [84]; injective ReLU networks are universal approximators of any map with a sufficiently high-dimensional output space [61] as well as of densities on manifolds [62].

There is an analogy between random neural networks and random matrices. Just as results for random matrices help us understand general matrices and have implications throughout mathematics, physics, engineering, and computer science, random neural networks yield insight into general neural networks. This is the perspective of recent work on “nonlinear random matrix theory” for machine learning [63,45]. We mention two other examples from this emerging line of research: neural networks at initialization have been used to theoretically study batch normalization [23] and properties of gradients in deep networks [42].

## 1.2. Injectivity and random geometry

**Notation** $\mathbb{N}^* = \mathbb{Z}_{>0}$ denotes the positive integers. We say that an event occurs with high probability (w.h.p.) when its probability is $1 - o(1)$ as the dimension $n \to \infty$. We denote $\mu_n$ the uniform probability measure on the Euclidean unit sphere $S^{n-1}$ in $\mathbb{R}^n$. The symbol $\mathbb{P} \to$ refers to convergence in probability, and $D_n^\epsilon$ is the standard Gaussian measure on $\mathbb{R}$, as usual in physics.

Our first tool is a proposition proved in Appendix A.1, stated as Proposition 4.10 in [54] and Proposition 37 in [19], which is a simple consequence of Theorem 1 of [61]. It connects injectivity to random geometry:

**Proposition 1.1 (Injectivity and random geometry).** The probability $p_{m,n}$ that $\phi_W$ is injective is

$$p_{m,n} = \mathbb{P}_V [V \cap C_{m,n} = \{0\}], \qquad (2)$$

where $V$ is a uniformly random $n$-dimensional subspace of $\mathbb{R}^m$, and $C_{m,n}$ is the set of vectors in $\mathbb{R}^m$ with strictly less than $n$ strictly positive coordinates.

**Remark.** Since $V \cap C_{m,n}$ is a cone, we can equivalently ask in eq. (2) that $V \cap C_{m,n} \cap S^{m-1}$ be an empty set.

Recall that we will study injectivity for large matrices $W$ in the proportional growth asymptotics,

$$n \to \infty, \quad m/n \to \alpha.$$

In what follows we will only consider the case $m \ge n$ (and therefore $\alpha \ge 1$). For $m < n$ even $x \mapsto Wx$ is not injective, implying that $p_{m,n} = 0$. An analysis of the random subspace-set intersection introduced in Proposition 1.1, which is based on the phase transition in the expected Euler characteristic, yields a sharp injectivity threshold prediction of $\alpha_{\text{inj}}^{\text{Euler}} \approx 8.34$ [54], see Section 1.4. Here we refute this prediction and conjecture a new threshold based on a different geometric intuition.

## 1.3. Statistical physics and the spherical perceptron

**Injectivity as energy minimization** The random subspace $V$ of Proposition 1.1 is constructed as the column space of the random matrix $W$, which has dimension $n$ with probability 1 when $m \ge n$. If $V' := W(S^{n-1})$ is the image of the $n$-dimensional unit sphere, we have that $\mathbb{P}[V \cap C_{m,n} = \{0\}] = \mathbb{P}[V' \cap C_{m,n} = \emptyset]$. Moreover, for any $x \in S^{n-1}$ we can define $E_W(x)$ as the total number of positive coordinates of $Wx$, and $e_W(x)$ as a normalization of this quantity:

$$E_W(x) := \sum_{\mu=1}^{m} \theta[(Wx)_{\mu}], \qquad e_W(x) := \frac{E_W(x)}{n}, \qquad (3)$$

<footnote n="1">¹ If formal injectivity was itself the goal, we could simply replace ReLU by Leaky ReLU and reduce the problem to injectivity of matrices. In that case the interesting quantity to study may be the inverse Lipschitz constant.</footnote>
where $\theta(x) = 1(x > 0)$ is the Heaviside step function, with the convention $\theta(0) = 0$. Since $C_{m,n}$ is the set of all vectors in $\mathbb{R}^m$ with strictly less than $n$ (strictly) positive coordinates, one has immediately that $Wx \in C_{m,n} \Leftrightarrow E_W(x) < n$. Therefore, by Proposition 1.1, $p_{m,n}$ can be rewritten as<fnref n="2" />

$$p_{m,n} = \mathbb{P}_W \left[ \min_{x \in S^{n-1}} E_W(x) \geq n \right]. \quad (4)$$

Eqs. (2) and (4) express two different geometric intuitions. The former one lives in $\mathbb{R}^m$ (recall that $m \ge n$) and it is about an intersection of a random $n$-dimensional subspace and a certain nonconvex union of orthants. The latter one lives in $\mathbb{R}^n$ and it is about the existence of a halfspace which contains less than $n$ (out of $m$) random vectors. The two intuitions naturally encourage different analytic tools.

**Statistical physics of disordered systems** The right-hand side of eq. (4) is reminiscent of quantities that theoretical physicists have been tackling since the 1970s, in the field of physics of disordered systems. In these disordered models (also known as spin glasses), one wishes to minimize an energy function like $E_W$, which is itself a function of random interactions (also called quenched disorder), represented in our case by $W$. We recommend the famous book by Mézard, Parisi, and Virasoro for a beautiful review of the early breakthroughs of the physics of spin glasses [50].

Given this short description, we can see that eq. (4) fits the framework of these studies: the energy function given in eq. (3) defines a model known in the statistical physics literature as the spherical perceptron (sometimes referred to as the Gardner–Derrida perceptron [34] when $E_W(x)$ is given by eq. (3)). We consider this perhaps unexpected point of view on injectivity of random layers in neural networks.

**Cover's theorem and the bound $\alpha_{inj} \ge 3$** Cover's theorem [20] leads to a first natural bound for $\alpha_{inj}$. It implies that for $\alpha < 2$, there exists with high probability (as $n \to \infty$) $x \in S^{n-1}$ s.t. $E_W(x) = 0$ (that is, the constraint satisfaction problem $E_W(x) = 0$ is satisfiable w.h.p.). One can easily deduce from this that $\alpha_{inj} \ge 3$:

**Lemma 1.2 (Cover's lower bound for injectivity).** Assume $\alpha < 3$. Then as $n, m \to \infty$ the ReLU layer is non injective with high probability, i.e., $\lim_{n \to \infty} p_{m,n} = 0$.

Such arguments are classical, and we detail the proof of Lemma 1.2 for completeness in Appendix A.2.<fnref n="3" /> Results about the perceptron based on Cover's theorem were greatly extended by Gardner and Derrida [33,34] using non-rigorous tools, and then later rigorously justified by Scherbina and Tirozzi [67,68] and Stojnic [69]. In the constraint satisfaction problem (CSP) view on the perceptron, $\alpha = 2$ is sometimes referred to as the *Gardner capacity*, which marks the limit between the satisfiable (SAT) and unsatisfiable (UNSAT) phases.

**Thermal relaxation: the Gibbs–Boltzmann distribution** Statistical physicists characterize the landscape of the (random) energy function $E_W(x)$ by considering the Gibbs–Boltzmann distribution $\mathbb{P}_{\beta,W}$, defined for any inverse temperature $\beta \ge 0$ as

$$d\mathbb{P}_{\beta,W}(x) := \frac{1}{\bar{Z}_n(W, \beta)} e^{-\beta E_W(x)} \mu_n(dx). \quad (x \in S^{n-1}) \quad (5)$$

Informally, the parameter $\beta \ge 0$ interpolates between two extremes: the infinite-temperature ($\beta = 0$) regime, in which the Gibbs measure is uniform on the sphere, and the zero-temperature ($\beta \to \infty$) limit, in which the Gibbs measure is concentrated on the global minima of the energy function $E_W(x)$. Studying the properties of the Gibbs measure for $n \to \infty$ at various $\beta$ (remaining finite when $n \to \infty$) yields deep insight about the landscape of the corresponding energy function [28].<fnref n="4" /> In particular, many of our results will be based on an analysis of the large $n$ limit of the *free entropy*, which is defined as the logarithm of the normalization in eq. (5):

$$\Phi_n(W, \beta) := \frac{1}{n} \log \bar{Z}_n(W, \beta) = \frac{1}{n} \log \int_{S^{n-1}} \mu_n(dx) e^{-\beta E_W(x)}. \quad (6)$$

**Universality of the free entropy** Following classical arguments based on the Lindeberg exchange method [16], one can show that the free entropy $\Phi(\alpha, \beta)$ is universal for all matrices $W$ with independent zero-mean entries with unit variance and uniformly bounded third moment. In particular, all our conjectures and theorems on the free entropy can be stated in this more general case. We note that in a recent line of work, similar universality properties have been generalized to matrices with independent rows (see, e.g., [51,37] and references therein) under a “one-dimensional CLT” condition. In particular, [37] conjectures that the ground state energy $f^*(\alpha) = \lim_{n \to \infty} \min_x e_W(x)$ (shown in Fig. 1) is universal with respect to the distribution of $W$ in a much wider class than matrices with independent elements: we leave the investigation of this conjecture and its implications on injectivity for future work.

<footnote n="2">² The minimum is always reached since $E_W(S^{n-1})$ is a finite set.</footnote>

<footnote n="3">³ In a nutshell, by Lemma 1.2 there is always an $x$ at obtuse angle with the top $2n$ rows of $W$. Even if all the remaining $m-2n$ rows form acute angles with $x$, we need at least $n$ such rows for injectivity.</footnote>

<footnote n="4">⁴ The Gibbs distribution is also the invariant measure of stochastic optimization procedures such as Langevin dynamics.</footnote>
## 1.4. Related work

**Average Euler characteristic prediction** We follow here closely the presentation of [54] (see also [19]). Proposition 1.1 is reminiscent of the kinematic formulas in integral geometry [74], that allow to compute expressions of the type $E[F(V \cap C)]$, when $V$ is a uniformly-sampled random $n$-dimensional subspace, and

(i) $C$ is a finite union of convex cones.

(ii) $F$ is an additive function, i.e., it satisfies for any $A, B \subseteq \mathbb{R}^m$ that $F(A \cup B) + F(A \cap B) = F(A) + F(B)$.

Recall that we can write eq. (2) as $p_{m,n} = E[1_S(V \cap C_{m,n})]$, with $1_S(A) := 1\{A \cap S^{m-1} \neq \emptyset\}$ the indicator function of the sphere. While $C_{m,n}$ is indeed a finite union of orthants (and thus of convex cones), $1_S$ is not additive. However, it follows from Groemer's extension theorem [74] that the unique additive function defined on finite unions of convex cones to agree with $1_S$ on convex cones is the (spherical) Euler characteristic $\chi_S(A) := \chi(A \cap S^{m-1})$. A possible heuristic is thus to approximate $p_{m,n} = E[1_S(V \cap C_{m,n})]$ by

$$q_{m,n} := E[\chi_S(V \cap C_{m,n})], \qquad (7)$$

in order to apply the kinematic formulas. We refer to [54] for more discussion on the validity of this heuristic. In particular, let us note that this strategy has also been used to estimate the probability of excursions of random fields, see [6]. Using the kinematic formulas, one can obtain an explicit formula for $q_{m,n}$. Estimating its limit as $n, m \to \infty$ is involved, and a non-rigorous calculation performed in [54] leads to the conjecture:

$$\left\{ \begin{array}{ll} \limsup_{n \to \infty} \frac{1}{n} \log q_{m,n} < 0 & \text{for } \alpha < \alpha_{\text{inj}}^{\text{Euler}}, \\ \\ \liminf_{n \to \infty} \frac{1}{n} \log q_{m,n} > 0 & \text{for } \alpha > \alpha_{\text{inj}}^{\text{Euler}}, \end{array} \right. \qquad (8)$$

for a sharp threshold $\alpha_{\text{inj}}^{\text{Euler}} \approx 8.34$, which we will call the average Euler characteristic prediction for injectivity. Checking the validity of this heuristic approach as a prediction for the behavior of $p_{m,n}$ was one of the motivations of our work.

**Physics and mathematics of the perceptron** Motivated in particular by the relation of the perceptron to continuous constraint satisfaction problems (e.g. to soft sphere packing), studies of the spherical perceptron in physics and mathematics are numerous. Without aiming at being exhaustive, and rather primarily referring to works relevant for our presentation, these studies include [34,33,30] in the physics literature, while the spherical perceptron has also been studied with mathematically rigorous techniques [67], [78, Chapter 3], [79, Chapter 8], [69,70,53]. In particular, the satisfiability threshold $\alpha = 2$ has been rigorously determined. The techniques however do not apply to the unsatisfiable (UNSAT) regime, which is the one that is relevant in this paper. One reason for this is that the satisfiability question can be formulated in terms of a convex Hamiltonian, while in the unsatisfiable regime one is interested in a Hamiltonian given by the number of half-spaces a point is contained in, which is not convex. This precludes the straightforward use of these rigorous techniques to study the injectivity question. A rigorous sharp characterization of the unsatisfiable phase remains an important open problem. We refer to [13] for a summary of current advances on the spherical perceptron, from both the physics and the mathematics points of view.

**Other related work** Puthawala et al. derived a suite of results on injectivity of neural networks, including a simple analysis of random ReLU layers [61]. By combining ideas related to Cover's theorem with union bounds over row selections from $\mathbf{W}$ and concentration of measure, they proved upper and lower bounds on the injectivity threshold, the upper bound being later improved by Paleka [54] and Clum [19]. We summarize them in the following theorem:

**Theorem 1.3 (Known bounds for injectivity [61,54,19]).**

$$(\alpha \le 3.3 \Rightarrow \lim_{n \to \infty} p_{m,n} = 0) \quad \text{and} \quad (\alpha \ge 9.091 \Rightarrow \lim_{n \to \infty} p_{m,n} = 1).$$

By Proposition 1.1, the injectivity threshold can be characterized as a phase transition in the probability that a random subspace intersects a certain union of orthants. Similar characterizations arise in the study of convex relaxations of sparse linear regression and other high-dimensional convex optimization problems with random data. Amelunxen et al. connect the probability of success of these optimization problems to random convex constraint satisfaction problems, namely the probability that two random convex cones have a common ray [3]. They prove that this probability exhibits a sharp phase transition in terms of scalar values known as the statistical dimension of the cones. Unfortunately, these results are limited to convex cones, whereas the union of orthants from Proposition 1.1 is non-convex.

## 1.5. Main results

Recall that we study a high-dimensional regime in which $n \to \infty$ and $m = m(n)$ satisfies $m(n)/n \to \alpha > 0$. We will sometimes use the notation $\alpha_n := m(n)/n$. The proofs of the rigorous statements in this section are given in Appendix A.
### 1.5.1. Relating the free entropy to injectivity

Our starting point is eq. (4) in Proposition 1.1 (recall that $e_W(x) = E_W(x)/n$):

$$p_{m,n} = \mathbb{P}_W \left[ \min_{x \in S^{n-1}} e_W(x) \ge 1 \right].$$

Recall the definition of the free entropy in eq. (6). We immediately have

$$-\frac{\Phi_n(W, \beta)}{\beta} \ge \min_{x \in S^{n-1}} e_W(x), \qquad (9)$$

which formalizes the fact that the Gibbs distribution is a relaxation of the uniform distribution on the global minima of $E_W$. Our strategy is to use eq. (9) to characterize injectivity. This involves two challenging steps:

(i) Make the inequality of eq. (9) as tight as possible: as we explain below, conjecturally, when taking $n \to \infty$ and then $\beta \to \infty$, eq. (9) becomes an equality. While we are not able to prove this statement, we will use it to conjecture a sharp transition for injectivity in terms of the aspect ratio $\alpha$. Moreover, without assuming that this conjecture holds, we will also use eq. (9) to prove upper bounds on the injectivity threshold.

(ii) Second, computing the large system limit $n \to \infty$ of $\Phi_n(W, \beta)$ on the left-hand side of eq. (9). This is a central object in the physics of disordered systems, and we will provide a conjecture for its limiting value, as well as rigorous upper bounds. Our results leverage a long line of work combining probability theory with heuristic predictions of statistical physics.

The following statement is classical in the theory of disordered systems and a direct consequence of celebrated concentration inequalities [11]. It bounds the probability that the free entropy deviates from its mean (with respect to the disorder W):

**Theorem 1.4 (Free entropy concentration).** For any $\beta \ge 0$ and $n \ge 1$, we have,

$$\mathbb{P}_W[|\Phi_n(W, \beta) - \mathbb{E}_W \Phi_n(W, \beta)| \ge t] \le 2 \exp \left\{ - \frac{nt^2}{2\alpha_n \beta^2} \right\}.$$

Combined with the bound of eq. (9), this already allows us to state a sufficient condition for non-injectivity with high probability. We summarize this in the following corollary, proved in Appendix A.4.

**Corollary 1.5 (Sufficient condition for non-injectivity).** We denote $\Phi(\alpha, \beta) = \liminf_{n \to \infty} \mathbb{E}_W \Phi_n(W, \beta)$. It has the following properties:

(i) $\beta \mapsto -\Phi(\alpha, \beta)/\beta$ is a positive non-increasing function of $\beta > 0$.

(ii) Its limit as $\beta \to \infty$ satisfies

$$\lim_{\beta \to \infty} \left[ - \frac{\Phi(\alpha, \beta)}{\beta} \right] < 1 \Rightarrow \lim_{n \to \infty} p_{m,n} = 0,$$

that is, the limit being smaller than 1 implies non-injectivity w.h.p. as $n, m \to \infty$.<fnref n="5" />

**Existence of the limit** While we expect the limit of $\mathbb{E}_W \Phi_n(W, \beta)$ as $n \to \infty$ to exist, or, in other words, $\Phi(\alpha, \beta)$ to be defined not only as a $\liminf$, this fact is far from trivial. In the spin glass literature, this has historically been shown using interpolation methods due to Guerra, by showing sub-additivity of the free entropy in the system size [40,78] for mean-field spin glass models possessing certain convexity properties. Guerra's technique, however, fails beyond this setting, e.g. in bipartite (or other multi-species) spin glass models [57]. On the other hand, even in some mean-field spin glasses, including spherical p-spins, the existence of the limit was only shown as a corollary of the much stronger asymptotically tight two-sided bound allowing to precisely relate the value of the limit to the Parisi formula, i.e. the prediction of statistical physics [76,17].<fnref n="6" /> In the spherical perceptron we consider here, the existence of this limit is, to the best of our knowledge, still a conjecture.

Following the statistical physics intuition about the asymptotic tightness of eq. (9), we conjecture the following.

**Conjecture 1.6 (Tightness of the free entropy bound).** The bound of Corollary 1.5 is tight, i.e.,

$$\left\{ \begin{array}{l} \lim_{\beta \to \infty} \left[ - \frac{\Phi(\alpha, \beta)}{\beta} \right] < 1 \Rightarrow \lim_{n \to \infty} p_{m,n} = 0, \\ \\ \lim_{\beta \to \infty} \left[ - \frac{\Phi(\alpha, \beta)}{\beta} \right] > 1 \Rightarrow \lim_{n \to \infty} p_{m,n} = 1. \end{array} \right.$$

<footnote n="5">⁵ The proof actually shows that $p_{m,n}$ goes to zero exponentially fast in $n$, see eq. (65).</footnote>

<footnote n="6">⁶ However an approximate sub-additivity property has recently been shown to be enough to deduce the convergence of the free entropy in this case [73].</footnote>
**A generalized conjecture** Conjecture 1.6 is a weakened version of a more general conjecture one can make from the definition of $\Phi(\alpha, \beta)$, which largely motivates the study of free entropies in statistical physics. First, assume that the limit defining $\Phi(\alpha, \beta)$ is well defined, so that $\Phi(\alpha, \beta) = \lim_{n \to \infty} \mathbb{E}_{W} \Phi_{n}(\beta, W)$. As $\beta \to \infty$, we expect the configurations that have dominating mass under the Gibbs measure of eq. (5) to have the smallest energy, i.e., to be the ground state configurations. Therefore, the stronger conjecture that motivates our use of $\Phi(\alpha, \beta)$ to characterize injectivity is that as $\beta \to \infty$, the bound of eq. (9) is actually an equality. In a nutshell, this conjecture can be stated as (p-lim denotes limit in probability):

$$ \lim_{\beta \to \infty} -\frac{\Phi(\alpha, \beta)}{\beta} = \mathrm{p-lim}_{n \to \infty} \left\{ \min_{\mathbf{x} \in S^{n-1}} e_W(\mathbf{x}) \right\}. \qquad (10) $$

Note that such a statement also assumes the concentration of the ground state energy on a value independent of $W$ as $n \to \infty$. Generally, the concentration of the intensive energy $e_W(\mathbf{x})$ under the Gibbs measure at any given $\beta \ge 0$ can be deduced from the existence of the limiting free entropy and its differentiability in $\beta$ [2].<fnref n="7" />

**A remark on discretization** A subtlety in establishing eq. (10) arises from the continuous nature of the variable $\mathbf{x}$: one needs to discard the existence of sets with “super-exponentially” small volume that might contain the global minima of $e_W$. In discrete models this issue is often not present. For example, replacing $\int_{S^{n-1}} \mu_n(\mathbf{d}\mathbf{x})$ by $2^{-n} \sum_{\mathbf{x} \in \{\pm 1\}^n}$ in eq. (6) yields a model called the binary (or Ising) perceptron, for which it is easy to see that

$$ \min_{\mathbf{x} \in \{\pm 1\}^n} e_W(\mathbf{x}) \le -\frac{\Phi_n(W, \beta)}{\beta} \le \min_{\mathbf{x} \in \{\pm 1\}^n} e_W(\mathbf{x}) + \frac{\log 2}{\beta}, \qquad (11) $$

so that the generalized conjecture of eq. (10) follows from the concentration and existence of the limit of the free entropy. In our spherical model one could hope to approximate $S^{n-1}$ by a sufficiently fine $\epsilon$-net, so that the value of $\Phi_n(W, \beta)$ is well approximated by averaging over the points of this net, and such that a two-sided bound similar to eq. (11) holds. Let us briefly describe such an approach. Considering an arbitrary fixed vector $\mathbf{x} \in S^{n-1}$, it is clear that with high probability there exists $\mu \in [n]$ s.t. $|W_\mu \cdot \mathbf{x}| \le 1$.<fnref n="8" /> From this, one easily deduces that there exists a small rotation $\mathbf{y} = \mathbf{R}\mathbf{x}$ of $\mathbf{x}$ (in the direction of $\pm W_\mu / \|W_\mu\|$), with angle $\varphi(1/\sqrt{n})$, such that $(\mathbf{y} \cdot W_\mu)(\mathbf{x} \cdot W_\mu) < 0$, while $\|\mathbf{y} - \mathbf{x}\|_2 \lesssim 1/\sqrt{n}$. This (very) rough estimation shows that $\epsilon \lesssim 1/\sqrt{n}$ is necessary to approximate the minimum of $e_W$ over $S^{n-1}$ by the minimum on an Euclidean-distance net. However it is well known that such a net needs to have cardinality at least $(1/\epsilon)^n$ [83]. Thus under this discretization the term $\log 2/\beta$ in the upper bound of eq. (11) becomes $\Omega(\log \epsilon^{-1}/\beta) = \Omega(\log n/\beta)$. Therefore we would need to consider diverging inverse temperatures $\beta = \beta(n) \ge \log n$ in the discretized system for its free entropy to provably approximate the ground state energy. A rigorous computation of the free entropy on this net with diverging $\beta$ would be challenging: since our results are based on heuristic methods of statistical physics assuming Conjecture 1.6 (with the exception of a rigorous upper bound), we leave the analysis of a possible discretization for future work.

### 1.5.2. Predictions of full replica symmetry breaking theory

Computing $\Phi(\alpha, \beta)$ is in general intractable rigorously. We will show in Theorem 1.8 that we can still derive meaningful rigorous bounds, but before describing that result we first introduce another conjecture, stemming from non-rigorous methods of statistical physics. This conjecture, which we call a *Parisi formula* as usual in spin glass models, and that we derive in Section 3 using the non-rigorous *replica method* of statistical physics, gives us a (heuristic) means to *exactly compute* $\Phi(\alpha, \beta)$.

**Conjecture 1.7 (Parisi formula).** $\Phi(\alpha, \beta)$ is given by the full replica symmetry breaking (FRSB) prediction of statistical physics, discussed in Section 3. More precisely, we have $\Phi(\alpha, \beta) = \Phi_{\mathrm{FRSB}}(\alpha, \beta)$, cf. eq. (47), with the following interpretation:

(i) We have the “Parisi formula”:

$$ \Phi_{\mathrm{FRSB}}(\alpha, \beta) = \inf_{q \in \mathcal{F}} P[q; \alpha, \beta], \qquad (12) $$

with $\mathcal{F}$ the set of non-decreasing functions from $[0, 1]$ to $[0, 1]$, and $P[q; \alpha, \beta]$ a functional of $q$, whose expression is given in eq. (47).

(ii) The infimum in eq. (12) is attained at a $q^* \in \mathcal{F}$ that is the functional inverse of the CDF of a probability distribution $\rho^*$ on $[0, 1]$, such that for any continuous bounded function $f$ we have

$$ \lim_{n \to \infty} \mathbb{E}_W \left[ \mathbb{E}_{(\mathbf{x}, \mathbf{x}') \sim \mathcal{P}_{\beta, W}^{\otimes 2}} f(\mathbf{x} \cdot \mathbf{x}') \right] = \int f(u) \rho^*(du), \qquad (13) $$

where $\mathcal{P}_{\beta, W}$ is the Gibbs measure defined in eq. (5).

Eq. (13) shows that in the *Parisi formula* of eq. (12), the functional parameter $q \in \mathcal{F}$ can be interpreted as the *average overlap distribution* of the system. Intuitively speaking, the “alignment” $\mathbf{x} \cdot \mathbf{x}'$ of two independent draws $\mathbf{x}, \mathbf{x}'$ of the Gibbs measure $\mathcal{P}_{\beta, W}$

<footnote n="7">⁷ Unfortunately, proving these properties often requires the full power of the so-called *Parisi formula* for the limit of the free entropy, which must first be proven as we discuss later.</footnote>

<footnote n="8">⁸ Since $\{W_\mu \cdot \mathbf{x}\}_{\mu=1}^n \stackrel{\text{i.i.d.}}{\sim} \mathcal{N}(0, 1)$.</footnote>
(sharing the same matrix W) will, on average, be distributed according to $\rho^*$ as $n \to \infty$. The fact that the large-size limit of the system is characterized by this overlap distribution (called therefore an “order parameter” in statistical physics) is one of the most important predictions of the replica symmetry breaking theory of Parisi, and we will further discuss this theory in the following.

**Rigorous approaches** While the most general full replica symmetry breaking framework is widely believed to yield exact predictions in the asymptotic limit, proving these predictions is a field of probability theory in itself. Indeed, significant progress has been made in some mean-field spin glass models, see e.g. [78,56], or in the context of inference problems and the study of computational-to-statistical gaps [14,10], but proving the validity of the replica symmetry breaking procedure in more generality remains one of the important open problems in a rigorous description of the physics of disordered systems. In particular, in the spherical perceptron considered here, the general full-RSB prediction is still a conjecture beyond the satisfiable phase.

Based on Conjectures 1.6 and 1.7, we can design a statistical physics program to characterize the injectivity of the ReLU layer:

(i) For any $\beta \ge 0$, compute $\Phi(\alpha, \beta) = \lim_{n \to \infty} \mathbb{E}_W \log \mathcal{Z}_n(W, \beta)/n$, as given by the Parisi formula of Conjecture 1.7.

(ii) Compute analytically the limit $f^*(\alpha) := -\lim_{\beta \to \infty} \Phi(\alpha, \beta)/\beta$. As we discussed above, this is a non-decreasing function of $\alpha$, and moreover $f^*(2) = 0$.

(iii) $\varphi_W$ is (typically) injective if $f^*(\alpha) > 1$, and non-injective if $f^*(\alpha) < 1$. In particular, if $f^*$ is continuous and strictly increasing (which we numerically observe), the injectivity threshold $\alpha_{inj}$ is characterized by

$$ \alpha_{inj} = [f^*]^{-1}(1). \qquad (14) $$

We perform this procedure in detail in Section 3, and it yields the main result of this section.

**Result 1.1 ("Full-RSB conjecture).** Assume Conjectures 1.6 and 1.7 hold. Denote by A the event "$\varphi_W$ (cf. eq. (1)) is injective", and let $p_{m,n} = \mathbb{P}_W[A]$. There exists a constant $\alpha_{FRSB} \in (6.6979, 6.6982)$, obtained via the Full-RSB prediction of Conjecture 1.7, such that:

(i) If $\limsup_{n \to \infty} (m/n) < \alpha_{inj}^{FRSB}$, then $\lim_{n \to \infty} p_{m,n} = 0$.

(ii) If $\liminf_{n \to \infty} (m/n) > \alpha_{inj}^{FRSB}$, then $\lim_{n \to \infty} p_{m,n} = 1$.

### 1.5.3. Additional bounds

**The replica hierarchy of upper bounds** In Conjecture 1.7, the FRSB prediction is given as

$$ \Phi_{\text{FRSB}}(\alpha, \beta) = \inf_{q \in \mathcal{F}} P[q; \alpha, \beta], \qquad (15) $$

and we saw that the function $q: [0, 1] \to [0, 1]$ could be interpreted in terms of an *overlap distribution*. Restricting the infimum to atomic overlap distributions with $k+1$ atoms (or, equivalently, letting $x \mapsto q(x)$ be a step function with $k+1$ steps) yields a sequence of upper bounds indexed by $k \ge 0$:

$$ \Phi^{\text{conj.}} = \Phi_{\text{FRSB}} = \lim_{k \to \infty} \Phi_{k-\text{RSB}} \le \dots \le \Phi_{k-\text{RSB}} \le \dots \le \Phi_{1\text{RSB}} \le \Phi_{\text{RS}}, \qquad (16) $$

in which the “$k$-RSB” functional is given by eq. (15), with the infimum restricted to step functions with $k+1$ steps, and we suppressed the dependence of all quantities on $\alpha$ and $\beta$ to lighten notation. Let $k^*$ be the smallest $k$ such that $\Phi_{\text{FRSB}}(\alpha, \beta) = \Phi_{k^*-\text{RSB}}(\alpha, \beta)$. If $1 \le k^* < \infty$, we say that the system is $k^*-\text{th step replica symmetry breaking}$; if $k^* = 0$ the system is called *replica-symmetric* (RS); if $k^*$ does not exist the system is said to exhibit *full replica symmetry breaking*. We will clarify the meaning of “replica symmetry breaking” in Section 2. Finally, note that by using Corollary 1.5 and Conjecture 1.6, eq. (16) transfers into a hierarchy of upper bounds for the injectivity threshold:

$$ \alpha_{inj}^{\text{conj.}} = \alpha_{inj}^{\text{FRSB}} \le \dots \le \alpha_{inj}^{(k+1)-\text{RSB}} \le \alpha_{inj}^{k-\text{RSB}} \le \dots \le \alpha_{inj}^{1\text{RSB}} \le \alpha_{inj}^{\text{RS}}, \qquad (17) $$

in which $\alpha_{inj}^{k-\text{RSB}}$ is the value of $\alpha$ at which $f_{k-\text{RSB}}^*(\alpha) := \lim_{\beta \to \infty} [-\Phi_{k-\text{RSB}}(\alpha, \beta)/\beta]$ crosses 1. In particular, as we will see in Section 2, one can compute $\alpha_{inj}^{\text{RS}} \approx 7.65$. Note that increasing $k$ and in particular going to the full-RSB solution, which conjecturally solves the problem, only takes us further from the Euler characteristic prediction $\alpha_{inj}^{\text{Euler}} \approx 8.34$. In Fig. 1 we illustrate the predictions at the RS, 1-RSB, and Full-RSB levels.

**Proving the replica-symmetric bound** We can state another rigorous characterization. Using Gordon's min-max theorem [38,75], we can prove that the replica-symmetric prediction is an upper bound on the injectivity threshold:

**Theorem 1.8 (Replica-symmetric upper bound for the injectivity threshold).** Assume that $\alpha > \alpha_{inj}^{\text{RS}} \approx 7.65$. Then $p_{m,n} \to 1$ as $n, m \to \infty$, that is, $\varphi_W$ is injective w.h.p.
<figure><img src="image_5.png" /><figcaption>Fig. 1. T = 0 limit of the RS, 1RSB and FRSB solutions, as a function of α. We compare the predictions for the ground state energy $f^*(α) = \lim_{β→∞} [-Φ(α, β)/β]$ and the zero-temperature susceptibility χ (see Sections 2 and 3). The green area is forbidden for $α_{inj}$ by the replica-symmetric lower bound of eq. (39). (For interpretation of the colors in the figure(s), the reader is referred to the web version of this article.)</figcaption></figure>

Note that for the computation of the Gardner capacity of the so-called “positive” perceptron, the replica-symmetric prediction has been shown to be tight also using Gordon’s inequality [69], because one can rewrite the associated min-max problem using a convex function on convex sets. In the unsatisfiable phase we consider here the solution is conjecturally full-RSB, and the replica-symmetric bound of Theorem 1.8 is not expected to be tight.

Theorem 1.8 is proved in Appendix A.5. It improves upon the earlier upper bounds of Theorem 1.3, and it disproves the Euler characteristic based threshold prediction $α_{inj}^{Euler} \approx 8.34$ [54,19,21]. In Appendix G, we provide an alternative proof of Theorem 1.8, developed during the review process of this paper, which leverages Gordon’s “escape through a mesh” theorem [39]. Due to this chronology, and because Gordon’s min-max theorem underpins the “escape through a mesh” result while potentially being better suited for future refinements (see the discussion below), we have retained the original proof alongside the “escape through a mesh” approach. Finally, let us mention two other bounds one can obtain on the injectivity threshold.

**The annealed bound** A classical approach in statistical physics to upper-bound the free entropy $Φ(α, β)$ is an annealed calculation. Namely, one uses Jensen’s inequality to write

$$E_W \Phi_n(W, \beta) = \frac{1}{n} E_W \log \bar{Z}_n(W, \beta) \le \frac{1}{n} \log E_W \bar{Z}_n(W, \beta) \xrightarrow{n \to \infty} \Phi_{ann}(\alpha, \beta).$$

This gives us an additional upper bound $Φ(α, β) \le Φ_{ann}(α, β)^9$ and a corresponding upper bound for the injectivity threshold $α_{inj} \le α_{inj}^{ann}$. We leave to the reader the exercise to show $Φ_{ann}(α, β) = α \log[(1 + e^{-β})/2]$. In particular, we have $-Φ_{ann}(α, β)/β \to 0$ as $β \to \infty$ for any $α > 0$, and therefore $α_{inj}^{ann} = +\infty$: here, the result of the annealed calculation is completely uninformative.

**An additional lower bound** In Fig. 1 we also show in green a region that is discarded for the injectivity threshold by a non-rigorous lower bound $α_{inj} \ge α_{dAT} \approx 5.32$, based on the de Almeida-Thouless criterion [22] of statistical physics. We detail its origin in Section 2.3, and its calculation in Appendix C. While it is not mathematically rigorous, proving it would follow from a rigorous computation of the free entropy in the “high-temperature” (or small $β$) phase in which replica symmetry is conjectured to hold. In many models, this turned out to be possible to handle more easily than the complete full-RSB conjecture, so we mention it for completeness. We also note that it improves over the lower bound $α_{inj} \ge 3.4$ of Theorem 1.3.

## 1.6. Structure of the paper and open problems

Section 2 has in great part a pedagogical purpose, to introduce the unacquainted reader to the (mostly non-rigorous) results of statistical physics known in the spin glass literature under the umbrella of replica method and replica symmetry breaking. We detail there the replica computation in the spherical perceptron and the arising of replica symmetry breaking, and derive the replica symmetric and one-step replica symmetry breaking predictions for the injectivity threshold. In Section 3 we discuss the full-replica symmetry breaking prediction for the free entropy, and we derive an efficient algorithmic procedure to solve the zero-temperature full-RSB equations. We discuss the numerical behavior of this algorithm, and use it to derive the numerical estimate of the injectivity threshold in Result 1.1. As mentioned, the proofs of our rigorous results (in particular Theorem 1.8) are given in Appendix A, and other analytical or numerical details and technical arguments will be deferred to the other appendices.

Let us finally mention a few open directions that stem from our analysis.

<footnote n="9">⁹ However, it never improves over the replica-symmetric one, since it is a general fact that $Φ_{RS}(α, β) \le Φ_{ann}(α, β)$.</footnote>
**Deep networks** A natural extension of our results would be to analyze a composition of multiple ReLU layers. Denoting still by $n$ the input dimension, Theorem 1.8 guarantees injectivity w.h.p. if the size $k_L$ of the L-th layer satisfies $k_L > n(\alpha_{\text{inj}}^{\text{RS}})^L$. However, this is far from optimal: leveraging the structure of the image space of a ReLU layer, [54,19] have shown that $k_L \ge n(C_1 + C_2 L \log L)$ (for some constants $C_1, C_2 > 0$) is enough to guarantee injectivity; this may be further improved using arguments based on random projections [61]. An interesting open question is whether the techniques we develop here (and in particular the replica symmetry breaking framework) can be extended to predict exact injectivity transitions in the multi-layer case.

**Stability of the inverse** While the injectivity question is limited to non-injective $\sigma$ – such as ReLU – in eq. (1), a natural extension would be to estimate the Lipschitz constant of the inverse of $\varphi_W$ on its range, either in the injective phase we described for $\sigma = \text{ReLU}$, or for any $\alpha > 0$ when $\sigma$ is injective. Whether this question can be tackled using statistical physics tools similar to the ones we used here is an interesting open direction.

**Improvement over Theorem 1.8** One can consider a closely-related model called the negative perceptron by replacing $\theta(x) = 1\{x > 0\}$ by $1\{x \ge \kappa\}$ with $\kappa < 0$ in the energy of eq. (3). In this model, even computing the Gardner capacity conjecturally requires the full-RSB prediction. We note that [70,53] have made a refined use of Gordon's inequality to improve over the replica-symmetric upper bound for the capacity. While similar ideas might be able to improve the upper bound of Theorem 1.8, it is not immediate to implement them, since the method used in [53] relies on the min-max problem being formulated over unit-norm vectors, which is not the case here: we give more details on this point in Appendix A.7. Since Theorem 1.8 already allows to disprove the Euler characteristic prediction, we leave such an improvement for later work.

**Large deviations of sublevel sets** The non-validity of the average Euler characteristic prediction also leads to interesting predictions on the energy landscape of the perceptron. Indeed, the quantity $q_{m,n}$ of eq. (7) is the mean Euler characteristic of a sublevel set $U$ of the perceptron, more precisely $q_{m,n} = \mathbb{E}_W[\chi(U)]$, with $U := \{x \in S^{n-1} : e_W(x) \le 1\}$. Recall that $\alpha_{\text{inj}}^{\text{Euler}} \approx 8.34$ while $\alpha_{\text{inj}}^{\text{RS}} \approx 7.65$. According to Theorem 1.8, for all $\alpha \in (\alpha_{\text{inj}}^{\text{RS}}, \alpha_{\text{inj}}^{\text{Euler}})$ (and conjecturally in $(\alpha_{\text{inj}}^{\text{RSB}}, \alpha_{\text{inj}}^{\text{Euler}})$) the set $U$ is typically empty: however its average Euler characteristic is exponentially large! A possible explanation for this discrepancy is that there exist large deviations events with probability $\exp(-nI_1)$ in which the set $U$ is not only non-empty, but has Euler characteristic $\exp(nI_2)$. A natural conjecture is that $I_2 > I_1$ for $\alpha < \alpha_{\text{inj}}^{\text{Euler}}$ and $I_2 < I_1$ for $\alpha > \alpha_{\text{inj}}^{\text{Euler}}$. Exploring further these large deviations could thus explain the error made in the Euler characteristic approach.

**Numerical code and reproducibility** All figures and numerical results in this paper are fully reproducible. The JAX [8] code is available in a GitHub repository [46].

**Acknowledgments** We would like to thank the anonymous referees for their feedback, which led in particular to the alternative proof of Theorem 1.8 presented in Appendix G. A.M. and A.B. thank D. Paleka, C. Clum, and D. Mixon for several discussions related to this paper. A.M. is grateful to F. Krzakala, L. Zdeborová, B. Loureiro and P. Urbani for insightful discussions. I.D. acknowledges support by the European Research Council (ERC) Starting Grant 852821—SWING.

## 2. The replica hierarchy of upper bounds

### 2.1. General principles of the replica method

The replica method is based on the replica trick, a heuristic use of the following formula, for any random variable $X > 0$ (assuming that all the moments written hereafter are well-defined):

$$ \mathbb{E} \log X = \lim_{r \to 0} \frac{\mathbb{E} X^r - 1}{r} = \frac{\partial}{\partial r} [\log \mathbb{E} X^r]_{r=0}. \quad (18) $$

While the replica trick is most often described as the first equality in eq. (18), we will here use the second (and equivalent) equality. Assuming that $\Phi(\alpha, \beta) := \lim_{n \to \infty} \mathbb{E}_W \Phi_n(\mathbf{W}, \beta)$ is well defined, we reach:

$$ \Phi(\alpha, \beta) = \lim_{n \to \infty} \frac{\partial}{\partial r} \left[ \frac{1}{n} \log \mathbb{E}_W \{ \mathcal{Z}_n (\mathbf{W}, \beta)^r \} \right]_{r=0}. \quad (19) $$

So far, eq. (19) is not really surprising. The replica method is based on several heuristics, and leverages the fact that it is often possible to compute the RHS of eq. (19) for integer $r$. More precisely, the replica method proceeds as follows:
## Replica method

(i) Assume that the limits $n \to \infty$ and $r \to 0$ can be inverted in eq. (19), i.e. that we have $\Phi(\alpha, \beta) = \partial_r[\Phi(\alpha, \beta; r)]_{r=0}$, with

$$ \Phi(\alpha, \beta; r) := \lim_{n \to \infty} \frac{1}{n} \log \mathbb{E}_{\mathbf{W}} \{ \mathcal{Z}_n (\mathbf{W}, \beta)^r \}. \quad (20) $$

(ii) Compute $\Phi(\alpha, \beta; r)$ for integer $r$, i.e. the asymptotics of the moments of $\mathcal{Z}_n(\mathbf{W}, \beta)$.

(iii) Use these values to analytically expand $\{\Phi(\alpha, \beta; r)\}_{r \in \mathbb{N}}$ to all $r \ge 0$.

(iv) Compute $\Phi(\alpha, \beta) = \partial_r[\Phi(\alpha, \beta; r)]_{r=0}$ from the analytic continuation above.

Note that step (i), although a priori non-rigorous, can sometimes be put on rigorous ground using convexity arguments, cf. e.g. page 146 of [78] in the context of the Sherrington-Kirkpatrick (or SK) model. The arguably “most heuristic” step is (iii), as there is in general no guarantee for the uniqueness of the analytic continuation (and it is often not unique!). The choice of the conjecturally correct continuation was proposed by Parisi in a remarkable series of papers [58–60], one of the most important contributions for which he earned a Nobel prize in Physics in 2021, and we will describe this choice in the following sections. In the SK model originally studied by Parisi his prediction was ultimately proven to be correct by Talagrand [77] and generalized by Panchenko [56], leveraging notably interpolation techniques that originated with Guerra [41]. An actual rigorous treatment of the replica method itself remains out of reach, and in the spherical perceptron considered here replica predictions have not been proven, with the exception of the satisfiable phase [68,69].

## 2.2. First steps of the replica method

Let us now perform step (ii) of the replica method. From now on, we relax the level of rigor and sometimes adopt notations closer to the theoretical physics literature, since the core of the method is heuristic. Fixing $r \in \mathbb{N}^*$ we have (recall eq. (6)):

$$ \begin{aligned} \Phi(\alpha, \beta; r) &= \lim_{n \to \infty} \frac{1}{n} \log \mathbb{E}_{\mathbf{W}} \left\{ \left( \int_{S^{n-1}} \mu_n(\mathrm{d}\mathbf{x}) e^{-\beta E_{\mathbf{W}}(\mathbf{x})} \right)^r \right\}, \\ &= \lim_{n \to \infty} \frac{1}{n} \log \int \prod_{a=1}^{r} \mu_n(\mathrm{d}\mathbf{x}^a) \mathbb{E}_{\mathbf{W}} \left\{ \prod_{a=1}^{r} \exp \left\{ -\beta \sum_{\mu=1}^{m} \theta \left[ (\mathbf{W}\mathbf{x}^a)_\mu \right] \right\} \right\}. \end{aligned} \quad (21) $$

We have used Fubini’s theorem in eq. (21). We see appearing a set $\{\mathbf{x}^a\}_{a=1}^r$ of independent samples from the Gibbs measure $P_{\beta, \mathbf{W}}$, with the same realization of the matrix $\mathbf{W}$: we call such independent samples replicas, following the statistical physics nomenclature. The expectation with respect to $\mathbf{W}$ in eq. (21) can be performed, since at fixed $\{\mathbf{x}^a\}$, $\mathbf{z}^a := \mathbf{W}\mathbf{x}^a$ are jointly Gaussian vectors with covariance $\mathbb{E}[\mathbf{z}_\mu^a \mathbf{z}_\nu^b] = \delta_{\mu\nu}Q^{ab}$, where we introduced the overlap matrix $Q^{ab} := \mathbf{x}^a \cdot \mathbf{x}^b$ (note that $Q^{aa} = 1$, $Q^{ab} = Q^{ba}$, and that the matrix $\{\mathbf{x}^a \cdot \mathbf{x}^b\}$ is almost surely invertible under $\mu_n^{\otimes r}$). Therefore we have:

$$ \mathbb{E}_{\mathbf{W}} \prod_{a=1}^{r} e^{-\beta \sum_{\mu=1}^{m} \theta[(\mathbf{W}\mathbf{x}^a)_\mu]} = I_{\beta}(\mathbf{Q})^m, $$

in which we defined

$$ I_{\beta}(\mathbf{Q}) := \int_{\mathbb{R}^r} \frac{d\mathbf{z}}{(2\pi)^{r/2} \sqrt{\det \mathbf{Q}}} e^{-\frac{1}{2} \mathbf{z}^T \mathbf{Q}^{-1} \mathbf{z}} e^{-\beta \sum_{a=1}^{r} \theta(z^a)}. \quad (22) $$

One can thus write eq. (21) as:

$$ \Phi(\alpha, \beta; r) = \lim_{n \to \infty} \frac{1}{n} \log \left[ \int \left\{ \prod_{a<b} dQ^{ab} \right\} J(\mathbf{Q}) \times I_{\beta}(\mathbf{Q})^m \right], $$

with $J(\mathbf{Q})$ defined as the PDF of the overlap matrix $Q(\{\mathbf{x}^a\})$ (for $\{\mathbf{x}^a\} \sim \mu_n^{\otimes r}$) evaluated in $\mathbf{Q}$:

$$ J(\mathbf{Q}) := \int \prod_{a=1}^{r} \mu_n(\mathrm{d}\mathbf{x}^a) \prod_{a<b} \delta(Q^{ab} - \mathbf{x}^a \cdot \mathbf{x}^b) = n^{\frac{r(r-1)}{2}} \frac{\int \prod_{a=1}^{r} \mathrm{d}\mathbf{x}^a \prod_{a \le b} \delta(nQ^{ab} - \mathbf{x}^a \cdot \mathbf{x}^b)}{\int \prod_{a=1}^{r} \mathrm{d}\mathbf{x}^a \delta(n - \|\mathbf{x}^a\|^2)}, \quad (23) $$

in which we used that $Q^{aa} = 1$ and we re-normalized $\mathbf{x}^a$ by $\sqrt{n}$. One way to compute the numerator in eq. (23) is to use an exponential tilting method, by the following argument: for any symmetric $\Lambda \in \mathbb{R}^{r \times r}$ positive-definite, we have

$$ \begin{aligned} & \frac{1}{n} \log \int \prod_{a=1}^{r} \mathrm{d}\mathbf{x}^a \prod_{a \le b} \delta(nQ^{ab} - \mathbf{x}^a \cdot \mathbf{x}^b) \\ &= \frac{1}{2} \mathrm{Tr}[\Lambda \mathbf{Q}] + \frac{1}{n} \log \int \prod_{a=1}^{r} \mathrm{d}\mathbf{x}^a \prod_{a \le b} \delta(nQ^{ab} - \mathbf{x}^a \cdot \mathbf{x}^b) e^{-\frac{1}{2} \sum_{a,b} \Lambda^{ab} \mathbf{x}^a \cdot \mathbf{x}^b}. \end{aligned} \quad (24) $$
The idea is to pick $\Lambda$ so that under the probability distribution $P_{\Lambda}(\{x^a\}) \propto \exp\{-\frac{1}{2} \sum_{a,b} \Lambda^{ab} x^a \cdot x^b\}$, we have with high probability $x^a \cdot x^b / n \to Q^{ab}$ as $n \to \infty$. Since $P_{\Lambda}$ is Gaussian, one finds $\Lambda = Q^{-1}$ as the correct choice. Heuristically, the argument then goes as follows: for $\Lambda = Q^{-1}$, the constraint terms in eq. (24) are satisfied as $n \to \infty$, so that we can remove the Dirac deltas without affecting the asymptotic value of the integral. Performing the same calculation in the denominator (for which $\Lambda = I_r$ is now the correct choice), one reaches:

$$ \frac{1}{n} \log J(Q) = \frac{1}{2} \mathrm{Tr}[Q^{-1}Q] + \log \int_{\mathbb{R}^r} \prod_{a=1}^{r} dx^a e^{-\frac{1}{2} \sum_{a,b} (Q^{-1})^{ab} x^a x^b} - \frac{r(1 + \log 2\pi)}{2} + o_n(1). \quad (25) $$

Such “exponential tilting” arguments can be made rigorous, and are classical e.g. in the theory of large deviations [25]. Another (equivalent) way to obtain eq. (25) is to introduce the Fourier transform of the Dirac delta in eq. (23), and perform a saddle-point method over the parameters of the Fourier integral, see e.g. [15] or [81]. The Gaussian integral in eq. (25) can be computed:

$$ \frac{1}{n} \log J(Q) = \frac{1}{2} \log \det Q + o_n(1). $$

This yields:

$$ \Phi(\alpha, \beta; r) = \lim_{n \to \infty} \frac{1}{n} \log \left[ \int \left\{ \prod_{a<b} dQ^{ab} \right\} \exp\{nF_n(Q)\} \right], \quad (26) $$

with

$$ F_n(Q) := \frac{1}{2} \log \det Q + \alpha \log I_{\beta}(Q) + o_n(1). $$

It is crucial that in many physical models, the average of the replicated partition function can be written as in eq. (26), as a function of a low-dimensional parameter (recall that $Q$ is a $r \times r$ matrix, and that $r$ is a fixed positive integer). In physics, one refers to the overlap matrix $Q$ as the order parameter of the problem: a low-dimensional quantity that allows to characterize the macroscopic behavior of our high-dimensional system (similarly to the average magnetization in a ferromagnet for instance).

Applying Laplace's method to the integral in eq. (26), we finally reach:

$$ \Phi(\alpha, \beta; r) = \sup_Q \left[ \frac{1}{2} \log \det Q + \alpha \log I_{\beta}(Q) \right], \quad (27) $$

where the supremum is over $r \times r$ symmetric positive-definite matrices such that $Q^{aa} = 1$, and recall that $I_{\beta}(Q)$ is defined in eq. (22). Note that we completely removed the high dimensionality of the problem! The remaining task is to perform step (iii) of the replica method, i.e. to analytically continue $\Phi(\alpha, \beta, r)$ to any $r > 0$. This is the crucial difficulty of the replica method (and the main reason why it is ill-posed mathematically in general), which was solved by Parisi [58–60].

## 2.3. The replica-symmetric solution

The functional in eq. (27) is symmetric: one can permute the different replicas of the systems (and correspondingly swap the rows and columns of $Q$) without changing the value of the functional. This has led physicists to first assume that the supremum in eq. (27) is attained by a matrix $Q$ that is also invariant under permutations, i.e. that satisfies $Q^{ab} = q$ for all $a \neq b$. This replica-symmetric assumption was historically the first one considered to find a solution to the SK model [66]. We will see how it allows to complete the final steps of the replica method.

Note that replica symmetry can be put on a firmer mathematical ground, using the following characterization.

**Replica symmetry (RS)** – Let $Q(x, x') := x \cdot x'$, and recall the Gibbs distribution $P_{\beta,W}$ of eq. (5). Replica symmetry amounts to assuming that the random variable $Q(x, x')$ concentrates when $x, x'$ are sampled independently from $P_{\beta,W}$ (with the same W), in the following sense:

$$ \lim_{n \to \infty} \mathbb{E}_W \left[ \mathbb{E}_{(x,x') \sim P_{\beta,W}^{\otimes 2}} \left\{ (Q(x,x') - \mathbb{E}Q)^2 \right\} \right] = 0, \quad (28) $$

$$ \text{with the shorthand } \mathbb{E}Q := \mathbb{E}_W[\mathbb{E}_{(x,x') \sim P_{\beta,W}^{\otimes 2}} (Q(x,x'))]. $$

In particular, under the RS ansatz, we can write the off-diagonal elements of the overlap matrix appearing in eq. (27) as $Q^{ab} = q = \mathbb{E}_W[\mathbb{E}_{(x,x') \sim P_{\beta,W}^{\otimes 2}} (x \cdot x')]$, in which $x, x'$ are two independent samples under the Gibbs measure with quenched noise $W$ (two replicas of the system), and $a \neq b$. Therefore, we also have $q = \mathbb{E}_W[\|\mathbb{E}_{x \sim P_{\beta,W}}(x)\|^2]$, which implies in particular that $q \in [0, 1]$.

Let us now finish the replica calculation under a replica symmetric assumption, going back to eq. (27). By simple linear algebra calculations, the RS ansatz implies, for all $a \neq b$:
<figure><img src="image_6.png" /><figcaption>Fig. 2. The function $\Phi_{RS}(r, q) - \Phi_{RS}(r, q^*(r))$ as a function of $q \in [0, 1]$, for different values of $r$ close to 1, and $q^*(r)$ the unique solution to $\partial_q \Phi_{RS}(r, q) = 0$. We observe that $q^*(r)$ is a global maximum for $r > 1$, and becomes a global minimum for $r < 1$. Here $\alpha = 5$ and $\beta = 1$.</figcaption></figure>

$$ egin{cases} Q_{ab}^{-1} = \frac{q}{(1-q)[1+(r-1)q]}, \\ Q_{aa}^{-1} - Q_{ab}^{-1} = \frac{1}{1-q}, \end{cases} $$

and moreover

$$ \log \det \mathbf{Q} = (r-1) \log[1-q] + \log[1+(r-1)q]. \quad (29) $$

Plugging the form of $\mathbf{Q}^{-1}$ we have:

$$ \begin{aligned} \exp\left\{-\frac{1}{2}\mathbf{z}^\top\mathbf{Q}^{-1}\mathbf{z}\right\} &= \exp\left\{-\frac{1}{2(1-q)}\sum_{a=1}^r (z^a)^2 + \frac{q}{2(1-q)[1+(r-1)q]}\left(\sum_{a=1}^r z^a\right)^2\right\} \\ &= \int D\xi \exp\left\{-\frac{1}{2(1-q)}\sum_{a=1}^r (z^a)^2 + \sqrt{\frac{q}{(1-q)[1+(r-1)q]}}\left(\sum_{a=1}^r z^a\right)\xi\right\}. \end{aligned} \quad (30) $$

Recall that $D\xi$ is the standard Gaussian measure on $\mathbb{R}$, and we have used the identity $\exp(x^2/2) = \int D\xi \exp(x\xi)$. Plugging eqs. (29) and (30) in eq. (27) we reach, for $r \in \mathbb{N}^*$:

$$ \begin{aligned} \Phi_{RS}(\alpha, \beta; r) = \sup_{q \in [0,1]} \Phi_{RS}(\alpha, \beta; r, q) = \sup_{q \in [0,1]} & \left[ -\frac{\alpha-1}{2} \left[ (r-1)\log[1-q] + \log[1+(r-1)q] \right] \right] \\ & + \alpha \log \int D\xi \left[ \int_{\mathbb{R}} \frac{dz}{\sqrt{2\pi}} e^{-\frac{1}{2(1-q)}z^2 + \sqrt{\frac{q}{(1-q)[1+(r-1)q]}}z\xi - \beta\theta(z)} \right]^r. \end{aligned} \quad (31) $$

One can now begin to see how the replica-symmetric ansatz yields an analytical continuation of $\Phi_{RS}(\alpha, \beta; r)$ for all $r > 0$. A final non-trivial (and non-rigorous) technicality of the replica method, which we do not detail here, is that when we analytically expand the function above to $r < 1$, theoretical physicists argue that maximizers of eq. (31) for $r > 1$ are continued into minima of $\Phi_{RS}(r, q)$ for $r < 1$. We refer to [50] for a detailed discussion: in the present case this phenomenon can be easily observed numerically, see Fig. 2. Under the replica-symmetric ansatz, we therefore obtain:

$$ \begin{aligned} \Phi_{RS}(\alpha, \beta) &= \partial_r[\Phi_{RS}(\alpha, \beta; r)]_{r=0} \\ &= \inf_{q \in [0,1]} \left\{ -\frac{\alpha-1}{2} \left[ \log[1-q] + \frac{q}{1-q} \right] + \alpha \int D\xi \log \int \frac{dz}{\sqrt{2\pi}} e^{-\frac{1}{2(1-q)}z^2 + \sqrt{\frac{q}{1-q}}z\xi - \beta\theta(z)} \right\}. \end{aligned} $$

The inner integral is easy to work out:

$$ \int_{\mathbb{R}} \frac{dz}{\sqrt{2\pi}} e^{-\frac{1}{2(1-q)}z^2 + \sqrt{\frac{q}{1-q}}z\xi - \beta\theta(z)} = \sqrt{1-q} e^{\frac{q}{2(1-q)}\xi^2} \left[ 1 - (1 - e^{-\beta})H\left(-\xi\sqrt{\frac{q}{1-q}}\right) \right], $$

where $H(x) := \int_{\mathbb{X}} Du = [1 - \text{erf}(x/\sqrt{2})]/2$. In particular, $H'(x) = -e^{-x^2/2}/\sqrt{2\pi}$. Then:

$$ \Phi_{RS}(\alpha, \beta) = \inf_{q \in [0,1]} \left\{ \frac{1}{2} \left[ \log[1-q] + \frac{q}{1-q} \right] + \alpha \int D\xi \log \left[ 1 - (1 - e^{-\beta}) H\left(\xi \sqrt{\frac{q}{1-q}}\right) \right] \right\}. \quad (32) $$

For any $\beta \ge 0$, the minimizing $q$ is thus given by the solution to

$$ \frac{q^{3/2}}{\sqrt{1-q}} = \alpha \int D\xi \frac{(1 - e^{-\beta}) \xi H'(\xi \sqrt{\frac{q}{1-q}})}{1 - (1 - e^{-\beta}) H(\xi \sqrt{\frac{q}{1-q}})} \quad (33) $$
that minimizes the functional of eq. (32). The quantity $e^*(\alpha, \beta) := -\partial_\beta \Phi_{RS}(\alpha, \beta)$ is called the *average intensive energy*: as can be seen from eq. (6), $ne^*(\alpha, \beta)$ is the average number of negative components of $\mathbf{x}$ when sampled from the Gibbs measure of eq. (5). At the replica-symmetric level it is given by:

$$e_{RS}^*(\alpha, \beta) = \alpha e^{-\beta} \int_{\mathbb{R}} D\xi \frac{H\left(\xi \sqrt{\frac{q}{1-q}}\right)}{1 - (1 - e^{-\beta})H\left(\xi \sqrt{\frac{q}{1-q}}\right)}. \quad (34)$$

In particular, one sees that for $\beta = 0$ we have $q = 0$ and $e^*(\alpha, \beta = 0) = \alpha/2$, which is the typical number of negative components of a random $m$-dimensional vector (divided by $n$).

**The zero-temperature limit** – For any $\alpha > 2$ (i.e. in the UNSAT phase), one can check from eq. (33) that $q \to 1$ as $\beta \to \infty$. This means that the replica-symmetric ansatz predicts that, as $\beta \to \infty$, the Gibbs measure concentrates on the global minima of $E_W(\mathbf{x})$, and that (at fixed $W$) the distance between any two such minima goes to 0 as $n \to \infty$.<fnref n="10" /> One can see also from this equation (cf. [34,30]) that the expansion of the solution $q$ is of the type:

$$q = 1 - \frac{\chi_{RS}}{\beta} + \mathcal{O}(\beta^{-2}), \quad (35)$$

where $\chi_{RS}$ is the so-called zero-temperature susceptibility. Plugging this expansion in the equations above, we recover the result of [34] (we detail the computations in Appendix B.1). We find that $\chi_{RS}$ is the unique solution to:

$$\alpha \int_{0}^{\sqrt{2\chi_{RS}}} D\xi \xi^2 = 1, \quad (36)$$

and $f_{RS}^*(\alpha) = \lim_{\beta \to \infty} [-\Phi_{RS}(\alpha, \beta)/\beta]$ is given as (recall $H(x) = \int_x^\infty Du$):

$$f_{RS}^*(\alpha) = \alpha H[\sqrt{2\chi_{RS}}]. \quad (37)$$

**Replica-symmetric prediction for $\alpha_{inj}$** – Recall the criterion of eq. (14) for the injectivity threshold. Eqs. (36) and (37) are easy to analyze numerically, and they yield that $f_{RS}^*(\alpha) = 1$ for:

$$\alpha_{inj}^{RS} \approx 7.64769, \quad (38)$$

in which RS stands for the replica-symmetric assumption.

**Instability of the replica-symmetric solution and the need for a different ansatz** – An important check of the validity of the replica-symmetric ansatz is that it indeed is a maximum of the functional given in eq. (27) (or a minimum when $r < 1$ as we discussed). This can be verified locally, by considering the Hessian of this function, and looking at the sign of its eigenvalues when $r \to 0$. The stability criterion is called the *de Almeida-Thouless (dAT)* condition [22], and we derive it in Appendix B.2 for any inverse temperature $\beta \ge 0$, cf. eq. (98). However, we also show that this condition is never satisfied in the limit $\beta \to \infty$, for any $\alpha > 2$. This suggests that the correct solution actually breaks the replica symmetry! Formally, the functional of eq. (27) exhibits a well-known physical phenomenon known as spontaneous symmetry breaking: while the function to maximize is invariant under the group of permutations of the $r$ replicas, any particular maximum is not invariant under this symmetry.

**A replica-symmetric lower bound** – In Appendix C, we detail a way to use the replica-symmetric prediction at finite $\beta \ge 0$, combined with the stability analysis of Appendix B.2, to obtain a lower bound on $\alpha_{inj}$:

$$\alpha_{inj} \ge \alpha_{dAT} \approx 5.3238, \quad (39)$$

in which the definition and calculation of $\alpha_{dAT}$ can be deduced solely from the replica-symmetric calculation at high enough temperature (low enough $\beta$). High temperature replica-symmetric regimes in spin glasses are notoriously easier to analyze mathematically than low-temperature settings [78]: for this reason, while we do not provide here a mathematical proof of eq. (39), we expect it to be easier to establish rigorously than bounds from replica symmetry breaking theory, and we leave a proof of eq. (39) as an interesting open problem. We refer to Appendix C for more details on this bound, which is shown as a light green area in Fig. 1.

## 2.4. The overlap distribution and replica symmetry breaking

Since we must go beyond replica symmetry, one has to understand what could happen if the overlap concentration of eq. (28) is not satisfied. We define $q \equiv \mathbf{x} \cdot \mathbf{x}'$, in which $\mathbf{x}, \mathbf{x}'$ are independent samples under the Gibbs measure of eq. (5), with the *same quenched noise* $W$, and we will study the law of $q$ *averaged over W*, which we will denote $\rho_n(q)$.

A natural possibility is that, while the random variable $q$ no longer concentrates, its average distribution $\rho_n(q)$ still converges (weakly) to an asymptotic law $\rho(q)$ (for $q \in [0, 1]$) as $n \to \infty$. Replica-symmetry then corresponds to the case $\rho(q) = \delta(q - q_0)$. But how

<footnote n="10">¹⁰ As we will see in Sec. 3, while the replica-symmetry assumption turns out to be wrong, this prediction remains correct!</footnote>
does an arbitrary $\rho(q)$ transfers to a $r \times r$ overlap matrix $Q$ maximizing eq. (27)? Actually, the other way (going from $Q$ to $\rho(q)$) is easier to formalize. Indeed, for the same $W$, let us draw two independent samples $x, x'$ under the Gibbs measure (two “replicas”). On average, their overlap is distributed as the off-diagonal elements of the overlap matrix, i.e. we have (one can formalize this argument, see e.g. [52])

$$ \rho(q) \approx \frac{1}{r(r-1)} \sum_{a \neq b} \delta(q - Q^{ab}). $$

However, recall that our physical system is not represented by the overlap matrix $Q$ at finite $r$, but rather by its $r \to 0$ limit, so we should take this limit as well to get the $\rho(q)$ that describes our original physical system (even though taking the $r \to 0$ limit of a $r \times r$ matrix shatters much of our intuition!). More concretely, the overlap distribution $\rho(q)$ is related to the overlap matrix $Q$ by:

$$ \rho(q) = \lim_{r \to 0} \frac{1}{r(r-1)} \sum_{a \neq b} \delta(q - Q^{ab}). \quad (40) $$

**One-step replica symmetry breaking** – To build back our intuition a bit, let us look at the simplest possible $\rho(q)$ beyond the RS ansatz, that is, let us assume that $\rho(q) = m\delta(q - q_0) + (1-m)\delta(q - q_1)$, with $m \in [0, 1]$, and $q_0 \le q_1$. One brilliant realization of Parisi [58–60] was that this distribution arises from an ultrametric overlap matrix $Q$, i.e. that has the following form:

$$ \rho(q) = m\delta(q - q_0) + (1-m)\delta(q - q_1) \quad \text{“} \iff \text{“} \quad Q = \begin{pmatrix} 1 & q_1 & q_1 \\ q_1 & 1 & q_1 \\ q_1 & q_1 & 1 \\ \vdots & \vdots & \vdots \\ q_0 & q_0 & \vdots \\ \vdots & \vdots & \vdots \\ 1 & q_1 & q_1 \\ q_1 & 1 & q_1 \\ q_1 & q_1 & 1 \end{pmatrix}. \quad (41) $$

Let us detail how to go from the $Q$ shown in eq. (41) to the $\rho(q)$ that we want. We denote $x \in \{1, \dots, r\}$ the size of the diagonal blocks in this matrix $Q$. Then:

$$ \frac{1}{r(r-1)} \sum_{a \neq b} \delta(q - Q^{ab}) = \frac{x-1}{r-1} \delta(q - q_1) + \frac{r-x}{r-1} \delta(q - q_0). \quad (42) $$

Now arises an issue: since we take the $r \downarrow 0$ limit, and $x \in \{1, \dots, r\}$ is an integer, how should we proceed? Comparing eq. (42) with our target $\rho(q)$ gives us a possible answer (which turns out to be the correct one [50]): relaxing the constraint that $x \in \{1, \dots, r\}$, and taking the limit $r \downarrow 0$ independently of $x$, we reach:

$$ \rho(q) = (1-x)\delta(q - q_1) + x\delta(q - q_0), $$

i.e. exactly the $\rho(q)$ we wanted to build, with $x = m \in [0, 1]$ which now became a real parameter in [0, 1]. This type of distribution $\rho(q)$ (and by extension the corresponding $Q$ in eq. (41)) is called One-Step Replica Symmetry Breaking (1RSB).

**General replica symmetry breaking** – More generally, one can represent a distribution with a finite support of $(k+1)$ elements as $\rho(q) = \sum_{i=0}^{k} (m_i - m_{i-1})\delta(q - q_i)$, with weights $m_0 \le m_1 \le \dots \le m_{k-1} \le m_k$, using the conventions $m_{-1} = 0, m_k = 1$. This distribution is called “k-step replica symmetry breaking” (k-RSB), and in this ansatz, the overlap matrix $\{Q^{ab}\}$ can be written as a hierarchical generalization of eq. (41) (with the convention $q_{-1} = 0$ and $q_{k+1} = 1$):

$$ Q = \sum_{i=0}^{k+1} (q_i - q_{i-1}) J_{m_{i-1}}^{(r)}, $$

with $J_{m_{i-1}}^{(r)}$ the block-diagonal matrix with $r/m$ blocks of size $m$, each diagonal block being the all-ones matrix. Once again, the integers $\{m_i\}_{i=0}^k$ become elements of $[0, 1]$ in the $r \downarrow 0$ limit. As in the replica-symmetric case discussed above, the limit $r \downarrow 0$ also turns the maximum over $\{m_i, q_i\}$ into an infimum [50]. In the end, the k-RSB prediction for the free entropy is of the form:

$$ \Phi_{k-\text{RSB}}(\alpha, \beta) = \inf_{0 \le q_0 \le \dots \le q_k \le 1} \inf_{0 < m_0 < \dots < m_{k-1} < m_k = 1} \mathcal{P}[\{m_i\}, \{q_i\}; \alpha, \beta]. \quad (43) $$

It is common to represent the right hand side as a function of a step function $q(x)$ for $x \in [0, 1]$, uniquely defined by $\{m_i\}$ and $\{q_i\}$, see Fig. 3 (left, blue curve). We write then the argument of the RHS of eq. (43) as $\mathcal{P}[\{q(x)\}; \alpha, \beta]$. This allows to consider completely generic distributions $\rho(q)$ (or equivalently functions $q(x)$), by taking the $k \to \infty$ limit of eq. (43). This generic procedure is called “Full Replica Symmetry Breaking” (Full RSB), and was introduced by Parisi in [58]. It yields for the free entropy a formula of the type:

$$ \Phi_{\text{FRSB}}(\alpha, \beta) = \inf_{\{q(x)\}} \{\mathcal{P}[\{q(x)\}; \alpha, \beta]\}. \quad (44) $$
<figure><img src="image_7.png" /><figcaption>Fig. 3. Illustration of the finite-RSB and full-RSB structure in the functions $\rho(q)$ (right) and $q(x)$ (left). We use the convention $m_{-1} = 0$. In terms of the overlap distribution, the k-RSB ansatz (in blue) corresponds to $\rho(q) = \sum_{i=0}^{k}(m_i - m_{i-1})\delta(q - q_i)$, with the convention $m_{-1} = 0$. In orange, the full-RSB distribution is $\rho(q) = \int_{0}^{1}\delta(q - q(x))dx$, and is assumed to have two delta peaks at the edges of its support $q \in \{q_m, q_M\}$, with masses $\{x_m, (1-x_M)\}$ (see the equation on the right figure). $x(q)$ is the functional inverse of $q(x)$.</figcaption></figure>

Such formulas are usually called Parisi formulas in the spin glass literature. Note that in many disordered models, the overlap distribution $\rho(q)$ has been observed to have two points with positive mass, at the edges of its bulk (see Fig. 3, right). This leads to generically characterize the function $q(x)$ as (see Fig. 3 right, red curve):

$$ \left\{ \begin{array}{ll} q(x) = q_m & \text{if } x \in [0, x_m], \\ q(x) & \text{if } x \in [x_m, x_M], \\ q(x) = q_M & \text{if } x \in [x_M, 1]. \end{array} \right. $$

This is purely a convention that often turns out to be convenient and does not remove any generality as one can always set $x_m = 0$ and $x_M = 1$.

**Relation between $\rho(q)$ and $q(x)$** – For an overlap distribution with a well-defined density $\rho(q)$, one has the relation $\rho(q) = x'(q)$, with $x(q) \in [0, 1]$ the CDF of the overlap, and $x \mapsto q(x)$ is then the functional inverse of $q \mapsto x(q)$.

**RSB and the form of the Gibbs measure** – Interestingly, one can interpret the level of RSB as an assumption on the structure of the level sets of the Gibbs measure (or the global minima of the energy, when $\beta = \infty$). Roughly speaking, 1-RSB corresponds to an organization of the mass of the Gibbs measure into clusters. Inside each cluster two solutions typically have overlap $q_1$, while solutions belonging to two different clusters have a typical overlap $q_0$. This hierarchy can be iterated inside each cluster, which gives rise to the 2-RSB structure. Iterating even further, the level of RSB corresponds to the depth of this hierarchical structure of clusters, which is known as ultrametric [49,55]. Ultrametricity and RSB is a beautiful mathematical representation of the free energy landscape of spin glass models, which also allows creating efficient algorithms [26, 27, 72, 47, 5].

A thorough description of all the consequences of replica symmetry breaking would be beyond our scope: the major reference on this topic is [50], and we invite the reader to read as well [78], and the very recent lecture notes [52], for discussions in a more mathematically-friendly language.

## 2.5. One-step replica symmetry breaking

We start by generalizing the calculation we made in Section 2.3 to the more general one-RSB ansatz we described above. We give the results here, while the calculation is detailed in Appendix D. The final result is given as an infimum over three parameters $\{m, q_0, q_1\}$ (see Fig. 3 for their interpretation):

$$ \Phi_{1RSB}(\alpha, \beta) = \inf_{m, q_0, q_1} \left[ \frac{m-1}{2m} \log(1-q_1) + \frac{1}{2m} \log[1-mq_0 + (m-1)q_1] + \frac{q_0}{2[1-mq_0 + (m-1)q_1]} \right. \\ \left. + \frac{\alpha}{m} \int D_{\xi_0}^{\xi} \log \left\{ \int D_{\xi_1}^{\xi} \left[ 1 - (1 - e^{-\beta})H\left(-\frac{\sqrt{q_0\xi_0 + \sqrt{q_1 - q_0\xi_1}}}{\sqrt{1-q_1}}\right) \right]^m \right\} \right]. \quad (45) $$

Note that when $q_1 = q_0$ or when $m = 1$, the overlap distribution $\rho(q)$ reduces to a single delta peak, and we consistently retrieve the replica-symmetric solution of eq. (32).

**The zero-temperature limit and the injectivity threshold** – In Appendix D.2, we detail how to take the $\beta \to \infty$ limit in $\Phi_{1RSB}(\alpha, \beta)$, and to obtain the function $f_{1RSB}^*(\alpha) := \lim_{\beta \to \infty} [-\Phi_{1RSB}(\alpha, \beta)/\beta]$. In Appendix D.3 we present the numerical procedure we used to solve the resulting equations. We reach the light blue curve in Fig. 1 for $f_{1RSB}^*(\alpha)$, and in particular we have

$$ \alpha_{\text{inj}}^{\text{RSB}} \approx 6.7157. \quad (46) $$
**Validity of the 1-RSB assumption** – While the 1-RSB ansatz is a natural extension of the previous replica symmetric assumption, the results of [30] (which study the same model with a slightly different energy function) strongly suggest that for any $\alpha > 2$, at low enough temperatures the system undergoes a continuous transition from a RS to a Full RSB phase, without any finite level of RSB at intermediate temperatures.<fnref n="11" /> This motivates us to compute the complete Full RSB picture in Section 3. Nevertheless, we will see the 1-RSB prediction of eq. (46) is already very accurate.

### 3. The full-RSB solution: exact injectivity threshold

#### 3.1. The full-RSB prediction for the free entropy

The full-RSB calculation is detailed in Appendix E, and quite closely follows a similar derivation presented in [30,81].

**Notations** – Before stating the result, let us introduce some notation. For any $\sigma \ge 0$, we let $\gamma_{\sigma^2}(h) = \exp\{-h^2/(2\sigma^2)\}/\sqrt{2\pi\sigma^2}$ the PDF of $N(0, \sigma^2)$. For two functions $a, b: \mathbb{R} \to \mathbb{R}$, we denote $(a \star b)(h) = \int du a(u)b(h-u)$ their convolution. For a function $f(x, h)$ with $x \in [0, 1]$ and $h \in \mathbb{R}$, we always consider convolutions in the $h$ variable, e.g. the notation $\gamma_{\sigma^2} \star f(x, h)$ denotes the function $(\gamma_{\sigma^2} \star f)(x, h) = \int du \gamma_{\sigma^2}(u)f(x, h-u)$. Moreover, we denote with a dot derivatives in the $x$ variable, and with a prime derivatives in the $h$ variable, e.g. $f' = \partial_x f$ and $f'' = \partial_h^2 f$.

Let us now state the results of the full-RSB calculation. We obtain the following formula for the free entropy:

$$ \Phi_{\text{FRSB}}(\alpha, \beta) = \inf_{\{q(x)\}} \left\{ \frac{1}{2} \log(1-q(1)) + \frac{q(0)}{2(1-q)} + \frac{1}{2} \int_0^1 du \frac{\dot{q}(u)}{\lambda(u)} + \alpha(\gamma_{q(0)} \star f)(0, 0) \right\}. \quad (47) $$

Here, we denoted $\langle q \rangle = \int_0^1 du q(u)$ and we defined the auxiliary function:

$$ \lambda(x) := 1 - xq(x) - \int_x^1 dy q(y). \quad (48) $$

Moreover, $f(x, h)$ is taken to be the solution of the Parisi PDE:

$$ \left\{ \begin{aligned} f(1, h) &= \log \gamma_{1-q(1)} \star e^{-\beta\theta}(h), \\ \dot{f}(x, h) &= -\frac{\dot{q}(x)}{2} [f''(x, h) + x f'(x, h)^2], \quad x \in (0, 1). \end{aligned} \right. \quad (49) $$

Similar equations were derived and analyzed in [30,81]. These works followed a long series of important papers on the spherical perceptron and its connection to the packing of hard spheres [18,31,65]. Note that these works consider a shift $\sigma$ in the perceptron activation, so that here we are in the $\sigma = 0$ setting of their results. Moreover, their energy function is slightly different from eq. (3), as it contains a multiplicative quadratic term.

**The positive-temperature FRSB equations** – In order to impose the Parisi PDE constraint on the function $f(x, h)$ in eq. (47), we use a functional Lagrange multiplier $\Gamma(x, h)$. This yields that the free entropy $\Phi_{\text{FRSB}}(\alpha, \beta)$ is given by the extremization with respect to $q(x)$, $\Lambda(x, h)$, $f(x, h)$ of:

$$ \begin{aligned} \Phi_{\text{FRSB}}(\alpha, \beta) = & \frac{1}{2} \log(1-q(1)) + \frac{q(0)}{2(1-q)} + \frac{1}{2} \int_0^1 du \frac{\dot{q}(u)}{\lambda(u)} + \alpha \gamma_{q(0)} \star f(0, 0) \\ & - \alpha \int dh \Lambda(1, h) [f(1, h) - \log \gamma_{1-q(1)} \star e^{-\beta\theta}(h)] \\ & + \alpha \int_0^1 dx \int dh \Lambda(x, h) [\dot{f}(x, h) + \frac{\dot{q}(x)}{2} (f''(x, h) + x f'(x, h)^2)]. \end{aligned} \quad (50) $$

Differentiating these equations with respect to $\Lambda(x, h)$ yields the Parisi PDE of eq. (49) (as it should), while differentiation w.r.t. $q(x)$ and $f(x, h)$ respectively yield:

<footnote n="11">¹¹ In particular, a stability analysis of the 1-RSB ansatz, similar to what we did in Appendix B.2, would yield that it becomes unstable at the same temperature as the RS ansatz.</footnote>
$$ 
\begin{equation}
\begin{cases}
\frac{q(0)}{\lambda(0)^2} + \int_0^x du \frac{\dot{q}(u)}{\lambda(u)^2} = \alpha \int dh \Lambda(x, h) f'(x, h)^2, & (a) \\
\dot{\Lambda}(x, h) = \frac{\dot{q}(x)}{2} [\Lambda''(x, h) - 2x(f'(x, h)\Lambda(x, h))'], & (b) \\
\Lambda(0, h) = \gamma_{q(0)}(h). & (c)
\end{cases}
\tag{51}
\end{equation}
$$

Finally, differentiation w.r.t. $\beta$ yields the average energy:

$$ e_{\text{FRSB}}^{*}(\alpha, \beta) := -\Phi'_{\text{FRSB}}(\alpha, \beta) = \alpha \int dh \Lambda(1, h) \frac{[\gamma_{1-q(1)} \star \theta e^{-\beta\theta}](h)}{[\gamma_{1-q(1)} \star e^{-\beta\theta}](h)}. \tag{52} $$

**A sanity check: the RS solution** – In the RS assumption, we have $q(x) = q_0$ for all $x$. In particular, this implies that $\dot{q}(x) = 0$, and $q(0) = \langle q \rangle = q_0$. Moreover, it is easy to see that in this case, since $\dot{q}(x) = 0$, we have $f(x, h) = f(1, h) = \log \gamma_{1-q_0} \star e^{-\beta\theta(h)}$ for all $x$, and similarly $\Lambda(x, h) = \gamma_{q_0}(h)$. Therefore, eq. (51a) becomes:

$$ \frac{q_0}{(1-q_0)^2} = \alpha \int dh \gamma_{q_0}(h) \left[ \frac{(\gamma_{1-q_0} \star e^{-\beta\theta})'(h)}{\gamma_{1-q_0} \star e^{-\beta\theta}(h)} \right]^2. \tag{53} $$

One can check (the derivation is presented in Appendix E.3) that this equation is equivalent to eq. (33): we found back the RS solution!

## 3.2. Zero-temperature limit and algorithm for the injectivity threshold

**The zero-temperature limit** – In the zero temperature limit, the scaling of the FRSB equations in the “UNSAT” phase of a slightly different spherical perceptron has been worked out in [30]. The scaling with $\beta$ of the solution to eqs. (49) and (51), as $\beta \to \infty$, can be deduced by transposing their arguments to our model. More precisely, in the $\beta \to \infty$ limit, letting $\lambda(q) := \lambda[x(q)]$ and $f(q, h) := f(x(q), h)$, one can show that the “rescaled” variables $(\beta(1-q_M); \beta x(q); \beta \lambda(q); \beta^{-1} f(q, h))$ satisfy non-trivial limiting equations as $\beta \to \infty$, and we define $(\chi; x_\infty; \lambda_\infty; f_\infty)$ as the limiting values of these variables:

$$ 
\begin{cases}
\beta(1 - q_M) & \to \chi, \\
\beta x(q) & \to x_\infty(q), \\
\beta \lambda(q) & \to \lambda_\infty(q), \\
\beta^{-1} f(q, h) & \to f_\infty(q, h).
\end{cases}
\tag{54}
$$

Moreover, $\Lambda(q, h) := \Lambda(x(q), h)$ remains finite as $\beta \to \infty$. In particular, since $x(q=1) = 1$ by definition (see Fig. 3), we have that $x_\infty(q)$ now extends up to $+\infty$. We define $q_\infty(x)$ as the inverse function to $x_\infty(q)$, and then we can define all functions in terms of $x$, e.g. $f_\infty(x, h) := f_\infty(q_\infty(x), h)$. In this limit, all eqs. (51a), (51b), (51c) scale very naturally, and the Parisi PDE of eq. (49) as well. The only non-trivial part is the boundary condition at $x=1$, which becomes

$$ f_{\infty}(x \to +\infty, h) = \frac{1}{\beta} \log \gamma_{\chi/\beta} \star e^{-\beta\theta}(h) + o(1). $$

The scaling of the right hand-side can be worked out exactly:

$$ f_{\infty}(x \to +\infty, h) = \begin{cases} 0 & \text{if } h < 0, \\ -1 & \text{if } h > \sqrt{2\chi}, \\ -\frac{h^2}{2\chi} & \text{otherwise.} \end{cases} \tag{55} $$

Similarly, we can work out the zero-temperature limit of eq. (52), and we get:

$$ f_{\text{FRSB}}^{*}(\alpha) = \lim_{\beta \to \infty} e_{\text{FRSB}}^{*}(\alpha, \beta) = \alpha \int_{\sqrt{2\chi}}^{\infty} \Lambda_{\infty}(x \to \infty, h) dh. $$

**Algorithmic procedure** – In this paragraph, for the clarity of the presentation, all quantities are considered in the zero-temperature limit, and we drop the $\infty$ subscripts.

The procedure we use is relatively similar to the finite-temperature one described in Appendix B of [30], but is done at zero temperature, and at fixed $x$ rather than fixed $q$ (as we found this choice to be numerically more stable). In order to increase numerical precision, we rescale $h$ and use $t = h/\sqrt{2\chi}$, allowing to handle small values of the susceptibility $\chi$. Our algorithmic procedure is as follows:

* **Before starting** – Pick $k$ large enough, $x_{\max} \gg 1$ large enough, and a grid $0 < x_0 < x_1 < \dots < x_{k-1} = x_{\max} < x_k = \infty$.

* **Initialization** – Start from a guess $\chi > 0$ and $0 \le q_0 \le q_1 \le \dots \le q_{k-1} < q_k = 1$.
(i) Find the functions $f(x_i, t)$ via the procedure:

$$f(x_k = \infty, t) = \begin{cases} 0 & \text{if } t \le 0, \\ -1 & \text{if } t \ge 1, \\ -t^2 & \text{if } t \in (0, 1), \end{cases} \qquad (56)$$

$$f(x_i, t) = \frac{1}{x_i} \log \left[ \gamma \frac{q_{i+1} - q_i}{2\chi} \star e^{x_i f} (x_{i+1}, t) \right]. \qquad (57)$$

(ii) Find $\Lambda(q_i, t)$ via the procedure:

$$\begin{cases} \Lambda(x_0, t) = \gamma_{q_0}(\sqrt{2\chi}t), \\ \Lambda(x_i, t) = e^{x_{i-1}f}(x_i, t) \gamma_{\frac{q_i - q_{i-1}}{2\chi}} \star [\Lambda \cdot e^{-x_{i-1}f}](x_{i-1}, t). \end{cases} \qquad (58)$$

(iii) Compute $q_i^{-1}$ (the hierarchical elements of $Q^{-1}$, not $1/q_i$) using, for all $i \in \{0, \dots, k\}$:

$$q_i^{-1} = -\frac{\alpha}{\sqrt{2\chi}} \int dt \Lambda(x_i, t) f'(x_i, t)^2. \qquad (59)$$

(iv) Update $\lambda_i = \lambda(q_i)$ via

$$\begin{cases} \lambda_0 = \sqrt{-\frac{q_0}{q_0^{-1}}}, \\ \frac{1}{\lambda_i} = \frac{1}{\lambda_{i-1}} - x_{i-1}(q_i^{-1} - q_{i-1}^{-1}). \end{cases} \qquad (60)$$

(v) Update $\{q_i\}_{i=0}^k$ with $q_k = 1$ and

$$q_i = 1 - \frac{\lambda_i}{x_i} - \sum_{j=i+1}^{k} \left( \frac{1}{x_j} - \frac{1}{x_{j-1}} \right) \lambda_j. \qquad (61)$$

(vi) Update $\chi$ by solving the equation (with $q_{-1} = 0$ and $x_{-1} = 0$):

$$\sum_{i=0}^{k} \frac{\sqrt{\chi}(q_i - q_{i-1})}{[\chi + \sum_{j=i+1}^{k}(q_j - q_{j-1})x_{j-1}][\chi + \sum_{j=i}^{k}(q_j - q_{j-1})x_{j-1}]} = 2^{3/2} \alpha \int_{0}^{1} dt \Lambda(1, t) t^2. \qquad (62)$$

• **Iterate steps (i) → (vi) until convergence.**

• **Final value for the energy** – We then compute the ground state energy as:

$$f_{\text{FRSB}}^{*}(\alpha) = \alpha \sqrt{2\chi} \int_{1}^{\infty} dt \Lambda(1, t).$$

The procedure is done for $k$ large enough so that the result does not vary with $k$ and approaches the $k \to \infty$ limit. Steps (i) and (ii) are a discretization of the zero-temperature limits of the PDEs of eqs. (49) and (51b), arising from the $k$-RSB ansatz (see Appendix E). We give more details on the derivation of steps (iii) – (vi) in Appendix F.1, leveraging results of [30].

The different convolutions with Gaussians are done using an analytical formula for the Discrete Fourier Transform (DFT) of a Gaussian under a Shannon-Whittaker interpolation, and fast Fourier transform techniques. More details on this point are given in Appendix F.3.

**Implementation and results** – We present our results for $f_{\text{FRSB}}^*$ and the zero-temperature susceptibility $\chi$ in Fig. 1, and the zero-temperature overlap distribution function $q(x)$ for various values of $\alpha$ in Fig. 4. In particular, the full-RSB prediction for the injectivity threshold is $\alpha_{\text{inj}}^{\text{FRSB}} \approx 6.698$. We ran a more precise binary search procedure for computing the value of this transition, which we detail in Appendix F.4. A summary of its result is presented in Fig. 5, and it yields the bound we conjecture in Result 1.1:

$$6.6979 \le \alpha_{\text{inj}}^{\text{FRSB}} \le 6.6981. \qquad (63)$$

Note that this bound is compatible with the hierarchy described in eq. (17). Moreover, the 1-RSB predictions are found to be very close (but not equal) to the exact FRSB results. This can be intuitively visualized by the fact that $q(x)$ is relatively well approximated by a step function, which corresponds to the 1RSB ansatz, cf. Fig. 4. We emphasize however that the full-RSB algorithmic procedure above does not allow to directly recover the 1-RSB result, even used with $k = 1$: indeed it implicitly relies on the fact that one takes $k$ large enough so as not to have to optimize over the variables $x_1, \dots, x_k$, so that we can take them to be fixed.
<figure><img src="image_8.png" /><figcaption>Fig. 4. $T = 0$ limit quantities of the RS, 1RSB and FRSB solutions, as a function of $\alpha$. We compare the predictions for the different forms of the function $q(x)$ corresponding to the assumed level of replica symmetry breaking.</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Fig. 5. Computation of $\alpha_{\text{inj}}^{\text{FRSB}}$ using the FRSB algorithmic procedure. For different values of $x_{\text{max}}$ and $k$ we give an interval numerically found to contain $\alpha_{\text{inj}}^{\text{FRSB}}$. In Result 1.1 we took the interval of values obtained with $k = 200$ and $x_{\text{max}} = 15$. We give more details on the numerical procedure in Appendix F.4.</figcaption></figure>

**Remark (Convexity of the Parisi functional).** In the context of mixed $p$-spin models, the so-called Parisi functional, i.e. the functional whose infimum we take in eq. (47), has been shown to be strictly convex, and thus to have a unique minimizer [1]. This is conjectured to hold as well in our setting, however there is no rigorous guarantee that our iterative procedure should converge to a global minimizer. However, our numerical simulations are compatible with this conjecture: as we detail in Appendix F.2, we find the iterative procedure to converge to a consistent solution for all initializing points. Moreover, our procedure exhibits polynomial convergence (see Fig. 6): this suggests that there is an accumulation of near-zero eigenvalues in the Hessian of the Parisi functional close to the minimum (otherwise we would observe exponential convergence), and thus that the Parisi functional is strictly but not strongly convex.

## Declaration of competing interest

None.

## Appendix A. Proofs

### A.1. Proof of Proposition 1.1

Note that if $m < n$, then $x \in \mathbb{R}^n \mapsto Wx \in \mathbb{R}^m$ is not injective, $C_{m,n} = \mathbb{R}^m$, and eq. (2) stands trivially. We thus assume $m \ge n$. Since $x \in \mathbb{R}^n \mapsto Wx \in \mathbb{R}^m$ is then a.s. injective, $W\mathbb{R}^m$ is a (random) $n$-dimensional subspace of $\mathbb{R}^m$. Moreover, by rotation invariance of the
Gaussian distribution, it is uniformly sampled. Thus it is enough to show that $p_{m,n} = \mathbb{P}[(W\mathbb{R}^n) \cap C_{m,n} = \{0\}]$. In the end, it suffices to show the following lemma, whose proof elements can be found in [61,54,19], which we repeat for completeness:

**Lemma A.1.** *Almost surely under the law of W, the following two statements are equivalent:*

(i) $\varphi_W$ is injective.

(ii) $(W\mathbb{R}^n) \cap C_{m,n} = \{0\}$.

**Proof of Lemma A.1.** In the following, we assume that the following event stands:

$E(W) := \{\text{All choices of } n \text{ distinct rows of W are linearly independent vectors in } \mathbb{R}^n\}$.

It is easy to see that $\mathbb{P}[E(W)] = 1$, since every set of $n$ independent standard Gaussian vectors in $\mathbb{R}^n$ is linearly independent almost surely.

Let us show first that (ii) ⇒ (i). Recall ReLU($x$) = max(0, $x$). Note that for any $a \le b \in \mathbb{R}$, ReLU($a$) = ReLU($b$) implies that ReLU is constant on $(a, b)$. Assume that $\varphi_W(x) = \varphi_W(y)$. Let us consider $z = (x + y)/2$, then $\varphi_W(z) = \varphi_W(x)$ by the note above. Moreover, for all $\mu \in [m]$ such that $(Wz)_\mu > 0$, then $(Wx)_\mu = (Wy)_\mu = (Wz)_\mu$. On the other hand, if $(Wz)_\mu = 0$, then necessarily $(Wx)_\mu = (Wy)_\mu = 0$, since $(Wx)_\mu \le 0 \Leftrightarrow (Wy)_\mu \le 0$. By (ii), $Wz$ has at least $n$ non-negative coordinates, so the argument above implies that there exists at least $n$ values of $\mu \in [m]$ such that $(Wx)_\mu = (Wy)_\mu$. Since $E(W)$ stands, this shows that $x = y$.

Let us now show (i) ⇒ (ii). We divide $\mathbb{R}^n$ into equivalence classes defined by the relation $x \sim y \Leftrightarrow \forall \mu \in [m], (Wx)_\mu > 0 \Leftrightarrow (Wy)_\mu > 0$. These equivalence classes $R_S$ are defined by a subset $S$ of $[m]$, so that for all $x \in R_S$, $(Wx)_\mu > 0 \Leftrightarrow \mu \in S$. Assume that there exists $x \in \mathbb{R}^n$ such that $Wx \ne 0$ and $Wx$ has strictly less than $n$ positive coordinates, i.e. $x \in R_S$ with $|S| < n$. On $R_S$, $\varphi_W$ is a linear transformation with $|S| < n$ linearly independent rows $\{W_\mu\}_{\mu \in S}$. Its image has thus dimension smaller than $n$. Therefore, the following result, which implies that $R_S$ has dimension $n$, then implies that $\varphi_W$ is not injective on $R_S$. Having proved the contrapositive, we can then infer (i) ⇒ (ii). □

**Lemma A.2.** *The following statement is true almost surely: for all $S \subseteq [m]$, either $R_S = \{0\}$, or there exists $x \in R_S$ and $\varepsilon > 0$ such that $B_2(x, \varepsilon) \subseteq R_S$.*

**Proof of Lemma A.2.** By a union bound over all $S \subseteq [m]$, it suffices to show this statement a.s. for any fixed $S \subseteq [m]$. Let us assume that $R_S \ne 0$. The following statement implies the conclusion of Lemma A.2:

$$ \mathbb{P}\{\forall x \in R_S, \exists \mu \notin S \text{ s.t. } W_\mu \cdot x = 0\} = 0. \qquad (64) $$

Indeed, one can then a.s. find an element $x \in R_S$ such that $(Wx)_\mu > 0$ for all $\mu \in S$ and $(Wx)_\mu < 0$ for all $\mu \notin S$, therefore $B_2(x, \varepsilon) \subseteq R_S$ for sufficiently small $\varepsilon$. We now show eq. (64).

Assume that there exists $x \in R_S \setminus \{0\}$, with $v_1, \dots, v_{k_x} \in [m]$ all indices such that $W_v \cdot x = 0$, that satisfies $k_x \ge 1$. Note that by $E(W)$ (which stands a.s.) and since $x \ne 0$ we must have $k_x < n$. Thus, since $\{W_{v_i}\}_{i=1}^{k_x}$ are linearly independent on $E(W)$, we can then fix $y \in (\{W_{v_i}\}_{i=1}^{k_x-1})^\perp$ such that $W_{v_{k_x}} \cdot y < 0$. Consider $x' = x + \delta y$ with arbitrary $\delta > 0$. By hypothesis, $W_{v_i} \cdot x' = 0$ for all $i \in [k_x - 1]$. Moreover, for $\delta$ small enough, $W_\mu \cdot x'$ has the same sign as $W_\mu \cdot x$ if $\mu \notin \{v_1, \dots, v_{k_x}\}$. Finally, $W_{v_{k_x}} \cdot x' = \delta W_{v_{k_x}} \cdot y < 0$. In the end, taking $\delta$ small enough, we have found $x' \in R_S$ with $k_x' = k_x - 1$. Iterating this procedure, we have shown that a.s. there exists a point $x \in R_S$ such that $k_x = 0$, which implies eq. (64). □

A.2. *Proof of Lemma 1.2*

Let us first recall Cover's theorem [20]. We use the sign($x$) function, with the convention sign(0) = 0. We call a set of vectors $\{W_1, \dots, W_m\}$ in $\mathbb{R}^n$ in general position if it has no linearly independent subset of size strictly less than $n$. Cover's theorem is an exact formula for the number of dichotomies<fnref n="12" /> of this set that are realizable by a linear separation:

**Theorem A.3 (Cover [20]).** Let $W_1, \dots, W_m \in \mathbb{R}^n$ be in general position. Then

$$ \sum_{\epsilon \in \{\pm 1\}^m} 1 \{ \exists \mathbf{x} \in \mathbb{S}^{n-1} \text{ realizing } \forall \mu \in [m] : \text{sign}(W_\mu \cdot \mathbf{x}) = \epsilon_\mu \} = 2 \sum_{k=0}^{n-1} \binom{m-1}{k}. $$

Let us now show that Theorem A.3 implies Lemma 1.2. We assume $\alpha < 3$, so in particular we can fix $\delta > 0$ such that $m \le (3-\delta)(n-1)$ for $n$ large enough. We denote $\tilde{m} = m - (n-1) \le (2-\delta)n$. Since $W$ is a Gaussian matrix, the set $\{W_\mu\}_{\mu \in [\tilde{m}]}$ is a.s. in general position. Moreover, by sign invariance, for any $\epsilon \in \{\pm 1\}^m$ we have:

<footnote n="12">¹² A dichotomy is a binary labeling of the vectors.</footnote>
$$ \mathbb{P}_W\{\exists \mathbf{x} \in S^{n-1} : \forall \mu \in [\tilde{m}], \text{sign}(\mathbf{W}_{\mu} \cdot \mathbf{x}) = \varepsilon_{\mu}\} = \mathbb{P}_W\{\exists \mathbf{x} \in S^{n-1} : \forall \mu \in [\tilde{m}], \text{sign}(\mathbf{W}_{\mu} \cdot \mathbf{x}) = -1\}. $$

For $\epsilon$ uniformly sampled in $\{\pm 1\}^m$ (independently of $W$), we denote $\mathbb{P}_{W,\epsilon}$ the joint probability law of $(W, \epsilon)$, and $\mathbb{P}_{\epsilon}$ the law of $\epsilon$. The previous remark on sign invariance allows to deduce:

$$ \begin{aligned} & \mathbb{P}_W\{\exists \mathbf{x} \in S^{n-1} : \forall \mu \in [\tilde{m}], \text{sign}(\mathbf{W}_{\mu} \cdot \mathbf{x}) = -1\} \\ &= \mathbb{P}_{W,\epsilon}\{\exists \mathbf{x} \in S^{n-1} : \forall \mu \in [\tilde{m}], \text{sign}(\mathbf{W}_{\mu} \cdot \mathbf{x}) = \varepsilon_{\mu}\}, \\ &= \mathbb{E}_W[\mathbb{P}_{\epsilon}(\exists \mathbf{x} \in S^{n-1} : \forall \mu \in [\tilde{m}], \text{sign}(\mathbf{W}_{\mu} \cdot \mathbf{x}) = \varepsilon_{\mu} | W)], \\ &= \frac{1}{2\tilde{m}} \times 2 \sum_{k=0}^{n-1} \binom{\tilde{m}-1}{k}, \end{aligned} $$

by Theorem A.3. Since $\tilde{m} \le (2 - \delta)n$, it is then elementary to check that this implies

$$ \lim_{n \to \infty} \mathbb{P}_W \{ \exists \mathbf{x} \in S^{n-1} : \forall \mu \in [\tilde{m}], \text{sign}(\mathbf{W}_{\mu} \cdot \mathbf{x}) = -1 \} = 1. $$

The proof is then finished by noticing that if $\mathbf{x}$ satisfies $\text{sign}(\mathbf{W}_{\mu} \cdot \mathbf{x}) = -1$ for all $\mu \in [\tilde{m}]$, it must satisfy $E_W(\mathbf{x}) \le m - \tilde{m} < n$, and using eq. (4).

### A.3. Proof of Theorem 1.4

It is easy to see that if $W, W'$ are two matrices for which $W'_{\nu} = W_{\nu}$ for all $\nu \in [m] \setminus \{\mu\}$, then

$$ |\Phi_n(W, \beta) - \Phi_n(W', \beta)| \le \frac{2\beta}{n}. $$

The theorem is then a simple consequence of McDarmid's inequality (see e.g. Theorem 6.2 of [11]).

### A.4. Proof of Corollary 1.5

By a dominated convergence argument, we have:

$$ \partial_{\beta}\{\mathbb{E}_{W}\Phi_{n}(W, \beta)\} = -\frac{1}{n}\mathbb{E}_{W}\left\{\frac{\int_{S^{n-1}} \mu_{n}(\mathrm{d}\mathbf{x}) E_{W}(\mathbf{x}) e^{-\beta E_{W}(\mathbf{x})}}{\int_{S^{n-1}} \mu_{n}(\mathrm{d}\mathbf{x}) e^{-\beta E_{W}(\mathbf{x})}}\right\}. $$

Therefore

$$ -\beta^2 \partial_{\beta} \{ \mathbb{E}_{W} \Phi_{n}(W, \beta) / \beta \} = \frac{1}{n} \mathbb{E}_{W} \left\{ \frac{\int_{S^{n-1}} \mu_{n}(\mathrm{d}\mathbf{x}) \beta E_{W}(\mathbf{x}) e^{-\beta E_{W}(\mathbf{x})}}{\int_{S^{n-1}} \mu_{n}(\mathrm{d}\mathbf{x}) e^{-\beta E_{W}(\mathbf{x})}} \right\} + \mathbb{E}_{W} \Phi_{n}(W, \beta). $$

Recall the definition of the Gibbs measure $\mathbb{P}_{\beta,W}$ in eq. (5). It is easy to see that the previous equation relates directly to the entropy of $\mathbb{P}_{\beta,W}$, i.e.

$$ \beta^2 \partial_{\beta} \{ \mathbb{E}_{W} \Phi_n(W, \beta) / \beta \} = \frac{1}{n} \mathbb{E}_{W} \int d\mathbb{P}_{\beta,W}(\mathbf{x}) \log \frac{d\mathbb{P}_{\beta,W}}{d\mu_n}(\mathbf{x}) = \mathbb{E}_{W} D_{KL}(\mathbb{P}_{\beta,W} \| \mu_n) \ge 0. $$

In the language of statistical physics, this is a rewriting of the fact that the temperature derivative of the free energy is given by (minus) the entropy. In particular, for any $n, \beta \mapsto -\mathbb{E}_{W}\Phi_{n}(W, \beta)/\beta$ is non-increasing, and in the limit this shows that $\beta \mapsto -\Phi(\alpha, \beta)/\beta$ is non-increasing. The positivity of this function follows from $\Phi_n(W, \beta) \le 0$, since $E_W(\mathbf{x}) \ge 0$.

Let us now assume that there exists some $\beta < \infty$ such that $-\Phi(\alpha, \beta) < \beta$. In particular, fixing $\delta > 0$, for $n$ large enough we have $\mathbb{E}_{W}\Phi_{n}(W, \beta) \ge -\beta + \delta$. Using Theorem 1.4, for large enough $n$, this implies

$$ \begin{aligned} \mathbb{P}_W[\Phi_n(W, \beta) \le -\beta] &\le 2 \exp \left\{ - \frac{n[\beta + \mathbb{E}_W \Phi_n(W, \beta)]^2}{2\alpha_n \beta^2} \right\}, \\ &\le 2 \exp \left\{ -C(\alpha, \beta)n \right\}, \end{aligned} $$

for some $C(\alpha, \beta) > 0$. In particular, using eq. (9) and Proposition 1.1:

$$ p_{m,n} = \mathbb{P}_W \left[ \min_{\mathbf{x} \in S^{n-1}} E_W(\mathbf{x}) \ge n \right] \le \mathbb{P}_W \left[ \Phi_n(W, \beta) \le -\beta \right] \le 2 \exp \left\{ -C(\alpha, \beta)n \right\}. \quad (65) $$

The claim follows.
### A.5. Proof of Theorem 1.8

**Remark.** In what follows we usually consider $m = \alpha n$ with $\alpha > 0$, and the proof can be straightforwardly generalized to the original assumption $m/n \to \alpha > 0$. For lightness of the presentation, we assume the simplified statement we described.

First, note that given Lemma 1.2, we can assume $\alpha \ge 3$ in what follows. Using Proposition 1.1, we want to characterize

$$G(\mathbf{W}) := \min_{\mathbf{x} \in S^{n-1}} e_{\mathbf{W}}(\mathbf{x}) = \min_{\mathbf{x} \in S^{n-1}} \frac{1}{n} \sum_{\mu=1}^{m} \mathbb{1}\{\mathbf{W}_{\mu} \cdot \mathbf{x} > 0\},$$

in which $\mathbf{W} = \{\mathbf{W}_{\mu}\}_{\mu=1}^m$ i.i.d. $\mathcal{N}(0, I_n)$. The minimum of this function is reached since it takes discrete values. Introducing an auxiliary variable $z_{\mu} := \mathbf{W}_{\mu} \cdot \mathbf{x}$, and a Lagrange multiplier $\lambda \in \mathbb{R}^m$ to fix this relation, the problem is equivalent by strong duality to

$$ 
\begin{aligned}
G(\mathbf{W}) &= \min_{\mathbf{x} \in S^{n-1}} \inf_{z \in \mathbb{R}^m} \sup_{\lambda \in \mathbb{R}^m} \left\{ \lambda^\top \mathbf{W} \mathbf{x} - \lambda^\top \mathbf{z} + \frac{1}{n} \sum_{\mu=1}^m \mathbb{1}\{z_{\mu} > 0\} \right\}, \\
&= \inf_{z \in \mathbb{R}^m} \min_{\mathbf{x} \in S^{n-1}} \sup_{\lambda \in \mathbb{R}^m} \left\{ \lambda^\top \mathbf{W} \mathbf{x} - \lambda^\top \mathbf{z} + \frac{1}{n} \sum_{\mu=1}^m \mathbb{1}\{z_{\mu} > 0\} \right\}.
\end{aligned}
\quad (66) $$

Note that the infimum over $z$ in eq. (66) is actually done over $z \in \mathbf{W}S^{n-1}$, since the supremum over $\lambda$ becomes $+\infty$ for $z \ne \mathbf{W}x$. Letting $\|\mathbf{W}\|_{\text{op}} := \max_{\mathbf{x} \in S^{n-1}} \|\mathbf{W}\mathbf{x}\|_2$, we know by classical concentration inequalities (see e.g. [82] - Theorem 4.4.5) and since $m = \alpha n$, that $\mathbb{P}[\|\mathbf{W}\|_{\text{op}} \ge K\sqrt{n}] \le e^{-n}$, for some constant $K > 1$ (that might depend on $\alpha$). Let us denote $B(K) := \{z \in \mathbb{R}^m : \|z\|_2 \le K\sqrt{n}\}$. By the argument above and the law of total probability, for all $t > 0$,

$$ \mathbb{P}[G(\mathbf{W}) \le t] \le \mathbb{P}[G_K(\mathbf{W}) \le t] + e^{-n}, \quad (67) $$

with

$$ G_K(\mathbf{W}) := \inf_{z \in B(K)} \min_{\mathbf{x} \in S^{n-1}} \sup_{\lambda \in \mathbb{R}^m} \left\{ \lambda^\top \mathbf{W} \mathbf{x} - \lambda^\top \mathbf{z} + \frac{1}{n} \sum_{\mu=1}^m \mathbb{1}\{z_{\mu} > 0\} \right\}. \quad (68) $$

Moreover, we will approximate $\mathbb{1}\{z > 0\}$ by continuous functions; we let, for any $\delta \ge 0$:

$$ \ell_{\delta}(x) := \begin{cases} 0 & \text{if } x \le 0, \\ 1 & \text{if } x > \delta, \\ x/\delta & \text{if } x \in (0, \delta]. \end{cases} \quad (69) $$

Since $\ell_{\delta}(x) \le \mathbb{1}\{x > 0\}$, it is clear that:

$$ G_K(\mathbf{W}) \ge G_{\delta,K}(\mathbf{W}) := \inf_{z \in B(K)} \min_{\mathbf{x} \in S^{n-1}} \sup_{\lambda \in \mathbb{R}^m} \left\{ \lambda^\top \mathbf{W} \mathbf{x} - \lambda^\top \mathbf{z} + \frac{1}{n} \sum_{\mu=1}^m \ell_{\delta}(z_{\mu}) \right\}. \quad (70) $$

We now make use of the Gaussian min-max theorem [39,80]:

**Proposition A.4 (Gaussian min-max theorem).** Let $\mathbf{W} \in \mathbb{R}^{m \times n}$ be an i.i.d. standard normal matrix, and $\mathbf{g} \in \mathbb{R}^m$, $\mathbf{h} \in \mathbb{R}^n$ two independent vectors with i.i.d. $\mathcal{N}(0, 1)$ coordinates. Let $S_v, S_u$ be two compact subsets respectively of $\mathbb{R}^n$ and $\mathbb{R}^m$, and let $\psi: S_v \times S_u \to \mathbb{R}$ be a continuous function. We define the two optimization problems:

$$ 
\begin{cases}
C(\mathbf{W}) := \min_{\mathbf{v} \in S_v} \max_{\mathbf{u} \in S_u} \{\mathbf{u}^\top \mathbf{W} \mathbf{v} + \psi(\mathbf{v}, \mathbf{u})\}, \\
C(\mathbf{g}, \mathbf{h}) := \min_{\mathbf{v} \in S_v} \max_{\mathbf{u} \in S_u} \{\|\mathbf{u}\| \mathbf{h}^\top \mathbf{v} + \|\mathbf{v}\| \mathbf{g}^\top \mathbf{u} + \psi(\mathbf{v}, \mathbf{u})\}.
\end{cases}
$$

Then, for all $t \in \mathbb{R}$, one has

$$ \mathbb{P}_{\mathbf{W}}[C(\mathbf{W}) \le t] \le 2 \mathbb{P}_{\mathbf{g},\mathbf{h}}[C(\mathbf{g}, \mathbf{h}) \le t]. \quad (71) $$

**Remark I.** It is easy to see from the proof of [39,80] that the statement of the theorem also holds if $\mathbf{W}$ is a block matrix of the form

$$ \mathbf{W} = \begin{pmatrix} \mathbf{W}_1 & 0 \\ 0 & 0 \end{pmatrix}, $$

with $\mathbf{W}_1 \in \mathbb{R}^{m_1 \times n_1}$ having i.i.d. $\mathcal{N}(0, 1)$ elements. Denoting $\mathbf{u}^\top \mathbf{W} \mathbf{v} = \mathbf{u}_1^\top \mathbf{W}_1 \mathbf{v}_1$, the definition of the auxiliary problem that appears in the theorem is then modified as:
$$C(\mathbf{g}, \mathbf{h}) := \min_{\mathbf{v} \in S_u} \max_{\mathbf{u} \in S_u} \left\{ \|\mathbf{u}_1\| \mathbf{h}^\top \mathbf{v}_1 + \|\mathbf{v}_1\| \mathbf{g}^\top \mathbf{u}_1 + \psi(\mathbf{v}, \mathbf{u}) \right\}, \quad (72)$$

for $\mathbf{g} \sim \mathcal{N}(0, I_{m_1})$, $\mathbf{h} \sim \mathcal{N}(0, I_{n_1})$.

**Remark II.** The full result of [80] actually includes the proof of a converse bound to eq. (71) when the function $\psi$ is convex-concave, and the sets $S_u, S_w$ are convex. Here, we do not expect such a converse bound to be true, since the solution is conjecturally described by the full-RSB equations, and we will see that the upper bound of eq. (71) corresponds to the replica-symmetric (RS) solution.

Let us first state a lemma that simplifies the auxiliary problem:

**Lemma A.5 (Auxiliary problem simplification).** For any $\delta > 0$, and any $A \in (0, \infty]$, we define the auxiliary optimization problem, for $\mathbf{g} \in \mathbb{R}^m, \mathbf{h} \in \mathbb{R}^n$:

$$C_{A,\delta}(\mathbf{g}, \mathbf{h}) := \inf_{\mathbf{z} \in \mathbb{R}^m} \min_{\mathbf{x} \in S^{n-1}} \max_{\|\boldsymbol{\lambda}\| \le A} \left\{ \|\boldsymbol{\lambda}\| \|\mathbf{h}^\top \mathbf{x} + \mathbf{g}^\top \boldsymbol{\lambda} - \boldsymbol{\lambda}^\top \mathbf{z} + \frac{1}{n} \sum_{\mu=1}^m \ell_\delta(z_\mu)\| \right\}. \quad (73)$$

Then $A \mapsto C_{A,\delta}(\mathbf{g}, \mathbf{h})$ is non-decreasing and one has:

$$\lim_{A \to \infty} C_{A,\delta}(\mathbf{g}, \mathbf{h}) = \min_{\mathbf{z} \in \mathbb{R}^m} \left\{ \frac{1}{n} \sum_{\mu=1}^m \ell_\delta(g_\mu - z_\mu) \right\}. \quad (74)$$

Note that we added a constraint over $\|\boldsymbol{\lambda}\|$ in the auxiliary problem, so that the set of $\boldsymbol{\lambda}$ considered is compact. This allows to deduce, using Proposition A.4 (and Remark I below) in eqs. (70) and (67):

**Lemma A.6.** For all $\delta > 0$, and all $t \in \mathbb{R}$, one has

$$\mathbb{P}_{\mathbf{W}}[G(\mathbf{W}) \le t] \le 2\mathbb{P}_{\mathbf{g},\mathbf{h}}[C_{\delta}(\mathbf{g}, \mathbf{h}) \le t] + e^{-n},$$

with $C_\delta(\mathbf{g}, \mathbf{h})$ the RHS of eq. (74), and $\mathbf{g}, \mathbf{h}$ vectors with i.i.d. $\mathcal{N}(0, 1)$ coordinates.

Lemmas A.5 and A.6 are proven in Section A.6. We are now ready to prove Theorem 1.8. Note that by weak duality:

$$C_{\delta}(\mathbf{g}, \mathbf{h}) = \inf_{\mathbf{z} \in \mathbb{R}^m} \sup_{\kappa \ge 0} \left\{ \frac{\kappa}{n} (\|\mathbf{z}\|^2 - \|\mathbf{h}\|^2) + \frac{1}{n} \sum_{\mu=1}^m \ell_{\delta}(g_{\mu} - z_{\mu}) \right\}, \\ \ge \sup_{\kappa \ge 0} \inf_{\mathbf{z} \in \mathbb{R}^m} \left\{ \frac{\kappa}{n} (\|\mathbf{z}\|^2 - \|\mathbf{h}\|^2) + \frac{1}{n} \sum_{\mu=1}^m \ell_{\delta}(g_{\mu} - z_{\mu}) \right\} := \mathcal{M}_{\delta}(\mathbf{g}, \mathbf{h}).$$

Therefore $\mathbb{P}[C_\delta(\mathbf{g}, \mathbf{h}) \le t] \le \mathbb{P}[\mathcal{M}_\delta(\mathbf{g}, \mathbf{h}) \le t]$. Moreover, by $\|\mathbf{z}\|^2 = \sum z_\mu^2$, one has:

$$\mathcal{M}_{\delta}(\mathbf{g}, \mathbf{h}) = \sup_{\kappa \ge 0} \left\{ -\frac{\kappa}{n} \|\mathbf{h}\|^2 + \frac{1}{n} \sum_{\mu=1}^{m} \inf_{\mathbf{z} \in \mathbb{R}} \{\kappa z^2 + \ell_{\delta}(g_{\mu} - z)\} \right\}. \quad (75)$$

Let us show

$$\mathcal{M}_{\delta}(\mathbf{g}, \mathbf{h}) \xrightarrow{\mathbb{P}} \mathcal{M}_{\delta} := \sup_{\kappa \ge 0} \left\{ -\kappa + \alpha \int_{\mathbb{R}} D\mathbf{x} \left[ \inf_{\mathbf{z} \in \mathbb{R}} \{\kappa z^2 + \ell_{\delta}(\mathbf{x} - \mathbf{z})\} \right] \right\}. \quad (76)$$

We can assume $\|\mathbf{h}\|^2/n \ge 1/2$, an event that has probability $1 - o_n(1)$. Denoting $f(\kappa, \mathbf{g}, \mathbf{h})$ the maximized function in eq. (75), we then have<fnref n="13" /> $f(\kappa, \mathbf{g}, \mathbf{h}) \le 2\alpha - \kappa/2$ and $f(0, \mathbf{g}, \mathbf{h}) \ge 0$, so that we can write $\mathcal{M}_\delta(\mathbf{g}, \mathbf{h}) = \max_{0 \le \kappa \le 4\alpha} f(\kappa, \mathbf{g}, \mathbf{h})$. Letting

$$f_{\infty}(\kappa) := -\kappa + \alpha \int_{\mathbb{R}} D\mathbf{x} \left[ \inf_{\mathbf{z} \in \mathbb{R}} \{\kappa z^2 + \ell_{\delta}(\mathbf{x} - \mathbf{z})\} \right],$$

we have then for all $\kappa \in [0, 4\alpha]$:

$$|f(\kappa, \mathbf{g}, \mathbf{h}) - f_{\infty}(\kappa)| \le 4\alpha \left| \frac{\|\mathbf{h}\|^2}{n} - 1 \right| + \frac{\alpha}{m} \left| \sum_{\mu=1}^{m} (X_{\mu} - \mathbb{E}[X_{\mu}]) \right|, \quad (77)$$

$$X_{\mu} := \inf_{\mathbf{z} \in \mathbb{R}} \{\kappa z^2 + \ell_{\delta}(g_{\mu} - z)\}.$$

<footnote n="13">¹³ Indeed, $\inf_{\mathbf{z} \in \mathbb{R}} \{\kappa z^2 + \ell_{\delta}(\mathbf{x} - \mathbf{z})\} \le \ell_{\delta}(\mathbf{x}) \le 1$.</footnote>
Note that {$X_\mu$} are i.i.d. random variables, and one shows easily that $X_\mu \in [0, 1]$, so by Hoeffding's inequality, for all $t > 0$:

$$ \mathbb{P}\left[\frac{1}{m}\left|\sum_{\mu=1}^{m}(X_{\mu}-\mathbb{E}[X_{\mu}])\right| \geq t\right] \leq 2e^{-2mt^{2}}. $$

Plugging it in eq. (77) and using the concentration of $||h||^2/n$, we reach that for all $t > 0$:

$$ \lim_{n \to \infty} \sup_{\kappa \in [0,4\alpha]} \mathbb{P}[|f(\kappa, \mathbf{g}, \mathbf{h}) - f_{\infty}(\kappa)| \geq t] = 0. $$

It is elementary to check that this implies $\max_{0 \le \kappa \le 4\alpha} f(\kappa, \mathbf{g}, \mathbf{h}) \xrightarrow{\mathbb{P}} \max_{0 \le \kappa \le 4\alpha} f_\infty(\kappa)$, and therefore eq. (76). By Lemma A.6 we have then shown that for any $t, \delta > 0$,

$$ \mathcal{M}_{\delta} > t \Rightarrow \lim_{n \to \infty} \mathbb{P}[G(\mathbf{W}) > t] = 1. \quad (78) $$

We will then conclude by considering the limit $\delta \to 0$:

**Lemma A.7.** We have $\lim_{\delta \to 0} \mathcal{M}_\delta = \mathcal{M}$, with

$$ \begin{aligned} \mathcal{M} &:= \sup_{\kappa \ge 0} \left\{ -\kappa + \alpha \int_{\mathbb{R}} Dx \left[ \inf_{z \in \mathbb{R}} \{\kappa z^2 + 1\{x > z\}\} \right] \right\}, \\ &= \sup_{\kappa \ge 0} \left\{ -\kappa + \alpha \int_{1/\sqrt{\kappa}}^{\infty} Dx + \alpha \kappa \int_{0}^{1/\sqrt{\kappa}} Dx x^2 \right\}. \end{aligned} \quad (79) $$

Moreover, the maximum in eq. (79) is reached in $\kappa^*$ such that:

$$ 1 = \alpha \int_{0}^{1/\sqrt{\kappa^*}} Dx x^2. $$

And the limit is then given by:

$$ \mathcal{M} = \alpha \int_{1/\sqrt{\kappa^*}}^{\infty} Dx. $$

We recognize the replica-symmetric prediction of eq. (37), with $\kappa = (2\chi_{RS})^{-1}$! By Lemma A.7 and eq. (78), we showed that $\mathcal{M} > t$ implies that $\mathbb{P}[G(\mathbf{W}) > t] \to 1$ as $n \to \infty$. Applying it for $t = 1$ ends the proof of Theorem 1.8. $\square$

### A.6. Proof of Lemmas A.5, A.6 and A.7

**Proof of Lemma A.5.** First note that in eq. (73), writing $\lambda = \tau e$ with $||e|| = 1$, one can perform the supremum over e:

$$ C_{\Lambda, \delta}(\mathbf{g}, \mathbf{h}) = \inf_{\mathbf{z} \in \mathbb{R}^m} \min_{\tau \in [0, A]} \max_{\mathbf{x} \in S^{n-1}} \left\{ \tau \mathbf{h}^{\top} \mathbf{x} + \tau \|\mathbf{g} - \mathbf{z}\| + \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(z_{\mu}) \right\}. $$

The maximum over $\tau \in [0, A]$ and the minimum over $\mathbf{x}$ can be carried out explicitly:

$$ \begin{aligned} C_{\Lambda, \delta}(\mathbf{g}, \mathbf{h}) &= \inf_{\mathbf{z} \in \mathbb{R}^m} \left\{ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(z_{\mu}) + \min_{\mathbf{x} \in S^{n-1}} [A(\mathbf{h}^{\top}\mathbf{x} + \|\mathbf{g} - \mathbf{z}\|)1\{\mathbf{h}^{\top}\mathbf{x} + \|\mathbf{g} - \mathbf{z}\| > 0\}] \right\}, \\ &= \inf_{\mathbf{z} \in \mathbb{R}^m} \left\{ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(z_{\mu}) + A(-\|\mathbf{h}\| + \|\mathbf{g} - \mathbf{z}\|)1\{-\|\mathbf{h}\| + \|\mathbf{g} - \mathbf{z}\| > 0\} \right\}. \end{aligned} $$

Letting $z' = g - z$, this yields:

$$ C_{\Lambda, \delta}(\mathbf{g}, \mathbf{h}) = \min \left\{ \min_{\mathbf{z} \in \mathbb{R}^m} \left[ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) \right], \inf_{\mathbf{z} \in \mathbb{R}^m} \left[ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) + A(\|\mathbf{z}\| - \|\mathbf{h}\|) \right] \right\}. $$

We now show that:
$$ \lim_{A \to \infty} \inf_{z \in \mathbb{R}^m} \left[ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) + A(\|z\| - \|h\|) \right] \geq \min_{\|z\| \leq \|h\|} \left[ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) \right], \quad (80) $$

which ends the proof. Notice that the LHS of eq. (80) is obviously a non-decreasing function of A, so that it indeed has a limit (possibly +∞). Moreover, we can restrict the infimum to $\|z\| \le \|h\| + \alpha/A$, since trivially for all A one has (recall $\ell_{\delta} \le 1$):

$$ \begin{aligned} \inf_{\|h\| < \|z\| \le \|h\| + \alpha/A} \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) + A(\|z\| - \|h\|) &\le \inf_{\|h\| < \|z\| \le \|h\| + \alpha/A} \left[ \alpha + A(\|z\| - \|h\|) \right], \\ &\le \alpha \inf_{\|z\| > \|h\| + \alpha/A} \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) + A(\|z\| - \|h\|), \end{aligned} $$

in which we used in (a) and (b) that $\ell_{\delta}(x) \in [0, 1]$. We let $\epsilon > 0$, and for all $A > 0$ we fix $\tilde{z}^{(A)} \in \mathbb{R}^m$ with $\|\tilde{z}^{(A)}\| \in (\|\mathbf{h}\|, \|\mathbf{h}\| + \alpha/A)$ such that:

$$ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - \tilde{z}_{\mu}^{(A)}) + A(\|\tilde{z}^{(A)}\| - \|\mathbf{h}\|) \le \inf_{\|z\| > \|\mathbf{h}\|} \left[ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) + A(\|z\| - \|\mathbf{h}\|) \right] + \epsilon. $$

Since $\|\tilde{z}^{(A)}\| \le \|\mathbf{h}\| + \alpha/A$, we can extract a converging subsequence $z^{(k)} = \tilde{z}^{(A(k))}$ such that $\exists \lim_{k \to \infty} z^{(k)} =: z^*$, and $\|\mathbf{h}\| < \|z^{(k)}\| \le \|\mathbf{h}\| + \alpha/A(k)$, with $A(k) \to \infty$. Therefore $\|z^*\| = \|\mathbf{h}\|$. Moreover:

$$ \begin{aligned} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}^{*}) &= \lim_{k \to \infty} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}^{(k)}), \\ &\le \liminf_{k \to \infty} \left[ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}^{(k)}) + A(k)(\|z^{(k)}\| - \|\mathbf{h}\|) \right], \\ &\le \liminf_{k \to \infty} \left\{ \inf_{\|z\| > \|\mathbf{h}\|} \left[ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) + A(k)(\|z\| - \|\mathbf{h}\|) \right] \right\} + \epsilon, \\ &\le \lim_{A \to \infty} \inf_{\|z\| > \|\mathbf{h}\|} \left[ \frac{1}{n} \sum_{\mu=1}^{m} \ell_{\delta}(g_{\mu} - z_{\mu}) + A(\|z\| - \|\mathbf{h}\|) \right] + \epsilon. \end{aligned} $$

Letting $\epsilon > 0$ be arbitrarily small, the claim of eq. (80) follows. □

**Proof of Lemma A.6.** Recall eq. (70). In particular, for any $A, \delta, K > 0$ we have:

$$ G_K(\mathbf{W}) \ge G_{A,\delta,K}(\mathbf{W}) := \inf_{z \in B(K)} \min_{x \in S^{n-1}} \max_{\|\lambda\| \le A} \left\{ \lambda^\top \mathbf{W} \mathbf{x} - \lambda^\top \mathbf{z} + \frac{1}{n} \sum_{\mu=1}^m \ell_{\delta}(z_{\mu}) \right\}. \quad (81) $$

By eq. (67) and eq. (81), we have:

$$ \mathbb{P}_W[G(\mathbf{W}) \le t] \le \mathbb{P}_W[G_K(\mathbf{W}) \le t] + e^{-n} \le \mathbb{P}_W[G_{A,\delta,K}(\mathbf{W}) \le t] + e^{-n}. \quad (82) $$

Using Proposition A.4 (since all sets are compact and functions involved are continuous, see in particular Remark I below it) we have, for all $t \in \mathbb{R}$:

$$ \mathbb{P}_W[G_{A,\delta,K}(\mathbf{W}, \mathbf{z}) \le t] \le 2\mathbb{P}_{g,h}[C_{A,\delta,K}(\mathbf{g}, \mathbf{h}, \mathbf{z}) \le t], $$

in which $C_{A,\delta,K}(\mathbf{g}, \mathbf{h})$ is defined as in eq. (73), restricting furthermore the infimum to $\mathbf{z} \in B(K)$. In particular, $C_{A,\delta,K}(\mathbf{g}, \mathbf{h}) \ge C_{A,\delta}(\mathbf{g}, \mathbf{h})$. Therefore by eq. (82):

$$ \mathbb{P}_W[G(\mathbf{W}) \le t] \le 2\mathbb{P}_{g,h}[C_{A,\delta}(\mathbf{g}, \mathbf{h}) \le t] + e^{-n}. \quad (83) $$

Note that $\mathbb{P}_{g,h}[C_{A,\delta}(\mathbf{g}, \mathbf{h}) \le t] = \mathbb{E}_{g,h}[1\{C_{A,\delta}(\mathbf{g}, \mathbf{h}) \le t\}]$, and moreover by Lemma A.5$^{14}$:

$$ \lim_{A \to \infty} 1\{C_{A,\delta}(\mathbf{g}, \mathbf{h}) \le t\} = 1\{C_{\delta}(\mathbf{g}, \mathbf{h}) \le t\}. $$

Taking the $A \to \infty$ limit in eq. (83) and using the dominated convergence theorem ends the proof of Lemma A.6. □

<footnote n="14">14 We use there the fact that $A \mapsto C_{A,\delta}(\mathbf{g}, \mathbf{h})$ is non-decreasing.</footnote>
**Proof of Lemma A.7.** For $\delta \ge 0$, we define

$$f_{\delta}(\kappa) := -\kappa + \alpha \int_{\mathbb{R}} Dx \left[ \inf_{z \in \mathbb{R}} \{ \kappa z^2 + \ell_{\delta}(x-z) \} \right],$$

so that $\mathcal{M}_{\delta} = \sup_{\kappa \ge 0} f_{\delta}(\kappa)$ for $\delta > 0$, and $\mathcal{M} = \sup_{\kappa \ge 0} f_0(\kappa)$. Notice first that eq. (79) follows from the following identity, that can be easily checked:

$$\inf_{z \in \mathbb{R}} \{ \kappa z^2 + 1 \{ z < x \} \} = 1 \{ \sqrt{\kappa} x \ge 1 \} + 1 \{ \sqrt{\kappa} x \in (0, 1) \} \kappa x^2.$$

Lemma A.7 will follow if we can show:

$$\lim_{\delta \to 0} \sup_{\kappa \ge 0} |f_{\delta}(\kappa) - f_0(\kappa)| = 0. \qquad (84)$$

Notice that for all $\delta > 0$ and all $x \in \mathbb{R}$, we have $1\{x > \delta\} \le \ell_{\delta}(x) \le 1\{x > 0\}$. In particular,

$$\inf_{z \in \mathbb{R}} \{ \kappa z^2 + 1 \{ z < x - \delta \} \} \le \inf_{z \in \mathbb{R}} \{ \kappa z^2 + \ell_{\delta}(x-z) \} \le \inf_{z \in \mathbb{R}} \{ \kappa z^2 + 1 \{ z < x \} \}.$$

One computes easily the left and right sides of this inequality:

$$\left\{ \begin{array}{l} \inf_{z \in \mathbb{R}} \{ \kappa z^2 + \ell_{\delta}(x-z) \} \le 1 \{ \sqrt{\kappa} x \ge 1 \} + 1 \{ \sqrt{\kappa} x \in (0, 1) \} \kappa x^2, \\ \\ \inf_{z \in \mathbb{R}} \{ \kappa z^2 + \ell_{\delta}(x-z) \} \ge 1 \{ \sqrt{\kappa} (x-\delta) \ge 1 \} + 1 \{ \sqrt{\kappa} (x-\delta) \in (0, 1) \} \kappa (x-\delta)^2. \end{array} \right.$$

Therefore we reach:

$$\begin{aligned} |f_{\delta}(\kappa) - f_0(\kappa)| &\le \alpha \int_{1/\sqrt{\kappa}}^{1/\sqrt{\kappa+\delta}} Dx + \alpha\kappa \int_0^{1/\sqrt{\kappa}} \frac{dx}{\sqrt{2\pi}} x^2 \left[ e^{-x^2/2} - e^{-(x+\delta)^2/2} \right], \\ &\le \alpha \int_0^{\delta} Dx + \alpha \int_0^{1/\sqrt{\kappa}} \frac{dx}{\sqrt{2\pi}} \left[ e^{-x^2/2} - e^{-(x+\delta)^2/2} \right], \\ &\le \alpha \int_0^{\delta} Dx + \alpha \int_0^{\infty} \frac{dx}{\sqrt{2\pi}} \left[ e^{-x^2/2} - e^{-(x+\delta)^2/2} \right], \\ &\le 2\alpha \int_0^{\delta} Dx, \end{aligned}$$

which goes to 0 as $\delta \to 0$, uniformly in $\kappa$. This ends the proof. $\square$

### A.7. Improving over a standard use of Gordon's inequality?

We give here a brief and informal description of the improvements made in [70,53] over the standard use of Gordon's inequality. The starting point of this improvement is to use Gordon's inequality in the form of stochastic domination, cf. e.g. Theorem 1 of [80]. This form implies that for $G$ a Gaussian i.i.d. matrix and $z \sim \mathcal{N}(0, 1)$, $g, h \sim \mathcal{N}(0, I_d)$, defining the min-max problems

$$\left\{ \begin{array}{l} \hat{\xi} := \min_{\mathbf{w}} \max[\mathbf{u}^\top \mathbf{G} \mathbf{w} + \psi(\mathbf{w}, \mathbf{u})], \\ \xi := \min_{\mathbf{w}} \max[\mathbf{u}^\top \mathbf{G} \mathbf{w} + \psi(\mathbf{w}, \mathbf{u}) + z \|\mathbf{u}\|\|\mathbf{w}\|], \\ \xi_{\text{lin.}} := \min_{\mathbf{w}} \max[\|\mathbf{g}\|\mathbf{u}^\top \mathbf{h} + \|\mathbf{h}\|\mathbf{w}^\top \mathbf{g} + \psi(\mathbf{w}, \mathbf{u})], \end{array} \right.$$

then for any $c \ge 0$, we have

$$\mathbb{E}[\exp\{-c\xi\}] \le \mathbb{E}[\exp\{-c\xi_{\text{lin.}}\}].$$

For our purposes, we would like to obtain an upper bound for $\mathbb{P}[\hat{\xi} \le t]$, cf. eq. (70). In the settings of [70,53], the vectors $\mathbf{w}, \mathbf{u}$ are unit-normed, so that $\xi = \hat{\xi} + z$, and therefore

$$\mathbb{E}[e^{-c\hat{\xi}}] = \frac{\mathbb{E}[e^{-c\xi}]}{\mathbb{E}[e^{-cz}]} \le \frac{\mathbb{E}[\exp\{-c\xi_{\text{lin.}}\}]}{\mathbb{E}[e^{-cz}]}.$$
Markov's inequality yields then:

$$ \mathbb{P}[\hat{\xi} \le t] \le e^{ct} \mathbb{E}[e^{-c\hat{\xi}}] \le e^{ct} \frac{\mathbb{E}[\exp\{-c\xi_{\text{lin.}}\}]}{\mathbb{E}[e^{-cz}]} $$

The authors of [70,53] use this bound and optimize it over $c \ge 0$. However, in our setting the vectors are not unit-normed, cf eq. (70). Instead, we use in Proposition A.4 a form of Gordon's inequality that is weaker than stochastic domination, but that allows to directly compare $\hat{\xi}$ and $\xi_{\text{lin}}$:

$$ \mathbb{P}[\hat{\xi} \le t] \le 2\mathbb{P}[\xi_{\text{lin.}} \le t]. $$

This technicality prevents us from directly applying the inequality used in [70,53]: nevertheless, similar improvements over the standard application of the min-max inequality are likely possible, and we leave it as an open question for future work.

## Appendix B. Replica-symmetric supplementary calculations

### B.1. Zero-temperature limit of the replica-symmetric solution

In this section, we derive eqs. (36) and (37). Our arguments will sometimes be informal, and a rigorous treatment would demand more care.

Recall that we have the expansion of eq. (35), with $\chi_{RS}$ the zero-temperature susceptibility of the system. In this section, we often drop the RS subscript on quantities to lighten the notations. We use the expansion of $H(x) = \int_x^\infty Du$ for large $x \gg 1$:

$$ H(x) = \frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}} \left[ \frac{1}{x} + \mathcal{O}_{x \to \infty} \left( \frac{1}{x^3} \right) \right]. \qquad (85) $$

**Computation of $f_{RS}^*(\alpha)$** - We start by deriving eq. (37). As one can check from eq. (32) that $\Phi_{RS}(\alpha, \beta)$ is a differentiable function of $\beta$, by L'Hospital's rule we have $f_{RS}^*(\alpha) = \lim_{\beta \to \infty} e_{RS}^*(\alpha, \beta)$, with $e_{RS}^*(\alpha, \beta) := -\partial_\beta \Phi(\alpha, \beta)$. We have from eq. (35):

$$ \sqrt{\frac{q}{1-q}} = \sqrt{\frac{\beta}{\chi}} + \mathcal{O}(\beta^{-1/2}). $$

We compute the limit of the integrand in eq. (34) (changing variables $\xi \to -\xi$):

$$ \frac{e^{-\beta} H\left(-\xi \sqrt{\frac{q}{1-q}}\right)}{1 - (1 - e^{-\beta}) H\left(-\xi \sqrt{\frac{q}{1-q}}\right)} \approx \frac{e^{-\beta} H\left(-\xi \sqrt{\frac{\beta}{\chi}}\right)}{1 - (1 - e^{-\beta}) H\left(-\xi \sqrt{\frac{\beta}{\chi}}\right)}. $$

We separate three cases, and use the expansion of eq. (85) to reach that at leading order in $\beta$:

$$ \frac{e^{-\beta} H\left(-\xi \sqrt{\frac{\beta}{\chi}}\right)}{1 - (1 - e^{-\beta}) H\left(-\xi \sqrt{\frac{\beta}{\chi}}\right)} \approx \begin{cases} \frac{\sqrt{\chi}}{\sqrt{2\pi\beta}\xi} e^{-\beta - \frac{\xi^2}{2\chi}} \to \beta \to \infty & \text{if } \xi < 0, \\ \frac{\xi\sqrt{2\pi\beta}}{\sqrt{\chi}} e^{-\beta + \frac{\xi^2}{2\chi}} \to \beta \to \infty & \text{if } \xi \in (0, \sqrt{2\chi}), \\ 1 & \text{if } \xi > \sqrt{2\chi}. \end{cases} \qquad (86) $$

Using the pointwise limit above, we reach (as we mentioned above, a more careful argument would need to be carried out to make this expansion rigorous)

$$ e^*(\alpha, \beta) \approx \alpha \int_{\sqrt{2\chi}}^{\infty} D\xi = \alpha H[\sqrt{2\chi}]. $$

In the end, we reach eq. (37):

$$ f_{RS}^*(\alpha) = \lim_{\beta \to \infty} e_{RS}^*(\alpha, \beta) = \alpha H[\sqrt{2\chi_{RS}}]. $$

**Computing $\chi$** - There now remains to find $\chi$ as a function of $\alpha$, from eq. (33). Plugging in the expansion of eq. (35) we find (changing $\xi \to -\xi$):

$$ \frac{1}{\sqrt{\chi}} = -\alpha \lim_{\beta \to \infty} \frac{1}{\sqrt{\beta}} \int D\xi \frac{(1 - e^{-\beta})\xi H'\left(-\xi \sqrt{\frac{q}{1-q}}\right)}{1 - (1 - e^{-\beta})H\left(-\xi \sqrt{\frac{q}{1-q}}\right)}. \qquad (87) $$
In the same way as in eq. (86), we can show:

$$ -\frac{1}{\sqrt{\beta}} \frac{(1 - e^{-\beta}) \xi H' \left(-\xi \sqrt{\frac{q}{1-q}}\right)}{1 - (1 - e^{-\beta}) H \left(-\xi \sqrt{\frac{q}{1-q}}\right)} \approx \begin{cases} \frac{\xi}{\sqrt{2\pi\beta}} e^{-\frac{\beta z^2}{2\chi}} \rightarrow \beta \rightarrow \infty & \text{if } \xi < 0, \\ \frac{\xi^2}{\sqrt{\chi}} & \text{if } \xi \in (0, \sqrt{2\chi}), \\ \frac{\xi}{\sqrt{2\pi\beta}} e^{\beta - \frac{\beta z^2}{2\chi}} \rightarrow \beta \rightarrow \infty & \text{if } \xi > \sqrt{2\chi}. \end{cases} \quad (88) $$

Therefore, we reach from eq. (87) that, as $\beta \to \infty$:

$$ \alpha \int_{0}^{\sqrt{2\chi}} D\xi \xi^2 = 1, $$

which is eq. (36).

## B.2. Stability of the replica-symmetric solution

In this section we follow Appendix 4 of [29] (see also e.g. [81]) to characterize the stability of the RS solution in replica space. This gives rise to the so-called de Almeida-Thouless conditions [22,34], which is a criterion for stability expressed in terms of so-called replicon eigenvalues.

We start again from the general expression of eq. (27): $\Phi(\alpha, \beta; r) = \sup_Q G_r(Q)$, with

$$ G_r(Q) := \frac{1}{2} \log \det Q + \alpha \log \int_{\mathbb{R}^r} \frac{dz}{(2\pi)^{r/2} \sqrt{\det Q}} e^{-\frac{1}{2} z^\mathrm{T} Q^{-1} z - \beta \sum_{a=1}^r \theta(z^a)} = G_{1,r}(Q) + \alpha G_{2,r}(Q). \quad (89) $$

In what follows, we compute the Hessian of $G_r(Q)$ taken at the replica-symmetric point.

### B.2.1. The derivatives of $G_{1,r}$

The derivatives of $G_{1,r}(Q)$ can be worked out in terms of the matrix elements of $Q^{-1}$ (here $a < b$ and $c < d$):

$$ \begin{cases} \frac{\partial G_{1,r}}{\partial Q_{ab}} = Q_{ab}^{-1}, \\ \frac{\partial^2 G_{1,r}}{\partial Q_{ab} \partial Q_{cd}} = -[Q_{ac}^{-1} Q_{bd}^{-1} + Q_{ad}^{-1} Q_{bc}^{-1}]. \end{cases} $$

Recall that at the replica symmetric point with $Q_{ab} = q$ and $Q_{aa} = 1$ we have

$$ \left\{ \begin{aligned} Q_{aa}^{-1} &= \frac{1 + (r - 2)q}{(1 - q)[1 + (r - 1)q]}, \\ Q_{ab}^{-1} &= -\frac{q}{(1 - q)[1 + (r - 1)q]}. \end{aligned} \right. \qquad (90) $$

Therefore (taking the notations of [29]):

$$ \left[ \frac{\partial^2 G_{1,r}}{\partial Q_{ab} \partial Q_{cd}} \right]_{\mathrm{RS}} = \begin{cases} P_1 & \text{if } a=c; b=d, \\ Q_1 & \text{if } a=c; b \neq d \text{ or } b=c \text{ or } a \neq c; b=d \text{ or } a=d, \\ R_1 & \text{if all indices are distinct,} \end{cases} \quad (91) $$

in which $P_1, Q_1, R_1$ are defined as:

$$ \left\{ \begin{aligned} P_1 &:= - \left( \frac{1 + (r - 2)q}{(1 - q)[1 + (r - 1)q]} \right)^2 - \left( \frac{q}{(1 - q)[1 + (r - 1)q]} \right)^2, \\ Q_1 &:= - \left( \frac{1 + (r - 2)q}{(1 - q)[1 + (r - 1)q]} \right) \left( - \frac{q}{(1 - q)[1 + (r - 1)q]} \right) - \left( \frac{q}{(1 - q)[1 + (r - 1)q]} \right)^2, \\ R_1 &:= -2 \left( \frac{q}{(1 - q)[1 + (r - 1)q]} \right)^2. \end{aligned} \right. $$
We now take the limit $r \downarrow 0$. With an abuse of notation, we still denote the limits $P_1, Q_1, R_1$:

$$ egin{cases} P_1 = \frac{-1 + 4q(1-q) - q^2}{(1-q)^4}, \\ Q_1 = \frac{q(1-q) - 2q^2}{(1-q)^4}, \\ R_1 = -\frac{2q^2}{(1-q)^4}. \end{cases} \tag{92} $$

### B.2.2. The derivatives of $G_{2,r}$

We now turn to $G_{2,r}(Q)$, that we rewrite using a Gaussian transformation:

$$ G_{2,r}(Q) = \log \int_{\mathbb{R}^r} \frac{\mathrm{d}u \mathrm{d}v}{(2\pi)^r} e^{-\frac{1}{2} \sum_{a,b} Q^{ab} v^a v^b - \beta \sum_{a=1}^r \theta(u^a) + i \sum_{a=1}^r u^a v^a} \tag{93} $$

This form is more suitable for computing the Hessian with respect to $Q$. In order to write the formulas compactly, we introduce the following average for any function of $\{v^a\}$:

$$ \langle g(\{v^a\}) \rangle_r := \left\{ \frac{\int_{\mathbb{R}^r} \mathrm{d}u \mathrm{d}v g(\{v^a\}) e^{-\frac{1}{2} \sum_{a,b} Q^{ab} v^a v^b - \beta \sum_{a=1}^r \theta(u^a) + i \sum_{a=1}^r u^a v^a}}{\int_{\mathbb{R}^r} \mathrm{d}u \mathrm{d}v e^{-\frac{1}{2} \sum_{a,b} Q^{ab} v^a v^b - \beta \sum_{a=1}^r \theta(u^a) + i \sum_{a=1}^r u^a v^a}} \right\}_{\mathrm{RS}}. $$

With this definition, we have from eq. (93):

$$ \left[ \frac{\partial^2 G_{2,r}}{\partial Q_{ab} \partial Q_{cd}} \right]_{RS} = \langle v^a v^b v^c v^d \rangle - \langle v^a v^b \rangle \langle v^c v^d \rangle, \tag{94} $$

in which $a < b$ and $c < d$. One can easily see that this Hessian has the same “replica-symmetric” structure as the one of $G_{1,r}$:

$$ \left[ \frac{\partial^2 G_{2,r}}{\partial Q_{ab} \partial Q_{cd}} \right]_{RS} = \begin{cases} P_2 & \text{if } a=c; b=d, \\ Q_2 & \text{if } a=c; b \neq d \text{ or } b=c \text{ or } a \neq c; b=d \text{ or } a=d, \\ R_2 & \text{if all indices are distinct.} \end{cases} \tag{95} $$

We compute these three terms separately in the limit $r \to 0$. In order to simplify the results, we introduce the notation $\mathbb{E}\langle g(v) \rangle$, with $\mathbb{E}$ the expectation over $\xi \sim \mathcal{N}(0, 1)$, and

$$ \langle g(v) \rangle := \frac{\int \mathrm{d}u \mathrm{d}v g(v) e^{-\frac{1-q}{2} v^2 - \beta \theta(u) + i v[u - \sqrt{q\xi}]} }{\int \mathrm{d}u \mathrm{d}v e^{-\frac{1-q}{2} v^2 - \beta \theta(u) + i v[u - \sqrt{q\xi}]} } $$

From this definition and eq. (94), one can check (using the same trick to decouple the replicas we used in the RS calculation, cf. Section 2.3) that we have, as $r \to 0$:

$$ \left\{ \begin{aligned} P_2 &= \mathbb{E}[\langle v^2 \rangle^2] - \mathbb{E}[\langle v \rangle^2]^2, \\ Q_2 &= \mathbb{E}[\langle v^2 \rangle \langle v \rangle^2] - \mathbb{E}[\langle v \rangle^2]^2, \\ R_2 &= \mathbb{E}[\langle v \rangle^4] - \mathbb{E}[\langle v \rangle^2]^2. \end{aligned} \right. \tag{96} $$

### B.2.3. de Almeida-Thouless condition for replica-symmetric stability

Classical replica studies [29] show that for a Hessian having the form of eqs. (91) or (95), the linear stability of the RS local maximum is given by the sign of the “replicon” eigenvalue $P - 2Q + R$. More precisely, the AT condition for the stability of the RS solution in replica space reads here:

$$ \lambda_3 = [P_1 - 2Q_1 + R_1] + \alpha [P_2 - 2Q_2 + R_2] \le 0. $$

By eqs. (92) and (96) we get:

$$ \frac{1}{(1-q)^2} \ge \alpha \mathbb{E} \left[ \left( \langle v^2 \rangle - \langle v \rangle^2 \right)^2 \right]. \tag{97} $$

In order to make eq. (97) more explicit, we compute the right-hand side using the identity $\langle v^2 \rangle - \langle v \rangle^2 = -q^{-1} \partial_{\xi}^2 \log Z(\xi)$, with

$$ Z(\xi) := \int \frac{\mathrm{d}u \mathrm{d}v}{2\pi} e^{-\frac{1-q}{2} v^2 - \beta \theta(u) + i v[u - \sqrt{q\xi}]} $$

This integral is easy to work out:
$$ \log \mathcal{Z}(\xi) = \log \int \frac{du}{\sqrt{2\pi(1-q)}} e^{-\beta\theta(u) - \frac{1}{2(1-q)}(u - \sqrt{q\xi})^2} = \log \left[ 1 - (1 - e^{-\beta})H\left(-\xi\sqrt{\frac{q}{1-q}}\right) \right]. $$

Let us define $f_{\beta}(h) := \log(1 - (1 - e^{-\beta})H[-h/\sqrt{1-q}])$, so that $\log \mathcal{Z}(\xi) = f_{\beta}(\sqrt{q\xi})$. Then $\langle v^2 \rangle - \langle v \rangle^2 = -f_{\beta}''(\sqrt{q\xi})$. The AT condition for the stability of the replica-symmetric solution is then expressed easily as a function of $(\alpha, q)$ at any $\beta \ge 0$ as

$$ \frac{1}{\alpha} \ge (1-q)^2 \int D\xi f_{\beta}''(\sqrt{q\xi})^2. \qquad (98) $$

### B.2.4. The $\beta \to \infty$ limit

We now take the limit $\beta \to \infty$ in eq. (98), introducing the zero-temperature susceptibility $\chi_{RS} = \chi$ (cf. eq. (35)). Using the same expansions as in eqs. (86) and (88) we have as $\beta \to \infty$:

$$ \frac{1}{\beta} f_{\beta}(h) \approx \begin{cases} 0 & \text{if } h < 0, \\ -1 & \text{if } h > \sqrt{2\chi}, \\ -\frac{h^2}{2\chi} & \text{otherwise.} \end{cases} \qquad (99) $$

Therefore, we have at large $\beta$, that $f_{\beta}''(h) \approx -\beta\chi^{-1}1\{h \in (0, \sqrt{2\chi})\}$. Since $(1-q)^2 \approx \chi^2/\beta^2$, the RS stability condition (98) becomes, in the $\beta \to \infty$ limit:

$$ \alpha \int_0^{\sqrt{2\chi}} D\xi \le 1. \qquad (100) $$

However, recall that in the zero-temperature limit, the RS susceptibility $\chi$ is given by the solution to eq. (36):

$$ \alpha \int_0^{\sqrt{2\chi}} D\xi \xi^2 = 1, $$

which can be turned easily by integration by parts into:

$$ \alpha \int_0^{\sqrt{2\chi}} D\xi = 1 + \alpha \sqrt{\frac{\chi}{\pi}} e^{-\chi} > 1, $$

in which the inequality holds in all the “UNSAT” phase $\alpha > 2$ for which $\chi < \infty$. Therefore, eq. (100) is never satisfied for any $\alpha > 2$ at zero-temperature, the replica-symmetric solution is never linearly stable!

## Appendix C. A replica-symmetric lower bound

**High-dimensional concentration on energy level sets** – Let us first describe physical reasons (at a heuristic level) for the concentration of the energy under the Gibbs measure of eq. (5), for any $\beta \ge 0$. As we mentioned in Section 1, proving this property is highly non-trivial. While we did not need to assume this concentration to hold in the rest of the paper, it will be important in this part to describe the derivation of a replica-symmetric lower bound for the injectivity threshold.

At fixed $\mathbf{W}$, the distribution of intensive energies is described by a probability density $P_{\beta}(e)$ given by:

$$ P_{\beta}(e) := \int d\mathbb{P}_{\beta, \mathbf{W}}(\mathbf{x}) \delta\left(\frac{E_{\mathbf{W}}(\mathbf{x})}{n} - e\right) = \frac{e^{-n\beta e}}{Z_{\beta}(\mathbf{W}, \beta)} \int \mu_{n}(\mathrm{d}\mathbf{x}) \delta\left(\frac{E_{\mathbf{W}}(\mathbf{x})}{n} - e\right). \qquad (101) $$

One can show (using properties of the uniform measure $\mu_n$ and the fact that the energy is extensive) that the “entropic” term on the right scales exponentially with $n$, that is that for any $e \in [0, a]$, one has a well-defined $F(e) := \lim_{n \to \infty} (1/n) \log \int \mu_n(\mathrm{d}\mathbf{x}) \delta(E_{\mathbf{W}}(\mathbf{x})/n - e) \in [-\infty, 0]$. In mathematical terms, for $\mathbf{x} \sim \mu_n$, $E_{\mathbf{W}}(\mathbf{x})/n$ satisfies a large deviation principle in the scale $n$, with rate function $-F(e)$. Therefore, by eq. (101), $P_{\beta}(e)$ has large deviations in the scale $n$ around a value $e^*(\beta)$, i.e. we have the following behavior:

$$ \left\{ \begin{aligned} e^*(\beta) &:= \arg\max_{e}[-\beta e + F(e)], \\ P_{\beta}(e) &\approx \exp\left\{n\left(-\beta e + F(e) - [-\beta e^*(\beta) + F(e^*(\beta))]\right)\right\}. \end{aligned} \right. \qquad (102) $$

In particular, the probability (under the Gibbs measure) of having a configuration with energy $e$ such that $|e - e^*(\beta)| > \epsilon$ is exponentially small in $n$ for any $\epsilon > 0$. Therefore, we expect that at any $\beta \ge 0$, all the mass of the Gibbs measure concentrates (as $n \to \infty$) around the level set with intensive energy $e^*(\beta)$, given thus also by the mean energy under the Gibbs measure [28]. Note that we discarded the dependency of $e^*$ on $\mathbf{W}$: the concentration with respect to $\mathbf{W}$ can be justified (but not proven!) using the concentration
of $\Phi_n(W, \beta)$ in Theorem 1.4. Indeed, note that the average energy under the Gibbs measure is precisely given by a derivative of the free energy:

$$ \int d\mathbb{P}_{\beta,W}(\mathbf{x}) E_W(\mathbf{x}) = -\frac{\partial}{\partial \beta} \left[ \log \mathcal{Z}_n(W, \beta) \right]. $$

Therefore, one expects that the concentration of the free energy transfers to the derivatives, and thus that the energy level also concentrates as a function of W. Summing up, the function $e^*(\alpha, \beta)$ (we explicit its dependency on $\alpha$ and $\beta$) is – conjecturally – equal to the following limit:

$$ e^*(\alpha, \beta) = \text{p-lim}_{n \to \infty} \frac{1}{n} \int d\mathbb{P}_{\beta,W}(\mathbf{x}) E_W(\mathbf{x}) = -\partial_{\beta} \Phi(\alpha, \beta), $$

in which the limit is again in probability over the randomness induced by W. Furthermore, in the limit $\beta \to \infty$ – as we argued in the main text – we expect the Gibbs measure to concentrate its mass around the global minima of $E_W$, and therefore that

$$ \lim_{\beta \to \infty} e^*(\alpha, \beta) = \text{p-lim}_{n \to \infty} \left\{ \frac{1}{n} \min_{\mathbf{x} \in S^{n-1}} E_W(\mathbf{x}) \right\}. \quad (103) $$

**The lower bound** – By eq. (4) and eq. (103), $e^*(\alpha, \beta = \infty) \ge 1 \Leftrightarrow \alpha \ge \alpha_{\text{inj}}$.<fnref n="15" /> Since $e^*(\alpha, \beta)$ is a decreasing function of $\beta$ and $e^*(\alpha, \beta = 0) = \alpha/2$, this implies that for any $\alpha \in (2, \alpha_{\text{inj}}]$ there exists $\beta^*(\alpha) \in [0, \infty]$ such that

$$ \beta^*(\alpha) := \sup\{\beta \ge 0 : e^*(\alpha, \beta) \ge 1\}. $$

Moreover, it is easy to see that $\beta^*(\alpha)$ is a non-decreasing function of $\alpha$. In particular, if for all $\beta < \beta^*(\alpha)$ the RS solution is stable (in the sense of the dAT condition described above, and derived in Appendix B.2), then the replica-symmetric ansatz will yield the exact solution for all $\beta \in [0, \beta^*(\alpha))$. We denote $\alpha_{\text{dAT}}$ the largest such $\alpha$:

$$ \alpha_{\text{dAT}} := \sup\{\alpha \mid \alpha > 2 \text{ and the RS solution is stable for all } \beta < \beta^*(\alpha)\}. $$

Recall that $\alpha_{\text{inj}}$ is, according to our criterion, equal to:

$$ \alpha_{\text{inj}} = \inf\{\alpha : \lim_{\beta \to \infty} e^*(\alpha, \beta) \ge 1\} = \inf\{\alpha : \beta^*(\alpha) = \infty\}. $$

However, we know that for $\beta \to \infty$ the RS solution is never stable for $\alpha > 2$ (see Appendix B.2), so for all $\alpha > 2$, if $\beta^*(\alpha) = \infty$ then $\alpha > \alpha_{\text{dAT}}$. In particular, we get the lower bound $\alpha_{\text{dAT}} \le \alpha_{\text{inj}}$. We stress that an important property of $\alpha_{\text{dAT}}$ is that it can be computed solely from the RS solution (and its stability analysis), and might thus be more amenable to a rigorous analysis than the replica symmetry breaking upper bounds. Recall that the stability condition for the RS solution is given by eq. (98), in which $q$ is the overlap given by the RS calculation, i.e. by eq. (33). A numerical evaluation of eq. (98), available in the attached code [46], yields $\alpha_{\text{dAT}} \approx 5.3238$, which implies the lower bound presented in eq. (39).

## Appendix D. One-step replica symmetry breaking

### D.1. Derivation of the 1-RSB free entropy

We perform here, for completeness of our presentation, the textbook calculation of the spherical perceptron free entropy at the one-RSB level. We start again from eq. (27), which we rewrite using a Gaussian transformation as:

$$ \Phi(\alpha, \beta, r) = \sup_{\mathbf{Q}} \left[ \frac{1}{2} \log \det \mathbf{Q} + \alpha \log \int_{\mathbb{R}^r} \frac{\mathrm{dudv}}{(2\pi)^r} e^{-\frac{1}{2} \sum_{a,b} Q^{ab} v^a v^b - \beta \sum_{a=1}^r \theta(u^a) + i \sum_{a=1}^r u^a v^a} \right]. \quad (104) $$

We assume a 1RSB ansatz given in eq. (41), with $q_1 > q_0$, and $m \in \{1, \dots, r\}$ with $m|r$ the Parisi parameter (i.e. the size of the diagonal blocks in the ultrametric $\mathbf{Q}$). More precisely we have, with $k := r/m$:

$$ \left\{ \begin{array}{l} Q_{aa} = 1, \\ Q_{ab} = q_1 \text{ if } \lfloor \frac{a}{k} \rfloor = \lfloor \frac{b}{k} \rfloor, \\ Q_{ab} = q_0 \text{ otherwise.} \end{array} \right. \quad (105) $$

**The entropic contribution** – We focus on the first term of eq. (104). It is elementary algebra to check that under the ansatz of eq. (105), the spectrum of $\mathbf{Q}$ is:

$$ \mathrm{Sp}(\mathbf{Q}) = \{1 - q_1\}^{r-k} \cup \{1 - mq_0 + (m-1)q_1\}^{k-1} \cup \{1 + (r-m)q_0 + (m-1)q_1\}. $$

In particular, this yields:

<footnote n="15">¹⁵ Assuming that $\alpha \mapsto e^*(\alpha, \beta = \infty)$ is continuous and strictly increasing, which we always observe, see Fig. 1.</footnote>
$$ \log \det \mathbf{Q} = r \frac{m-1}{m} \log(1-q_1) + \frac{r-m}{m} \log[1-mq_0 + (m-1)q_1] + \log[1+(r-m)q_0 + (m-1)q_1]. $$

And thus:

$$ \partial_r[\log \det \mathbf{Q}]_{r=0} = \frac{m-1}{m} \log(1-q_1) + \frac{1}{m} \log[1-mq_0 + (m-1)q_1] + \frac{q_0}{[1-mq_0 + (m-1)q_1]} \quad (106) $$

**The interaction contribution** – We focus now on the second term $\alpha G_{2,r}(\mathbf{Q})$ in eq. (104), with:

$$ G_{2,r}(\mathbf{Q}) := \log \int_{\mathbb{R}^r} \frac{\mathrm{dudv}}{(2\pi)^r} e^{-\frac{1}{2} \sum_{a,b} Q^{ab} v^a v^b - \beta \sum_{a=1}^r \theta(u^a) + i \sum_{a=1}^r u^a v^a} $$

Under the 1-RSB ansatz, it becomes:

$$ G_{2,r}(\mathbf{Q}) = \log \int_{\mathbb{R}^r} \frac{\mathrm{dudv}}{(2\pi)^r} e^{-\frac{1-q_1}{2} \sum_a (v^a)^2 - \frac{q_1-q_0}{2} \sum_{x=0}^{k-1} \left( \sum_{l=1}^m v^{mx+l} \right)^2 - \sum_a [\beta\theta(u^a) - iu^a v^a]} $$

Introducing Gaussian transformations based on the formula $e^{-x^2/2} = \int Dz e^{-izx}$ to decouple the replicas, we obtain:

$$ G_{2,r}(\mathbf{Q}) = \log \int D\xi \prod_{x=0}^{k-1} \int Dz_x \int_{\mathbb{R}^r} \frac{\mathrm{dudv}}{(2\pi)^r} \exp \left\{ -\frac{1-q_1}{2} \sum_a (v^a)^2 - i\sqrt{q_0}\xi \sum_a v^a \right. \\ -i\sqrt{q_1-q_0} \sum_{x=0}^{k-1} z_x \sum_{l=1}^m v^{mx+l} - \beta \sum_a \theta(u^a) + i \sum_a u^a v^a \right\}, \\ = \log \int D\xi \left\{ \int Dz \left[ \int \frac{\mathrm{dudv}}{2\pi} \exp \left\{ -\frac{1-q_1}{2} v^2 - i\nu[\sqrt{q_0}\xi + \sqrt{q_1-q_0}z] - \beta\theta(u) + iuv \right\} \right]^m \right\}^{\frac{r}{m}} $$

Using this Gaussian transformation trick, we were able to decouple replicas and therefore obtain an expression that is analytic in $r$. This allows to take the $r \downarrow 0$ limit (keeping $m$ fixed), and to reach:

$$ \partial_r [G_{2,r}(\mathbf{Q})]_{r=0} = \frac{1}{m} \int D\xi \log \left\{ \int Dz \left[ \int \frac{\mathrm{dudv}}{2\pi} \exp \left\{ -\frac{1-q_1}{2} v^2 + i\nu[u - \sqrt{q_0}\xi - \sqrt{q_1-q_0}z] - \beta\theta(u) \right\} \right]^m \right\} $$

Performing the Gaussian integrals, and recall the definition of $H(x) := \int_x^\infty Du$, we reach:

$$ \partial_r [G_{2,r}(\mathbf{Q})]_{r=0} = \frac{1}{m} \int D\xi \log \left\{ \int Dz \left[ 1 - (1 - e^{-\beta})H\left(-\frac{\sqrt{q_0}\xi + \sqrt{q_1 - q_0}z}{\sqrt{1 - q_1}}\right) \right]^m \right\}. \quad (107) $$

Combining eq. (106) and eq. (107), we reach eq. (45).

## D.2. Zero-temperature limit

Recall that in the $\beta \to \infty$ limit we have the scaling (see e.g. [30])

$$ m \sim \frac{c_m}{\beta} \quad \text{and} \quad 1 - q_1 \sim \frac{\chi_{1\mathrm{RSB}}}{\beta}, \qquad (108) $$

while $q_0$ has a limit in $(0, 1)$ as $\beta \to \infty$. In the following of this section, we write $\chi_{1\mathrm{RSB}} = \chi$ to lighten the notations. The asymptotics of the determinant term in eq. (45) can be worked out:

$$ \frac{m-1}{2m} \log(1-q_1) + \frac{1}{2m} \log[1-mq_0 + (m-1)q_1] + \frac{q_0}{2[1-mq_0 + (m-1)q_1]} \\ \approx \frac{\beta}{2} \left[ \frac{q_0}{\chi + c_m(1-q_0)} + \frac{1}{c_m} \log \left( \frac{\chi + c_m(1-q_0)}{\chi} \right) \right]. $$

The limit of the other term in eq. (45) can also be computed, using that:

$$ \left[ 1 - (1 - e^{-\beta})H\left(-\frac{\sqrt{q_0}\xi + \sqrt{q_1 - q_0}\xi_1}{\sqrt{1 - q_1}}\right) \right]^m = \exp\{m f_{\beta}(u)\}, $$
with $u := \sqrt{q_0\xi_0} + \sqrt{1 - q_0\xi_1}$, and $f_\beta(h) := \log(1 - (1 - e^{-\beta})H[-h/\sqrt{1 - q_1}])$. We described the expansion of $f_\beta(h)/\beta$ for large $\beta$ in eq. (99) (simply replacing $\chi_{RS}$ by $\chi_{1RSB}$). We reach then:

$$ \left[ 1 - (1 - e^{-\beta})H\left(-\frac{\sqrt{q_0\xi} + \sqrt{q_1 - q_0\xi_1}}{\sqrt{1 - q_1}}\right) \right]^m \approx \begin{cases} 1 & \text{if } u < 0, \\ e^{-c_m} & \text{if } u > \sqrt{2\chi}, \\ e^{-\frac{c_m u^2}{2\chi}} & \text{if } u \in (0, \sqrt{2\chi}). \end{cases} \quad (109) $$

Anticipating on what follows, we introduce the auxiliary functions (in which $u = u(\xi_0, \xi_1) := \sqrt{q_0\xi_0} + \sqrt{1 - q_0\xi_1}$):

$$ \left\{ \begin{aligned} n(\xi_0) &:= \int_{u \le 0} D\xi_1 + e^{-c_m} \int_{u > \sqrt{2\chi}} D\xi_1 + \int_{0 < u < \sqrt{2\chi}} D\xi_1 e^{-\frac{c_m u^2}{2\chi}}, \\ a(\xi_0) &:= \int_{0 < u < \sqrt{2\chi}} D\xi_1 e^{-\frac{c_m u^2}{2\chi}} u, \\ b(\xi_0) &:= \int_{0 < u < \sqrt{2\chi}} D\xi_1 e^{-\frac{c_m u^2}{2\chi}} u^2, \\ c(\xi_0) &:= e^{-c_m} \int_{u > \sqrt{2\chi}} D\xi_1 + \frac{1}{2\chi} \int_{0 < u < \sqrt{2\chi}} D\xi_1 u^2 e^{-\frac{c_m u^2}{2\chi}}. \end{aligned} \right. \quad (110) $$

By integration by parts, all these functions can be expressed in terms of elementary functions and $H(x) := \int_{\chi}^{\infty} D\xi$. Moreover, note that we have the identities:

$$ \left\{ \begin{aligned} \partial_{q_0} n(\xi_0) &= -\frac{c_m}{2\chi(1-q_0)} \left[ \frac{\xi_0}{\sqrt{q_0}} a(\xi_0) - b(\xi_0) \right], & (a) \\ \partial_{\chi} n(\xi_0) &= \frac{c_m}{2\chi^2} b(\xi_0), & (b) \\ \partial_{c_m} n(\xi_0) &= -c(\xi_0). & (c) \end{aligned} \right. \quad (111) $$

Eqs. (111b) and (111c) can be obtained directly from the definition of eq. (110). For eq. (111a), we found more convenient to differentiate the finite-$\beta$ integral one can write for $n(\xi_0)$ using eq. (109), and then take its large $\beta$ limit. We leave the derivation of these equations to the reader. Using the expansion of eq. (109), we obtain the limit of the second term of eq. (45):

$$ \int D\xi_0 \log \left\{ \int D\xi_1 \left[ 1 - (1 - e^{-\beta})H\left(-\frac{\sqrt{q_0\xi_0} + \sqrt{q_1 - q_0\xi_1}}{\sqrt{1 - q_1}}\right) \right]^m \right\} \approx \int D\xi_0 \log n(\xi_0). $$

In the end, we have computed the limit of the free energy at the 1-RSB level, i.e. $f_{1RSB}^*(\alpha) := -\lim_{\beta \to \infty} \Phi_{1RSB}(\alpha, \beta)/\beta$:

$$ f_{1RSB}^*(\alpha) = -\frac{q_0}{2[\chi + c_m(1 - q_0)]} - \frac{1}{2c_m} \log \left( \frac{\chi + c_m(1 - q_0)}{\chi} \right) - \frac{\alpha}{c_m} \int D\xi_0 \log n(\xi_0), \quad (112) $$

in which one must implicitly maximize over $(c_m, q_0, \chi)$. Note that an equivalent expression can be obtained using the limit of the average energy, since $e_{1RSB}^*(\alpha, \beta = \infty) = \lim_{\beta \to \infty} [-\partial_\beta \Phi_{1RSB}(\alpha, \beta)] = f_{1RSB}^*(\alpha)$. Performing expansions in a similar way to the RS computations described in Appendix B.1, we reach:

$$ f_{1RSB}^*(\alpha) = e_{1RSB}^*(\alpha, \beta = \infty) = \alpha \int D\xi_0 \frac{1}{n(\xi_0)} e^{-c_m} \int_{u > \sqrt{2\chi}} D\xi_1. \quad (113) $$

Let us emphasize that eq. (113) is an identity involving the parameters $(c_m, q_0, \chi)$, which have to be found by maximizing eq. (112).

### D.3. Numerical procedure

Let us summarize here the equations that allow to find the 1-RSB prediction for the injectivity threshold, using the set of auxiliary functions of eq. (110). One simply proceeds by derivation of the limit of the free energy functional given in eq. (112) with respect to $(q_0, \chi, c_m)$, using eq. (111). More precisely, at a given value of $\alpha > 2$, one must find $q_0 \in (0, 1)$ and $\chi, c_m > 0$ satisfying the following set of three equations:
$$ 
\left\{
\begin{aligned}
\frac{q_0}{[\chi + (1 - q_0)c_m]^2} &= \frac{\alpha}{c_m \chi(1 - q_0)} \int D\xi_0 \frac{1}{n(\xi_0)} \left[ \frac{\xi_0}{\sqrt{q_0}} a(\xi_0) - b(\xi_0) \right], \\
\frac{\chi + (1 - q_0)^2 c_m}{\chi[(1 - q_0)c_m + \chi]^2} &= \frac{\alpha}{\chi^2} \int D\xi_0 \frac{b(\xi_0)}{n(\xi_0)}, \\
\frac{c_m(1 - q_0)[\chi + c_m(1 - 2q_0)]}{2[\chi + c_m(1 - q_0)]^2} - \frac{1}{2} \log \frac{\chi + c_m(1 - q_0)}{\chi} &= \alpha \int D\xi_0 \left\{ \log n(\xi_0) + c_m \frac{c(\xi_0)}{n(\xi_0)} \right\}.
\end{aligned}
\right.
\quad (114) $$

Once one has found the solution to eq. (114), we can obtain the large-$\beta$ limit of the energy either from eq. (112) or eq. (113).

Following the statistical physics folklore, in order to implement an iterative scheme to solve eq. (114), we use auxiliary variables. Namely, we iterate the first two equations of eq. (114) as:

$$ 
\left\{
\begin{aligned}
A_0^t &= \frac{\alpha}{c_m \chi^t(1 - q_0^t)} \int D\xi_0 \frac{1}{n_t(\xi_0)} \left[ \frac{\xi_0}{\sqrt{q_0^t}} a_t(\xi_0) - b_t(\xi_0) \right], \\
A_1^t &= \frac{\alpha}{(\chi^t)^2} \int D\xi_0 \frac{b_t(\xi_0)}{n_t(\xi_0)}, \\
q_0^{t+1} &= F_1(A_0^t, A_1^t, c_m^t), \\
\chi^{t+1} &= F_2(A_0^t, A_1^t, c_m^t),
\end{aligned}
\right.
\quad (115) $$

in which we added a time subscript for the auxiliary functions to highlight their dependency on $q_0^t$, $\chi^t$, $c_m^t$. Moreover, the functions $F_1$, $F_2$ are defined as the only roots (in $q_0$, $\chi$) of the equations

$$ A_0 = \frac{q_0}{[\chi + (1 - q_0)c_m]^2} \quad \text{and} \quad A_1 = \frac{\chi + (1 - q_0)^2 c_m}{\chi[(1 - q_0)c_m + \chi]^2}, $$

such that $q_0 \in (0, 1)$ and $\chi \ge 0$. Note that this implies that

$$ \chi = \frac{A_0 c_m (1 - q_0)^2}{q_0 A_1 - A_0}. \quad (116) $$

Therefore, in order for the solution to exist we must have $A_0 < A_1$, and then the solution satisfies $q_0 > A_0/A_1$. The remaining equation on $q_0$ can be written as:

$$ A_0 = \frac{(A_1 q_0 - A_0)^2}{q_0 c_m^2 (1 - q_0)^2 (A_1 - A_0)^2}. \quad (117) $$

We solve eq. (117) on $q_0$ with a polynomial equations solver, and consider the unique solution in $(0, 1)$ such that the corresponding $\chi$ in eq. (116) satisfies $\chi \ge 0$, i.e. such that $q_0 > A_0/A_1$.

At a given iteration $t$, we iterate eq. (115) for the value $c_m = c_m^t$. We then do a binary search to solve the last equation of eq. (114) and find $c_m^{t+1}$. We found this procedure to converge very quickly (see the attached code [46]), and it yields the 1RSB curves in Fig. 1 and the prediction of eq. (46).

## Appendix E. Details of the FRSB computation

In this section we derive the full RSB conjecture for the free entropy $\Phi(\alpha, \beta)$. Our computation is extremely close to the one of [30], and we refer to this work (and the lecture notes [81]) for more details on the technicalities of the derivation.

Recall the form of the r-th moment of the partition function, written as a function of the overlap matrix (without any assumption on the form of the saddle point), that is eq. (27). Note that by using the Gaussian integration formula, we can rewrite $I_\beta(\mathbf{Q})$ so as to obtain:

$$ \Phi(\alpha, \beta; r) = \sup_{\mathbf{Q}} \left[ \frac{1}{2} \log \det \mathbf{Q} + \alpha \log \int_{\mathbb{R}^r} \frac{\mathrm{dudv}}{(2\pi)^r} e^{-\frac{1}{2} \sum_{a,b} Q^{ab} v_a v_b - \beta \sum_{\vec{a}=1}^r \theta(u^a) + i \sum_{\vec{a}=1}^r u^a v^a} \right]. \quad (118) $$

Let us now perform the replica method under the full-RSB ansatz described in Fig. 3.

### E.1. Entropic contribution

We start with the first “entropic” term in eq. (118). Its expression under a full-RSB ansatz is given in eq. (23) of [30], itself taken from Appendix A.II of [48]. However the derivation is itself very interesting and will be useful for the other term in eq. (118), so we first detail it here.

**Derivation for $r > 0$** – We focus on the entropic term, which we may write as:

$$ \frac{1}{2} \log \det \mathbf{Q} = - \log \int_{\mathbb{R}^r} \frac{\mathrm{d}u}{(2\pi)^r} \exp \left\{ -\frac{1}{2} \mathbf{u}^T \mathbf{Q} \mathbf{u} \right\}. \quad (119) $$
We fix a k-RSB ansatz, cf. Fig. 3, and we will take in the end the limit $k \to \infty$. We have in the $r \downarrow 0$ limit $m_{-1} := r \le m_0 \le m_1 \le \cdots \le m_{k-1} \le m_k = 1$, and the parameters $q_0 \le q_1 \le q_k \le q_{k+1} = 1$. Recall that in this ansatz, the hierarchical overlap matrix $\{Q_{ab}\}$ can be written as:

$$Q = \sum_{i=0}^{k+1} (q_i - q_{i-1}) J_{m_{i-1}}^{(r)},$$

with $J_m^{(r)}$ the block-diagonal matrix with $r/m$ blocks of size $m$, each diagonal block being the all-ones matrix. In order to compute the integral of eq. (119), we use a simple yet very powerful identity introduced in [24], and valid for any matrix (not necessarily a hierarchical RSB matrix) $\{Q_{ab}\}$:

$$\exp\left\{-\frac{1}{2}\sum_{a,b=1}^{r} Q_{ab}u_a u_b\right\} = \exp\left(\frac{1}{2}\sum_{a,b=1}^{r} Q_{ab} \frac{\partial^2}{\partial h_a \partial h_b}\right) \left[\prod_{c=1}^{r} \exp(-iu_c h_c)\right]_{h=0}. \quad (120)$$

This identity can be shown by Taylor-expanding the exponential involving the differential operator. Using it in eq. (119) we get:

$$-\frac{1}{2} \log \det \mathbf{Q} = \log \int \frac{d\mathbf{u}}{(2\pi)^{r/2}} \exp\left(\frac{1}{2} \sum_{a,b=1}^{r} Q_{ab} \frac{\partial^2}{\partial h_a \partial h_b}\right) \left[\prod_{c=1}^{r} \exp(-iu_c h_c)\right]_{h=0}. \quad (121)$$

Note that $\mathbf{u}$ does not appear in the differential operator, so that one can exchange the differential operator and the integral over $\mathbf{u}$. Integrating with respect to $\mathbf{u}$ yields then, using the Fourier representation of the delta distribution (we denote $\partial_a = \partial/\partial h_a$):

$$\begin{aligned}
-\frac{1}{2} \log \det \mathbf{Q} &= \log \left\{ (2\pi)^{r/2} \exp\left(\frac{1}{2} \sum_{a,b=1}^{r} Q_{ab} \partial_a \partial_b\right) \left[\prod_{c=1}^{r} \delta(h_c)\right]_{h=0} \right\}, \\
&= \log \left\{ (2\pi)^{r/2} \exp\left(\frac{1}{2} \sum_{i=0}^{k+1} (q_i - q_{i-1}) \sum_{a,b=1}^{r} (J_{m_{i-1}}^{(r)})_{ab} \partial_a \partial_b\right) \left[\prod_{c=1}^{r} \delta(h_c)\right]_{h=0} \right\}, \\
&= \log \left\{ (2\pi)^{r/2} \exp\left(\frac{1}{2} \sum_{i=0}^{k} (q_i - q_{i-1}) \sum_{a,b=1}^{r} (J_{m_{i-1}}^{(r)})_{ab} \partial_a \partial_b\right) \exp\left(\frac{1-q_k}{2} \sum_{a=1}^{r} \partial_a^2\right) \left[\prod_{c=1}^{r} \delta(h_c)\right]_{h=0} \right\}.
\end{aligned} \quad (122)$$

We use now the crucial identity, for any $\omega \ge 0$ and smooth function $f$, and which can be shown by Taylor-expanding $f$ around $h$ inside the integral on the right hand side:

$$\exp\left(\frac{\omega}{2} \partial_h^2\right) f[h] = [\gamma_\omega \star f](h) = \int \frac{dz}{\sqrt{2\pi\omega}} e^{-\frac{z^2}{2\omega}} f(h-z). \quad (123)$$

Here we denoted $\gamma_\omega(x) = e^{-x^2/(2\omega)}/\sqrt{2\pi\omega}$, and $\gamma_0(x) = \delta(x)$. Using eq. (123) inside eq. (122) we reach:

$$-\frac{1}{2} \log \det \mathbf{Q} = \log \left\{ (2\pi)^{r/2} \exp\left(\frac{1}{2} \sum_{i=0}^{k} (q_i - q_{i-1}) \sum_{a,b=1}^{r} (J_{m_{i-1}}^{(r)})_{ab} \partial_a \partial_b\right) \left[\prod_{c=1}^{r} \gamma_{1-q_k}(h_c)\right]_{h=0} \right\}. \quad (124)$$

We will iteratively apply the differential operator in the exponential, starting from $i=0$ up to $i=k$. We will make use of another important identity, which is just a consequence of simple differential calculus combined with eq. (123), and valid for any $p, n \in \mathbb{N}$ and smooth $R(h_1, \cdots, h_n)$:

$$\left\{
\begin{array}{l}
\displaystyle \left[ \left( \sum_{a=1}^{n} \frac{\partial}{\partial h_a} \right)^p R(h_1, \cdots, h_n) \right]_{h_a=h} \\
\displaystyle \quad = \frac{\partial^p}{\partial h^p} [h \mapsto R(h, h, \cdots, h)], \\
\\
\displaystyle \exp\left(\frac{\omega}{2} \left(\sum_{a=1}^{n} \partial_a\right)^2\right) [R(h_1, \cdots, h_n)]_{h_a=h} \\
\displaystyle \quad = e^{\frac{\omega}{2} \frac{\partial^2}{\partial h^2}} R(h, \cdots, h) = \gamma_\omega \star [h \mapsto R(h, \cdots, h)].
\end{array}
\right.
\quad (125)$$

Let us now come back to eq. (124). We separate the term $i=0$, and we have, with eq. (123):

$$\begin{aligned}
& \exp\left(\frac{1}{2} \sum_{i=0}^{k} (q_i - q_{i-1}) \sum_{a,b=1}^{r} (\mathbf{J}_{m_{i-1}}^{(r)})_{ab} \partial_a \partial_b\right) \left[\prod_{c=1}^{r} \gamma_{1-q_k}(h_c)\right]_{h=0} \\
& = \exp\left(\frac{q_0}{2} \left(\sum_a \partial_a\right)^2\right) [\Xi(\mathbf{h})]_{h=0} = \gamma_{q_0} \star [h \mapsto \Xi(h, \cdots, h)]_{h=0},
\end{aligned} \quad (126)$$

with $\Xi(\mathbf{h})$ defined as:

$$\Xi(\mathbf{h}) := \exp\left(\frac{1}{2} \sum_{i=1}^{k} (q_i - q_{i-1}) \sum_{a,b=1}^{r} (\mathbf{J}_{m_{i-1}}^{(r)})_{ab} \partial_a \partial_b\right) \left[\prod_{c=1}^{r} \gamma_{1-q_k}(h_c)\right].$$
Note that $\Xi(h)$ factorizes over the inner diagonal blocks of size $m_0$, and we have $\Xi(h, \dots, h) = \zeta(h)^{r/m_0}$, with

$$ \zeta(h) := \exp \left( \frac{1}{2} \sum_{i=1}^{k} (q_i - q_{i-1}) \sum_{a,b=1}^{r/m_0} (\mathbf{J}_{m_{i-1}/m_0}^{(r/m_0)})_{ab} \partial_a \partial_b \right) \left[ \prod_{c=1}^{m_0} \gamma_{1-q_c}(h_c) \right]_{h_c=h} . \quad (127) $$

Therefore, putting it back into eq. (126) and using eq. (125), we have:

$$ \exp \left( \frac{1}{2} \sum_{i=0}^{k} (q_i - q_{i-1}) \sum_{a,b=1}^{r} (\mathbf{J}_{m_{i-1}/m_0}^{(r)})_{ab} \partial_a \partial_b \right) \left[ \prod_{c=1}^{r} \gamma_{1-q_c}(h_c) \right]_{h=0} = [\gamma_{q_0} \star \zeta^{r/m_0}](h=0), $$

with $\zeta(h)$ defined in eq. (127). This procedure can then be repeated iteratively on the diagonal blocks, all the way to the innermost ones. Eq. (124) then becomes:

$$ -\frac{1}{2} \log \det \mathbf{Q} = \log \left[ (2\pi)^{r/2} \gamma_{q_0} \star g^{r/m_0} (m_0, h=0) \right], \quad (128) $$

with the functions $g(m_i, h)$ iteratively defined as:

$$ \left\{ \begin{aligned} g(m_k = 1, h) &= \gamma_{1-q_k}(h), \\ g(m_{i-1}, h) &= \gamma_{q_i - q_{i-1}} \star g^{m_{i-1}/m_i}(m_i, h). \end{aligned} \right. \quad (129) $$

We now take the $k \to \infty$ (Full RSB) limit in eq. (129). In this limit we can approximate any function $g(x)$ (see Fig. 3), and taking for $(m_i)_{i=0}^k$ a regular grid on $x \in [0, 1]$, we have $m_0 \to 0$, $m_{k-1} \to 1$, and for all $i=0, \dots, k-1$, we have $m_i \to x$ and $m_i - m_{i-1} = dx$. Moreover $q_k \to q(1)$, $q_0 \to q(0)$, and $q_{i+1} - q_i = \dot{q}(x)dx$. We sometimes also use the notation $q_m = q(0)$, $q_M = q(1)$. To make things clearer, we will denote derivatives w.r.t. $x$ with dots, and the ones w.r.t. $h$ with the usual prime. The second line of eq. (129) becomes, at first order in $dx$ (recall the crucial eq. (123)), for $x \in (0, 1):$

$$ g(x, h) - dx \dot{g}(x, h) = e^{\frac{\dot{q}(x)}{2}} dx \partial_h^2 \left[ g - \frac{dx}{x} g \log g \right] (x, h) = \left( 1 + \frac{\dot{q}(x)}{2} dx \partial_h^2 \right) \left[ g - \frac{dx}{x} g \log g \right] (x, h). $$

Comparing the terms at first order in $dx$, we reach the PDE:

$$ \dot{g}(x, h) = -\frac{\dot{q}(x)}{2} g''(x, h) + \frac{1}{x} g \log g(x, h), \quad x \in (0, 1). \quad (130) $$

It is convenient to rewrite eq. (130) in terms of $f(x, h) := (1/x) \log g(x, h)$, which yields the Parisi PDE:

$$ \left\{ \begin{aligned} f(1, h) &= \log \gamma_{1-q(1)}(h), \\ \dot{f}(x, h) &= -\frac{\dot{q}(x)}{2} [f''(x, h) + x f'(x, h)^2], \quad x \in (0, 1). \end{aligned} \right. \quad (131) $$

The boundary condition in the first line was given by eq. (129): $g(1, h) = \gamma_{1-q(1)}(h)$.

**Remark (Universality of the Parisi PDE).** As can be already hinted by the calculation above and the method of [24], the Parisi PDE described in eq. (131) is actually extremely general: the specificities of the term that we wish to compute only appear in the boundary conditions at $x=1$, while the evolution equation is only dependent on the ultrametric structure of the problem. We will see a clear example of this when computing the energetic contribution to the free entropy.

**The $r \to 0$ limit** – Taking the $r \to 0$ limit in eq. (128) yields finally:

$$ -\frac{1}{2} \partial_r [\log \det \mathbf{Q}]_{r=0} = \frac{\log 2\pi}{2} + \gamma_{q_m} \star f(0, h=0). $$

**Solution to the Parisi PDE for the entropic contribution** – Fortunately, with the boundary condition that we have here, the Parisi PDE of eq. (131) is analytically solvable. Indeed $g(x, h)$ always remains (up to a scaling) a centered Gaussian function of $h$, or equivalently we can look for a solution in the form

$$ f(x, h) = \frac{1}{x} \log C(x) + \frac{1}{x} \log \gamma_{\omega(x)}(h), $$

with $\omega(1) = 1 - q(1)$ and $C(1) = 1$. This yields after some algebra simple ODEs on $\omega, C$ that are easily verified to be solved by:

$$ \left\{ \begin{aligned} \omega(x) &= \frac{1 - xq(x) - \int_x^1 q(u)du}{x} = \frac{\lambda(x)}{x}, \\ \log C(x) &= \frac{x}{2} \int_x^1 \frac{du}{u^2} [1 + \log 2\pi\omega(u)]. \end{aligned} \right. $$

We took the notation $\lambda(x)$ defined in eq. (48). In particular, for every $x \in (0, 1)$, we have:
$$ \gamma_{q_m} \star f(x, h=0) = \frac{1}{2} \int_x^1 \frac{du}{u^2} \left[ 1 + \log 2\pi \frac{\lambda(u)}{u} \right] - \frac{1}{2x} \log \left[ 2\pi \frac{\lambda(x)}{x} \right] - \frac{q_m}{2\lambda(x)}. $$

We can take the limit of this equation as $x \to 0$. With our notations, we have $\lambda(0) = 1 - \langle q \rangle$, $\lambda(1) = 1 - q_M$ and $\dot{\lambda}(q) = -u\dot{q}(u)$. By integration by parts, we reach:

$$ \begin{aligned} \gamma_{q_m} \star f(x, h=0) &= \frac{1}{2} \int_x^1 \frac{du}{u} \left[ \frac{-u\dot{q}(u)}{\lambda(u)} - \frac{1}{u} \right] - \frac{1}{2} \left[ 1 + \log 2\pi(1-q_M) \right] + \frac{1}{2x} - \frac{q_m}{2\lambda(x)}, \\ &= -\frac{1}{2} \int_x^1 du \frac{\dot{q}(u)}{\lambda(u)} - \frac{1}{2} \log 2\pi(1-q_M) - \frac{q_m}{2\lambda(x)}. \end{aligned} $$

**Final result for the entropic contribution** – Therefore, taking the limit $x \to 0$, we have

$$ \partial_r[\log \det \mathbf{Q}]_{r=0} = -\log 2\pi - 2\gamma_{q_m} \star f(0, h=0) = \log(1-q_M) + \frac{q_m}{1-\langle q \rangle} + \int_0^1 du \frac{\dot{q}(u)}{\lambda(u)}. \quad (132) $$

Note that eq. (132) is also equivalent to a formula given in Appendix II of [48] as can be seen by integration by parts:

$$ \partial_r[\log \det \mathbf{Q}]_{r=0} = \log(1 - \langle q \rangle) + \frac{q_m}{1 - \langle q \rangle} - \int_0^1 \frac{dx}{x^2} \log \frac{\lambda(x)}{1 - \langle q \rangle}. \quad (133) $$

In the IPP, one uses $\lambda(0) = 1 - \langle q \rangle$, $\lambda(1) = 1 - q_M$, and $\lambda(u) = \lambda(0) + \mathcal{O}(u^2)$.

## E.2. Energetic contribution

The second part of the free entropy is the energetic contribution, i.e. $\alpha G_{2,r}(\mathbf{Q})$, with

$$ G_{2,r}(\mathbf{Q}) := \log \int_{\mathbb{R}^r} \frac{\mathrm{dudv}}{(2\pi)^r} e^{-\frac{1}{2} \sum_{a,b} Q^{ab} v^a v^b - \beta \sum_{a=1}^r \theta(u^a) + i \sum_{a=1}^r u^a v^a} $$

Again using the identity of eq. (120), we have:

$$ \begin{aligned} G_{2,r}(\mathbf{Q}) &= \log \int_{\mathbb{R}^r} \frac{\mathrm{dudv}}{(2\pi)^r} e^{-\beta \sum_{a=1}^r \theta(u^a)+i \sum_{a=1}^r u^a v^a} e^{\frac{1}{2} \sum_{a,b} Q^{ab} \partial_a \partial_b} \left[ \prod_{a=1}^r e^{-iv^a h_a} \right]_{h=0}, \\ &= \log e^{\frac{1}{2} \sum_{a,b} Q^{ab} \partial_a \partial_b} \left[ \prod_{a=1}^r e^{-\beta \sum_{a=1}^r \theta(h_a)} \right]_{h=0}. \end{aligned} $$

One can notice that this equation is extremely similar to eq. (122), but the function $\delta(h)$ has been replaced with $e^{-\beta\theta(h)}$. However, the whole procedure that we described above to obtain the Parisi PDE does not change at all, since it did not depend on the specifics of this function: the PDE itself remains the same, only the boundary condition at $x = 1$ will be different. In the end, this yields:

$$ \partial_r[G_{2,r}(\mathbf{Q})]_{r=0} = \gamma_{q(0)} \star f(x=0, h=0), $$

with $f(x, h)$ given as the solution to the Parisi PDE with specific boundary condition at $x = 1$:

$$ \left\{ \begin{array}{l} f(1, h) = \log[\gamma_{1-q(1)} \star e^{-\beta\theta}(h)], \\ f'(x, h) = -\frac{\dot{q}(x)}{2} [f''(x, h) + x f'(x, h)^2], \quad x \in (0, 1). \end{array} \right. \quad (134) $$

Note that one can equivalently write this PDE in terms of the parameter $q$ rather than $x$ by a change of variable $q = q(x)$, as described e.g. in [81].

## E.3. Recovering the RS result from the full RSB equations

In this paragraph we show that eq. (53) is equivalent to eq. (33). We denote $q_0 = q$ coherently with the RS computation. One computes easily that

$$ \gamma_{1-q} \star e^{-\beta\theta}(h) = 1 - (1 - e^{-\beta}) H\left(\frac{-h}{\sqrt{1-q}}\right). $$
In particular, we have:

$$[\gamma_{1-q} \star e^{-\beta\theta}]'(h) = \frac{1 - e^{-\beta}}{\sqrt{1-q}} H'\left(\frac{-h}{\sqrt{1-q}}\right).$$

Therefore eq. (53) reads:

$$\frac{q}{(1-q)^2} = \alpha \int dh \frac{e^{-\frac{h^2}{2q}}}{(1-q)\sqrt{2\pi q}} \left\{ \frac{(1-e^{-\beta})H'\left(\frac{-h}{\sqrt{1-q}}\right)}{1-(1-e^{-\beta})H\left(\frac{-h}{\sqrt{1-q}}\right)} \right\}^2,$$

or equivalently:

$$\frac{q}{1-q} = \alpha \int D\xi \left\{ \frac{(1 - e^{-\beta}) H'\left(\xi \sqrt{\frac{q}{1-q}}\right)}{1 - (1 - e^{-\beta}) H\left(\xi \sqrt{\frac{q}{1-q}}\right)} \right\}^2. \qquad (135)$$

Since $H'(x) = -e^{-x^2/2}/\sqrt{2\pi}$, letting $f(\xi) := 1 - (1 - e^{-\beta})H[\xi\sqrt{q/(1-q)}]$ we can rewrite eq. (135) and use an integration by parts:

$$\begin{aligned}
\frac{q}{1-q} &= -\alpha(1 - e^{-\beta}) \sqrt{\frac{1-q}{q}} \int d\xi \frac{e^{-\frac{\xi^2}{2(1-q)}}}{2\pi} \left[ -\frac{f'(\xi)}{f(\xi)^2} \right], \\
&= -\alpha(1 - e^{-\beta}) \sqrt{\frac{1-q}{q}} \int d\xi \frac{e^{-\frac{\xi^2}{2(1-q)}}}{2\pi} \frac{\xi}{1-q} \frac{1}{f(\xi)}, \\
&= \alpha(1 - e^{-\beta}) \sqrt{\frac{1}{q(1-q)}} \int D\xi \frac{\xi H'\left(\xi \sqrt{\frac{q}{1-q}}\right)}{1 - (1 - e^{-\beta}) H\left(\xi \sqrt{\frac{q}{1-q}}\right)},
\end{aligned}$$

which is equivalent to eq. (33).

## Appendix F. Technicalities of the algorithmic FRSB procedure

### F.1. Technicalities of the derivation of the algorithmic procedure

We give here some details on the arising of eqs. (59)-(62). Recall that here all the quantities are considered at zero-temperature, with the scaling of eq. (54).

* Eq. (59) is a general relation between $q^{-1}$, $f$ and $\Lambda$ when eq. (51) is satisfied. It is explained for instance in [30], see eq. (B.4).

* Eq. (60) is a consequence of the general relation between $q^{-1}(x)$ (the function corresponding to the overlap matrix $Q^{-1}$) and $q(x)$ in the full RSB ansatz, which is (see e.g. eq. (B.9) in [30]):

$$\frac{1}{\lambda(x)} - \frac{1}{\lambda(0)} = -xq^{-1}(x) + \int_{0}^{x} dy q^{-1}(y) \quad \text{and} \quad \lambda(0) = \sqrt{-\frac{q(0)}{q^{-1}(0)}}.$$

Discretization of this relation yields eq. (60).

* One can invert eq. (48) to obtain $q(x)$ as a function of $\lambda(x)$ via:

$$q(x) = 1 - \frac{\lambda(x)}{x} + \int_{x}^{1} \frac{dy}{y^2} \lambda(y).$$

It is the discretization of this equation that yields eq. (61).

* Eq. (62) is a consequence of the boundary condition of eq. (51a) taken at $x = 1$, followed by a change of variable from $x$ to $q$ in the parameters of the functions $\Lambda, f, \lambda$. After these procedures, eq. (51a) becomes, for the *unrescaled variables* and any $\beta \ge 0$:

$$\frac{q(0)}{\lambda(q(0))^2} + \int_{q(0)}^{q(1)} \frac{dp}{\lambda(p)^2} = \alpha \int dh \Lambda(q(1), h) f'(q(1), h)^2.$$

After taking the $\beta \to \infty$ limit, this yields for the variables that are rescaled as $\beta \to \infty$ according to eq. (54) (dropping the $\infty$ subscript):
<figure><img src="image_10.png" /><figcaption>Fig. 6. Illustration of the convergence of the Full RSB procedure for different values of $\alpha$, for $k = 200, c = 30, H = 40$ (see Section F.3 for the definitions of $H, c$). On the left we show the convergence of $\chi$ and $f^*(\alpha)$ along the iterations, as well as (in inset) the evolution of the error $\|q_i - q_{i-1}\|_{\infty}$ up to the threshold $10^{-4}$ we took for convergence. On the right, we show the evolution of $q(x)$ along the iterations. We find very consistent behaviors when varying the parameter $k$, indicating that our simulations indeed capture well the Full RSB limit. We use $x_{\max} = 10$, well validated by the functions $q(x)$ we obtain.</figcaption></figure>

$$ \frac{q_0}{\lambda(q_0)^2} + \int_{q_0}^{1} \frac{dp}{\lambda(p)^2} = \alpha \int dh \Lambda(1, h) f'(1, h)^2. $$

Moreover, $f'(1, h) = -(h/\chi)1\{h \in (0, \sqrt{2\chi})\}$. Therefore, rescaling then $t = h/\sqrt{2\chi}$ (and using the abusive notation $\Lambda(1, h) = \Lambda(1, t)$) we have:

$$ \frac{q_0}{\lambda(q_0)^2} + \int_{q_0}^{1} \frac{dp}{\lambda(p)^2} = \frac{2^{3/2} \alpha}{\sqrt{\chi}} \int_{0}^{1} dt \Lambda(1, t) t^2. \qquad (136) $$

We focus on the left-hand side of this last equation, in the $k$-RSB ansatz. We first use that $\lambda(q) = \chi + \int_q^1 dp x(p)$, a simple consequence of eq. (48), after change of variables and rescaling. Therefore, we have:

$$ \int_{q_0}^{1} \frac{dp}{\lambda(p)^2} = \sum_{i=0}^{k-1} \int_{q_i}^{q_{i+1}} \frac{dp}{[\chi + \sum_{j=i+1}^{k-1} (q_{j+1} - q_j)x_j + (q_{i+1} - p)x_i]^2}, \\ = \sum_{i=0}^{k-1} \frac{(q_{i+1} - q_i)}{[\chi + \sum_{j=i+1}^{k-1} (q_{j+1} - q_j)x_j][\chi + \sum_{j=i}^{k-1} (q_{j+1} - q_j)x_j]} $$

Using the convention $q_{-1} = 0$ and $x_{-1} = 0$, we therefore reach from eq. (136) that:

$$ \sum_{i=0}^{k} \frac{(q_i - q_{i-1})}{[\chi + \sum_{j=i+1}^{k} (q_j - q_{j-1})x_{j-1}][\chi + \sum_{j=i}^{k} (q_j - q_{j-1})x_{j-1}]} = \frac{2^{3/2} \alpha}{\sqrt{\chi}} \int_{0}^{1} dt \Lambda(1, t) t^2, $$

which is precisely eq. (62).

## F.2. Numerical results of the procedure

In Fig. 6 we present the results of typical iterations of the algorithmic procedure described above. For different values of $\alpha$ and the RSB parameter $k$ we show the evolution of the estimates of $f^*(\alpha)$, the susceptibility $\chi$, and the function $q(x)$, along the iterations.
In all the cases implemented we see power-law convergence to the solution, and very consistent results when varying the parameters used in the algorithm (in particular increasing $k$).

### F.3. Some details on the implementation of convolutions

#### F.3.1. Convolutions via DFTs

In order to implement the algorithmic procedure of Section 3.2, we use a discrete Fourier transform approach. We refer to [35] for a review on Gaussian convolution algorithms. The goal is to compute the convolution of a centered Gaussian $\gamma_{\omega}$ with variance $\omega > 0$ and a function $f(h)$:

$$ \gamma_{\omega} \star f(h) = \int dz \gamma_{\omega}(z) f(h-z). $$

We fix $N \in \mathbb{N}^*$ and $H > 0$, and we consider a grid $h_{\mu} = \mu H/N$, with $\mu \in \{-N, \dots, N\}$. In order to leverage analytical formulas for the DFT of the Gaussian, we use a Shannon-Whittaker interpolation for $f$, i.e. we approximate $f$ as:

$$ f(h) \approx \sum_{v=-N}^{N} f_v \varphi \left[ \frac{N h}{H} - v \right], $$

with $\varphi(x) = \text{sinc}(x) = \sin(\pi x)/(\pi x)$. Since $\varphi(v) = 0$ for all $v \in \mathbb{Z}^*$, and $\varphi(0) = 1$, we have $f_{\mu} = f(h_{\mu})$. This approximation transfers into an approximation for $\gamma_{\omega} \star f$ as:

$$ \gamma_{\omega} \star f(h) \approx \sum_{v=-N}^{N} f_v (\gamma_{\omega} \star \varphi_v)(h), $$

with $\varphi_v(h) := \varphi(Nh/H - v)$. Thus, we have, with $(\gamma_{\omega} \star f)_{\mu} = \gamma_{\omega} \star f(h_{\mu})$, and using $\varphi_v(x) = \varphi_0(x - h_v)$:

$$ (\gamma_{\omega} \star f)_{\mu} \approx \sum_{v=-N}^{N} f_v (\gamma_{\omega} \star \varphi_v)_{\mu} = \sum_{v=-N}^{N} f_v (\gamma_{\omega} \star \varphi_0)_{\mu-v}. \quad (137) $$

Note that we naturally extended $(\gamma_{\omega} \star \varphi_0)_{\mu}$ to all $\mu \in \mathbb{Z}$, since these coefficients have an analytic expression. In the same way, we extend $f_v = 0$ if $|v| > N$. For a general sequence $(f_v)_{v=-N}^N$, we define its Discrete Fourier Transform (DFT) as, for $k \in \{0, \dots, 2N\}$:

$$ \left\{ \begin{aligned} \hat{f}_k &= \sum_{\mu=-N}^{N} e^{-\frac{2\pi i k (\mu+N)}{2N+1}} f_\mu = e^{-\frac{2\pi i k N}{2N+1}} \sum_{\mu=-N}^{N} e^{-\frac{2\pi i k \mu}{2N+1}} f_\mu, \\ f_\mu &= \frac{1}{2N+1} e^{\frac{2\pi i k N}{2N+1}} \sum_{k=0}^{2N} e^{\frac{2\pi i k \mu}{2N+1}} \hat{f}_k. \end{aligned} \right. \quad (138) $$

Taking the DFT of eq. (137), one finds:

$$ \widehat{\gamma_{\omega} \star f}_k \approx e^{\frac{2\pi i k N}{2N+1}} \hat{f}_k (\gamma_{\omega} \star \varphi_0)_k. \quad (139) $$

Moreover, we define the Fourier transform as $\tilde{f}(\xi) := \int dx f(x) e^{-2i\pi x\xi}$, and have then easily $\tilde{\varphi}_0(\xi) = (H/N)\mathbb{1}\{|\xi| \le N/(2H)\}$. The Fourier transform of the convolution is $\hat{f} \star g(\xi) = \tilde{f}(\xi)\tilde{g}(\xi)$. This yields, via inverse Fourier transformation:

$$ (\gamma_{\omega} \star \varphi_0)_{\mu} = \frac{H}{N} \int_{|\xi| \le \frac{N}{2H}} d\xi e^{-2\pi^2 \omega \xi^2 + \frac{2i\pi H \mu \xi}{N}} = \int_{|\xi| \le \frac{1}{2}} d\xi e^{-\frac{2\pi^2 N^2 \omega \xi^2}{H^2} + \frac{2i\pi \mu \xi}{N}}. $$

Therefore, we have by eq. (138):

$$ (\widehat{\gamma_{\omega} \star \varphi_0})_k = e^{-\frac{2\pi i k N}{2N+1}} \int_{|\xi| \le \frac{1}{2}} d\xi e^{-\frac{2\pi^2 N^2 \omega \xi^2}{H^2}} \sum_{\mu=-N}^{N} e^{-\frac{2\pi i k \mu}{2N+1} + \frac{2i\pi \mu \xi}{N}}. $$

Taking $N \gg 1$, the term on the right is well approximated by the Dirac comb:

$$ \sum_{\mu=-N}^{N} e^{-\frac{2\pi i k \mu}{2N+1} + 2i\pi \mu \xi} \approx \sum_{n \in \mathbb{Z}} \delta\left(\xi - \frac{k}{2N+1} - n\right). $$

However, since $|\xi| \le 1/2$ and $k \in \{0, \dots, 2N\}$, this implies:
$$ (\gamma_{\omega} \star \varphi_0)_k \underset{N \to \infty}{\approx} e^{-\frac{2\pi i k N}{2N+1}} \times \begin{cases} e^{-\frac{2\pi^2 N^2 \omega}{H^2} \left[ \frac{k}{2N+1} \right]^2} & \text{if } k \le N, \\ e^{-\frac{2\pi^2 N^2 \omega}{H^2} \left[ \frac{k}{2N+1} - 1 \right]^2} & \text{if } k > N. \end{cases} $$

Plugging it back into eq. (139), we finally obtain the formula we use for the DFT of the convolution $\gamma_{\omega} \star f$:

$$ \widehat{\gamma_{\omega} \star f}_k \approx \hat{f}_k \times \begin{cases} e^{-\frac{2\pi^2 N^2 \omega}{H^2} \left[ \frac{k}{2N+1} \right]^2} & \text{if } k \le N, \\ e^{-\frac{2\pi^2 N^2 \omega}{H^2} \left[ \frac{k}{2N+1} - 1 \right]^2} & \text{if } k > N. \end{cases} $$

### F.3.2. Taking a large enough value of N

Note that in order for the Gaussian convolutions to be numerically well-defined, we need the spacing in the grid we take on $h$ to be much smaller than the standard deviation of the Gaussians, that is we need for any $(q(x), q(x) + dx \hat{q}(x))$:

$$ \frac{H}{N} \ll \sqrt{\frac{dx \hat{q}(x)}{2\chi}}. $$

Note that, as shown in [30], and as one can also verify from Fig. 4, we have the following scaling as $x \to \infty$: $q(x) \sim 1 - A/x^2$, with $A > 0$. Therefore, $\hat{q}(x_{\max}) \sim 2A/x_{\max}^3$. Since we take $dx \sim x_{\max}/k$ in our numerical procedure, we have that in order for our procedure to be valid we need

$$ \frac{H}{N} \ll \sqrt{\frac{A}{k \chi x_{\max}^2}}. $$

In practice, we find typically $\chi/A \sim 10^{-1}$, so that we will impose $N \gg N_0$, with

$$ N_0 := \sqrt{k H x_{\max}}. $$

In practice, we consider $N = cN_0$ (we often take $c = 30$) with a constant $c \gg 1$ in order to be well into the regime $N \gg N_0$, and still have a reasonable computational time.

### F.4. Bounds on the injectivity threshold

Let us detail the results of our numerical computation of $\alpha_{\text{inj}}^{\text{FRSB}}$, illustrated in Fig. 5. For a given value of all parameters of the algorithm detailed in Section 3.2, we ran Brent's method to find the zero of $f_{\text{FRSB}}^{*}(\alpha) - 1$, with a tolerance of $10^{-4}$ on the value of $\alpha$. For all values of $\alpha$, we iterated the FRSB equations until $\|q^{t+1} - q_t\|_{\infty} \le \epsilon = 10^{-5}$. We ran this procedure for different values of $k \in \{30, 50, 100, 200\}$, $x_{\max} \in \{10, 11, 12, 13, 14, 15\}$, $H \in \{40, 60\}$, and $c = 30$ (recall that $H$ and $c$ are defined in Section F.3). In Fig. 5 the runs with different values of $H$ and $c$ are aggregated.

## Appendix G. "Escape through a mesh" theorem: an alternative proof of Theorem 1.8

In this appendix, we provide an alternative proof of Theorem 1.8 using Gordon's "escape through a mesh" theorem [39]. This seminal result establishes upper bounds on the probability of a random set intersecting a fixed set. In an earlier version of this paper, we applied Gordon's "mesh" theorem to derive a highly suboptimal bound, $\alpha_{\text{inj}} \le 23.54$, due to loose estimates in our calculations. During the review process, however, we refined this approach, ultimately achieving the same replica-symmetric upper bound as that obtained through Gordon's min-max inequality.

For $m \ge 1$, we denote $a_m := \mathbb{E}[\|g\|_2]$, for $g \sim \mathcal{N}(0, I_m)$. One can easily show the bound [82]:

$$ \frac{m}{\sqrt{m+1}} \le a_m \le \sqrt{m}. \qquad (140) $$

Moreover, for a closed set $S \subseteq \mathbb{R}^m$, we define its Gaussian width as

$$ \omega(S) := \mathbb{E} \max_{x \in S} [g \cdot x]. $$

We are now ready to state Gordon's "escape through a mesh" theorem.

**Theorem G.1** ([39]). Let $S \subseteq S^{m-1}$ be a closed subset such that $\omega(S) < a_{m-n}$. Let $V$ be a uniformly-sampled random $n$-dimensional subspace of $\mathbb{R}^m$. Then

$$ \mathbb{P}[V \cap S = \emptyset] \ge 1 - \frac{7}{2} \exp \left\{ - \frac{1}{18} \left( a_{m-n} - \omega(S) \right)^2 \right\}. $$

Applying this theorem to Proposition 1.1, we directly reach
**Corollary G.2.** Assume that $a_{m-n} - \omega(C_{m,n} \cap S^{m-1}) \to \infty$ as $m, n \to \infty$. Then $p_{m,n} \to 1$, i.e. $\varphi_W$ is injective w.h.p.

We can now state the core of our argument, which is an upper bound for the Gaussian width $\omega(C_{m,n} \cap S^{m-1})$, and is proven in Appendix G.1.

**Proposition G.3.** Assume $\alpha > 2$. Then

$$ \limsup_{m \to \infty} \frac{\omega(C_{m,n} \cap S^{m-1})^2}{n} \le \alpha \left( 1 - \int_0^{t_\alpha} D x \, x^2 \right), \quad (141) $$

where recall that $Dx := e^{-x^2/2}dx/\sqrt{2\pi}$ is the standard Gaussian measure. Moreover, $t_\alpha$ is the unique value of $t \ge 0$ such that

$$ \int_{t_\alpha}^{\infty} Dx = \frac{1}{\alpha}. \quad (142) $$

Notably – as discussed below – we expect that our proof can be improved by classical concentration arguments, to yield that eq. (141) holds as an equality for $\lim(\omega^2/n)$, although we do not require it to prove Theorem 1.8. Since $a_{m-n} \ge \sqrt{\alpha-1}\sqrt{n}(1-o(1))$ by eq. (140), Proposition G.3 and Corollary G.2 imply that $p_{m,n} \to 1$ whenever

$$ \alpha - 1 > \alpha \left( 1 - \int_{0}^{t_{\alpha}} Dx \, x^2 \right), $$

i.e. whenever $\alpha > \alpha_{\text{inj}}^{\text{mesh}}$ with $\alpha_{\text{inj}}^{\text{mesh}}$ the solution to

$$ \left\{ \begin{array}{l} \alpha \int_0^{t_\alpha} Dx \, x^2 = 1, \\ \\ \int_{t_\alpha}^{\infty} Dx = \frac{1}{\alpha}. \end{array} \right. \quad (143) $$

We recognize in eq. (143) the replica-symmetric threshold prediction of eqs. (36) and (37), with $t = \sqrt{2\chi_{\text{RS}}}$. Thus, $\alpha_{\text{inj}}^{\text{mesh}} = \alpha_{\text{inj}}^{\text{RS}}$, and this ends our alternative proof of Theorem 1.8.

G.1. Proof of Proposition G.3

We denote $\omega = \omega(C_{m,n} \cap S^{m-1})$. By weak duality, we have

$$ \omega = \mathbb{E} \sup_{\mathbf{x} \in C_{m,n}} \inf_{\lambda \in \mathbb{R}} \left[ \mathbf{g} \cdot \mathbf{x} - \frac{\lambda}{2} (\|\mathbf{x}\|^2 - 1) \right], $$

$$ \le \mathbb{E} \inf_{\lambda \in \mathbb{R}} \sup_{\mathbf{x} \in C_{m,n}} \left[ \mathbf{g} \cdot \mathbf{x} - \frac{\lambda}{2} (\|\mathbf{x}\|^2 - 1) \right], $$

$$ \le \mathbb{E} \inf_{\lambda > 0} \sup_{\mathbf{x} \in C_{m,n}} \left[ \mathbf{g} \cdot \mathbf{x} - \frac{\lambda}{2} (\|\mathbf{x}\|^2 - 1) \right]. $$

An element $\mathbf{x} \in C_{m,n}$ can be parametrized by a subset $S \subseteq [m]$ with $|S| < n$, and a set of values $\{x_\mu\}$, with $x_\mu > 0$ for $\mu \in S$ and $x_\mu \le 0$ for $\mu \notin S$. This yields:

$$ \omega \le \mathbb{E} \inf_{\lambda > 0} \max_{S \subseteq [m] \atop |S| < n} \left[ \frac{\lambda}{2} + \sum_{\mu \in S} \sup_{x>0} \left( xg_{\mu} - \frac{\lambda}{2}x^2 \right) + \sum_{\mu \notin S} \sup_{x \le 0} \left( xg_{\mu} - \frac{\lambda}{2}x^2 \right) \right], $$

$$ \le \mathbb{E} \inf_{\lambda > 0} \max_{S \subseteq [m] \atop |S| < n} \left[ \frac{\lambda}{2} + \frac{1}{2\lambda} \sum_{\mu \in S} g_{\mu}^2 \mathbf{1}\{g_{\mu} \ge 0\} + \frac{1}{2\lambda} \sum_{\mu \notin S} g_{\mu}^2 \mathbf{1}\{g_{\mu} \le 0\} \right], $$

$$ \le \mathbb{E} \left[ \left( \max_{S \subseteq [m] \atop |S| < n} \left[ \sum_{\mu \in S} g_{\mu}^2 \mathbf{1}\{g_{\mu} \ge 0\} + \sum_{\mu \notin S} g_{\mu}^2 \mathbf{1}\{g_{\mu} \le 0\} \right) \right)^{1/2} \right]. $$

We used that $\inf_{\lambda>0}[\lambda + T/\lambda] = 2\sqrt{T}$, for $T > 0$. Since the law of $\mathbf{g}$ is invariant under permutation of the indices, we can assume $g_1 \ge g_2 \ge \dots \ge g_p \ge 0 > g_{p+1} \ge \dots \ge g_m$, with $p = p(\mathbf{g}) \in [m]$. It is then straightforward to check that:
$$ \max_{S \subseteq [m] \atop |S| < n} \left[ \sum_{\mu \in S} g_{\mu}^2 1\{g_{\mu} \ge 0\} + \sum_{\mu \notin S} g_{\mu}^2 1\{g_{\mu} \le 0\} \right] = \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} \ge 0\} + \sum_{\mu=p+1}^{m} g_{\mu}^2. $$

Therefore

$$ \frac{1}{\sqrt{n}} \omega \le \mathbb{E} \sqrt{ \frac{1}{n} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} \ge 0\} + \frac{1}{n} \sum_{\mu=p+1}^{m} g_{\mu}^2 } \le \sqrt{ \frac{1}{n} \mathbb{E} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} \ge 0\} + \frac{1}{n} \sum_{\mu=p+1}^{m} g_{\mu}^2 } \quad (144) $$

Note that – although it is not needed in what follows – a careful analysis based on concentration would show that the first and second inequalities of eq. (144) actually hold as equalities, up to a multiplicative term 1 + o(1) as n, m → ∞. The second term inside the square root in eq. (144) can be computed easily:

$$ \frac{1}{n} \mathbb{E} \sum_{\mu=p+1}^{m} g_{\mu}^2 = \frac{1}{n} \mathbb{E} \sum_{\mu=1}^{m} g_{\mu}^2 1\{g_{\mu} < 0\} = \frac{m}{2n} \xrightarrow{m \to \infty} \frac{\alpha}{2}. \quad (145) $$

We now show:

$$ \lim_{m \to \infty} \frac{1}{m} \mathbb{E} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} \ge 0\} = \int_{t_{\alpha}}^{\infty} Dx x^2 = \frac{1}{2} - \int_{0}^{t_{\alpha}} Dx x^2, \quad (146) $$

with $t_\alpha$ defined in eq. (142). Combining eqs. (145) and (146) in eq. (144) ends the proof of Proposition G.3. To prove eq. (146) we rely on the following technical lemma, proven in Appendix G.2.

**Lemma G.4.** Let $m \ge 1$, and $z_1, \dots, z_m$ i.i.d. $\mathcal{N}(0, 1)$. Denote as $g_1 \ge \dots \ge g_m$ the non-increasing ordering of $(z_\mu)_{\mu=1}^m$. For $\beta \ge 1$, let $t_\beta \in \mathbb{R}$ be the unique solution to $\beta \int_{t_\beta}^\infty Dx = 1$. Then, for any $\beta \in [1, \infty)$, if $n \in \{1, \dots, m\}$ with $m/n \to \beta$ as $m \to \infty$:

$$ (i) \quad g_n \xrightarrow[m \to \infty]{a.s.} t_\beta. $$

(ii) We have

$$ \lim_{\delta \downarrow 0} \limsup_{m \to \infty} \frac{1}{m} \mathbb{E} \left[ \sum_{(1-\delta)n \le \mu \le n} g_{\mu}^2 \right] = 0. $$

By the law of large numbers and the triangular inequality,

$$ \begin{aligned} \left| \frac{1}{m} \mathbb{E} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} \ge 0\} - \int_{t_{\alpha}}^{\infty} Dx x^2 \right| & \le \frac{1}{m} \mathbb{E} \left| \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} \ge 0\} - \sum_{\mu=1}^{m} g_{\mu}^2 1\{g_{\mu} \ge t_{\alpha}\} \right| + o(1), \\ & \le \frac{1}{m} \mathbb{E} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} < t_{\alpha}\} + \frac{1}{m} \mathbb{E} \sum_{\mu=n}^{m} g_{\mu}^2 1\{g_{\mu} \ge t_{\alpha}\} + o(1). \end{aligned} $$
$$ \therefore \begin{array}{l} \left. \begin{array}{l} \underbrace{\frac{1}{m} \mathbb{E} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} < t_{\alpha}\}}_{:=I_1} + \frac{1}{m} \mathbb{E} \sum_{\mu=n}^{m} g_{\mu}^2 1\{g_{\mu} \ge t_{\alpha}\} + o(1). \end{array} \right\} \\ \therefore \begin{array}{l} \begin{array}{l} \underbrace{\frac{1}{m} \mathbb{E} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} < t_{\alpha}\}}_{:=I_2} + \frac{1}{m} \mathbb{E} \sum_{\mu=n}^{m} g_{\mu}^2 1\{g_{\mu} \ge t_{\alpha}\} + o(1). \end{array} \end{array} \end{aligned} $$

We now show that $I_1, I_2 \to 0$. Letting $\delta > 0$ and $A_\delta := \{g_{[(1-\delta)n]} < t_\alpha\}$, then $\mathbb{P}[A_\delta] \to 0$ by (i) of Lemma G.4. By the Cauchy-Schwarz inequality:

$$ \begin{aligned} I_1 &= \frac{1}{m} \mathbb{E} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} < t_{\alpha}\} 1\{A_{\delta}\} + \frac{1}{m} \mathbb{E} \sum_{\mu=1}^{n-1} g_{\mu}^2 1\{g_{\mu} < t_{\alpha}\} 1\{g_{[(1-\delta)n]} \ge t_{\alpha}\}, \\ &\le \sqrt{\mathbb{P}[A_{\delta}]} \frac{[\mathbb{E}(\|g\|^4)]^{1/2}}{m} + \frac{1}{m} \mathbb{E} \sum_{\mu=[(1-\delta)n]}^{n} g_{\mu}^2. \end{aligned} $$

We then deduce that $I_1 \to 0$ as $m \to \infty$ since $\mathbb{E}(\|g\|^4) = \mathcal{O}(m^2)$ and by taking the $\delta \downarrow 0$ limit using (ii) of Lemma G.4. The proof that $I_2 \to 0$ follows exactly the same lines. Together, this implies eq. (146), which ends the proof of Proposition G.3 as detailed above. $\square$

### G.2. Proof of Lemma G.4

We start with (i). Let $\hat{\mu}_g := (1/m) \sum_{\mu=1}^m \delta_{z_\mu} = (1/m) \sum_{\mu=1}^m \delta_{g_\mu}$. By definition of $g_n$, $\hat{\mu}_g((g_n, \infty)) = (n-1)/m$. If $\xi \sim \mathcal{N}(0, 1)$, by the Glivenko-Cantelli theorem:
$$|\hat{\mu}_g((g_n, \infty)) - \mathbb{P}[\xi > g_n]| \le \sup_{\theta \in \mathbb{R}} |\hat{\mu}_g((\theta, \infty)) - \mathbb{P}[\xi > \theta]| \xrightarrow{a.s.} 0.$$

Therefore since $n/m \to 1/\beta$:

$$\mathbb{P}[\xi > g_n] = \int_{g_n}^{\infty} Dx \xrightarrow{a.s.} \frac{1}{\beta}.$$

Since $t \mapsto \int_{t}^{\infty} Dx$ is a smooth and strictly decreasing function, this implies that $g_n \xrightarrow{a.s.} t_{\beta}$.

We now prove (ii). For any $t \in (0, 1)$ we have by Jensen's inequality and the union bound:

$$\begin{aligned} \frac{1}{m} \mathbb{E} \left[ \sum_{(1-\delta)n \le \mu \le n} g_{\mu}^2 \right] &\le \frac{2}{tm} \log \mathbb{E} \exp \left\{ \frac{t}{2} \sum_{(1-\delta)n \le \mu \le n} g_{\mu}^2 \right\} \\ &\le \frac{2}{tm} \log \max_{|I|=\delta n} \exp \left\{ \frac{t}{2} \sum_{\mu \in I} g_{\mu}^2 \right\}, \\ &\le \frac{2}{tm} \log \sum_{\substack{|I| \le m \\ |I|=\delta n}} \mathbb{E} \exp \left\{ \frac{t}{2} \sum_{\mu \in I} g_{\mu}^2 \right\}, \\ &\le \frac{2}{tm} \log \left[ \left( \frac{m}{\delta n} \right) (1-t)^{-\delta n/2} \right]. \end{aligned}$$

Taking $t = 1/2$ and using the bound $\binom{p}{k} \le 2^{pH(k/p)}$ with $H(q) := -q \log q - (1-q) \log(1-q)$ the binary entropy function, yields (recall that $m/n \to \beta$):

$$\frac{1}{m} \mathbb{E} \left[ \sum_{(1-\delta)n \le \mu \le n} g_{\mu}^2 \right] \le 4H\left(\frac{\delta}{\beta}\right) \log 2 + \frac{2\delta}{\beta} \log 2 + o(1).$$

Taking the limit $m \to \infty$ followed by $\delta \to 0$ ends the proof. $\square$

<figure><img src="image_11.png" /></figure>

## Data availability

A link to the code used to produce all figures is provided in the bibliography of the paper.

## References

[1] Antonio Auffinger, Wei-Kuo Chen, The Parisi formula has a unique minimizer, Commun. Math. Phys. 335 (3) (2015) 1429-1444.

[2] Antonio Auffinger, Wei-Kuo Chen, On concentration properties of disordered Hamiltonians, Proc. Am. Math. Soc. 146 (4) (2018) 1807-1815.

[3] Dennis Amelunxen, Martin Lotz, Michael B. McCoy, Joel A. Tropp, Living on the edge: phase transitions in convex programs with random data, Inf. Inference 3 (3) (2014) 224-294.

[4] Simon Arridge, Peter Maass, Ozan Öktem, Carola-Bibiane Schönlieb, Solving inverse problems using data-driven models, Acta Numer. 28 (2019) 1-174.

[5] Antonio Auffinger, Andrea Montanari, Eliran Subag, Optimization of random high-dimensional functions: structure and algorithms, in: Spin Glass Theory and Far Beyond: Replica Symmetry Breaking After 40 Years, World Scientific, 2023, pp. 609-633.

[6] Robert J. Adler, Jonathan E. Taylor, Random Fields and Geometry, vol. 80, Springer, 2007.

[7] Johann Brehmer, Kyle Cranmer, Flows for simultaneous manifold learning and density estimation, Adv. Neural Inf. Process. Syst. 33 (2020) 442-453.

[8] James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, Qiao Zhang, JAX: composable transformations of Python+NumPy programs, 2018.

[9] Ashish Bora, Ajil Jalal, Eric Price, Alexandros G. Dimakis, Compressed sensing using generative models, in: International Conference on Machine Learning, PMLR, 2017, pp. 537-546.

[10] Jean Barbier, Florent Krzakala, Nicolas Macris, Léo Miolane, Lenka Zdeborová, Optimal errors and phase transitions in high-dimensional generalized linear models, Proc. Natl. Acad. Sci. 116 (12) (2019) 5451-5460.

[11] Stéphane Boucheron, Gábor Lugosi, Pascal Massart, Concentration Inequalities: A Nonasymptotic Theory of Independence, Oxford University Press, 2013.

[12] Yu Bai, Tengyu Ma, Andrej Risteski, Approximability of discriminators implies diversity in GANs, in: International Conference on Learning Representations, 2018.

[13] Erwin Bolthausen, Shuta Nakajima, Nike Sun, Changji Xu, Gardner formula for Ising perceptron models at small densities, in: Conference on Learning Theory, PMLR, 2022, pp. 1787-1911.

[14] Afonso S. Bandeira, Amelia Perry, Alexander S. Wein, Notes on computational-to-statistical gaps: predictions using statistical physics, Port. Math. 75 (2) (2018) 159-186.

[15] Tommaso Castellani, Andrea Cavagna, Spin-glass theory for pedestrians, J. Stat. Mech. Theory Exp. 2005 (05) (2005) P05012.

[16] Sourav Chatterjee, A generalization of the Lindeberg principle, Ann. Probab. 34 (6) (2006) 2061-2076.

[17] Wei-Kuo Chen, The Aizenman-Sims-Starr scheme and Parisi formula for mixed p-spin spherical models, Electron. J. Probab. 18 (2013) 1-14.

[18] Patrick Charbonneau, Jorge Kurchan, Giorgio Parisi, Pierfrancesco Urbani, Francesco Zamponi, Fractal free energy landscapes in structural glasses, Nat. Commun. 5 (1) (2014) 1-6.

[19] Charles Clum, Topics in the Mathematics of Data Science, PhD thesis, The Ohio State University, 2022.

[20] Thomas M. Cover, Geometrical and statistical properties of systems of linear inequalities with applications in pattern recognition, IEEE Trans. Electron. Comput. (1965) 326-334.

[21] Charles Clum, Daniel Paleka, Afonso S. Bandeira, Dustin G. Mixon, Private communication, 2022.

[22] Jairo R.L. de Almeida, David J. Thouless, Stability of the Sherrington-Kirkpatrick solution of a spin glass model, J. Phys. A, Math. Gen. 11 (5) (1978) 983.

[23] Hadi Daneshmand, Jonas Kohler, Francis Bach, Thomas Hofmann, Aurelien Lucchi, Batch normalization provably avoids ranks collapse for randomly initialised deep networks, Adv. Neural Inf. Process. Syst. 33 (2020) 18387-18398.