Weakly Symmetrically Continuous Functions

Abstract: We extend the definition of weak symmetric continuity to be applicable for functions defined on any nonempty subset of $\R$. Then we investigate basic properties of weakly symmetrically continuous functions and compare them with those of symmetrically continuous functions and weakly continuous functions. Several examples are also given.

\section{Introduction and Preliminaries}

There are many types of generalized continuities, three of which will be discussed in this article. Throughout, let $A$ be a nonempty subset of $\R$ and $a \in A$.
\begin{itemize}
\item[(1)] A function $f:A\rightarrow\R$ is said to be symmetrically continuous at $a$ if
\begin{align*}
	\forall \varepsilon >0 \exists\delta >0 \forall h \in \R, \left|h\right|<\delta\wedge a+h, a-h \in A \Rightarrow \left|f(a+h)-f(a-h)\right| < \varepsilon.
 \end{align*}
\item[(2)]  Let $L_a(A)$ and $U_a(A)$ denote respectively the set of all strictly increasing sequence in $A$ converging to $a$ and the set of all strictly decreasing sequence in $A$ converging to $a$.
A function $f:A\rightarrow\R$ is said to be weakly continuous at $a$ if the following statements hold:
\begin{itemize}
\item[(2.1)]  if $L_a(A) \neq \emptyset$, then there is $\left(x_n\right) \in L_a(A)$ such that $\lim_{n \rightarrow \infty} f\left(x_n\right) = f(a)$, and
\item[(2.2)]  if $U_a(A) \neq \emptyset$, then there is $\left(y_n\right) \in U_a(A)$ such that $\lim_{n \rightarrow \infty} f\left(y_n\right) = f(a)$.
\end{itemize}
\end{itemize}

We remark that the above definitions were first given for functions defined on $\R$ and were later extended \cite{Weak, R_Sym, Sym} for functions defined on any nonempty subset of $\R$.
Similarly, the definition of weak symmetric continuity is given for functions defined on $\R$ as follows \cite{NS, Def_Weak_Sym}

\begin{itemize}
\item[(3)]  A function $g:\R \rightarrow \R$ is said to be weakly symmetrically continuous at $a \in \R$ if there exists a sequence $\left( h_n\right)$ of positive real numbers converging to $0$ such that $\lim_{n\rightarrow \infty} f(a+h_n) - f(a-h_n) = 0$.
\end{itemize}

In this article, we will extend (3) so that it is applicable for functions defined on a nonempty subset of $\R$. Let $S_a(A)$ be the set of all sequences $\left(h_n \right)$ of positive real numbers converging to $0$ such that $a+h_n$ and $a-h_n$ are in $A$ for every $n \in \N$. Then weak symmetric continuity can be extended as follows:

\begin{definition} \label{Def_WSC}
A function $f:A\rightarrow\R$ is said to be weakly symmetrically continuous at $a$ if $S_a(A) \neq \emptyset$ implies that there exists a sequence $\left( h_n\right) \in S_a(A)$ such that $\lim_{n\rightarrow \infty} f(a+h_n) - f(a-h_n) = 0$.
\end{definition}

Our purpose is to obtain basic properties of weakly symmetrically continuous functions defined on a nonempty subset of $\R$ and compare them with those of weakly continuous functions and symmetrically continuous functions. We will give basic relations between these three types of continuities in Section 2. Then we will investigate combinations of these functions in Section 3. Then a study of sequences of weakly symmetrically continuous functions will be given in Section 4. We refer the reader to \cite{Be,Da,Do,H,Ko,Ma,Ok,Uni,Pon,Ros,S,S2} for other results concerning symmetric continuity of functions. We end this section by giving some results that will be used later.

\begin{lemma} {\rm\cite[Theorem 4.1]{Sym}} \label{LimitSym}
Let $f:A\rightarrow\R$ and let $a \in A$. Then $f$ is symmetrically continuous at $a$ if and only if for every sequence $\left(h_n\right)$ in $\R$ with $a+h_n,a-h_n \in A$ for every $n \in \N$, $\lim_{n\rightarrow \infty} h_n = 0$ implies that $\lim_{n\rightarrow \infty} f\left(a+h_n\right) - f\left(a-h_n\right) = 0$.
\end{lemma}

\begin{lemma} {\rm\cite[Proposition~2.2]{Sym}} \label{Prop2.2}
Let $f:A\rightarrow\R$ and $a \in \InTR{A}$. Assume that $\lim_{x \rightarrow a^{+}} f(x) $ and $\lim_{x \rightarrow a^{-}} f(x) $ exist in $\R$. Then $f$ is symmetrically continuous at $a$ if and only if $\lim_{x \rightarrow a} f(x)$ exists.
\end{lemma}

\begin{remark} \label{remark1}
From the definition given above if $f:A\rightarrow \R$ and $a \in A$ is such that $L_a(A) = \emptyset$ and $U_a(A) = \emptyset$, then $f$ is weakly continuous at $a$. Similarly, if $S_a(A) = \emptyset$, then $f$ is symmetrically continuous and weakly symmetrically continuous at $a$. In particular, if $a$ is not a cluster point of $A$, then $f$ is weakly continuous, symmetrically continuous, and weakly symmetrically continuous at $a$.
\end{remark}

\section{Basic Relations}

Let $SC$, $WC$, and $WSC$ be, respectively, the space of symmetrically continuous functions, the space of weakly continuous functions, and the space of weakly symmetrically continuous functions defined on nonempty subsets of $\R$. In this section, we will show that the following relations hold:

\begin{itemize}
\item[(R1)] $SC \subseteq WSC$ and $WSC \nsubseteq SC$,
\item[(R2)] $SC \nsubseteq WC$ and $WC \nsubseteq SC$, and
\item[(R3)] $WSC \nsubseteq WC$ and $WC \nsubseteq WSC$.
\end{itemize}

\begin{theorem} \label{SC_implie_WSC}
Let $f:A\rightarrow \R$. If $f$ is symmetrically continuous at $a$, then $f$ is weakly symmetrically continuous at $a$. In particular, if $f$ is a symmetrically continuous function, then it is a weakly symmetrically continuous function.
\end{theorem}

\begin{proof}
This follows immediately from Definition \ref{Def_WSC} and Lemma \ref{LimitSym}.
\end{proof}

Next we give various examples to show a clearer picture of each type of continuities and to verify the relations (R1), (R2) and (R3).

\begin{example} \label{WSC_notim_SC}
Let $A=\left\{ \frac{1}{n} \mid n \in \Z-\left\{0\right\} \right\} \cup \left\{ 0 \right\}$. Define $f:\R\rightarrow\R$ by
$$
f(x) = \begin{cases}
0, \quad & \text{if} \; x \in A; \\
1, \quad & \text{if} \; x > 0 \; \text{and} \; x \notin A; \\
-1, \quad & \text{if} \; x < 0 \; \text{and} \; x \notin A.
\end{cases}
$$
Since $\left( \frac{1}{n} \right)_{n \in \N} \in S_0(\R)$ and
\begin{align*}
	\lim_{n\rightarrow \infty} \left| f\left(0+\frac{1}{n}\right) - f\left(0-\frac{1}{n}\right)\right| = \lim_{n\rightarrow \infty} \left| f\left(\frac{1}{n}\right) - f\left( -\frac{1}{n}\right)\right| =0,
\end{align*}
 $f$ is weakly symmetrically continuous at $0$. Observe that $\left( \frac{1}{n} \right)_{n \in \N} \in U_0(\R)$, $\left(- \frac{1}{n} \right)_{n \in \N} \in L_0(\R)$, and $\lim_{n\rightarrow \infty} f\left(\frac{1}{n}\right) = f(0) = \lim_{n\rightarrow \infty} f\left(- \frac{1}{n}\right)$. So f is weakly continuous at $0$. However, $f$ is not symmetrically continuous at $0$. To see this, $f\left(0 + \frac{\sqrt{2}}{n}\right) - f\left(0 - \frac{\sqrt{2}}{n}\right) = 1-(-1) = 2$ which dose not converge to $0$ as $n \rightarrow \infty$. So the assertion follows from Lemma \ref{LimitSym}. Next, let $a \in \R-\left\{0\right\}$. It is easy to see that $\lim_{x\rightarrow a^+} f(x) = \lim_{x\rightarrow a^-} f(x)$ exist and are equal to $1$ or $-1$. By Lemma \ref{Prop2.2}, f is symmetrically continuous at $a$. By Theorem \ref{SC_implie_WSC}, f is weakly symmetrically continuous at $a$. This shows that f is a weakly symmetrically continuous function, is symmetrically continuous at every point $a \in \R-\left\{0\right\}$ but is not symmetrically continuous at $a=0$. In addition, $f$ is not a weakly continuous function. For instance, $f(1)=0$ but for every $\left( y_n \right) \in U_1(\R)$, $f\left(y_n\right)=1$ for every $n \in \N$, so $\left(f\left(y_n\right)\right)_{n \in \N}$ does not converge to $f(1)$.
\end{example}
Next we give a function which is both weakly continuous and weakly symmetrically continuous but is not symmetrically continuous.
\begin{example} \label{WSC_notim_SC2}
Let $A=\left\{ \frac{1}{n} \mid n \in \Z-\left\{0\right\} \right\} \cup \left\{ 0 \right\}$ and $B =\left\{ \frac{\sqrt{2}}{n} \mid n \in \Z-\left\{0\right\} \right\}$. Define $f:A\cup B \rightarrow\R$ by
$$
f(x) = \begin{cases}
0, \quad & \text{if} \; x \in A; \\
1, \quad & \text{if} \; x > 0 \; \text{and} \; x \in B; \\
-1, \quad & \text{if} \; x < 0 \; \text{and} \; x \in B.
\end{cases}
$$
Let $a \in A \cup B - \left\{0\right\}$. Then $U_a(A \cup B)$, $L_a(A \cup B)$, and $S_a(A \cup B)$ are the empty set. As mention in Remark \ref{remark1}, we obtain that $f$ is weakly continuous at a, symmetrically continuous at a, and weakly symmetrically continuous at a. Similar to Example \ref{WSC_notim_SC}, $f$ is weakly symmetrically continuous at $0$, is weakly continuous at $0$, but is not symmetrically continuous at $0$. Therefore $f$ is both a weakly symmetrically continuous function and weakly continuous function, but is not a symmetrically continuous function.
\end{example}

\begin{example} \label{WC_notimplies_SC_WSC}
Let $A=\left\{ \frac{1}{n} \mid n \in \N \right\}$ and let $B= \left\{ -\frac{\sqrt{2}}{n} \mid n \in \N \right\}$. Define $f:\R \rightarrow \R$ by
$$
f(x) = \begin{cases}
x, \quad & \text{if} \; x \in A\cup B\cup \left\{ 0 \right\}; \\
1, \quad &  \text{if} \; x > 0 \; \text{and} \; x \notin A; \\
-1, \quad & \text{if} \;  x < 0 \; \text{and} \; x \notin B.
\end{cases}
$$
Observe that $\left( \frac{1}{n} \right)_{n \in \N} \in U_0(\R)$, $\left( - \frac{\sqrt{2}}{n} \right)_{n \in \N} \in L_0(\R)$, and
\begin{align*}
	\lim_{n\rightarrow \infty} f\left(\frac{1}{n}\right) = \lim_{n\rightarrow \infty} \frac{1}{n} = f\left(0\right) = \lim_{n\rightarrow \infty} -\frac{\sqrt{2}}{n} = \lim_{n\rightarrow \infty} f\left(-\frac{\sqrt{2}}{n}\right).
\end{align*}
Therefore $f$ is weakly continuous at $0$. But $f$ is not weakly symmetrically continuous at $0$. To see this, let $(h_n) \in S_0(\R)$. Let $n \in \N$. By the definition of $S_0(\R)$, $h_n > 0$. If $h_n \in A$, then $\left| f\left(0+h_n\right) - f\left(0-h_n\right) \right| = h_n+1$. If $h_n \notin A$, then $\left| f\left(0+h_n\right) - f\left(0-h_n\right) \right| \in \left\{1+h_n, 2\right\}$. In any case, $\left| f\left(0+h_n\right) - f\left(0-h_n\right) \right| \geq \min\left\{2, 1+h_n\right\}$ for every $n \in \N$. Since $1+h_n \rightarrow 1 \neq 0$, $f\left(0+h_n\right) - f\left(0-h_n\right)$ does not converge to $0$ as $n \rightarrow \infty$.
\end{example}

The function $f$ in Example \ref{WC_notimplies_SC_WSC} is not a weakly continuous function because it is not  weakly continuous at $a=\frac{1}{2}$: for every $\left( y_n \right) \in U_{\frac{1}{2}}(\R)$, $f\left(y_n\right)=1$ for every $n \in \N$, and therefore $\left(f\left(y_n\right)\right)_{n \in \N}$ does not converge to $f\left(\frac{1}{2}\right)$. The next example gives a function which is a weakly continuous function but is not a weakly symmetrically continuous function.

\begin{example} \label{WC_notimplies_SC_WSC2}
Let $A=\left\{ \frac{1}{n} \mid n \in \N \right\}$, $B= \left\{ -\frac{\sqrt{2}}{n} \mid n \in \N \right\}$, $C= \left\{\frac{\sqrt{2}}{n} \mid n \in \N \right\}$, and $D = A\cup B\cup C \cup\left\{0\right\}$. Define $f:D\rightarrow \R$ by
$$
f(x) = \begin{cases}
x, \quad & \text{if} \; x \in A\cup B\cup \left\{ 0 \right\}; \\
1, \quad & \text{if} \; x \in C.
\end{cases}
$$
Let $a \in D-\left\{0\right\}$. Then $U_a(D)$, $L_a(D)$, and $S_a(D)$ are the empty sets. Therefore $f$ is weakly continuous at $a$, symmetrically continuous at $a$, and weakly symmetrically continuous at $a$. Similar to Example \ref{WC_notimplies_SC_WSC}, $f$ is weakly continuous at $0$. But $f$ is not weakly symmetrically continuous at $0$. To see this, let $\left(h_n\right) \in S_0\left(D\right)$. By the definition of $S_0\left(D\right)$, $h_n > 0$ and $0+h_n, 0-h_n \in D$ for every $n \in \N$. Therefore $h_n \in C$ for every $n \in \N$. Then $f\left(0+h_n\right)-f\left(0-h_n\right) = 1 + h_n \rightarrow 1 \neq 0$ as $n \rightarrow \infty$. Therefore $f$ is a weakly continuous function but is not a weakly symmetrically continuous function.
\end{example}

\begin{example} \label{SC_WSC_notimplies_WC}
Define $f:\R \rightarrow \R$ by
$$
f(x) = \begin{cases}
0, \quad & \text{if} \; x = 0; \\
1, \quad & \text{if} \; x \neq 0.
\end{cases}
$$
For each $a \in \R$, $\lim_{x\rightarrow a^+} f(x) = \lim_{x\rightarrow a^-} f(x) = 1$. So by Lemma \ref{Prop2.2} and Theorem \ref{SC_implie_WSC}, $f$ is a symmetrically continuous function and is a weakly symmetrically continuous function. For each $\left(y_n\right) \in U_0(\R)$, $f(y_n) \rightarrow 1 \neq f(0)$. So $f$ is not a weakly continuous function.
\end{example}

\begin{theorem} \label{Relation1}
The following statements hold:
\begin{itemize}
\item[(i)] $SC \subseteq WSC$ and $SC \nsubseteq WC$,
\item[(ii)] $WSC \nsubseteq SC \cup WC$,
\item[(iii)] $WSC \cap WC \nsubseteq SC$, and
\item[(iv)] $WC \nsubseteq WSC$,
\end{itemize}
\end{theorem}

\begin{proof}
(i) follows from Theorem \ref{SC_implie_WSC} and Example \ref{SC_WSC_notimplies_WC}, (ii) follows from Example \ref{WSC_notim_SC}, (iii)  follows from Example \ref{WSC_notim_SC2}, and (iv) follows from Example \ref{WC_notimplies_SC_WSC2}.
\end{proof}

\begin{corollary}
The relations (R1), (R2) and (R3) hold.
\end{corollary}
\begin{proof}
(R1) follows from (i) and (ii) of Theorem \ref{Relation1}. (R2) follows from (i) and (iii) of Theorem \ref{Relation1}. (R3) follows from (ii) and (iv) of Theorem \ref{Relation1}.
\end{proof}

\section{Combinations of Functions}

Throughout, let $A$ and $B$ be nonempty subsets of $\R$ and let $a \in A$. The following statements are given in \cite{R_Sym} and \cite{Sym}.
\begin{itemize}
\item[(1)] If $f, g:A\rightarrow \R$ are symmetrically continuous at $a$ and $c \in \R $, then $\left| f \right|$, $cf$, $f+g$, $f-g$, $\max\left\{f,g\right\}$, and $\min\left\{f,g\right\}$ are symmetrically continuous at $a$.
\item[(2)] Let $f, g:A\rightarrow \R$ be symmetrically continuous at $a$. If $f$ and $g$ are locally bounded at $a$, then $fg$ is symmetrically continuous at $a$.
\item[(3)] Let $f:A\rightarrow \R$ and $g:B\rightarrow \R$ be functions such that $f(A) \subseteq B$. If $f$ is symmetrically continuous at $a$, and $g$ is uniformly continuous on $B$, then $g\circ f$ is symmetrically continuous at $a$.
\end{itemize}

Similar statements for weakly continuous functions are given in \cite{Weak}. In this article, we will investigate this kind of  properties for weakly symmetrically continuous functions.

\begin{theorem} \label{Constant_WS}
Let $f:A\rightarrow \R$ be weakly symmetrically continuous at $a$ and $c \in \R $. Then $\left| f \right|$ and $cf$ are weakly symmetrically continuous at $a$.
\end{theorem}

\begin{proof}
Assume that $S_{a}(A) \neq \emptyset$. Then there exists $\left(h_n\right) \in S_{a}(A)$ such that $\lim_{n \rightarrow \infty} f(a+h_n)-f(a-h_n) = 0$.
Since
\begin{align*}
	\left|\left| f\right|(a+h_n) - \left| f\right|(a-h_n) \right|= \left|\left| f(a+h_n) \right| - \left| f(a-h_n) \right|\right|
	\leq \left| f(a+h_n) - f(a-h_n) \right|,
\end{align*}
we obtain that $\lim_{n \rightarrow \infty} \left| f\right|(a+h_n)  - \left| f\right|(a-h_n) = 0$.
In addition,
\begin{align*}
	\lim_{n \rightarrow \infty} (cf)(a+h_n) - (cf)(a-h_n)  = c \lim_{n \rightarrow \infty}  f(a+h_n) - f(a-h_n)  = 0.
\end{align*}
This shows that $\left|f\right|$ and $cf$ are weakly symmetrically continuous at $a$.
\end{proof}

\begin{theorem} \label{Sum_WS}
Let $f:A\rightarrow \R$ be weakly symmetrically continuous at $a$ and let $g:A\rightarrow \R$ be symmetrically continuous at $a$. Then $f+g$, $f-g$, $\max\{ f,g \}$, and $\min\{ f,g \}$ are weakly symmetrically continuous at $a$.
\end{theorem}

\begin{proof}
Assume that $S_{a}(A) \neq \emptyset$. Then there exists $\left(h_n\right) \in S_{a}(A)$ such that
$\lim_{n \rightarrow \infty} f(a+h_n)-f(a-h_n) = 0$.
By Lemma \ref{LimitSym}, $g(a+h_n)-g(a-h_n)$ also converges to $0$. Then
\begin{align*}
& \lim_{n \rightarrow \infty} (f+g)(a+h_n)-(f+g)(a-h_n) \\
& \qquad = \lim_{n \rightarrow \infty} f(a+h_n)-f(a-h_n) + \lim_{n \rightarrow \infty} g(a+h_n)-g(a-h_n) = 0.
\end{align*}
Similarly, $\lim_{n \rightarrow \infty} (f-g)(a+h_n)-(f-g)(a-h_n) = 0$. This shows that $f+g$ and $f-g$ are weakly symmetrically continuous at $a$.

Note that $\max\{ f,g \} = \frac{f+g+\left|f-g\right|}{2}$ and $\min\{ f,g \} = \frac{f+g-\left|f-g\right|}{2}$.
Then
\begin{align*}
&\left|\max\{ f,g \}(a+h_n)-\max\{ f,g \}(a-h_n)\right| \\
	&\qquad \leq \left| \frac{f(a+h_n)-f(a-h_n)}{2} \right| + \left| \frac{g(a+h_n)-g(a-h_n)}{2} \right| \\
	&\qquad \quad + \left|\frac{\left|f-g\right|(a+h_n)-\left|f-g\right|(a-h_n)}{2} \right| \\
	&\qquad \leq \left| \frac{f(a+h_n)-f(a-h_n)}{2} \right| + \left| \frac{g(a+h_n)-g(a-h_n)}{2} \right| \\
	&\qquad \quad + \left|\frac{\left(f-g\right)(a+h_n)-\left(f-g\right)(a-h_n)}{2} \right| \\
	&\qquad \leq \left| \frac{f(a+h_n)-f(a-h_n)}{2} \right| + \left| \frac{g(a+h_n)-g(a-h_n)}{2} \right| \\
	&\qquad \quad + \left| \frac{f(a+h_n)-f(a-h_n)}{2} \right| + \left| \frac{g(a+h_n)-g(a-h_n)}{2} \right|  \\
	&\qquad = \left| f(a+h_n)-f(a-h_n) \right| + \left| g(a+h_n)-g(a-h_n)\right| \rightarrow 0
\end{align*}
as $n\rightarrow \infty$. Therefore $\max\{ f,g \}$ is weakly symmetrically continuous at $a$. Similarly, $\min\{ f,g \}$ is weakly symmetrically continuous at $a$.
\end{proof}

Although $f$ and $g$ are weakly symmetrically continuous at $a$, $f+g$, $f-g$, $\max\{ f,g \}$, and $\min\{ f,g \}$ may or may not be weakly symmetrically continuous at $a$. So we cannot replace the symmetric continuity of the function $g$ in Theorem \ref{Sum_WS} by weak symmetric continuity. We show this in the next example.

\begin{example}
Let $A = \left\{ \frac{1}{n} \mid n \in \Z- \left\{0\right\} \right\}$ and $B = \left\{ \frac{\sqrt{2}}{n} \mid n \in \Z-\left\{ 0 \right\} \right\}$ . Define $f, g:\R \rightarrow \R$ by
$$
f(x) = \begin{cases}
x, \quad & \text{if} \; x \in A\cup\left\{ 0 \right\}; \\
-1, \quad & \text{if} \; x > 0 \; \text{and} \; x \notin A; \\
1, \quad & \text{if} \; x < 0 \; \text{and} \; x \notin A,
\end{cases}
\; \text{and} \;
g(x) = \begin{cases}
x, \quad & \text{if} \; x \in B\cup\left\{ 0 \right\}; \\
-2, \quad & \text{if} \; x > 0 \; \text{and} \; x \notin B; \\
2, \quad & \text{if} \; x < 0 \; \text{and} \; x \notin B.
\end{cases}
$$
Since $f\left( \frac{1}{n} \right) - f\left(-\frac{1}{n} \right) = \frac{2}{n} \rightarrow 0$ and $g\left( \frac{\sqrt{2}}{n} \right) - g\left(-\frac{\sqrt{2}}{n} \right) = \frac{2\sqrt{2}}{n} \rightarrow 0$ as $n \rightarrow \infty$. So $f$ and $g$ are weakly symmetrically continuous at $0$. We obtain
$$
(f+g)(x) = \begin{cases}
-3, \quad & \text{if} \; x > 0 \; \text{and} \; x \notin A\cup B; \\
3, \quad & \text{if} \; x < 0 \; \text{and} \; x \notin A\cup B;  \\
x-2, \quad & \text{if} \; x > 0 \; \text{and} \; x \in A; \\
x+2, \quad & \text{if} \; x < 0 \; \text{and} \; x \in A; \\
x-1, \quad & \text{if} \; x > 0 \; \text{and} \; x \in B; \\
x+1, \quad & \text{if} \; x < 0 \; \text{and} \; x \in B; \\
0, \quad & \text{if} \; x = 0,
\end{cases}
$$
$$
(f-g)(x) = \begin{cases}
1, \quad & \text{if} \; x > 0 \; \text{and} \; x \notin A\cup B; \\
-1, \quad & \text{if} \; x < 0 \; \text{and} \; x \notin A\cup B;  \\
x+2, \quad & \text{if} \; x > 0 \; \text{and} \; x \in A; \\
x-2, \quad & \text{if} \; x < 0 \; \text{and} \; x \in A; \\
-x-1, \quad & \text{if} \; x > 0 \; \text{and} \; x \in B; \\
-x+1, \quad & \text{if} \; x < 0 \; \text{and} \; x \in B; \\
0, \quad & \text{if} \; x = 0,
\end{cases}
$$
$$
\max\left\{f,g\right\}(x) = \begin{cases}
-1, \quad & \text{if} \; x > 0 \; \text{and} \; x \notin A\cup B; \\
2, \quad & \text{if} \; x < 0 \; \text{and} \; x \notin A\cup B;  \\
x, \quad & \text{if} \; x > 0 \; \text{and} \; x \in A; \\
2, \quad & \text{if} \; x < 0 \; \text{and} \; x \in A; \\
x, \quad & \text{if} \; x > 0 \; \text{and} \; x \in B; \\
1, \quad & \text{if} \; x < 0 \; \text{and} \; x \in B; \\
0, \quad & \text{if} \; x = 0,
\end{cases}
$$
$$
\min\left\{f,g\right\}(x) = \begin{cases}
-2, \quad & \text{if} \; x > 0 \; \text{and} \; x \notin A\cup B; \\
1, \quad & \text{if} \; x < 0 \; \text{and} \; x \notin A\cup B;  \\
-2, \quad & \text{if} \; x > 0 \; \text{and} \; x \in A; \\
x, \quad & \text{if} \; x < 0 \; \text{and} \; x \in A; \\
-1, \quad & \text{if} \; x > 0 \; \text{and} \; x \in B; \\
x, \quad & \text{if} \; x < 0 \; \text{and} \; x \in B; \\
0, \quad & \text{if} \; x = 0.
\end{cases}
$$
Let $\left(h_n\right) \in S_0(\R)$. Similar to Example \ref{WC_notimplies_SC_WSC}, for each $n \in \N$,
$$
\left(f+g\right)(h_n) - \left(f+g\right)(-h_n) = \begin{cases}
6, \quad & \text{if} \; h_n > 0 \; \text{and} \; h_n \notin A\cup B; \\
2h_n-4, \quad & \text{if} \; h_n > 0 \; \text{and} \; h_n \in A; \\
2h_n-2, \quad & \text{if} \; h_n > 0 \; \text{and} \; h_n \in B.
\end{cases}
$$
So $\left(f+g\right)(h_n) - \left(f+g\right)(-h_n) \in \left\{ 6, 2h_n-4, 2h_n-2 \right\}$ for every $n \in \N$. Since $2h_n-4 \rightarrow -4$ and $2h_n-2 \rightarrow -2$ as $n \rightarrow \infty$, $\left(f+g\right)(h_n) - \left(f+g\right)(-h_n)$ does not converge to zero as $n \rightarrow \infty$. Similarly, we obtain that for every $n \in \N$,
\begin{align*}
&\left(f-g\right)(h_n) - \left(f-g\right)(-h_n) \in \left\{2,2h_n+4,-2h_n-2\right\}, \\
&\max\left\{f,g\right\}(h_n) - \max\left\{f,g\right\}(-h_n) \in \left\{-3, h_n-2, h_n-1\right\}, \quad \text{and} \\
&\min\left\{f,g\right\}(h_n) - \min\left\{f,g\right\}(-h_n) \in \left\{-3, -h_n-2, -h_n-1\right\}.
\end{align*}
Therefore they do not converge to zero as $n \rightarrow \infty$. This shows that $f+g$, $f-g$, $\max\left\{f,g\right\}$, and $\min\left\{f,g\right\}$ are not weakly symmetrically continuous at $0$.
\end{example}

Recall that a function $f:A\rightarrow \R$ is said to be locally bounded at $a$ if there exist $\delta > 0$ and $M > 0$ such that $\left|f(x)\right| < M$ for all $x \in \left(a-\delta,a+\delta \right)\cap A$. We have the following result.

\begin{theorem} \label{Product_WS}
Let $f:A\rightarrow \R$ be weakly symmetrically continuous at $a$ and let $g:A\rightarrow \R$ be symmetrically continuous at $a$. If $f$ and $g$ are locally bounded at $a$, then $fg$ is weakly symmetrically continuous at $a$.
\end{theorem}

\begin{proof}
Assume that $f$ and $g$ are locally bounded at $a$ and $S_{a}(A) \neq \emptyset$. Then there exists $\left(h_n\right) \in S_{a}(A)$ such that
$\lim_{n \rightarrow \infty} \left|f(a+h_n)-f(a-h_n)\right| = 0$. By Lemma \ref{LimitSym}, $\lim_{n \rightarrow \infty} \left|g(a+h_n)-g(a-h_n)\right| = 0$. Since $f$ and $g$ are locally bounded at $a$, there are positive real numbers $M$ and $\delta$ such that
$ \left| f(x) \right| < M$ and $\left| g(x) \right| < M$, for every $x \in \left(a-\delta , a+\delta \right) \cap A$.
Since $\left(h_n\right) \in S_{a}(A)$, we can choose $N \in \N$ such that $a+h_n$ and $a-h_n$ are in $\left(a-\delta , a+\delta \right) \cap A$ for all $n \geq N$. Writing $(fg)(a+h_n)- (fg)(a-h_n) = f(a+h_n)g(a+h_n)-f(a+h_n)g(a-h_n)+f(a+h_n)g(a-h_n)-f(a-h_n)g(a-h_n)$, we obtain that
\begin{align*}
&\left| (fg)(a+h_n)- (fg)(a-h_n) \right| \\
	&\qquad \leq \left| f(a+h_n)\right| \left|g(a+h_n)-g(a-h_n)\right|+\left|f(a+h_n)-f(a-h_n)\right| \left|g(a-h_n) \right| \\
	&\qquad \leq M \left|g(a+h_n)-g(a-h_n)\right| + M \left|f(a+h_n)-f(a-h_n)\right|,
\end{align*}
for every $n \geq \N$. This implies that $\lim_{n \rightarrow \infty} \left|(fg)(a+h_n)-(fg)(a-h_n)\right| = 0$. Hence $fg$ is weakly symmetrically continuous at $a$.
\end{proof}

Next we give an example to show that local boundedness of the functions $f$ and $g$ in Theorem \ref{Product_WS} cannot be omitted.

\begin{example} \label{Not_locallybounded}
Define $f,g:\R \rightarrow \R$ by
$$
f(x)=x \quad \text{and} \quad
g(x)= \begin{cases}
\frac{1}{\left|x\right|}, \quad & \text{if} \quad x\neq 0; \\
0, \quad & \text{if} \quad x=0.
\end{cases}
$$
Then $f$ and {g} are symmetrically continuous at $0$, $f$ is locally bounded at $0$ but $g$ is not locally bounded at $0$. By Theorem \ref{SC_implie_WSC}, $f$ is weakly symmetrically continuous at $0$. In addition,
$$
\left(fg\right)(x)= \begin{cases}
1, \quad & \text{if} \quad x>0; \\
-1, \quad & \text{if} \quad x<0; \\
0, \quad & \text{if} \quad x=0.
\end{cases}
$$
Therefore, for every $\left(h_n\right) \in S_0(\R)$, $\left(fg\right)(h_n) - \left(fg\right)(- h_n) = 2 \nrightarrow 0$ as $n \rightarrow \infty$. Hence, $fg$ is not weakly symmetrically continuous at $0$.
\end{example}

Next we give functions $f$ and $g$ such that $f$ and $g$ are weakly symmetrically continuous at $0$ and locally bounded at $0$ but $fg$ is not weakly symmetrically continuous at $0$. Therefore the symmetric continuity of the function $g$ in Theorem \ref{Product_WS} cannot be replaced by weak symmetric continuity.

\begin{example}
Let $A = \left\{ \frac{1}{n} \mid n \in \Z- \left\{0\right\} \right\}$, $B = \left\{ \frac{\sqrt{2}}{n} \mid n \in \Z-\left\{ 0 \right\} \right\}$, and $C = A\cup B\cup\left\{0\right\}$. Define $f, g:C \rightarrow \R$ by
$$
f(x) = \begin{cases}
1, \quad & \text{if} \; x \in B\cup\left\{ 0 \right\}; \\
\frac{1}{x^2+1}, \quad & \text{if} \; x > 0 \; \text{and} \; x \in A; \\
-\frac{1}{x^2+1}, \quad & \text{if} \; x < 0 \; \text{and} \; x \in A,
\end{cases}
$$
and
$$
g(x) = \begin{cases}
1, \quad & \text{if} \; x \in A\cup\left\{ 0 \right\}; \\
\frac{1}{x^2+2}, \quad & \text{if} \; x > 0 \; \text{and} \; x \in B; \\
-\frac{1}{x^2+2}, \quad & \text{if} \; x < 0 \; \text{and} \; x \in B.
\end{cases}
$$
Observe that $f\left(\frac{\sqrt{2}}{n}\right) - f\left(- \frac{\sqrt{2}}{n}\right) = 0$ and $g\left(\frac{1}{n}\right) - g\left(- \frac{1}{n}\right) = 0$ for every $n \in \N$. Therefore $f$ and $g$ are weakly symmetrically continuous at $0$. It is easy to see that $f$ and $g$ are bounded. So $f$ and $g$ are locally bounded at $0$. However,
$$
\left(fg\right)(x) = \begin{cases}
\frac{1}{x^2+1}, \quad & \text{if} \; x > 0 \; \text{and} \; x \in A; \\
-\frac{1}{x^2+1}, \quad & \text{if} \; x < 0 \; \text{and} \; x \in A; \\
\frac{1}{x^2+2}, \quad & \text{if} \; x > 0 \; \text{and} \; x \in B; \\
-\frac{1}{x^2+2}, \quad & \text{if} \; x < 0 \; \text{and} \; x \in B; \\
1, \quad & \text{if} \; x=0.
\end{cases}
$$
So for every $\left(h_n\right) \in S_0(\R)$, we have $\left(fg\right)(h_n) - \left(fg\right)(- h_n) \in \left\{\frac{2}{\left(h_n\right)^2+1}, \frac{2}{\left(h_n\right)^2+2}\right\}$ for every $n \in \N$. So $\left(\left(fg\right)(h_n) - \left(fg\right)(- h_n)\right)$ does not converge to $0$ as $n \rightarrow \infty$. Therefore $fg$ is not weakly symmetrically continuous at $0$.
\end{example}

Next we study symmetric continuity, weak symmetric continuity and the quotient of functions.

\begin{theorem}
Let $f:A\rightarrow \R$ be weakly symmetrically continuous at $a$. Assume that $f(x)\neq 0$ for all $x\in A$ and $\frac{1}{f}$ is locally bounded at $a$. Then $\frac{1}{f}$ is weakly symmetrically continuous at $a$.
\end{theorem}

\begin{proof}
Assume that $S_{a}(A) \neq \emptyset$. Then there exists $\left(h_n\right) \in S_{a}(A)$ such that $\lim_{n \rightarrow \infty} \left|f(a+h_n)-f(a-h_n)\right| = 0$. Since $\frac{1}{f}$ is locally bounded at $a$, there are positive real numbers $M$ and $\delta$ such that
\begin{align*}
	\left| \frac{1}{f(x)} \right| < M \quad \text{for every $x \in \left(a-\delta , a+\delta \right) \cap A$.}
\end{align*}
Since $\left(h_n\right) \in S_{a}(A)$, we can choose $N \in \N$ such that $a+h_n$ and $a-h_n$ are in $\left(a-\delta , a+\delta \right) \cap A$  for all $n \geq N$. Then for every $n \geq \N$,
\begin{align*}
 \left| \frac{1}{f(a+h_n)} - \frac{1}{f(a-h_n)} \right|  =  \left| \frac{f(a+h_n) - f(a-h_n)}{f(a+h_n)f(a-h_n)} \right|  \leq  M^{2}\left|f(a+h_n) - f(a-h_n)\right|.
\end{align*}
This implies that $\lim_{n \rightarrow \infty} \left| \frac{1}{f(a+h_n)} - \frac{1}{f(a-h_n)} \right| = 0$. Hence $\frac{1}{f}$ is weakly symmetrically continuous at $a$.
\end{proof}

\begin{lemma} \cite[Lemma~2.3]{R_Sym} \label{LS}
Let $f:A\rightarrow \R$ be symmetrically continuous at $a$ and $f(x) \neq 0$ for every $x\in A$. If $\frac{1}{f}$ is locally bounded at $a$, then $\frac{1}{f}$ is symmetrically continuous at $a$.
\end{lemma}

\begin{theorem}
Let $f:A\rightarrow \R$ be weakly symmetrically continuous at $a$ and locally bounded at $a$. Let $g:A\rightarrow \R$ be symmetrically continuous at $a$. If $g(x)\neq 0$ for all $x \in A$ and $\frac{1}{g}$ is locally bounded at $a$, then $\frac{f}{g}$ is weakly symmetrically continuous at $a$.
\end{theorem}

\begin{proof}
This follows immediately from Lemma \ref{LS} and Theorem \ref{Product_WS}.
\end{proof}

Next we obtain a result on the composition of functions.

\begin{theorem} \label{Composit_WS}
Let $f:A\rightarrow B$ and $g:B \rightarrow \R$. Assume that $f$ is weakly symmetrically continuous at $a$ and $g$ is uniformly continuous on $B$. Then $g\circ f$ is weakly symmetrically continuous at $a$.
\end{theorem}

\begin{proof}
Assume that $S_{a}(A) \neq \emptyset$. Then there exists $\left(h_n\right) \in S_{a}(A)$ such that $\lim_{n \rightarrow \infty} \left|f(a+h_n)-f(a-h_n)\right| = 0$. Let $\varepsilon > 0$. Then there exists $\delta > 0$ such that for all $x,y \in B$, if $\left|x-y\right| < \delta$, then
\begin{align} \label{Eqn1}
	\left|g(x)-g(y)\right| < \varepsilon.
\end{align}
There is $N \in \N$ such that for all $n \geq \N$
\begin{align} \label{Eqn2}
	\left|f(a+h_n)-f(a-h_n)\right| < \delta.
\end{align}
Let $n \geq \N$. By $\left(\ref{Eqn1}\right)$ and $\left(\ref{Eqn2}\right)$, we obtain
\begin{align*}
	\left|(g\circ f)(a+h_n)-(g\circ f)(a-h_n)\right| = \left|g(f(a+h_n))-g(f(a-h_n)) \right| < \varepsilon.
\end{align*}
This shows that $(g\circ f)(a+h_n)-(g\circ f)(a-h_n)$ converges to $0$ as $n \rightarrow \infty$, and therefore $g\circ f$ is weakly symmetrically continuous at $a$.
\end{proof}

The uniform continuity of the function $g$ in Theorem \ref{Composit_WS} cannot be replaced by continuity as shown in the next example.
\begin{example}
Defined $f, g:\R \rightarrow \R$ by
$$
f(x) = \begin{cases}
x+\frac{1}{x}, \quad & \text{if} \quad  x > 0; \\
-\frac{1}{x}, \quad & \text{if} \quad  x < 0;  \\
0, \quad & \text{if} \quad x = 0,
\end{cases}
\quad \text{and} \quad
g(x) =  \begin{cases}
x^2, \quad & \text{if} \quad  x \geq 0; \\
x, \quad & \text{if} \quad  x < 0.
\end{cases}
$$
It is shown in \cite{R_Sym} that $f$ is symmetrically continuous at $0$ and $g$ is continuous but is not uniformly continuous on $\R$. By Theorem \ref{SC_implie_WSC}, $f$ is weakly symmetrically continuous at $0$. In addition,
$$
\left(g\circ f\right)(x) = \begin{cases}
x^2+\frac{1}{x^2}+2 , \quad & \text{if} \quad  x > 0;  \\
\frac{1}{x^2}, \quad & \text{if} \quad  x < 0;  \\
0, \quad & \text{if} \quad x = 0.
\end{cases}
$$
Then for every $(h_n) \in S_0(\R)$, $\left(g\circ f\right)(0+h_n) - \left(g\circ f\right)(0-h_n) = (h_n)^2+\frac{1}{(h_n)^2}+2-\frac{1}{(h_n)^2} = (h_n)^2 + 2 \rightarrow 2 \neq 0$ as $n \rightarrow \infty$. So $g\circ f$ is not weakly symmetrically continuous at $0$.
\end{example}

\begin{corollary}
Let $f:A\rightarrow \R$ be weakly symmetrically continuous at $a \in A$ and $f(x) \geq 0 $ for all $x \in A$. Then $\sqrt{f}$ is weakly symmetrically continuous at $a$
\end{corollary}

\begin{proof}
Let $g:[0, \infty) \rightarrow \R$ be defined by $g(x)=\sqrt{x}$. Then $g$ is uniformly continuous on $[0,\infty)$ and $g\circ f=\sqrt{f}$. By Theorem \ref{Composit_WS}, $\sqrt{f}$ is weakly symmetrically continuous at $a$.
\end{proof}

\section{Sequences of Functions}

Let $\left(f_k\right)$ be a sequence of weakly symmetrically continuous functions.
In this section, we obtain basic results on pointwise and uniform convergence of $\left(f_k\right)$. We will see that pointwise limit of $\left(f_k\right)$ may or may not be weakly symmetrically continuous. In fact, although $f_k$ is symmetrically continuous for every $k$, the pointwise limit of $\left(f_k\right)$ may or may not be weakly symmetrically continuous as shown in the next example.

\begin{example}
For each $k \in \N$, let $f_k:\left[0,2\right] \rightarrow \R$ be given by
$$
f_k(x) = \begin{cases}
x^k, \quad & \text{if} \quad x \in \left[0,1\right]; \\
1, \quad & \text{if} \quad x > 1.
\end{cases}
$$
Let $f:\left[0,2\right] \rightarrow \R$ be given by
$$
f(x) = \begin{cases}
0, \quad & \text{if} \quad x \in \left[0,1\right);  \\
1, \quad & \text{if} \quad x \geq 1.
\end{cases}
$$
Then $f_k$ is a symmetrically continuous function for every $k$, $f_k \rightarrow f$, but $f$ is not weakly symmetrically continuous at $1$.
\end{example}

Next we show that uniform limit of weakly symmetrically continuous functions is weakly symmetrically continuous. A method similar to Cantor diagonalization process is used in the proof.

\begin{theorem}
For each $k \in \N$, let $f_k:A \rightarrow \R$ be weakly symmetrically continuous at $a$. Suppose that $\left(f_k\right)$ converges uniformly on $A$ to a function $f$. Then $f$ is weakly symmetrically continuous at $a$.
\end{theorem}

\begin{proof}
Assume that $S_{a}(A) \neq \emptyset$. For each $k \in \N$, since $f_k$ is weakly symmetrically continuous at $a$, there exists a sequence $\left(h_{n}^{\left(k\right)}\right)_{n \in \N} \in S_{a}(A)$ such that $\lim_{n \rightarrow \infty} \left|f_k(a+h_{n}^{\left(k\right)})-f_k(a-h_{n}^{\left(k\right)})\right| = 0$.
For each $k \in \N$, there exists $N_k \in \N$ such that
\begin{equation} \label{The5eqn1}
 \left| h_{N_k}^{\left(k\right)} \right| < \frac{1}{k} \quad \text{and} \quad \left|f_k(a+h_{N_k}^{\left(k\right)})-f_k(a-h_{N_k}^{\left(k\right)})\right| < \frac{1}{k}.
\end{equation}
For each $n \in \N$, let $x_n = h_{N_n}^{\left(n\right)}$.
Then $\left(x_n\right)$ converges to zero and $x_n > 0$ for every $n \in \N$. In addition, $a+x_n$ and $a-x_n$ are in $A$ for every $n \in \N$. Therefore $\left(x_n\right) \in S_a(A)$. It remains to show that $\lim_{n \rightarrow \infty} \left|f(a+x_n) - f(a-x_n)\right| = 0$.
Let $\varepsilon > 0$. Since $\left(f_k\right)$ converges uniformly to $f$ on $A$, there exists $M \in \N$ such that
\begin{equation} \label{The5eqn2}
	 \left|f_k(x)-f(x)\right| < \frac{\varepsilon}{3}
\end{equation}
for all $k \geq M$ and $x \in A$. There exists $K \in \N$ such that
\begin{equation} \label{The5eqn3}
\frac{1}{K} < \frac{\varepsilon}{3}.
\end{equation}
Let $N=\max\left\{M,K\right\}$ and let $n \geq N$. Then By $\left(\ref{The5eqn2}\right)$, $\left(\ref{The5eqn1}\right)$, the definition of $x_n$, and $\left(\ref{The5eqn3}\right)$, we obtain that
\begin{align*}
	& \left|f(a+x_n)-f(a-x_n)\right| \\
	& \leq \left|f(a+x_n)-f_n(a+x_n)\right|+\left|f_n(a+x_n)-f_n(a-x_n)\right|+\left|f_n(a-x_n)-f(a-x_n)\right| \\
	& < \frac{\varepsilon}{3} + \left|f_n(a+x_n)-f_n(a-x_n)\right| + \frac{\varepsilon}{3} < \frac{\varepsilon}{3} + \frac{1}{n}+ \frac{\varepsilon}{3} < \frac{\varepsilon}{3} + \frac{\varepsilon}{3}+ \frac{\varepsilon}{3} = \varepsilon.
\end{align*}
This completes the proof.
\end{proof}

\vskip.5cm \noindent{\bf Acknowledgement(s) :} The first author would like to thank Department of Mathematics, Faculty of Science, Silpakorn University for the support. The second author would like to thank the Development and Promotion of Science and Technology Talents Project (DPST) of Thailand for giving him scholarship.


Graph Homology and Stability of Coupled Oscillator Networks

Abstract: There are a number of models of coupled oscillator networks where the question of the stability of fixed points reduces to calculating the index of a graph Laplacian. Some examples of such models include the Kuramoto and Kuramoto--Sakaguchi equations as well as the swing equations, which govern the behavior of generators coupled in an electrical network. We show that the index calculation can be related to a dual calculation which is done on the first homology group of the graph, rather than the vertex space. We also show that this representation is computationally attractive for relatively sparse graphs, where the dimension of the first homology group is low, as is true in many applications. We also give explicit formulae for the dimension of the unstable manifold to a phase-locked solution for graphs containing one or two loops. As an application, we present some novel results for the Kuramoto model defined on a ring and compute the longest possible edge length for a stable solution.

\section{Introduction}

Let $G = (V,E,\Gamma = \{\gamma_{v,w}\}_{v,w\in V})$ be a weighted
graph.  The Laplacian matrix\footnote{Our Laplacian is the negative of
  the standard definition, but the reasons for this will be clear
  below} of $G$ is the $|V|\times|V|$ matrix whose components are
\begin{equation*}
  (\L_G)_{vw} = \begin{cases} \gamma_{vw},&v\neq w,\\ -\sum_u \gamma_{vu},& v=w.\end{cases}
\end{equation*}

A classical result is that if $\gamma_{vw}\ge 0$, then $\L_G$ is
negative semidefinite, with the number of zero eigenvalues equal to
the number of connected components of the graph $G$.  If some of the
$\gamma_{vw}$ are negative, then $\L_G$ can have positive eigenvalues
as well.  In~\cite{Bronski.DeVille.14, BDK-SIMAX.15}, the authors
consider the problem where some subset of the $\gamma_{vw}$ are
negative, and show upper and lower bounds on the number of positive
eigenvalues of $\L_G$ that depend only on the ``sign topology'' of
the graph, i.e. the pattern of which edges are positive and which are
negative, regardless of their weights.

More specifically, the main result of~\cite{Bronski.DeVille.14} is:
assume that the graph is symmetric ($\gamma_{(v,w)} =
\gamma_{(w,v)})$, and define $G_+$ (resp.~$G_-$) to be the subgraphs
of $G$ containing only edges with positive (resp.~negative)
weights. Let $|G|$ be the number of components of a graph $G$.  If
$n_+(G)$ is the number of positive eigenvalues of $\L_G$, then
\begin{equation}\label{eq:bound}
  |G_+| -1 \le n_+(G) \le |V|-|G_-|.
\end{equation}
Moreover, one can show that these bounds are saturated, i.e. for any
integer in that range, there is some choice of weights that give
exactly that many positive eigenvalues.  (In fact, one can say much
more about the genericity of the sets of weights that give these
values, see~\cite{BDK-SIMAX.15} for more detail.)

It follows from the formula above that if $G$ is a tree, then the
number of positive eigenvalues is exactly the number of negatively
weighted edges in the graph.  To see this, notice that, for a tree,
the number of connected components of $G_+$ is exactly one plus the
number of negative edges: if we start with a tree with only positive
edges, every flip of an edge from positive to negative will add
another component to the positive subtree.  Conversely, since the
negative edges cannot form a cycle, the number of connected components
of $G_-$ is the number of vertices minus the number of negatively
weighted edges.  In short, if $G$ is a tree, then $n_+(G)$ is
independent of the weights of the edges, and very easy to compute by
inspection.

Now, consider the case where the graph has one cycle and one negative
edge.  It is easy to see in this case that the upper bound
in~\eqref{eq:bound} is one, and the lower bound is either zero (if the
negative edge lies in the cycle); or one (if the negative edge does
not lie in the cycle).  In the latter case, the number of positive
eigenvalues is again independent of the weights.  In the former case,
the weight on the edge matters, and it is not hard to imagine that the
relative magnitude of the weight on the negative edge compared to the
other edges in the cycle determines the stability.

From these examples, it is at least plausible to conjecture that the
stability computation is something that can done on a cycle-by-cycle
basis.  This is further supported by previous work of the
authors~\cite{Bronski.DeVille.14}, where it was shown that a certain
quotient of $H_1(G)$ by a subgroup was important for understanding the
spectrum of the graph Laplacian with positive and negative edges.

In fact, this is the result of the current paper.  Let us denote the
number of cycles by $C = |E|-|V|+1$.  Then the main result of this
paper is that the computation of the index of $\L_G$ is the equivalent
to computing the index of a particular $C\times C$ matrix (what we
call the ``cycle intersection matrix'').  If $C\ll |V|$, then this is
clearly a much simpler problem; the technique we describe here is most
effective for sparse graphs.

\subsection{Connection to nonlinearly coupled phase oscillators}

As stated above, the problem we consider is a pure linear algebra
problem and can be stated as such, but in fact it is inspired and
informed by considering its ``killer app'', i.e. understanding the
dimension of the unstable manifold of a fixed point of a nonlinearly
coupled network dynamical system.

Some examples of the kinds of models we are interested in include the
Kuramoto problem on a general weighted connected graph $D = \{\delta_{ij}\}$, namely:
\begin{equation}\label{eq:Kuramoto}
  \frac{d\theta_i}{dt}=\omega_i + \sum \delta_{ij} \sin(\theta_j - \theta_i).
\end{equation}
More generally one can also consider the Kuramoto--Sakaguchi
model\cite{Kuramoto.Sakaguchi.1986,  DeSmet.Aeyels.07}
\begin{equation}\label{eq:KuramotoSakaguchi}
  \frac{d\theta_i}{dt}=\omega_i + \sum \delta_{ij} \sin(\theta_j - \theta_i+\alpha),
\end{equation}
as well as the swing equations, which govern the dynamics of a coupled system
of generators and loads\cite{Anderson.Fouad.1977}
\begin{equation}\label{eq:swing}
  M  \frac{d^2\theta_i}{dt^2} + D \frac{d\theta_i}{dt}=\omega_i + \sum \delta_{ij} \sin(\theta_j - \theta_i).
\end{equation}
In each of these examples the dimension of the unstable manifold to a
fixed point of the equations is given by the number of positive
eigenvalues of a graph Laplacian.

The study of the fixed points of these systems, and their stability,
has lead to a huge number of papers in the
literature~\cite{Kuramoto.book, Kuramoto.91,BS, E, TOR,
  Hansel.Sompolinsky.92, HK, HLRS, S, Acebron.etal.05, VO1, VO2, MS1,
  MS2, Dorfler.Bullo.12, Dorfler.Chertkov.Bullo.13,
  Coutinho.Goltsev.Dorogotsev.Mendes.13, Dorfler.Bullo.14}.  It has
been widely observed that the behavior of solutions varies
dramatically as the topology of the graph changes: these models are
essentially trivial on a tree, but become more complex as the graph
becomes denser. This again suggests that the first homology group
$H_1(D)$, which counts the number of loops in the graph, should be
important

To date, most of the analytical work has focused on special graph
configurations with a high degree of symmetry. The most-studied case,
where the behavior of the model is very well understood, is the case
of ``all-to-all'' coupling, where the underlying graph is the complete
graph $K_n$, and all of the edge weights $\delta_{ij}$ are equal. In a
ground breaking paper~\cite{MS2}, Mirollo and Strogatz gave upper and
lower bounds (which differed by 1) on the dimension of the unstable
manifold to an arbitrary fixed point solution to this
model. D\"{o}rfler and Bullo~\cite{Dorfler.Bullo.2011} gave a
sufficient condition for the existence of a stable phase-locked
solution, and two of the current
authors~\cite{Bronski.DeVille.Park.12} gave an explicit formula for
the dimension of the unstable manifold. Similarly Verwoerd and Mason
give a proof of the existence of a critical coupling constant for the
cases of the complete\cite{VO1} and bipartite graphs, and one of the
current authors~\cite{DeVille.12} gives some results on the minimizers
and saddles for the Kuramoto on cyclic graphs. For general topologies,
it was first observed by Ermentrout~\cite{Ermentrout.1992} that if the
graph is connected and all of the links are short (the angle
differences are less than $\frac{\pi}{2}$) then the fixed point is
stable.

We show in this paper that the intuition put forward in the preceeding
paragraphs is correct. We show that, rather than computing the number
of positive eigenvalues of the Laplacian, an object that acts on the
vertex space of the graph, there is a dual calculation that can be
posed on the cycle space. This dual problem gives an alternative
method for computing the dimension of the unstable manifold to a
particular fixed point. This approach is particularly attractive for
problems in which the graph is relatively sparse, and the dimension of
the cycle space is much smaller than the dimension of the vertex
space. We note that there are some very important applications for
which this condition is satisfied. One example is the graphs
associated with electrical power networks. Such networks are governed
by the swing equations~\eqref{eq:swing} and these tend to be
reasonably sparse. The following data is from Cotilla-Sanchez, Hines,
Barrows and Blumsack\cite{Cotilla-Sanchez.2012}, who calculated the
number of edges and vertices for the IEEE 300 model (a standard test
power system) as well as the Eastern (EI), Western (WI) and Texas (TI)
interconnects, the largest components of the North American electrical
network:\footnote{A small amount of processing has been done on this
  data, including combining parallel edges and removing disconnected
  buses. Other sources give slightly different numbers without
  changing the general picture. }

\begin{table}[ht]

\caption{Sparsities of Various Electrical Networks}

\centering
\begin{tabular}{|c|| c| c| c| c|}
\hline
\hline
Network & Edges $E$ & Vertices $N$ & Number of Cycles $C=E-N+1$ & Sparsity $\frac{C}{N}$ \\ \hline\hline
IEEE 300 & 409 & 300  & 110 & .37 \\ \hline
EI & 52075 & 41228 & 10848  & .26 \\ \hline
WI & 13734 & 11432 & 2303 & .2 \\ \hline
TI & 5532 & 4513 & 1020 & .23 \\
\hline\hline
\end{tabular}
\label{table:ElectricalNetworks}
\end{table}
As can be seen from the data above electrical networks tend to be
quite sparse, with the dimension of the cycle space being 20---40\% of
dimension of the vertex space. For instance if one wanted to
understand the stability of a fixed point of the Texas Interconnect,
the dual problem presented in this paper would reduce the calculation
to the eigenvalues of a $1020\times 1020$ matrix, rather than the
$4513\times 4513$ eigenvalue problem determined by a naive stability
calculation.

\section{Summary of Results}

In this section, we define our notation and state the two main
theorems of the paper, and give a sense of the main ideas of the
proofs. The complete proof of the main results will be deferred to
Section~\ref{sec:proofs}.

\subsection{Definitions}

\begin{define}\label{def:graph}
  A {\bf weighted graph} $G$ is the triple $G=(V,E,{\Gamma})$, where $V$ is
  a set of vertices, $E\subseteq V\times V$ a set of edges, and ${\Gamma} =
  \{\gamma_{e}\}_{e\in E}$ a set of edge weights.  By this definition,
  the graphs in this paper are always simple (at most one edge between
  vertices) and undirected.
\end{define}

\begin{define}\label{def:Laplacian}
  Let $G=(V,E,{\Gamma})$ be a weighted graph.  The {\bf Laplacian matrix} of
  $G$ is the $|V|\times|V|$ matrix whose entries are given by
  \begin{equation*}
    (\L_G)_{v,w} = \begin{cases} \quad\q\gamma_{(v,w)},&v\neq w,\\ -\sum_u \gamma_{(v,u)},& v=w.\end{cases}
  \end{equation*}
  Since the graph is undirected, the Laplacian matrix is always
  symmetric and has real spectrum.  We denote by $n_+(G), n_0(G),
  n_-(G)$ the number of positive, zero, and negative eigenvalues of
  $\L_G$, and refer to this triple as the {\bf spectral index} of $G$.
  Since, for any $G$, $\L_G{\bf 1} = {\bf 0}$, $\L_G$ has a zero
  eigenvalue and thus a zero determinant.  We define the {\bf reduced
    determinant} of $\L_G$, $\det_{\mathsf{red}}(\L_G)$, to be the determinant of
  the matrix restricted to the space of zero sum vectors, i.e. to the
  orthogonal complement of ${\bf 1}$ in $\R^{|V|}$.  (Note that
  $\det_{\mathsf{red}}(\L_G) = 0$ iff $\L_G$ has a nonsimple eigenvalue at $0$.)
  We will colloquially refer to a Laplacian as {\bf stable} if
  $n_+(\L_G) = 0$ and {\bf unstable} otherwise.
\end{define}

\begin{define}\label{def:incidence}
  Let $G = G(V,E,{\Gamma})$ be a connected weighted graph.  Choose and fix
  and orientation for each edge (so that each edge has both a head and
  tail vertex).  Define the {\bf signed incidence matrix} of $G$ as
  the $|V|\times |E|$ matrix whose entries are given by
\begin{equation*}
  (B_G)_{v,e} = \begin{cases}  1, & e = (v,*),\\ -1, & e = (*,v),\\ 0,& \mbox{else.}\end{cases}
\end{equation*}
The nullspace of the matrix is called the {\bf cycle space}.  It is a
standard result~\cite{Godsil.Royle} that if $G$ is connected, then the dimension
of this nullspace is $C:= |E(G)|-|V(G)|+1$.  We call this integer the
{\bf cycle rank} of the graph.  Note also that while the definition of
$B$ depends on the choice of orientation, the number $C$ does not.

Using the Rank--Nullity Theorem, the above is equivalent to saying
that $B_G^\top$ has nullity one, a fact we also use below.  It is also
not hard to see that $B_G^\top{\bf 1} = {\bf 0}$, so in fact
$\ker(B_G^\top) = \mathop{\rm span}\nolimits({\bf 1})$ whenever $G$ is connected.

We define the {\bf tree set} $\mathop{\rm Tree}\nolimits(G)$ to be the set of edges of $G$
that are contained in every spanning tree of $G$. The complement of
$\mathop{\rm Tree}\nolimits(G)$ is the {\bf cycle set} $\mathop{\rm Cycle}\nolimits(G)$, consisting of every
edge which is included in { some cycle} in the graph.  In terms of
the incidence matrix, $e$ is in the cycle set if and only if there is
a vector $x\in N(B_G)$ with $x_e\neq 0$.
\end{define}

\begin{define}\label{def:cycle}
  Let $y_1,y_2,\dots, y_C$ be a basis for the cycle space.  Define the
  $|E|\times C$ matrix $Y_G$ whose columns are given by the $y_i$, and
  $D_G$ to be the $|E|\times|E|$ diagonal matrix where the $e$th entry
  is $\gamma_e$.  Finally, we define the {\bf cycle intersection
    matrix}, or the {\bf cycle form}
  \begin{equation}\label{eq:defofZ}
    {\mathcal{Z}}_G:= -Y_G^\top D_G^{-1}Y_G,
  \end{equation}
  i.e. the matrix with components
  \begin{equation*}
    ({\mathcal{Z}}_G)_{ij} = -\sum_{e\in E}\gamma_e^{-1}{y_{i,e} y_{j,e}}.
  \end{equation*}
  Note that ${\mathcal{Z}}_G$ is always a $C\times C$ matrix.  The exact form
  of ${\mathcal{Z}}_G$ will depend on the choice of basis, and we will specify
  the exact choice of basis in~\eqref{eq:defofY} below.  For now, we
  simply note that any property that we need for ${\mathcal{Z}}_G$ will be
  independent of this choice.
\end{define}

\begin{lem}\label{lem:Laplacian-decomposition}
  Let $G=(V,E,\Gamma)$ be a connected weighted graph.  Define $D$ as
  in Definition~\ref{def:cycle} and $B$ as in Definition~\ref{def:incidence}.  Then

  \begin{equation*}
    \L_G = -B_GD_GB_G^\top.
  \end{equation*}

\end{lem}

\begin{proof}
  Let us first assume that $v\neq w$.  Then
\begin{equation*}
  (B_GD_GB_G^\top)_{v,w} = \sum_{e,e'} B_{ve}D_{ee'}B^\top_{e'w} = \sum_e B_{ve}B_{we}\gamma_e.
\end{equation*}
If $v,w$ are adjacent, then either $e=(v,w)$ or $e=(w,v)$ is an
oriented edge.  In either case, $B_{ve}B_{we} = -1$.  Moreover, if $e$
is an edge not incident on both $v$ and $w$, then $B_{ve}B_{we} = 0$,
and thus the sum has a single term, and $(B_GD_GB_G^\top)_{vw} = -\gamma_e$.
Therefore all of the off-diagonal terms are the same as $-\L_G$.

Finally, notice that since $B_G^\top {\bf 1} = {\bf 0}$, we have
$B_GD_GB_G^\top{\bf 1} = {\bf 0}$, and from this it follows that the
diagonal terms must be correct as well.

\end{proof}

\subsection{Theorems}

The following are the main results of the paper. The first result gives
a formula for the number of positive eigenvalues of the Laplacian in
terms of the number of edges with negative edge weights together
with the number of positive eigenvalues of the cycle intersection
matrix.

\begin{thm}\label{thm:index}
  Let $G = (V,E,{\Gamma})$ be a connected, weighted graph and let $\L_G$ be
  its Laplacian matrix.  Then the number of positive eigenvalues of
  the Laplacian is the number of negative edges in the graph minus the
  number of positive eigenvalues of the cycle intersection matrix,
  i.e.
  \begin{equation}\label{eq:LZ}
    n_+(\L_G) = \#\{e\in E\,|\, \gamma_e<0 \} - n_+({\mathcal{Z}}_G).
  \end{equation}
  Recall in the definition of ${\mathcal{Z}}_G$ that one makes a choice of
  basis; however, it follows from Lemma~\ref{lem:sylvester} that the
  index of ${\mathcal{Z}}_G$ is independent of this choice of basis.

In particular, we have the inequality
\begin{equation*}
  n_+(\L_G) \le \#\{e\in\mathop{\rm Tree}\nolimits(G) \,|\, \gamma_e<0 \}.
\end{equation*}
From~\eqref{eq:LZ}, the maximal number of negative edges a graph can
have and still have a stable Laplacian is the cycle number $C$.  In
the case where the Laplacian is stable and there are exactly $C$
negative edges, then there is choice of basis cycles so that there is
exactly one negative edge in each cycle in the basis. In other words
if there are exactly $C$ negative edges, then the graph with the
negative edges removed must be a tree.
\end{thm}

\begin{remark}
The basis for the cycle space can be chosen in the following way: Let $G_+$ be
the subgraph containing only the edges of $G$ with positive weight. The cycle
space of $G_+$ forms a subspace $S_+$ of the full cycle space of $G$. Similarly
let $G_-$  be the subgraph containing only negatively weighted edges, and
$S_-$ the corresponding cycle space. Note that $S_+$ and $S_-$ are necessarily
orthogonal. The basis for the cycle space of the full graph $G$ can be chosen
as the union of bases for $S_+$ and $S_-$ together with a set of ``mixed''
cycles that cannot be decomposed into a sum of cycles containing only edges
of one sign. These mixed cycles are a basis for the quotient of the full group
of cycles by the subgroups $S_\pm$. In this basis the cycle intersection form
can be written in the following partitioned form
\[
{\mathcal{Z}}_G=\left(
    \begin{array}{c|cc}
      A_{M}&B_{M,+}&B_{M,-}\\\hline
      B^t_{M,+}&{\mathcal{Z}}_{G_+}& 0\\
      B^t_{M,-}&0&{\mathcal{Z}}_{G_-}
    \end{array}
  \right)
\label{eq:partition}
\]
where ${\mathcal{Z}}_{G_+}$ and ${\mathcal{Z}}_{G_-}$ are the cycle intersection forms for the subgraphs $G_+$ and $G_-$ respectively.

First we note that ${\mathcal{Z}}_{G_+}$ is negative definite and ${\mathcal{Z}}_{G_-}$
is positive definite, so that $n_+({\mathcal{Z}}_G)$ is at least as large as
the dimension of the cycle space of $G_-$ and no larger than the
dimension of the full cycle space minus the dimension of the cycle
space of $G_+$. These inequalities are equivalent to the inequalities
derived previously by the authors\cite{Bronski.DeVille.14}.

Secondly we note that the calculation of the index of ${\mathcal{Z}}_G$ can be
further reduced to a calculation on the space of mixed cycles. In
particular by applying the Haynsworth theorem to \eqref{eq:partition}
we have that
\[
n_+({\mathcal{Z}}_G) = n_+(A_{M} - B_{M,+}{\mathcal{Z}}^{-1}_{G_+} B^t_{M,+} - B_{M,-}{\mathcal{Z}}^{-1}_{G_-} B^t_{M,-}),
\]
and thus the calculation can be reduced to finding the index of a matrix
whose size is the number of mixed cycles. However since the above formula
requires inversion of the matrices ${\mathcal{Z}}_{G_\pm}$ it is not obvious that
this is more attractive than working on the full cycle space.
\end{remark}

The second theorem is a similar result at the level of determinants
rather than the spectral index. This result is not really needed for
the applications, but it is proven with similar ideas and provides a
nice dual form of the famous matrix tree theorem. This is essentially
a weighted version of a theorem proven by Sjogren,\cite{Sjogren.91}
though the proof given here is quite different.

\begin{thm}\label{thm:detred}
  Let $G = (V,E,{\Gamma})$ be connected, and define $\L_G$ as above.  Let
  $N_G = |V(G)|$, and then
\begin{equation}\label{eq:detred}
 \frac1 {N_G} \det_{\mathsf{red}}(\L_G) = \det({\mathcal{Z}}(G)) \times \prod_{e \in E} \gamma_e.
\end{equation}
The quantity $\det({\mathcal{Z}}(G))$ is a homogeneous Laurent polynomial in
the edge weights which generates labelled tree complements: each term
in the Laurent polynomial represents a set of edges that, when removed
from the graph, yield a tree.
\end{thm}

\begin{remark}
  There is an obvious connection between the two theorems, but they
  are not quite equivalent since they address different quantities.
  For example, Theorem~\ref{thm:detred} seems stronger since it gives
  an actual number, but it only implies Theorem~\ref{thm:index} modulo
  2.
\end{remark}

We defer the proof of these results until a later section, but we will
briefly summarize the two main ideas here. The first is that for any
$G$, there is a {\bf covering tree} $T$ (which is a weighted tree),
and a graph map $\varphi\colon T\to G$, which is surjective on
vertices and bijective on edges.  In other words if one identifies
certain vertices of the tree $T$ one obtains $G$. The identification
of vertices in the graph corresponds at the level of linear algebra to
restriction of the Laplacian to a certain subspace, so the Laplacian
on any graph can be realized as the restriction of the Laplacian on a
tree to an appropriate subspace.

The second idea is to use the Haynsworth theorem\cite{H.1968}, which
is stated in Lemma~\ref{lem:haynsworth}.  The Haynsworth theorem is a
kind of duality result relating the number of positive eigenvalues of
a matrix to the number of positive eigenvalues of a $k\times k$
principle minor matrix and the number of positive eigenvalues of the
complementary $(n-k)\times(n-k)$ minor of the inverse matrix.  In
other words, modulo some invertibility assumptions, if $M$ is
self-adjoint and $S$ is a subspace of $\R^N$, then
\begin{equation*}
  n_+(M) = n_+(M|_S) + n_+(M^{-1}|_{S^\perp}).
\end{equation*}
Brushing aside some technical points associated with invertibility
which will be addressed below, the basic observation is that if we
take $M$ to be the Laplacian on the covering tree and $M|_S$ to be the
Laplacian on the graph $G$, then one can compute that
$M^{-1}|_{S^\perp}$ is exactly the cycle intersection form $Z_G$. For
a tree it is easy to see that the number of positive eigenvalues is
exactly the number of edges with negative edge-weights, and formula
\eqref{eq:LZ} follows. There is an analogous identity at the level of
determinants, giving \eqref{eq:detred}.

\section{Linear Examples}\label{sec:linex}

\subsection{Diamond graph}\label{sec:diamond}
We consider the simplest graph with cycle rank $C=2$, the diamond
graph shown in the left frame of Figure~\ref{fig:diamond.cover}, with
five edges and four vertices.  The Laplace matrix is given by
  \begin{equation*}
    \L_G
    = \left(\begin{array}{cccc}
        -(\gamma_a+\gamma_d+\gamma_e)& \gamma_a & \gamma_e & \gamma_d \\
        \gamma_a & -(\gamma_a+\gamma_b) & \gamma_b & 0 \\
        \gamma_e & \gamma_b & -(\gamma_b+\gamma_c+\gamma_e) & \gamma_c \\
        \gamma_d & 0 & \gamma_c & -(\gamma_c+\gamma_d)
      \end{array}\right)
\end{equation*}
By the matrix-tree theorem, we can obtain the eight labelled spanning
trees by considering the $4,4$ cofactor
\begin{equation}\label{eq:detLG}
\begin{split}
  \det\L_{44}(G)
  &=\left|\begin{array}{ccc}
      -(\gamma_a+\gamma_d+\gamma_e)& \gamma_a & \gamma_e \\
      \gamma_a & -(\gamma_a+\gamma_b) & \gamma_b \\
      \gamma_e & \gamma_b & -(\gamma_b+\gamma_c+\gamma_e)
    \end{array}\right|\\
  &=\gamma_a \gamma_b \gamma_c+\gamma_a \gamma_b \gamma_d+
  \gamma_a \gamma_c\gamma_d+\gamma_a \gamma_c \gamma_e+\gamma_a
  \gamma_d \gamma_e+\gamma_b \gamma_c \gamma_d+\gamma_b \gamma_c
  \gamma_e+\gamma_b\gamma_d \gamma_e.
\end{split}
\end{equation}
Let us orient this graph clockwise around the outside, then $1\to3$.
With this orientation, a basis for the cycle space is given by
\begin{align*}
 z_1 &= (1,1,0,0,-1)^t \\
 z_2 &= (0,0,1,1,1)^t.
\end{align*}
The cycle intersection matrix $Z_G$ is given by
\begin{equation*}
Z_G = -\left(\begin{array}{cc}\dfrac{1}{\gamma_a}+\dfrac{1}{\gamma_b}+\dfrac{1}{\gamma_e}& \dfrac{1}{\gamma_e}\\\\
 \dfrac{1}{\gamma_e} &\dfrac{1}{\gamma_c}+\dfrac{1}{\gamma_d}+\dfrac{1}{\gamma_e} \end{array}\right).
\end{equation*}
The determinant of this matrix is
\begin{equation}\label{eq:detCG}
\det Z_G = \dfrac{1}{\gamma_d \gamma_e}+\dfrac{1}{\gamma_c \gamma_e}
+\dfrac{1}{\gamma_b\gamma_e}+\dfrac{1}{\gamma_b \gamma_d}
+\dfrac{1}{\gamma_b \gamma_c}+\dfrac{1}{\gamma_a \gamma_e}
+\dfrac{1}{\gamma_a \gamma_d}+\dfrac{1}{\gamma_a \gamma_c}.
\end{equation}
It is not hard to see that if we multiply~\eqref{eq:detCG} by
$\gamma_a\gamma_b\gamma_c\gamma_d\gamma_e$, then we obtain the expression
in~\eqref{eq:detLG}, verifying Theorem~\ref{thm:detred}. The $\det(Z_G)$
generates labelled tree complements: each term in this Laurent polynomial
represents a pair of edges that, when removed from the graph, yield a
tree.

Moreover, we can use Theorem~\ref{thm:index} to compute bounds on the
edge weights to determine stability.  For ease of notation, we write
$\rho_i = 1/\gamma_i$, and
\begin{equation*}
  w_1 = \rho_a + \rho_b,\quad   w_2 = \rho_c+\rho_d,\quad   w_{12} = \rho_e.
\end{equation*}
Then we have
\begin{equation}\label{eq:diamond-zg}
  Z_G = -\left(\begin{array}{cc} w_1+w_{12}& w_{12}\\w_{12} &w_2+w_{12} \\\end{array}\right).
\end{equation}

Let us first consider the case where there is one negative edge.  In
this case, $Z_G$ has either one or zero positive eigenvalues, which is
the same as saying that $-Z_G$ has one or zero negative eigenvalues.
If there is one, then $\L_G$ is stable, and if zero, it is unstable.

Note however that $\det Z_G <0$ if and only if there is one positive
and one negative eigenvalue, which gives the condition
\begin{equation*}
  (w_1+w_{12})(w_2+w_{12}) - w_{12}^2 < 0,
\end{equation*}
or
\begin{equation*}
  w_1w_2 + w_1w_{12} + w_2w_{12} < 0.
\end{equation*}
If we assume that $\gamma_e<0$, then, solving for $w_{12}$, we obtain the inequality
\begin{equation*}
  w_{12} < -\frac{w_1w_2}{w_1+w_2},
\end{equation*}
or
\newcommand{\fg}[1]{\rho_{{#1}}}
\begin{equation*}
  \rho_e < -\frac{\fg a+\fg b+\fg c+\fg d}{\l(\fg a+\fg b\r)\l(\fg c+\fg d\r)}.
\end{equation*}
Notice, for example, that if we assume that $\gamma_a\approx 0$, then
the $\rho_a$ terms dominate, and the condition we obtain for stability
is $\gamma_e > -(\rho_c+\rho_d)$.  Here $\gamma_b$ is not relevant,
and this makes sense: as $\gamma_a\to 0$, the $a,b$ path is almost
broken as a loop and thus cannot significantly affect stability, so
the condition for stability will be a balance between $e$ and $c,d$.

On the other hand, if one of the edges on the outside is negative (say
wlog $\gamma_a$), we obtain the inequality
\begin{equation*}
  w_1 < \frac{w_2w_{12}}{w_2w_{12}},
\end{equation*}
or
\begin{equation*}
  \fg a < -\dfrac{\l(\fg c + \fg d\r)\fg e}{\fg c + \fg d+ \fg e}-\fg b.
\end{equation*}
Note that every $\rho$ on the right-hand side is positive.  Note the
particular role played by the $\rho_b$ term: if we make $\gamma_b$
larger, this makes $\rho_b$ smaller (in absolute value), making it
more difficult for $\rho_a$ to cause the instability.

qqqqq

Now, assume the graph has two negative edges and let us try and find
conditions for stability.  Note that we cannot have both $a,b$ or both
$c,d$ negative, since this automatically gives an unstable Laplacian.
Therefore we need that at least two of $w_1,w_2,w_{12}$ be negative.

The condition that the matrix be stable is that $-Z_G$ have two
negative eigenvalues, which we can obtain by the condition of having a
positive determinant and a negative trace, so
\begin{equation*}
  w_1w_2 + w_1w_{12} + w_2w_{12} > 0,\quad w_1+w_2+2w_{12} < 0.
\end{equation*}
By symmetry, we only need to consider the case where $w_1,w_2<0$ and
where $w_1,w_{12}<0$.  In the former case, there is a negative edge on
each of the ``outsides'' of the graph, and in the latter there is one
in the middle.

\subsection{One-cycle graphs}\label{sec:1cycle}

Let us now consider the general one-cycle graph and consider the
condition for stability.  Note that such a graph can have at most one
negative edge and still be stable, and, moreover, it cannot be
contained in the tree part of the graph, but must be part of the
cycle.  Therefore we can simplify and consider $R_N$, the ring graph
on $N$ vertices: this graph has $N$ vertices and $N$ edges, and let us
label them so that edge $i$ goes from $i\to i+1$, modulo $N$.

The cycle can be represented by the vector ${\bf 1}$, and thus we have
$Z_G$ is the $1\times1$ matrix (i.e. the scalar)
\begin{equation*}
  Z_G = -\sum_{i=1}^N \frac1{\gamma_i}.
\end{equation*}
Thus to obtain a stable Laplacian, we need that $Z_G > 0$, or
\begin{equation*}
  \sum_{i=1}^N \frac1{\gamma_i} < 0.
\end{equation*}
Assuming that $\gamma_1<0$ and the remainder are positive, the condition
for stability is

\begin{equation*}
  \gamma_1 > \frac{-1}{\displaystyle\sum_{i=2}^n \dfrac1{\gamma_i}}.
\end{equation*}
If all of the positive edges have an equal weight, $\gamma_i \equiv
\gamma$, then we obtain
\begin{equation*}
  \gamma_1 > -\gamma/(n-1).
\end{equation*}
In this case, we see that increasing $\gamma$ helps with stability,
whereas increasing the number of edges, all things being equal, hurts
stability.

\subsection{Two-cycle graphs}\label{sec:2cycle}

We can consider the general two-cycle graph; in fact, we can reuse
many of the computations of Section~\ref{sec:diamond} above.

As in the previous section, we simplify by assuming that there are no
edges in $\mathop{\rm Tree}\nolimits(G)$, i.e. each edge is in one or more cycles.  Let us
split the edges into three sets $S_1,S_2,S_{12}$; the edges in $S_1$
are those only in cycle one, those in $S_2$ are those only in cycle
two, and finally $S_{12}$ are those edges both in cycles one and two.
It is clear that we can choose $S_1,S_2$ to be non-empty, but for some
graphs, it may then be the case that $S_{12}$ is empty (e.g. a graph
with a figure-eight structure).  Let us reorder the edges so that when
ordered, the sets $S_1,S_2,S_{12}$ come in order, and we write $k_* =
|S_*|$.  From this we see that we can choose the cycle basis as
\begin{equation*}
  y_1 = (1,1,\dots,1,0,\dots,0,1,\dots, 1),\quad   y_2 = (0,0,\dots,0,1,\dots,1,1,\dots, 1),
\end{equation*}
where the three groups of edges are of length $k_1,k_2,k_{12}$.  If we then define
\begin{equation*}
  w_* = \sum_{e\in S_*} \frac1{\gamma_e},
\end{equation*}
then we see that the cycle form $Z_G$ has the same structure as
in~\eqref{eq:diamond-zg}, and the subsequent analysis holds over for
this case.

The simplest case is the one where $S_{12} = \emptyset$ and $w_{12} =
0$.  In this case $Z_G$ is diagonal, and the number of positive
eigenvalues is exactly the number of negative diagonal entries.  For
example, let us say that the edge $e$ for which $\gamma_e < 0$ is in
cycle $1$, and thus we need $w_1< 0$ to have a stable Laplacian.  This
gives
\begin{equation*}
  \frac1{\gamma_e} + \sum_{f\neq e,f\in S_1} \frac1{\gamma_f} < 0,
\end{equation*}
or
\begin{equation*}
  \gamma_e > \dfrac{-1}{\sum_{f\neq e,f\in S_1} 1/{\gamma_f}}.
\end{equation*}
This is exactly the condition as in the one-cycle case.  Similarly, if
the graph has two negative edges, we need both $w_1,w_2<0$ and the
conditions on each cycle are decoupled.

In the case where $w_{12}>0$, this gives an analysis similar to that
given above.  Let us consider the case where there is one negative
edge, and it is in both cycles one and two.  We again have the
condition
\begin{equation*}
  w_{12} < -\frac{w_1w_2}{w_1+w_2}.
\end{equation*}
If, for example, we consider the case where all of the positive edges
have the same weight $\gamma$, and the one negative edge has weight
$\gamma_e<0$, then we have
\begin{equation*}
  w_1 = k_1/\gamma,\quad w_2 = k_2/\gamma,\quad w_{12} = \frac{k_{12}-1}\gamma + \frac1{\gamma_e}.
\end{equation*}
This simplifies to
\begin{equation}\label{eq:geg}
  \frac1{\gamma_e} < -\frac 1\gamma \left(\frac{k_1k_2}{k_1+k_2} + (k_{12}-1)\right).
\end{equation}
Again, increasing $\gamma$ helps for stability since it makes the
condition easier to achieve, but increasing any of $k_1,k_2,k_{12}$
makes the condition harder to achieve.

The interpretation of these facts is as follows: clearly, increasing
the strength of the positive couplings will make it harder for the
negative coupling to destabilize the entire system, and in fact
from~\eqref{eq:geg} we see that the two weights are effectively
linearly related.  Moreover, we see that increasing the number of
links in either of the cycles makes it easier to destabilize the
system, similarly to the case of a single cycle.

\section{Nonlinear example --- Kuramoto model on a ring}\label{sec:nlex}

The examples in the previous section studied the stability of linear
Laplacians, but we can also use the current results to obtain novel
results for nonlinearly coupled oscillators as well --- in particular
we consider the Kuramoto model.

It has been known for a long time that if we have a fixed point for
the Kuramoto model where all of the links are ``short'', i.e. the
angle difference across a link is less than $\pi/2$ in absolute value,
then this gives a stable fixed point, see~\cite{Ermentrout.1992}.  We
could then pose the question of whether there exist solutions with
``long'' links that are still stable (this would correspond to having
negative off-diagonal terms in the Jacobian).  This question was
studied numerically in~\cite{Dorfler.Chertkov.Bullo.13}; there the
authors considered a large class of random networks and random
frequencies, and showed that stable fixed points with long links do
exist, but they are exceedingly rare (typically the proportion of
stable points found that have long links were less than $1/1000$).

Intuitively, it makes
sense that if we make the weight $\delta_{ij}$ on an edge arbitrarily
small, then this is possible, but we could then pose the question: can
we have a stable long-link solution if the edge weights are all equal?
We will show that this answer is affirmative on the ring by a
judicious choice of frequencies.  In particular, we will answer the
following question for the ring topology: given a specific graph
topology for the Kuramoto system with equal edge weights, what is the
largest possible link for a stable fixed point of the system?

We consider the Kuramoto model as in~\eqref{eq:Kuramoto}, where we
assume that the graph is a ring with $n$ vertices and that the edge
weights are all equal, and by rescaling we can assume that they are
all one, so that $\delta_{i,i+1} = 1$ (here and below this sum on the
indices is understood modulo $n$).  Let $\theta^*$ be a fixed point
of~\eqref{eq:Kuramoto}.  From this we have
\begin{equation}\label{eq:Knn}
   0 = \omega_i + \sin(\theta^*_{i+1}-\theta^*_i) + \sin(\theta^*_{i-1}-\theta^*_i),
\end{equation}
and the Jacobian at this point is given by $J$, where
\begin{equation*}
  J_{i,i\pm 1} = \cos(\theta_i^* - \theta_{i\pm 1}^*),
\end{equation*}
and the diagonal terms are chosen to make it a Laplacian.  Then we see
from the previous section that it is a stable fixed point if one of
the following two conditions are met:
\begin{enumerate}

\item For all $i=1,\dots, n$, $\gamma_{i,i+1} :=  \cos(\theta_i^\star -
  \theta_{i+1}^\star) > 0$;

\item one of the $\gamma_{i,i+1}$ is negative, and
\begin{equation}\label{eq:cossum}
  \sum_{i=0}^{n-1} \frac{1}{\gamma_{i,i+1}} = \sum_{i=0}^{n-1} \frac{1}{\cos(\theta_i^\star -
  \theta_{i+1}^\star)} < 0.
\end{equation}
\end{enumerate}

Note that $\cos(\theta)>0$ iff $\av{\theta} < \pi/2$, and thus the
sign of the cosine of the angle difference tells us whether a link is
long or short.  These conditions can be reinterpreted as saying: the
fixed point is stable if all of the links are short, or if there is
one long link, then we need the sum of the reciprocals of the edge
weights to be negative.  The question then remains: is there a
configuration $\theta^\star$ that is a fixed point
of~\eqref{eq:Kuramoto}, has one long link, and
satisfies~\eqref{eq:cossum}?

Let us write $\zeta_i = \theta_{i+1} -
\theta_i$.  Note that every term in the right-hand side
of~\eqref{eq:Knn} will be a $\zeta_i$, except for the term
$\theta_{n-1}-\theta_0$ which we can write as $\sum_{i=0}^{n-2}
\zeta_i$.  Then~\eqref{eq:cossum} becomes
\begin{equation}\label{eq:cossum2}
  \sum_{i=0}^{n-1} \frac1{\cos(\zeta_i)} + \frac{1}{\cos\left(\sum_{i=0}^{n-1} \zeta_i\right)}<0.
\end{equation}
Without loss of generality, let us assume that the longest link is
given by the gap $\theta_{n-1} - \theta_0$, so that if there is one
long link, it is represented by the last term in~\eqref{eq:cossum2}.

We can then pose this problem in an alternate form as follows: for any
$\eta \in (0,2\pi)$, let us find the maximum of
\begin{equation*}
  f(\zeta) = \sum_{i=0}^{n-2} \frac1{\cos(\zeta_i)},
  \mbox{ subject to }
  g(\zeta) = \sum_{i=0}^{n-2} \zeta_i = \eta.
\end{equation*}
Then it is possible to realize a fixed point with largest gap $\eta$ iff
\begin{equation*}
  \min_\zeta f(\zeta) + \frac1{\cos\eta} < 0.
\end{equation*}
The nice thing we see from the constrained optimization problem is
that since the constraint is symmetric up to any permutation of the
variables, any internal optimizer must be as well.  (We could also use
Lagrange multipliers to obtain the same result.)  Thus the maximum of
$f$ is acheived only when all of the $\zeta_i$ are equal,
and~\eqref{eq:cossum2} becomes
\begin{equation}\label{eq:cond2}
  \frac{n-1}{\cos(\zeta)} + \frac{1}{\cos((n-1)\zeta)} < 0.
\end{equation}
Summarizing our conditions, if we assume that $\cos(\zeta)$ is positive, then iff the conditions
\begin{equation*}
  \cos((n-1)\zeta) > 0\mbox{ or } (\cos((n-1)\zeta)< 0 \mbox{ and } \frac{n-1}{\cos(\zeta)} + \frac{1}{\cos((n-1)\zeta)} < 0
\end{equation*}
hold, then we have a stable fixed point for the solution $\theta_k^* =
k\zeta$.  Note that both of these conditions can be simplified to
require that their product be positive, i.e.
\begin{equation}\label{eq:hn}
  h_n(\zeta):= (n-1)\frac{\cos(n-1)\zeta}{\cos(\zeta)} + 1 > 0.
\end{equation}
To exhibit a ``long link'' solution, we need to show that there is
$\zeta^*$ with roots of $h_n(\zeta^*)=0$ and $|n\zeta^* \pmod 2\pi|
\in (\pi/2,3\pi/2)$.  We will show numerically that this is possible
for every $n$, see Table~\ref{tab:zeta}.

\begin{table}[ht]
\begin{centering}
\begin{tabular}{|c|c|}\hline
 $n$ & $n\zeta^*/2\pi$ \\\hline
 3 & 0.447 \\\hline
 4 & 0.392 \\\hline
 5 & 0.358 \\\hline
 10 & 0.297 \\\hline
 20 & 0.272 \\\hline
 30 & 0.264 \\\hline
 40 & 0.261 \\\hline
 50 & 0.258 \\\hline
\end{tabular}
\caption{Length of longest possible link for a stable solution on the
  ring with $n$ vertices}
  \label{tab:zeta}
\end{centering}
\end{table}

Here we have found the first root of $h_n(\zeta)$ and compute
$n\zeta_n$: this is the distance between $\theta_0$ and $\theta_{n-1}$
if we choose the solution $\theta_k = k\zeta^*$.  Note that in each
case, the length of the link is greater than a quarter turn (note that
we are presenting the length divided by $2\pi$, so that a link is
``long'' iff it is greater than $1/4$), but this distance decreases
monotonically to $1/4$ as $n\to\infty$.

Note that in general, $h_n(\zeta)$ has multiple roots, so that the
first root may not always give the largest link, but we have found
empirically that this is so.  As such, the numbers in
Table~\ref{tab:zeta} represent the longest link possible for a stable
fixed point of the Kuramoto system on a ring of size $n$.

We can also compute the values of $\omega_k$ that give this solution.
For all $k=1,\dots,n-2$, we have $\theta_{k+1}-\theta_k =
\theta_{k-1}-\theta_k = \zeta$, so that $\omega_k = 0$.  However, we
also have
\begin{equation*}
  \omega_{n-1}(\zeta):= - \sin(\theta_{0}-\theta_{n-1}) - \sin(\theta_{n-2}-\theta_{n-1}) = \sin((n-1)\zeta) + \sin(\zeta),
\end{equation*}
and $\omega_0 = -\omega_{n-1}$.

\begin{figure}[ht]
\begin{centering}
  \includegraphics[width=0.75\textwidth]{Curves.pdf}
  \caption{We plot several of the functions referenced in the text for
    $n=9$ vertices in the ring: $0.05 * h_9(\zeta)$ (blue), $\omega_8(\zeta)$
    (orange), $\cos(8\zeta)$ (purple).}
  \label{fig:curves}
\end{centering}
\end{figure}

We plot several of the curves for the case of $n=9$ in
Figure~\ref{fig:curves}.  We have scaled $h_9(\zeta)$ so that all the
curves are of the same order of magnitude; note that only its sign
matters.  As shown above, where the blue curve is positive, the
solution is stable.  The purple curve is the cosine of the length of
the $(n-1,0)$ link: since we see that this becomes negative before
$h_9(\zeta)$ does, there is a stable long link configuration.
Finally, note that the zeros of $h_9(\zeta)$ correspond to the
critical points of $\omega_8(\zeta)$ (this can be checked), and thus
the $\omega_8(\zeta)$ curve can be interpreted as a series of stable
and unstable branches: whenever $\omega_8(\zeta)$ is increasing in
$\zeta$, this corresponds to a stable solutions, and when it is
decreasing, this corresponds to a $1$-saddle.  As we slide up and down
in this graph, this leads to saddle--node bifurcations in the obvious
manner.  Moreover, note that the $\omega=0$ slice is the one
considered in~\cite{DeVille.12} --- it was shown there that for $n=9$
there are two nontrivial sinks and two corresponding saddles, and this
is recovered here.  By decreasing or increasing $\omega_7$, we can
cause these saddles to collide with either of two sinks.

\section{Proof of Theorems}\label{sec:proofs}

\subsection{Proof of Theorem~\ref{thm:index}}

\subsubsection{Definition of covering tree}

\begin{define}
  Let $G = (V,E,{\Gamma})$ be a connected graph.  We define the {\bf
    universal cover} of $G$, denoted $U(G)$.  If $G$ is a tree, then
  $U(G) = G$.  If $G$ is not a tree, then $U(G)$ is a countably
  infinite tree defined as follows:

\begin{itemize}

\item Choose a root vertex $r\in V(G)$.

\item The vertices of $U(G)$ are {\em non-backtracking rooted paths}
  in $G$, i.e. sequences of the form $w=(r,v_2,v_3,\dots, v_n)$ where
  $(v_i,v_{i+1})\in E$, and $v_{i-1}\neq v_{i+1}$ for all $i$.

\item We say that two vertices $w_1,w_2\in V(U(G))$ are adjacent if
  one is an extension of the other, i.e.
\begin{equation*}
  w_1 = (r,v_2,v_3,\dots, v_n),\quad w_2 = (r,v_2,v_3,\dots, v_n,v_{n+1}),
\end{equation*}
or vice versa.

\item Finally, we define the weight of the edge $(w_1,w_2)$ in the
  example above to be the same as the weight on the edge
  $(v_{n-1},v_n)$.

\end{itemize}
\end{define}

\begin{define}[Fundamental domain]\label{def:T}
  For any graph $G=(V,E,{\Gamma})$, we define $T$, a {\bf fundamental domain
    of the cover} of $G$, as follows.  First construct the universal
  cover $U(G)$.  Choose $T$ to be any finite connected subtree of
  $U(G)$ such that each edge of $G$ appears once.  Notice that by
  definition, $G$ and $T$ have the same edge sets, so we will write
  $E$ for either set.  Since there are $|E|$ edges in $T$ and it is a
  tree, then $|V(T)=|E|+1$.  We will also use the notation $N_G =
  |V(G)|$ and $N_T = |V(T)|$ throughout.
\end{define}

\begin{remark}  The universal cover has certain properties:

\begin{enumerate}

\item If $G$ is not a tree, then $U(G)$ has countably many vertices.
  The degree of the node $w = (r,v_2,\dots, v_n)$ in $U(G)$ is the
  same as the degree of $v_n$ in $G$.  In particular, $U(G)$ is
  locally finite.

\item The map
\begin{align*}
  \varphi\colon U(G) &\to G,\\
  (r,v_2,\dots,v_n)&\mapsto v_n
\end{align*}
is a covering map, i.e. it is a map of graphs, it is surjective, and
it is an isomorphism in the neighborhood of any vertex.

\item The construction of $T$ is independent (up to isomorphism) of
  the choice of the root vertex $r$.

\item Finally, it should be noted that we can construct $T$ directly
  without using the universal cover, see Example~\ref{exa:diamond} for
  an example.

\end{enumerate}
\end{remark}
\begin{prop}\label{prop:surjection}
  Let $G=(V,E,{\Gamma})$ be a connected weighted graph, and define $T$
  as above.  Then the graph map $\varphi\colon T\to G$ given by
\begin{equation*}
  \varphi((r,v_2,\dots, v_n)) = v_n
\end{equation*}
is a surjective map.  Note that $|V(T)| - |V(G)| = C$, i.e. the
difference in the number of vertices of a fundamental domain of the
covering tree and the original graph itself is the cycle rank of the
graph.
\end{prop}

\begin{proof}
  Assume that $w_1,w_2\in V(T)$ and $(w_1,w_2)\in E(T)$.
  Since $w_1,w_2$ are adjacent in $U(G)$, we have that
\begin{equation*}
  w_1 = (r,v_{1},\dots, v_{k}),\quad   w_2 = (r,v_{1},\dots, v_k, v_{k+1}),
\end{equation*}
and $(v_k,v_{k+1})\in E(G)$.  Then $\varphi(w_1) = v_k$ and
$\varphi(w_2) = v_{k+1}$ are adjacent in $G$ whenever $w_1,w_2$ are
adjacent in $T$.  Therefore $\varphi$ is a graph homomorphism.  To see
that it is surjective, note that every edge of $G$ appears in $T$, and
therefore its incident vertices must as well.  Finally, note that
\begin{equation*}
  |V(T)| - |V(G)| = |E| + 1 - |V(G)| = C.
\end{equation*}

\end{proof}

\begin{figure}[ht]
\begin{center}
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2cm,
  thick,main node/.style={circle,fill=blue!20,draw,font=\sffamily}]
  \node[main node] at (0,1) (1) {1};
  \node[main node] at (2,0) (4) {4};
  \node[main node] at (-2,0) (2) {2};
  \node[main node] at (0,-1) (3) {3};
  \path[very thick] (2) edge node  {$\gamma_a$} (1)
        (1) edge node {$\gamma_e$} (3)
        (3) edge node  {$\gamma_b$} (2)
        (4) edge node  {$\gamma_c$} (3)
        (1) edge node {$\gamma_d$} (4);
\end{tikzpicture}
\hspace{1in}
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2cm,
  thick,main node/.style={circle,fill=blue!20,draw,font=\sffamily}]
  \node[main node] at (0,1) (1) {1};
  \node[main node] at (2,0) (14) {14};
  \node[main node] at (-2,0) (12) {12};
  \node[main node] at (-2,-2) (123) {123};
  \node[main node] at (2,-2) (143) {143};
  \node[main node] at (0,-2) (13) {13};
  \path[very thick] (12) edge node  {$\gamma_a$} (1)
        (1) edge node {$\gamma_e$} (13)
        (123) edge node  {$\gamma_b$} (12)
        (143) edge node  {$\gamma_c$} (14)
        (1) edge node {$\gamma_d$} (14);
\end{tikzpicture}
\end{center}
\caption{The diamond graph $G$, and a choice of fundamental domain of
  its universal cover $T$.  Note that $G$ and $T$ have the same edge
  sets with five edges, and $T$ necessarily has six vertices.}
\label{fig:diamond.cover}
\end{figure}

\begin{example}\label{exa:diamond}
  Let us consider the diamond graph in Figure~\ref{fig:diamond.cover}.
  If we choose the root vertex as $1$, then $2,3,4$ are neighbors and
  so we add $12,13,14$ to $T$.  Since $\gamma_b,\gamma_c$ have not yet
  appeared, we add them as in the tree.  Of course, this is not the
  only covering tree we can obtain, even assuming that we choose $1$
  as the root; for example, if we remove vertex $143$ and add a vertex
  $1234$, this would also be a covering tree.
\end{example}

\subsubsection{The projections}

\begin{define}\label{def:X}
  Let $G$ be a connected graph, and $T$, $\varphi\colon T\to G$ as
  defined above.  We define $X$ to be the $N_T\times N_G$ matrix whose
  elements are
\begin{equation*}
  X_{a,v} = 1(\varphi(a)=v).
\end{equation*}
We will also refer to the columns by the vectors $x^v,v\in V(G)$.
\end{define}

\begin{lem}\label{lem:Xproj}
  Let $G=(V,E,{\Gamma})$ be a connected weighted graph, and $T, X$ as in
  Definitions~\ref{def:T},~\ref{def:X}.  Then
  \begin{equation}\label{eq:vw1}
    \L_G = X^\top \L_T X,
  \end{equation}
  or

  \begin{equation}\label{eq:vw2}
    (\L_G)_{v,w} = \ip{x^v}{\L_T x^w}.
  \end{equation}

\end{lem}

\begin{proof}
  Let us use formula~\eqref{eq:vw2}.  Writing this out, we have
\begin{equation*}
  \ip{x^v}{\L_Tx^w} = \sum_{i,j} x^v_i (\L_T)_{ij} x^w_j = \sum_{i,j}(\L_T)_{ij} 1_{\varphi(i)=v}1_{\varphi(j)=w}.
\end{equation*}
If we can show that there exists a unique pair $i,j$ such that
$\phi(i) = v $, $\phi(j) = w,$ and $(\L_T)_{ij} = \gamma_{(v,w)}$,
then we are done.  But notice that since $\phi(i) = v$, and $\phi(j) =
w$, if $(i,j)\in E(T)$, then the weight on the edge $(i,j)$ must be
$\gamma_{(v,w)}$, since $\phi$ is a graph homomorphism.  Moreover,
since each edge of $G$ can appear at most once in $T$, this means that
there is only one such pair.
\end{proof}

\begin{define}\label{def:Y}
  The map $\phi\colon T\to G$ is surjective but in general not
  injective.  For each $v\in V(G)$ with $\av{\phi^{-1}(v)}>1$, choose
  one representative of $\phi^{-1}(v)$ as the {\bf primary
    representative} of this set.  Now, for each $w\in\phi^{-1}(v)$
  with $w\neq \mathop{\rm prim}\nolimits(v)$, define the vector $q^w\in \R^{N_T}$ by
\begin{equation*}
  q^w_i = \begin{cases} -1, &i=\mathop{\rm prim}\nolimits(v),\\ 1, &i=w,\\ 0,&else.\end{cases}
\end{equation*}
We define $Q$ as the matrix whose columns are the $q^w$.
\end{define}

\begin{lem}\label{lem:Sbasis}
  Let $S\subseteq \R^{N_T}$ be the span of the $x^v$ defined in
  Definition~\ref{def:X}.  Then the vectors $q^w$ form a basis for
  $S^\perp$.  In particular, $\dim(\mathop{\rm span}\nolimits(q^w)) =\rank(Q)= c$, the
  cycle rank of $G$.
\end{lem}

\begin{proof}
  First we see that each $q^w$ is orthogonal to $S$.  Consider $x^v$
  where $v=\phi(w)$.  This vector is equal to $1$ both in the
  $\mathop{\rm prim}\nolimits(v)$ and $w$ index, and therefore $\ip{q^w}{x^v} = 0$.
  Moreover, if we consider $x^v$ with $v\neq \phi(w)$, then this
  vector is equal to zero on these indices, and again $\ip{q^w}{x^v} =
  0$.  Since $\dim(\mathop{\rm span}\nolimits(S)) = \rank(X) = |V(G)|$, so that $\rank(Q) =
  |E|+1-\dim S = |E| - |V(G)| +1 = c$.  Finally, note that the $q^w$
  are clearly independent by construction, so by dimension counting
  they form a basis for $S^\perp$.

\end{proof}

\begin{lem}\label{lem:z}
  The Laplacian $\L_T\colon \R^{N_T}\to\R^{N_T}$ is not invertible,
  but has a one-dimensional nullspace given by $\mathop{\rm span}\nolimits({\bf 1})$.  In
  this case, the canonical map
  $$\widetilde\L_T\colon \R^{N_T}/\{{\bf 1}\}\to\R^{N_T}/\{{\bf 1}\} $$
  is invertible.  We then have that
  \begin{equation*}
    Q^\top (\widetilde\L_T)^{-1} Q = {\mathcal{Z}}_G.
  \end{equation*}
\end{lem}

\begin{proof}
In general, for any graph $H$, the incidence matrix $B_H$ is map from
$\R^{|E(H)|}$ to $\R^{|V(H)|}$.  In particular, since $|E(T)| =
|E(G)|$ and $|V(T)| = |E(G)|+1$, this means that
\begin{equation*}
  B_{T}\colon \R^{|E(T)|} \to \R^{|V(T)|}
\end{equation*}
is a map of co-rank one, and as such $B_{T}^\top$ is a map with
a one-dimensional nullspace, which is $\mathop{\rm span}\nolimits({\bf 1})$.  Therefore we
can define $\widetilde{B}$ to be the canonical map so that
\begin{equation*}
  \widetilde{B}\colon \R^{|E(T)|}\to \R^{|E(T)|+1}/\{{\bf 1}\}
\end{equation*}
is invertible: to define this, we first define $\widetilde{B}^\top$ to
be the induced map on the quotient and then $\widetilde{B} =
(\widetilde{B}^\top)^\top$.  In particular, note that $\widetilde{B} =
B$ on ${\bf 1}^\perp$.

For each $w$ such that $q^w\neq \mathbf{0}$, consider the unique path in
$T$ from $w$ to $\mathop{\rm prim}\nolimits(\phi(w))$.  Let us write this path as
\begin{equation*}
  w=v_0\to v_1\to v_2\to\dots\to v_{n-1} \to v_n = \mathop{\rm prim}\nolimits(\phi(w)).
\end{equation*}
Define a vector $r^w\in\R^{|E(T)|}$ as follows:
\begin{equation*}
  r^w_e = \begin{cases} 1,& e=(v_i,v_{i+1}),\exists i,\\ -1 ,& e=(v_{i+1},v_{i}),\exists i,\\mathbf{0},&\mbox{else.}\end{cases}
\end{equation*}
We first compute that
\begin{equation*}
  B_{T}r^w = q^w.
\end{equation*}
To see this, note that $B_{T}r^w = 0$ on any vertex not in the
path, and, moreover, will be zero on any vertex on the interior of the
path due to cancellation.  We need only consider the endpoints.

First, assume that $w\to v_1$ is the chosen orientation for the edge.
Then $(B_{T}r^w)_w= ((B_{T})_{(w,v_1)}r_{(w,v_1)} = 1\cdot
1 = 1$.  If, on the other hand, $v_1\to w$ is the orientation, then we
have $(B_{T}r^w)_w= ((B_{T})_{(w,v_1)}r_{(w,v_1)} =
-1\cdot -1 = 1$ as well.  Similarly,
$(B_{T}r^w)_{\mathop{\rm prim}\nolimits(\phi(w))} = -1$.

From this, it follows that if we define
\begin{equation}\label{eq:defofY}
  Y = \widetilde{B}_{T}^{-1}Q,
\end{equation}
then the columns of $Y$ form a basis for the cycle space of $G$.

By Lemma~\ref{lem:Laplacian-decomposition}, $\L_T =
-B_{T}DB_{T}^\top$, and it is easy to see that similarly,
$\widetilde{\L}_T = -\widetilde B_{T}D\widetilde
B_{T}^\top$.  From this we have
\begin{equation*}
  Q^\top (\widetilde\L_T)^{-1} Q = -Q^\top \widetilde B^{-\top}_{T}D\widetilde
B_{T}^{-1}Q = -Y^\top D Y,
\end{equation*}
giving the definition~\eqref{eq:defofZ}.

\end{proof}

{\bf Proof of Theorem~\ref{thm:index}.}  Recall the definition of
$M:=\widetilde{\L}(T)$.  From Lemma~\ref{lem:Xproj} we have that
\begin{equation*}
  \widetilde{\L}_G = X^\top \widetilde{\L}_T X,
\end{equation*}
and Lemma~\ref{lem:sylvester} gives that
\begin{equation*}
  n_+(\L_G) = n_+(M|_S),
\end{equation*}
since the columns of $X$ form a basis for $S$.  From
Lemma~\ref{lem:z} we have that
\begin{equation*}
  {\mathcal{Z}}_G = Q^\top (\widetilde{\L}_T)^{-1} Q,
\end{equation*}
and Lemma~\ref{lem:sylvester} again gives that
\begin{equation*}
  n_+({\mathcal{Z}}_G) = n_+((M)^{-1}|_{S^\perp}),
\end{equation*}
since the columns of $Q$ form a basis for $S^\perp$.  Using
Lemma~\ref{lem:haynsworth} gives
\begin{equation*}
  n_+(\L_G) = n_+(\L_T) - n_+({\mathcal{Z}}_G).
\end{equation*}

Recall that $T$ is a tree.  Using Theorem~2.10
of~\cite{Bronski.DeVille.14}, this implies that the number of positive
eigenvalues of $\L_T$ are given exactly by the number of negative
edges in $E(T)$.  Recalling that the edge sets of $G$ and $T$ are the
same, we are done.

Finally, to prove the last sentence of the theorem, we again appeal to
Theorem~2.10 of~\cite{Bronski.DeVille.14}.  One consequence of this
theorem is that for $\L_G$ to be stable, $G_+$ must be connected.  If
the number of negative edges in $G$ is the same as the number of
cycles, this means that $G_+$ is a tree, and thus is a spanning tree
of $G$.  For each negative edge in $G$, consider the two incident
vertices and the unique path in $G_+$ connecting them.  This plus the
addition of the negative edge make a cycle in $G$, and it is clear
that each negative edge will be in a different cycle.  Using this
choice of cycles, we now have exactly one negative edge in each
cycle.\hfill{\ensuremath{\blacksquare}}

\subsection{Proof of Theorem~\ref{thm:detred}}

We again start with several lemmas.

\begin{define}\label{def:U}
  Recall $G,T,\phi\colon T\to G$.  For each $v\in V(G)$, if
  $|\phi^{-1}(v)| = 1$, let $\psi(v) = \phi^{-1}(v)$; else, $\psi(v) =
  \mathop{\rm prim}\nolimits(v)$ as defined in Definition~\ref{def:Y}.  Then order the
  vertices of $V(T)$ so that we list all of the vertices in the range
  of $\psi$ first, and then all of the other vertices in some order.
  It is easy to see that the range of $\psi$ as $N_G$ elements.

  We then define the first $N_G$ columns of the same way as we did in
  the definition of $X$, i.e. for $v\in V(G)$, define the $v$th column of $U$, $u^v$, by
  \begin{equation*}
    (u^v)_a = \begin{cases} 1,& \phi(a) = v,\\ 0,& \mbox{else},\end{cases}
  \end{equation*}
  and for columns $i=N_G+1,\dots, N_T$, define $u^i$ to be the
  standard basis function with a 1 in the $i$th slot.  By
  construction, $U$ is a lower triangular matrix with $1$s on the
  diagonal, so $\det(U) = 1$.
\end{define}

\begin{lem}\label{lem:ul}
  The $N_G\times N_G$ upper-left block of $U^\top \L_{T} U$ is
  $\L_G$.
\end{lem}

\begin{proof}
  The proof is more or less the same as Lemma~\ref{lem:Xproj}.  Notice
  that once we have chosen this ordering, the first $N_G$ columns of
  $U$ is the matrix $X$ as defined in Definition~\ref{def:X} with the
  corresponding ordering of vertices.
\end{proof}

\begin{lem}\label{lem:tensors}
  Let $H$ be a symmetric matrix with a one-dimensional nullspace, and
  let $x$ span this nullspace.  Then for any $y,z$, we have
\begin{equation*}
  \det(H+y\otimes z) = \frac{\ip x y \ip x z}{\ip x x}\det_{\mathsf{red}} H.
\end{equation*}

\end{lem}

\begin{proof}
  Since $H$ is self-adjoint, it has real eigenvalues and a orthonormal
  eigenbasis.  Let us write $\lambda_1 = 0$ with $\lambda_2,\dots,
  \lambda_n$ not zero, and let $w_1,\dots,w_n$ be the corresponding
  eigenvectors.  Let $W$ be the matrix whose columns are the $w_i$;
  since the eigenvectors form an orthonormal basis, $W^{-1} = W^\top$.

  Let $M_1$ be the diagonal matrix whose diagonal entries are the
  $\lambda_i$, and define $M_2 = (W^\top y)\otimes (W^\top z)$, i.e.
  \begin{equation*}
    (M_2)_{ij} = \ip {w_i} y \ip {w_j} z.
  \end{equation*}
  Notice that $H = WM_1W^\top$, since this is just its
  diagonalization, and
\begin{equation*}
  WM_2W^\top = W((W^\top u)\otimes (W^\top w))W^\top = WW^\top(u\otimes w) WW^\top = u\otimes w,
\end{equation*}
where we have used the identity $(Ax)\otimes (By) = A(x\otimes
y)B^\top$.  Thus we have
\begin{equation*}
  H + u\otimes w = W(M_1 + M_2)W^\top,
\end{equation*}
and since $W$ is unitary this gives
\begin{equation*}
  \det(H+ u\otimes w)  = \det(M_1+M_2).
\end{equation*}
To compute the last term, notice that we can use the multilinearity of
the determinant by rows and break up this into $2^n$ terms.  However,
note two things: the matrix $M_2$ is rank one and thus has only one
linearly independent row, so if we choose more than one row from
$M_2$, the determinant is zero.  Also, the first row of $M_1$ is zero,
so to obtain a nonzero determinant, we must choose the first row of
$M_2$.  Therefore the only term which gives a nonzero determinant is
the one where we choose the first row from $M_2$ and all of the other
rows from $M_1$.  Expanding by minors in the first column, the
determinant of this matrix is
\begin{equation*}
  \ip{w_1}y\ip{w_1}z\lambda_2\times\dots\times \lambda_n.
\end{equation*}
Since we chose $\lambda_1 = 0$, this means that $w_1$ is the unit
vector that spans $\ker(H)$, and also notice that $\det_{\mathsf{red}} H$ is by
definition $\lambda_2\times\dots\times \lambda_n$.  Thus we have
\begin{equation*}
  \det(H+y\otimes z)= \ip{w_1}y\ip{w_1}z\det_{\mathsf{red}} H
\end{equation*}
If $x$ is a general vector in $\ker(H)$, then $x$ is a scalar multiple
of $w_1$ and we have
\begin{equation*}
  \det(H+y\otimes z)= \frac{\ip{x}y\ip{x}z}{\ip xx}\det_{\mathsf{red}} H.
\end{equation*}

\end{proof}

{\bf Proof of Theorem~\ref{thm:detred}.}  Recall the definition of $U$
in Definition~\ref{def:U}.  Define
\begin{equation*}
  A = U^\top (\L_{T} + \mathbf{1}\otimes \mathbf{1})U = U^\top \L_{T} U + U^\top \mathbf{1} \otimes U^\top \mathbf{1}.
\end{equation*}
If we can establish the following three identities:
\begin{align}
  \det(A) &= N_T^2 \prod_{e\in E(G)} \gamma_e,\label{eq:A}\\
  \det(A|_S) &= \frac{N_T^2}{N_G} \det_{\mathsf{red}} \L_G,\label{eq:As}\\
  \det((A^{-1})|_{S^\perp}) &= \det({\mathcal{Z}}_G)\label{eq:Ai},
\end{align}
then, using Lemma~\ref{lem:HJ}, we obtain
\begin{equation*}
  N_T^2 \prod_{e\in E(G)} \gamma_e = \frac{\dfrac{N_T^2}{N_G} \det_{\mathsf{red}} \L_G}{\det({\mathcal{Z}}_G)},
\end{equation*}
and this proves the theorem.  So it remains to show these three identities.

Identity~\eqref{eq:Ai} follows directly from Lemma~\ref{lem:z}.
To establish~\eqref{eq:A}, we note that
\begin{equation*}
  \det(A) = \det(U^\top (\L_{T} + \mathbf{1}\otimes \mathbf{1})U) = \det(\L_{T} + \mathbf{1}\otimes \mathbf{1}),
\end{equation*}
since $\det(U) = 1$.  By Lemma~\ref{lem:tensors}, we have
\begin{equation*}
  \det(\L_{T} + \mathbf{1}\otimes \mathbf{1}) = \frac{\ip\mathbf{1}\1\ip\mathbf{1}\1}{\ip\mathbf{1}\1}\det_{\mathsf{red}}\L_{T} = N_T\det_{\mathsf{red}}\L_{T},
\end{equation*}
and since there is only one spanning tree of $T$, by the Matrix Tree
Theorem,
\begin{equation*}
  \det_{\mathsf{red}}\L_{T} = N_T \prod_{e\in E(G)} \gamma_e.
\end{equation*}
To establish~\eqref{eq:As}, note that if we use the basis for
$\R^{N_T}$ made from the columns of $U$, then $A|_S$ is just the upper
left $N_G\times N_G$ block of $A$, which is itself the upper left
block of $U^\top \L_{T} U + U^\top \mathbf{1} \otimes U^\top \mathbf{1}$.  By
Lemma~\ref{lem:ul}, the upper left block of the first term is just
$\L_G$, and the upper left block of the second term can be written as
\begin{equation*}
  \widetilde{U}^\top \mathbf{1} \otimes \widetilde{U}^\top\mathbf{1},
\end{equation*}
where $\widetilde(U)$ is just the first $N_G$ columns of $U$.  In
particular, the $v$th row of $\widetilde{U}^\top \mathbf{1}$ is a zero-one
vector with as many ones as vertices in $\phi^{-1}(v)$, and therefore
$u: =\widetilde{U}^\top \mathbf{1}$ is a column vector of height $N_G$ whose $v$th
entry is $\av{\phi^{-1}(v)}$.

Putting this together, and again using Lemma~\ref{lem:tensors} gives
\begin{equation*}
  \det(A|_S) = \det(\L_G + u\otimes u) = \frac{\ip u\mathbf{1}\ip u \mathbf{1}}{\ip\mathbf{1}\1}\det_{\mathsf{red}} \L_G = \frac{\left(\sum_{v\in V(G)}\phi^{-1}(v)\right)^2}{N_G}\det_{\mathsf{red}} \L_G = \frac{N_T^2}{N_G}\det_{\mathsf{red}} \L_G.
\end{equation*}

\hfill{\ensuremath{\blacksquare}}

Dynamical Systems (math.DS); Disordered Systems and Neural Networks (cond-mat.dis-nn); Spectral Theory (math.SP)