%! TEX root = SGT.tex
% vim: tw=80
% 30/05/2025 11AM

\begin{fcdefn}[Real stable]
  A polynomial $p(z_1, \ldots, z_n) \in \Rbb[z_1, \ldots, z_n]$ is \emph{real
  stable} if $p(z_1, \ldots, z_n) \neq 0$ for all $(z_1, \ldots, z_n) \in
  \mathcal{H}^n$, $\mathcal{H} = \{z \in \Cbb \st \Im z > 0\}$.
\end{fcdefn}

Notice that for a single variable, $p(z)$ is real stable if and only if real
rooted.

\begin{example*}
  $1 - z_1 z_2$.
\end{example*}

\begin{fcprop}[Stable iff real rooted]
  \begin{iffc}
    \lhs
    $p(z_1, \ldots, z_n)$ is real stable
    \rhs
    for all $\Rbb_{\ge 0}^n$, $b \in \Rbb^n$, the polynomial $t \mapsto p(at +
    b)$ is real rooted.
  \end{iffc}
\end{fcprop}

\begin{iffproof}
  \rightimpl
  If $p$ not stable, then there exists $z_0, \ldots, z_n \in \mathcal{H}$ with
  $p(z_1, \ldots, z_n) = 0$, $z_j = b_j + ia_j$, $a_j > 0$.
  Then $p(ai + b) = 0$, $t = i$.

  \leftimpl
  Suppose $\exists a \in \Rbb_{\ge 0}^n$, $b \in \Rbb^n$, $t \in \Cbb \setminus
  \Rbb$ with $p(a t + b) = 0$.
  Assume $\Im t > 0$.
  $z_j + a_j t + b_j \in \mathcal{H}$.
  $p(z_1, \ldots, z_n) = p(at + b) = 0$.
  \begin{center}
    \includegraphics[width=0.6\linewidth]{images/91a3560f024b4036.png}
  \end{center}
\end{iffproof}

\begin{fcprop}[Stability of real stable]
  Assuming:
  - $p(z_1, \ldots, z_n)$ is real stable
  Then:
  the following are also:
  \begin{itemize}
    \item $p(z_{\sigma(1)}, \ldots, z_{\sigma(n)})$, $\sigma \in S_n$.
    \item $p(az_1, z_2, \ldots, z_n)$, $a \in \Rbb_{\ge 0}$.
    \item $p(z_2, z_2, z_3, \ldots, z_n)$.
    \item $p(c, z_2, \ldots, z_n)$, $c \in \mathcal{H} \cup \Rbb$.
    \item $z_1^{d_1} p \left( -\frac{1}{z_1}, z_2, \ldots, z_n \right)$.
    \item $\partial_{z_1} p(z_1, \ldots, z_n)$.
    \item $\MAP(p(z_1, \ldots, z_n))$.
      $\MAP(z_1 z_2 + z_2 z_3^2 + 2z_1 z_4 + z_2 z_3^2) = z_1 z_2 + 2z_1 z_4$.
    \item If $p, q$ are real stable, then so is $pq$.
  \end{itemize}
\end{fcprop}

\begin{fcprop}[Mother of all stable polynomials]
  Assuming:
  - $B \in \Rbb^{d \times d}$ symmetric matrix
  - $A_1, \ldots, A_m \in \Rbb^{d \times d}$ positive semi definite
  Then:
  $\det(B + z_1 A_1 + \cdots + z_n A_n)$ is real stable.
\end{fcprop}

\begin{proof}
  Let $a \in \Rbb_{\ge 0}^n$, $b \in \Rbb^n$.
  Assume positive definite instead of positive semi definite.
  \begin{align*}
    \det \left( B + \sum_{j = 1}^n (a_j t + b_j) A_j \right)
    = \det \left( \ub{\left( \sum_{j = 1}^{n} a_j A_j \right)}_{\eqdef A} t
    + \ub{\left( \sum_{j = 1}^{n} b_j A_j + B \right)}_{\eqdef C} \right)
  \end{align*}
  $A$ is positive definite, and $C$ is symmetric.
  So
  \begin{align*}
    &= \det(At + C) \\
    &= \det(A^\half (tI + A^{-\half} C A^{-\half})A^\half) \\
    &= \det A \det(tI + A^{-\half} C A^{-\half})
  \end{align*}
  The roots are eigenvalues of a real symmetric matrix, hence real.
\end{proof}

\begin{proof}[Proof of \cref{thm:matrix}]
  Say $r_j$ equals $r_j^+$ with probability $p_j^+$, and equals $r_j^-$ with
  probability $p_j^-$.
  We will use Cauchy Binet:
  \[
    \det(AB) 
    = \sum_{\substack{}} \det(A_{S \times [n]}) \det(B_{[n] \times C})
    TODO
  \]
  \begin{align*}
    p(z_1, \ldots, z_n)
    &= \Ebb \det \left( \sum_{j = 1}^{n} z_j r_j r_j^\top \right) \\
    &= \Ebb \sum_{\substack{S \subseteq [m] \\ |S| = n}} \det \left( \sum_{j \in
    S} z_j r_j r_j^\top \right) \\
    &= \Ebb \sum_{\substack{S \subseteq [m] \\ |S| = n}} \left(\prod_{j \in S}
    z_j\right) \det \left( \sum_{j \in S} r_j r_j^\top \right)
  \end{align*}
  \[
    \det \left( \Ebb \sum_{j = 1}^n z_j r_j r_j^\top \right)
    = \det \left( \sum_{j = 1}^{n} z_j \Ebb r_j r_j^\top \right)
  \]
  is real stable since $\Ebb r_j r_j^\top \ge 0$ is a covariance matrix.
  \begin{align*}
    &= \det \left( \sum_{j = 1}^{m} z_j(p_j^+ r_j^+ (r_j^+)^\top + p_j^- r_j^-
    (r_j^-)^\top) \right) \\
    &= \sum_{\substack{S \subseteq [m] \\ |S| = n}} \left( \prod_{j \in S} z_j
    \right) \sum_{n \in \{\pm 1\}^S} \det (p_j^{h(j)} r_j^{h(j)}
    (r_j^{h(j)})^\top)
    + \text{``terms with squares''}
  \end{align*}
  So the earlier thing is real stable.
  So
  \[
    \Ebb \det \left( \sum_{j = 1}^{m} z_j r_j r_j^\top \right)
  \]
  is real stable.
  So
  \[
    \Ebb \det \left( \sum_{j = 1}^m z_j r_j r_j^\top
    + \sum_{j = 1}^{m} x_j e_j e_j^\top \right)
  \]
  is real stable.
  Take $z_j = -1$, $x_j = x$.
  Then
  \[
    \Ebb \det \left( xI - \sum_{j = 1}^{m} r_j r_j^\top \right)
  \]
  is real stable.
\end{proof}

\begin{fcthm}[Godsil]
  % Theorem 14
  Assuming:
  - $G$ is $d$-regular
  - $\lambda_1 \le \cdots \le \lambda_n$ are the roots of $\mu_G(x)$
  Then:
  \[
    \sum_{k = 1}^{n} \lambda_k^l
    = \sum_a W_a^l(G)
  ,\]
  where $W_a^l(G)$ is the number of closed walks of length $l$ from $a$ in the
  path tree $T_a(G)$ of $G$.
\end{fcthm}

\begin{fcdefn}[Path tree]
  Example: $T_a(G)$
  \begin{center}
    \includegraphics[width=0.6\linewidth]{images/e67fcde1c96141f0.png}
  \end{center}
\end{fcdefn}

\begin{proof}[Proof of \cref{thm:godsil14} implies \cref{thm:heilman3}]
  $W_a^l(G) \le W_a^l(\prod_d) \le (2\sqrt{d - 1} + o_l(1))^l$.

  $\lambda_n^l \le \sum \lambda_k^l = \sum_a W_a^l(G) \le n(2\sqrt{d - 1} +
  o_l(1))^l$.

  $\lambda_n \le n^{\frac{1}{l}} (2\sqrt{d - 1} + o_l(1))$.

  Take $l \to \infty$.
\end{proof}

\begin{proof}[Proof of \cref{thm:godsil14}]
  $\mu_G'(x) = \sum_a \mu_{G - a}(x)$
  Hence
  \begin{align*}
    \sum_a \sum_{k \ge 0} x^{n - 1 - 2k} (-1)^k m_k(G - a)
    &= \sum_{k \ge 0} (n - 2k) x^{n - 1 - 2k} (-1)^k m_k(G) \\
    &= \mu_G'(x)
  \end{align*}
  
  \begin{align*}
    \mu_G(x)
    &= x \mu_{G - a}(x) - \sum_{b \sim a} \mu_{G - a - b}(x) \\
    m_k(G)
    &= m_k(G - a) + \sum_{b \sim a} m_{k - 1}(G - a - b) \\
    x^{n - 2k}(-1)^k m_k(G)
    &= x \cdot x^{n - 1 - 2k} (-1)^k m_k(G - a) - \sum_{b \sim a} x^{n - 2 - 2(k
    - 1)} (-1)^{k - 1} m_{k - 1}(G - a - b) \\
    \sum_a \frac{\mu_{G - a}(x)}{\mu_G(x)}
    &= \frac{\mu_G'(x)}{\mu_G(x)} \\
    &= \sum_{j = 1}^{n} \frac{1}{x - \lambda_j} \\
    &= \frac{1}{x} \sum_{j = 1}^{n} \frac{1}{1 - \frac{\lambda_j}{x}} \\
    &= \frac{1}{x} \sum_{j = 1}^{n} \sum_{l \ge 0} \frac{\lambda_j^l}{x^l} \\
    &= \frac{1}{x} \sum_{l \ge 0} \frac{\sum_j \lambda_j^l}{x^l}
  \end{align*}
  Claim: $\frac{\mu_{G - a}(x)}{\mu_G(x)} = \frac{1}{x} \sum_{l \ge 0}
  \frac{W_a^l(G)}{x^l}$.
  \begin{align*}
    \frac{\mu_{G - a}(x)}{\mu_G(x)}
    &= \frac{\mu_{G - a}(x)}{x\mu_{G - a}(x) - \sum_{b \sim a} \mu_{G - a -
    b}(x)} \\
    &= \frac{1}{x} \frac{1}{1 - \frac{1}{x}\sum_{b \sim a} \frac{\mu_{G - a -
    b}(x)}{\mu_{G - a}(x)}} \\
    &= \frac{1}{x} \cdot \sum_{k \ge 0} \left( \frac{1}{x} \sum_{b \sim a}
    \frac{\mu_{G - a - b}(x)}{\mu_{G - a}(x)} \right)^k \\
    &= \frac{1}{x} \sum_{k \ge 0} \frac{1}{x^k} \left( \sum_{b \sim a}
    \frac{1}{x} \sum_{l \ge 0} \frac{W_b^l(G - a)}{x^l} \right)^k \\
    &= \frac{1}{x} \sum_{k \ge 0} \frac{1}{x^{2k}} \left( \sum_{b_1 \sim a}
    \sum_{l_1 \ge 0} \frac{W_G^{l_1}(G - a)}{x^{l_1}} \right)
    \cdots \left( \sum_{b_k \sim a} \sum_{l_k \ge 0} \frac{W_{b_k}^{l_k}(G -
    a)}{x^{l_k}} \right) \\
    &= \frac{1}{x} \sum_{l \ge 0} \frac{W_a^l(G)}{x^l}
  \end{align*}
  Why?
  A tree-like walk in $W_a^l(G)$ that visits $a$ exactly $k$ times is determined
  by:
  \begin{itemize}
    \item A sequence $b_1, \ldots, b_k$ of neighbours of $a$.
    \item A sequence $\gamma_1, \ldots, \gamma_k$ of walks in $T_{b_i}^{l_i}(G -
      a)$ where $2k + l_1 + \cdots + l_k = l$.
  \end{itemize}
\end{proof}
