\documentclass[fleqn]{article}

\usepackage{fullpage,amsmath,amssymb,latexsym}

\begin{document}

\section{Equilibrium}

\begin{equation}
  \beta F=\frac12\lim_{n\to0}\frac1n\left(\beta^2\sum_{ab}f(Q_{ab})+\log\det Q\right)-\frac12\log S_\infty
\end{equation}
$\log S_\infty=1+\log2\pi$.
\begin{align*}
  \beta F=
  -\frac12\log S_\infty+
  \frac12\lim_{n\to0}\frac1n\left(\beta^2nf(1)+\beta^2\sum_{i=0}^kn(x_i-x_{i+1})f(q_i)
  +\log\left[
    \frac{
      1+\sum_{i=0}^k(x_i-x_{i+1})q_i
    }{
      1+\sum_{i=1}^k(x_i-x_{i+1})q_i-x_1q_0
    }
  \right]\right.\\
  +\frac n{x_1}\log\left[
      1+\sum_{i=1}^k(x_i-x_{i+1})q_i-x_1q_0
  \right]\\
  \left.+\sum_{j=1}^kn(x_{j+1}^{-1}-x_j^{-1})\log\left[
      1+\sum_{i=j+1}^k(x_i-x_{i+1})q_i-x_{j+1}q_j
  \right]
\right)
\end{align*}

\begin{align*}
  \lim_{n\to0}\frac1n
  \log\left[
    \frac{
      1+\sum_{i=0}^k(x_i-x_{i+1})q_i
    }{
      1+\sum_{i=1}^k(x_i-x_{i+1})q_i-x_1q_0
    }
  \right]
  &=
  \lim_{n\to0}\frac1n
  \log\left[
    \frac{
      1+\sum_{i=0}^k(x_i-x_{i+1})q_i
    }{
      1+\sum_{i=0}^k(x_i-x_{i+1})q_i-nq_0
    }
  \right] \\
  &=q_0\left(1+\sum_{i=0}^k(x_i-x_{i+1})q_i\right)^{-1}
\end{align*}


\begin{align*}
  \beta F=
  -\frac12\log S_\infty+
  \frac12\left(\beta^2f(1)+\beta^2\sum_{i=0}^k(x_i-x_{i+1})f(q_i)
  +q_0\left(1+\sum_{i=0}^k(x_i-x_{i+1})q_i\right)^{-1}\right. \\
  +\frac1{x_1}\log\left[
      1+\sum_{i=1}^{k}(x_i-x_{i+1})q_i-x_1q_0
  \right]\\
  \left.+\sum_{j=1}^k(x_{j+1}^{-1}-x_j^{-1})\log\left[
      1+\sum_{i=j+1}^{k}(x_i-x_{i+1})q_i-x_{j+1}q_j
  \right]
\right)
\end{align*}
$q_0=0$
\begin{align*}
  \beta F=
  -\frac12\log S_\infty+
  \frac12\left(\beta^2f(1)+\beta^2\sum_{i=0}^k(x_i-x_{i+1})f(q_i)
  +\frac1{x_1}\log\left[
      1+\sum_{i=1}^{k}(x_i-x_{i+1})q_i
  \right]\right.\\
  \left.+\sum_{j=1}^k(x_{j+1}^{-1}-x_j^{-1})\log\left[
      1+\sum_{i=j+1}^{k}(x_i-x_{i+1})q_i-x_{j+1}q_j
  \right]
\right)
\end{align*}
$x_i=\tilde x_ix_k$, $x_k=y/\beta$, $q_k=1-z/\beta$
\begin{align*}
  \beta F=
  -\frac12\log S_\infty+
  \frac12\left(\beta^2f(1)+\beta^2(y\beta^{-1}-1)f(1-z\beta^{-1})+y\beta\sum_{i=0}^{k-1}(\tilde x_i-\tilde x_{i+1})f(q_i)\right. \\
  +\frac\beta{\tilde x_1 y}\log\left[
    y\sum_{i=1}^{k-1}(\tilde x_i-\tilde x_{i+1})q_i+y+z-yz/\beta
  \right]\\
  +\sum_{j=1}^{k-1}\frac\beta y(\tilde x_{j+1}^{-1}-\tilde x_j^{-1})\log\left[
    y\sum_{i=j+1}^{k-1}(\tilde x_i-\tilde x_{i+1})q_i+y+z-yz/\beta-y\tilde x_{j+1}q_j
\right]\\
    \left.-\frac\beta{\tilde x_1 y}\log\beta-\sum_{j=1}^{k-1}\frac\beta y(\tilde x_{j+1}^{-1}-\tilde x_j^{-1})\log\beta+(1-\beta y^{-1})\log\left[
      z/\beta
  \right]
\right)
\end{align*}
\begin{align*}
  \lim_{\beta\to\infty}F=
  \frac12\left(yf(1)+zf'(1)+y\sum_{i=0}^{k-1}(\tilde x_i-\tilde x_{i+1})f(q_i)
  +\frac1{\tilde x_1 y}\log\left[
    y\sum_{i=1}^{k-1}(\tilde x_i-\tilde x_{i+1})q_i+y+z
  \right]\right.\\
  \left.+\sum_{j=1}^{k-1}\frac1 y(\tilde x_{j+1}^{-1}-\tilde x_j^{-1})\log\left[
    y\sum_{i=j+1}^{k-1}(\tilde x_i-\tilde x_{i+1})q_i+y+z-y\tilde x_{j+1}q_j
    \right]
    -\frac1y\log z
\right)
\end{align*}
$F$ is a $k-1$ RSB ansatz with all eigenvalues scaled by $y$ and shifted by $z$. $\tilde x_0=0$ and $\tilde x_k=1$.
\begin{equation} \label{eq:ground.state.free.energy}
  \lim_{\beta\to\infty}F=\lim_{n\to0}\frac1n\frac12\left(nzf'(1)+y\sum_{ab}f(\tilde Q_{ab})+\frac1y\log\det(yz^{-1}\tilde Q+I)
  \right)
\end{equation}

\section{Kac-Rice}

\begin{align*}
  \Sigma
  =-\epsilon\hat\epsilon+\lim_{n\to0}\frac1n\left(
    \sum_a\mu(F_{aa}-R_{aa})
    +\frac12\sum_{ab}\left[
      \hat\epsilon^2f(Q_{ab})+2\hat\epsilon R_{ab}f'(Q_{ab})
      +D_{ab}f'(Q_{ab})+R_{ab}^2f''(Q_{ab})-F_{ab}^2f''(Q_{ab})
    \right]\right.\\\left.
  +\frac12\log\det\begin{bmatrix}Q&-iR\\-iR&-D\end{bmatrix}
  -\log\det F
  \right)
\end{align*}
\[
  0=\frac{\partial\Sigma}{\partial R_{ab}}
  =-\mu\delta_{ab}+\hat\epsilon f'(Q_{ab})+R_{ab}f''(Q_{ab})+\sum_c(R^2-DQ)^{-1}_{ac}R_{cb}
\]
\[
  0=\frac{\partial\Sigma}{\partial D_{ab}}
  =\frac12 f'(Q_{ab})-\frac12\sum_c(R^2-DQ)^{-1}_{ac}Q_{cb}
\]
The second equation implies
\[
  (R^2-DQ)^{-1}=Q^{-1}f'(Q)
\]
Insert the diagonal ansatz $R=R_dI$, $D=D_dI$. Then
\[
  0=(R_df''(1)-\mu)I+\hat\epsilon f'(Q)+R_d(R_d^2I-D_dQ)^{-1}
  =(R_df''(1)-\mu)I+\hat\epsilon f'(Q)+R_dQ^{-1}f'(Q)
\]
and
\[
  Q^{-1}f'(Q)=(I+D_df'(Q))/R_d^2
\]
Substituting the second into the first, we have
\[
  0=(R_df''(1)-\mu)I+\hat\epsilon f'(Q)+\frac1{R_d}(I+D_df'(Q))
\]
\[
  0=(R_df''(1)-\mu+R_d^{-1})I+(\hat\epsilon+D_d/R_d)f'(Q)
\]
The only way for this equation to be satisfied off the diagonal for nontrivial $Q$ is for $D_d=-R_d\hat\epsilon$. We therefore have
\begin{align*}
  \Sigma
  =-\epsilon\hat\epsilon+\lim_{n\to0}\frac1n\left(
    n\mu(F_d-R_d)+\frac12n\left[
      \hat\epsilon R_df'(1)+R_d^2f''(1)-F_d^2f''(1)
    \right]
    +\frac12\sum_{ab}
      \hat\epsilon^2f(Q_{ab})
    ]\right.\\\left.
    +\frac12\log\det(\hat\epsilon R_d^{-1} Q+I)
    +n\log R_d
  -n\log F_d
  \right)
\end{align*}
Taking the saddle with respect to $\mu$ and $F_d$ yields
\[
  F_d=R_d
\]
\[
  \mu=R_d^{-1}(1+R_d^2f''(1))
\]
and gives
\begin{align*}
  \Sigma
  =-\epsilon\hat\epsilon+\lim_{n\to0}\frac1n\frac12\left(
    n
      \hat\epsilon R_df'(1)
    +\hat\epsilon^2\sum_{ab}
      f(Q_{ab})
    +\log\det(\hat\epsilon R_d^{-1} Q+I)
  \right)
\end{align*}
Finally, setting $0=\Sigma$ gives
\[
  \epsilon
  =\lim_{n\to0}\frac1n\frac12\left(nR_df'(1)+\hat\epsilon\sum_{ab}
      f(Q_{ab})
      +\frac1{\hat\epsilon}\log\det(\hat\epsilon R_d^{-1} Q+I)
  \right)
\]
which is precisely \eqref{eq:ground.state.free.energy} with $R_d=z$ and $\hat\epsilon=y$. Therefore, a $(k-1)$-RSB ansatz in Kac-Rice will predict the correct ground state energy for a model whose equilibrium state at small temperatures is $k$-RSB.

\section{Full}

\begin{align*}
  \lim_{n\to0}\frac1n\log\det(\hat\epsilon R_d^{-1} Q+I)
  =x_1^{-1}\log\left(\hat\epsilon R_d^{-1}(1-\bar q_k)+1\right)+\int_{q_0^+}^{q_{k-1}}dq\,\mu(q)\log\left[\hat\epsilon R_d^{-1}\lambda(q)+1\right]
\end{align*}
where
\[
  \mu(q)=\frac{\partial x^{-1}(q)}{\partial q}
\]
Integrating by parts,
\begin{align*}
  \lim_{n\to0}\frac1n\log\det(\hat\epsilon R_d^{-1} Q+I)
  &=x_1^{-1}\log\left(\hat\epsilon R_d^{-1}(1-\bar q_k)+1\right)+\left[x^{-1}(q)\log[\hat\epsilon R_d^{-1}\lambda(q)+1]\right]_{q=q_0^+}^{q=q_{k-1}}-\frac{\hat\epsilon}{R_d}\int_{q_0^+}^{q_{k-1}}dq\,\frac{\lambda'(q)}{x(q)}\frac1{\hat\epsilon R_d^{-1}\lambda(q)+1}\\
  &=\log[\hat\epsilon R_d^{-1}\lambda(q_{k-1})+1]+\frac{\hat\epsilon}{R_d}\int_{q_0^+}^{q_{k-1}}dq\,\frac1{\hat\epsilon R_d^{-1}\lambda(q)+1}
\end{align*}

\begin{align*}
  \Sigma
  =-\epsilon\hat\epsilon+
    \frac12\hat\epsilon R_df'(1)
    +\frac12\int_0^1dq\,\left[
      \hat\epsilon^2\lambda(q)f''(q)
      +\frac1{\lambda(q)+R_d/\hat\epsilon}
    \right]
\end{align*}
for $\lambda$ concave, monotonic,  $\lambda(1)=0$, and $\lambda'(1)=-1$
\[
  0=\frac{\delta\Sigma}{\delta\lambda(q)}=\frac12\hat\epsilon^2f''(q)-\frac12\frac1{(\lambda(q)+R_d/\hat\epsilon)^2}
\]
\[
  \lambda^*(q)=\frac1{\hat\epsilon}\left[f''(q)^{-1/2}-R_d\right]
\]

We suppose that solutions are given by
\begin{equation}
  \lambda(q)=\begin{cases}
    \lambda^*(q) & q<q^* \\
    1-q          & q\geq q^*
  \end{cases}
\end{equation}
where $1-q$ guarantees the boundary conditions at $q=1$, and corresponds to the 0RSB or annealed solutions (annealed Kac-Rice is recovered by substituting in $1-q$ for $\lambda$). We will need to require that $1-q^*=\lambda^*(q^*)$, i.e., continuity.

Inserting this into the complexity, we find
\begin{align*}
  \Sigma
  &=-\epsilon\hat\epsilon+\frac12\hat\epsilon R_df'(1)
  +\frac12\int_0^{q^*}dq\left[
    \hat\epsilon(f''(q)^{-1/2}-R_d)f''(q)+\hat\epsilon f''(q)^{1/2}
  \right]
  +\frac12\int_{q^*}^1dq\left[
    \hat\epsilon^2(1-q)f''(q)+\frac1{q-1+R_d/\hat\epsilon}
  \right] \\
  &=-\epsilon\hat\epsilon+\frac12\hat\epsilon R_d\left[f'(1)-f'(q^*)\right]
  +\hat\epsilon\int_0^{q^*}dq\,f''(q)^{1/2}
  +\frac12\hat\epsilon^2\int_{q^*}^1dq\,
    (1-q)f''(q)
    -\log\left[1-(1-q^*)\hat\epsilon/R_d\right]
\end{align*}
$R_d$ can be extremized now, with
\[
  R_d=\frac12\left(
    (1-q^*)\hat\epsilon\pm\sqrt{
      (1-q^*)\left(
        (1-q^*)\hat\epsilon^2+8/[f'(1)-f'(q^*)]
      \right)
    }
  \right)
\]

This all is for $\mu=\mu^*$, which counts the dominant saddles. We can also count by fixed macroscopic index $\mu$ by leaving it unoptimized in the complexity. This gives
\[
  F_d=\frac1{2f''(1)}\left[\mu\pm\sqrt{\mu^2-4f''(1)}\right]
\]
and
\begin{align*}
  \Sigma
  =-\epsilon\hat\epsilon+
    \frac12\hat\epsilon R_df'(1)
    +\frac12\int_0^1dq\,\left[
      \hat\epsilon^2\lambda(q)f''(q)
      +\frac1{\lambda(q)+R_d/\hat\epsilon}
    \right]-\mu R_d+\frac12R_d^2f''(1)+\log R_d\\
    +\operatorname{Re}\left\{\frac12\left(1+\frac\mu{2f''(1)}\left(\mu\pm\sqrt{\mu^2-4f''(1)}\right)\right)-\log\left(\frac1{2f''(1)}\left(\mu\pm\sqrt{\mu^2-4f''(1)}\right)\right)\right\}
\end{align*}

\end{document}
