A note on the largest bipartite subgraph in point-hyperplane incidence graphs

Abstract: Given $m$ points and $n$ hyperplanes in $\mathbb{R}^d$, if there are many incidences, we expect to find a big cluster $K_{r,s}$ in their incidence graph. Apfelbaum and Sharir found lower and upper bounds for the largest size of $rs$, which only match in three dimensions. In this paper we close the gap in four and five dimensions, up to some logarithmic factors.

\section{Introduction}
 Given a set $P$ of $m$ points and a set $Q$ of $n$ hyperplanes in $\mathbb{R}^d$, their \emph{incidence graph} $G(P,Q)$ is a bipartite graph with vertex set $P\cup Q$ and $(p,q)\in P\times Q$ forms an edge iff $p\in q$. It is proved in \cite{apfelbaum2007large} that if this graph does not contain $K_{r,s}$ as a subgraph for some fixed $r,s$, then it can have at most $O_d((mn)^{d/(d+1)}+m+n)$ edges. Here the notations $f=O_d(g)$  means there exists some constant $C$ that depends on $d$ such that $f\leq Cg$.

 Conversely, when the graph has many edges, we expect to find a big $K_{r,s}$ subgraph. How big can $rs$ be in term of $m,n$ and the number of edges? To make it precise, we use the following definition.
\begin{definition}\label{def:rs}
Given a set $P$ of points and $Q$ of hyperplanes in $\mathbb{R}^d$, let $rs(P,Q)$ be the maximum size of a complete bipartite subgraph of its incidence graph, and $rs_d(m,n,I)$ be the minimum of this quantity over all choices of $m$ points and $n$ hyperplanes in $\mathbb{R}^d$ with $I$ incidences. To be precise: $$rs(P,Q):=\max\{rs: K_{r,s}\subset G(P,Q)\}$$
$$rs_d(m,n,I):=\min_{|P|=m,|Q|=n,\newline |G(P,Q)|=I} rs(P,Q).$$
\end{definition}

Apfelbaum and Sharir in \cite{apfelbaum2007large} proved that if $I=\Omega_d( mn^{1-\frac{1}{d-1}}+ nm^{1-\frac{1}{d-1}})$ then
\begin{equation}\label{eq:ap-sh lower}
    rs_d(m,n,I)=\Omega_d\left( \left(\frac{I}{mn}\right)^{d-1} mn\right).
\end{equation}
Moreover, they show the following upper bound: if $I=\Omega_d((mn)^{1-\frac{1}{d-1}})$ then
\begin{equation}\label{eq:ap-sh upper}
    rs_d(m,n,I)=O_d\left( \left(\frac{I}{mn}\right)^{\frac{d+1}{2}} mn\right).
\end{equation}

These lower and upper bounds only match when $d=3$. In this paper we close the gap in four and five dimensions. In particular, we improve the lower bound to match with the upper bound up to some logarithmic factors.
 \begin{thm}\label{thm:4d}
When $d=4$, there exist constants $C_4$ and $C'_4$ such that if $I\geq C_4  (mn^{2/3}+nm^{3/5})$ then
$$rs_4(m,n,I)\geq C'_4 \left(\frac{I}{mn}\right)^{5/2} mn(\log mn)^{-4}.$$
\end{thm}
 \begin{thm}\label{thm:5d} When $d=5$, there exist constants $C_5$ and $C'_5$ such that if $I\geq C_5   (mn^{3/4}+nm^{2/3})$ then
$$rs_5(m,n,I)\geq C'_5 \left(\frac{I}{mn}\right)^{3} mn(\log mn)^{-10}.$$
\end{thm}

The main tool used to prove \cref{thm:4d} and \cref{thm:5d} is an incidence bound between points and \emph{nondegenerate} hyperplanes, which is reviewed in the next section. We then present the proof of \cref{thm:4d} and sketch the proof of \cref{thm:5d} in the subsequent sections. At the end we explain why our method does not work in six dimensions.
\subsection*{Acknowledgement} The author would like to thank Larry Guth  for many helpful conversations.

\section{Incidence with nondegenerate hyperplanes}
We use the following notations. Let $A$ and $B$ be two sets of geometric objects in $\mathbb{R}^d$. Their \emph{incidence graph} $G(A,B)$ is a bipartite graph on $A\times B$ where $(a,b)$ forms an edge iff $a\subset b$. The number of incidences between $A$ and $B$, denoted by $I(A,B)$, is the number of edges of this graph. In this paper, $A$ are either a set of points or a set of lines, and $B$ is a set of higher dimensional flats. Moreover, we sometimes use the notations $ f \gtrsim g$ instead of $f=\Omega(g)$ and $f\lesssim g$ instead of $f=O(g)$.

Given a set $H}{\mathcal{H}{S}$ of $m$ points in $\mathbb{R}^d$ and some $\beta\in(0,1)$, a hyperplane $H$ is \emph{$\beta$-nondegenerate} with respect to (w.r.t.) $H}{\mathcal{H}{S}$ if there does not exist a proper subflat $F\subset H$ that contains more than $\beta$ fraction of the number of points of $H}{\mathcal{H}{S}$ in $H$, i.e. $|F\cap H}{\mathcal{H}{S}|>\beta|H\cap H}{\mathcal{H}{S}|$. Otherwise, $H$ is \emph{$\beta$-degenerate}. Elekes and T\'oth proved the following incidence bound.

\begin{thm}[Elekes-T\'oth \cite{elekes2005incidences}]\label{thm:E-T}
If $H}{\mathcal{H}{S}$ is a set of $m$ points and $H}{\mathcal{H}{H}$ is a set of $n$ $\beta$-nondegenerate hyperplanes w.r.t. $H}{\mathcal{H}{S}$ (for any $0<\beta<1$)\footnote{Elekes-T\'oth actually proved this only for $\beta<\beta_d$ for some small $\beta_d$. It is later shown in \cite{do2016extending} that we can take $\beta_d=\frac{1}{d-1}$ and in \cite{lund2017two} that we can take $\beta_d=1$.} in $\mathbb{R}^{d}$ then there exists a constant $C_{\beta, d}$ such that
\begin{equation}\label{eq:E-T}
I(H}{\mathcal{H}{S},H}{\mathcal{H}{H})\leq C_{\beta,d}\left((mn)^{\frac{d}{d+1}}+mn^{1-\frac{1}{d-1}}\right).
\end{equation}
\end{thm}
This implies the maximum number of $\beta$-nondegenerate, $k$-rich (i.e. containing at least $k$ points of $H}{\mathcal{H}{S}$) hyperplanes is
$O_{\beta,d} \left(\frac{m^{d+1}}{k^{d+2}}+\frac{m^{d-1}}{k^{d-1}}\right).$
Actually this is what Elekes-T\'oth proved. It is shown to be equivalent to \eqref{eq:E-T} in \cite{apfelbaum2007large}.

Since lines and hyperplanes are dual to each other, we also have a dual version of the above result. Given a set $H}{\mathcal{H}{H}$ of n hyperplanes in $\mathbb{R}^d$, a point $p$ is $\beta$-nondengenerate with respect to $H}{\mathcal{H}{H}$ if there does not exist a line $\ell$ such that $\#\{H\in H}{\mathcal{H}{H}: \ell\subset H\}\geq \beta \#\{H\in H}{\mathcal{H}{H}: p\in H\}$.
\begin{corollary}\label{cor:dual E-T}
If $H}{\mathcal{H}{H}$ is a set of $n$ hyperplanes in $\mathbb{R}^d$ and $P$ is a set of $m$ $\beta$-nondegenerate points w.r.t. $H}{\mathcal{H}{H}$ then there exists a constant $C'_{\beta,d}$ such that
\begin{equation}\label{eq:E-T-dual}
I(H}{\mathcal{H}{S},H}{\mathcal{H}{H})\leq C'_{\beta,d} \left((mn)^{\frac{d}{d+1}}+nm^{1-\frac{1}{d-1}}\right).
\end{equation}
Equivalently, given $n$ hyperplanes in $\mathbb{R}^d$, the number of $k$-rich, $\beta$-nondegenerate points is $O_{\beta,d} \left(\frac{n^{d+1}}{k^{d+2}}+\frac{n^{d-1}}{k^{d-1}}\right).$
\end{corollary}

\section{Proof in four dimensions}

We first outline our strategy. Let $H}{\mathcal{H}{S}$ be a set of $m$ points, $H}{\mathcal{H}{H}$ be a set of $n$ hyperplanes in $\mathbb{R}^4$. There are two ways to form a big $K_{r,s}$ in the incidence graph $G(H}{\mathcal{H}{H},H}{\mathcal{H}{S})$: either a plane contains many points of $H}{\mathcal{H}{S}$ and belongs to many hyperplanes of $H}{\mathcal{H}{H}$, or a line does. By an averaging argument, we can assume each hyperplane is $\frac{I}{m}$-rich (i.e. contains at least $\frac{I}{m}$ points of $H}{\mathcal{H}{S}$). By \cref{thm:E-T}, the contribution from $\beta$-nondegenerate hyperplanes is negligible, so we can assume each hyperplane is $\beta$-degenerate, i.e. it contains some plane with at least $\beta$ of the total number of points, hence the plane is $\beta\frac{I}{m}$-rich. In this case, we say each hyperplane \emph{degenerates} to a rich plane. Either one of those planes belongs to many hyperplanes, which would form a big $K_{r,s}$, or we can find a subset $H}{\mathcal{H}{P}_i$ of planes such that $I(H}{\mathcal{H}{S},H}{\mathcal{H}{P}_i)$ is large.  We repeat our argument: using the averaging argument and \cref{cor:dual E-T}, we can assume each point in $H}{\mathcal{H}{S}$ belongs to many planes in $H}{\mathcal{H}{P}_i$ and degenerates to a line. Either one of those lines contains many points, which then form a big $K_{r,s}$, or we can find a subset $H}{\mathcal{H}{L}_j$ of lines such that $I(H}{\mathcal{H}{L}_j,H}{\mathcal{H}{P}_i)$ is large. But after some transformation, this number is the same with the number of incidences between points and lines in $\mathbb{R}^2$ and hence cannot be too large by \cref{thm:E-T} for $d=2$, or equivalently, Szemer\'edi-Trotter's theorem in \cite{szemeredi1983extremal}.

We now give the detailed proof.

\begin{proof}[Proof of \cref{thm:4d}] Assume $I\geq C_4(mn^{2/3}+nm^{3/5})$ for some big constant $C_4$ chosen later, but the incidence graph $G(H}{\mathcal{H}{S}, H}{\mathcal{H}{H})$ with $I$ edges contains no $K_{r,s}$ of size $rs\gtrsim \left(\frac{I}{mn}\right)^{5/2} mn(\log mn)^{-4}$. We follow several steps to derive a contradiction.
\\
\\
\noindent \textbf{Step 1:} We can assume each hyperplane is $\frac{I}{4n}$-rich and $\beta$-degenerate with respect to $H}{\mathcal{H}{S}$ for some $\beta>0$.

Indeed,
remove all the hyperplanes that contain fewer than $\frac{I}{4n}$ points and the hyperplanes that is $\beta$-nondegenerate. The number of incidences from the non-rich hyperplanes is at most $n\frac{I}{4n}=\frac{I}{4}$. By \cref{thm:E-T}, the number of incidences from the $\beta$-nondegenerate hyperplanes  is at most $C_{\beta,4}((mn)^{4/5}+mn^{2/3})<\frac{C_4}{4}(mn^{2/3}+nm^{3/5})$ for big enough $C_4$. Indeed, this only fails if $(mn)^{4/5}\gtrsim  mn^{2/3}$ and $(mn)^{4/5}\gtrsim nm^{3/5}$, which is equivalent to $m\lesssim n^{2/3}$ and $n\lesssim m$, but they cannot happen at the same time for appropriate choices of constants. Therefore, after the removal, there remains at least $\frac{I}{2}$ incidences left. Assume there are $n_1$ hyperplanes left, where $n_1\leq n$. In fact, throughout the proof, we always use $n$ to upper bound $n_1$, so we can simply assume $n_1=n$.
\\
\\
\noindent \textbf{Step 2:}
For each $\frac{I}{4n}$-rich $\beta$-degerenate hyperplane $H$, we can find a plane $P\subset H$ so that $|P|\geq \beta|H|\geq \frac{\beta I}{4n}$. Let $H}{\mathcal{H}{P}$ denote the set of these planes. We claim that no plane in $H}{\mathcal{H}{P}$ belongs to more than $s_0$ hyperplanes in $H}{\mathcal{H}{H}$ where
\begin{equation}\label{eq:s}
s_0:=\frac{c_1 I^{3/2}}{m^{3/2}n^{1/2}(\log mn)^4}\end{equation}

Indeed, assume there are $\frac{c_1I^{3/2}}{m^{3/2}n^{1/2}(\log mn)^4}$ hyperplanes that degenerate to a same plane for some constant $c_1$, then we have a configuration of $K_{r,s}$ where $$rs\geq \frac{\beta I}{4n}\cdot\frac{c_1I^{3/2}}{m^{3/2}n^{1/2}(\log mn)^4}\geq C'\left(\frac{I}{mn}\right)^{5/2} mn(\log mn)^{-4}$$
if we choose $C'<\frac{\beta c_1}{4}$. Contradiction.
\\
\\
\noindent \textbf{Step 3:} We use a dyadic decomposition to find a subset of planes with lots of incidences with $H}{\mathcal{H}{S}$.
Let $H}{\mathcal{H}{P}_j$  denote the set of all planes that is assigned to at least $2^j$ and at most $2^{j+1}$ hyperplanes where $j<\log s_0<\log n$ (here the logarithm is in base 2). We claim that there exists some $i$ such that
\begin{equation}\label{eq:I'}
    I':=I(H}{\mathcal{H}{S},H}{\mathcal{H}{P}_i)> 4C_{\beta,3} (|H}{\mathcal{H}{P}_i||H}{\mathcal{H}{S}|)^{3/4}+|H}{\mathcal{H}{P}_i||H}{\mathcal{H}{S}|^{1/2}
\end{equation} where $\beta$ is the same as before, and $C_{\beta,3}$ is defined in \cref{thm:E-T}.

Indeed, first notice that the contribution to incidences from the planes must be at least $\beta$-fraction the number of incidences from the $\beta$-degenerate hyperplanes, which implies
$\sum_{j=0}^{\log s_0} 2^{j+1} I(H}{\mathcal{H}{S},H}{\mathcal{H}{P}_j)\geq \frac{\beta}{4}I.$
Hence there must exist some $i$ such that
$$
2^{i_0+1}I(H}{\mathcal{H}{S},H}{\mathcal{H}{P}_{i})\geq \frac{\beta I}{4\log s_0}.
$$
On the other hand, since each hyperplane is assigned to exactly one plane, we have
 $\sum_{j=0}^{\log s_0} 2^{j} |H}{\mathcal{H}{P}_j|\leq n_2\leq n.$

 As a consequence, $|P_i|\leq \frac{n}{2^i}$.
From \eqref{eq:s}, we have $2^i\leq s_0\leq \frac{c_1 I^{3/2}}{m^{3/2}n^{1/2}(\log mn)^4}$. Assume \eqref{eq:I'} fails, then
\begin{align*}
\frac{\beta I}{4\log s_0} & \leq 2^{i+1} I'\\
&\leq 2^{i+1} 4C_{\beta,3} \left(|H}{\mathcal{H}{P}_i||H}{\mathcal{H}{S}|)^{3/4}+|H}{\mathcal{H}{P}_i||H}{\mathcal{H}{S}|^{1/2}\right) \\
& \leq 8C_{\beta,3} 2^{i}\left(\left(\frac{nm}{2^i}\right)^{3/4}+\frac{n}{2^i}m^{1/2}\right) \\ & \leq 8C_{\beta,3}\left((mn)^{3/4} \left(\frac{c_1 I^{3/2}}{m^{3/2}n^{1/2}(\log mn)^4}\right)^{1/4}+ nm^{1/2}\right)
\end{align*}
Since $I\geq Cnm^{3/5}\gg nm^{1/2}\log s_0$, the first term in the right hand side must be at least $\frac{\beta I}{8\log s_0}$. Rearranging we get
$$I^{5/8}\leq c_3 m^{3/8}n^{5/8}\frac{\log s_0}{\log mn}$$
where $c_3$ depends on $\beta, C_{\beta,3}$ and $c_1$. However, we can choose $\beta$ and $c_1$ small enough and $C_4$ big enough so that $c_3^{8/5}<C_4$ and hence this contradicts with $I\geq C_4 nm^{3/5}$. So \eqref{eq:I'}
must hold.
\\
\\
\noindent\textbf{Step 4:} Since the bound in \eqref{eq:I'} is the same with that in \cref{cor:dual E-T}, we can use a similar argument with Step 1 to assume each point in $S$ is $\frac{I'}{4m}$-rich (i.e. belongs to at least $\frac{I'}{4m}$ planes in $H}{\mathcal{H}{P}_i$), and is $\beta$-degenerate w.r.t. $H}{\mathcal{H}{P}_i$ (in the sense defined before \cref{cor:dual E-T}. Each such point degenerates to a line that is $\beta\frac{I'}{4m}$-rich. Let $H}{\mathcal{H}{L}$ denote the set of all these lines. We claim that no line in $H}{\mathcal{H}{L}$ contains more than $r_0$ points where

\begin{equation}\label{eq:r}
r_0:=\frac{c_5 I^{3/2}}{m^{1/2}n^{3/2}(\log mn)^3}
\end{equation}

Indeed, each line in $H}{\mathcal{H}{L}$ belongs to at least $\frac{\beta I'}{4m}$ planes in $H}{\mathcal{H}{P}_i$,  and thus belongs to at least $\frac{\beta I'2^i}{4m}\geq \frac{\beta I}{4m\log s_0}$  hyperplanes in $H}{\mathcal{H}{H}$ because each plane in $H}{\mathcal{H}{P}_i$ belongs to at least $2^i$ hyperplanes.
If there are $\frac{c_5 I^{3/2}}{m^{1/2}n^{3/2}(\log mn)^3}$ points that degenerates (or belongs) to a same line for some constant $c_5$, then we have a configuration of $K_{r,s}$ where
$$rs\geq \frac{\beta I}{4m\log s_0}\cdot\frac{c_5 I^{3/2}}{m^{1/2}n^{3/2}(\log mn)^3}\geq C'_4\left(\frac{I}{mn}\right)^{5/2} mn(\log mn)^{-4}$$
for small enough $C'_4$. Contradiction.
\\
\\
\noindent\textbf{Step 5:} Similar to Step 3, we use a dyadic decomposition to find a subset of lines in $H}{\mathcal{H}{L}$ that has many incidences with $H}{\mathcal{H}{P}$. Here we say a line $\ell$ is incident to a plane $P$ if $\ell\subset P$.
Let $H}{\mathcal{H}{L}_k$  denote the set of all lines that contain at least $2^k$ and at most $2^{k+1}$ points where $k<\log r_0<\log m$. Note that here for a line we only consider the points that degenerate to that line. We claim there must exist some $j$ such that
\begin{equation}\label{eq:I''}
    I'':=I(H}{\mathcal{H}{L}_j,H}{\mathcal{H}{P}_i)\geq C_{\beta, 2}\left( |H}{\mathcal{H}{P}_i|^{2/3}|H}{\mathcal{H}{L}_j|^{2/3}+|H}{\mathcal{H}{P}_i|+|H}{\mathcal{H}{L}_j|\right)
\end{equation}

Indeed, first notice that the contribution to incidences from the lines must be at least $\beta$-fraction, which implies
$\sum_{k=0}^{\log r_0} 2^{k+1} I(H}{\mathcal{H}{L}_k,H}{\mathcal{H}{P}_i)\geq \frac{\beta}{4}I'.$
Hence there must exist some $j$ such that
$$2^{j+1}I(H}{\mathcal{H}{L}_j,H}{\mathcal{H}{P}_i)\geq \frac{\beta I'}{4\log r_0 }\geq \frac{\beta^2 I}{16\log s_0\log r_0 2^{i}}.
$$
On the other hand, since each point is assigned to exactly one line  we have
$ \sum_{k=0}^{\log r_0} 2^{k} |H}{\mathcal{H}{L}_k|\leq m.$ As a consequence, $|H}{\mathcal{H}{L}_j|\leq\frac{m}{2^j}$. From \eqref{eq:r}, $2^j\leq r_0\leq \frac{c_5 I^{3/2}}{m^{1/2}n^{3/2}(\log mn)^3}$. Recall $|H}{\mathcal{H}{P}_i|\leq\frac{n}{2^i}$ and $2^i\leq s_0$. Assume \eqref{eq:I''} fails, then there exists some constant $c_6$ such that

\begin{align*}
I & \leq 32\beta^{-1}(\log r_0\log s_0) 2^{i+j}I(P_i, S_j)\\
& \leq c_6 (\log m\log n)\left( (s_0 r_0)^{1/3}(mn)^{2/3}+nr_0+ ms_0\right)\\
&\leq c_6(\log m\log n)\left( (mn)^{2/3}\left(\frac{c_1 I^{3/2}}{m^{3/2}n^{1/2}(\log mn)^4}\frac{c_5 I^{3/2}}{m^{1/2}n^{3/2}(\log mn)^3}\right)^{1/3}+m \frac{c_1 I^{3/2}}{m^{3/2}n^{1/2}(\log mn)^4}+n\frac{c_5 I^{3/2}}{m^{1/2}n^{3/2}(\log mn)^3}\right)\\
&\leq I\left[\frac{c_1c_5c_6\log m\log n}{(\log mn)^7}+\left(\frac{I}{mn}\right)^{1/2}\left(\frac{c_1\log m\log n}{(\log mn)^4}+\frac{c_5\log m\log n}{(\log mn)^3}\right)\right]\\
&\ll I.
\end{align*}
This contradiction implies \eqref{eq:I''} must hold.
\\
\\
\textbf{Step 6:} We claim that \eqref{eq:I''} violates \cref{thm:E-T} in two dimensions, or Szemer\'edi-Trotter's theorem.

Indeed, project the set of planes $H}{\mathcal{H}{P}_i$ and the set of lines $H}{\mathcal{H}{L}_j$ to a generic three dimensional subspace, then intersect them with  generic plane $\Pi$ within this subspace. After this transformation, $H}{\mathcal{H}{P}_i$ becomes a set of lines $P^*$ and  $H}{\mathcal{H}{L}_j$ becomes a set of points $L^*$ in $\Pi$. We have $I(P^*, L^*)=I(H}{\mathcal{H}{L}_j,H}{\mathcal{H}{P}_i)\gtrsim |P^*|^{2/3}|L^*|^{2/3}+|P^*|+|L^*|$. This violation finishes our proof.
 \end{proof}

\section{Sketch of proof in five dimensions}

The proof method is the same with that in four dimensions, but the exponents are different and the method is repeated one more time.
In particular, we unwrap in three layers: hyperplanes degenerate to 3-flats, points degenerate to lines, and 3-flats degenerate to planes. At each layer, either we can find a big $K_{r,s}$, or the number of incidences remain larger than the nondegenerate bound in \cref{thm:E-T}, and we can keep unwrapping. The detailed proof  is quite similar to that in the four dimensions case, so we only give an outline here. For simplicity, we ignore all the constants and logarithmic factors.

\begin{proof}[Proof's sketch of \cref{thm:5d}] Prove by contradiction. Let $H}{\mathcal{H}{S}$ denote the set of $m$ points and $H}{\mathcal{H}{H}$ denote the set of $n$ hyperplanes in $\mathbb{R}^5$.
Assume $I(H}{\mathcal{H}{S},H}{\mathcal{H}{H})\geq C_5(mn^{3/4}+nm^{2/3})$ but their incidence graph does not contain any $K_{rs}$ where $rs\gtrsim \left(\frac{I}{mn}\right)^3 mn(\log mn)^{-10}$.

\begin{itemize}
\item[Step 1] We can assume every hyperplane is $\frac{I}{n}$-rich, and $\beta$-degenerate with respect to $H}{\mathcal{H}{S}$ for some $\beta>0$.
\item[Step 2] For each such hyperplane $H$, we can find a 3-dimensional flat (or a 3-flat) $F$ such that $F\subset H$ and $|F\cap H}{\mathcal{H}{S}|\geq \beta|H\cap H}{\mathcal{H}{S}|\geq\frac{\beta I}{n}$. Let $H}{\mathcal{H}{F}$ denote the set of these 3-flats. We show that no flat in $H}{\mathcal{H}{F}$
belong to more than $s_0$ hyperplanes where $s_0\lesssim \frac{I^2}{m^2 n}$.

\item[Step 3] Let $H}{\mathcal{H}{F}_j$ denote the set of all 3-flats in $H}{\mathcal{H}{F}$ that is assigned to at least $2^j$ and at most $2^{j+1}$ hyperplanes where $j\leq \log s_0<\log n$. We show that there exists an $i$ such that
$$I':=I(H}{\mathcal{H}{F}_i, H}{\mathcal{H}{S})\gtrsim (|H}{\mathcal{H}{F}_i||H}{\mathcal{H}{S}|)^{4/5}+|H}{\mathcal{H}{F}_i||H}{\mathcal{H}{S}|^{2/3}.$$
Indeed, assume otherwise. Using $I'\gtrsim 2^i I$, $|H}{\mathcal{H}{F}_i|\leq \frac{n}{2^i}$ and $2^i\leq s_0\lesssim \frac{I^2}{m^2n}$, we have
$$I\lesssim 2^i I'\lesssim  2^i\left[\left(\frac{nm}{2^i}\right)^{4/5}+\frac{n}{2^i}m^{2/3}\right]
\lesssim (mn)^{4/5}\left(\frac{I^2}{m^2n}\right)^{1/5}+nm^{2/3}$$
which cannot happen given our condition $I\gtrsim mn^{3/4}+nm^{2/3}$.
\item[Step 4] Since $I'$ is large, using \cref{cor:dual E-T}, we can assume each point in $H}{\mathcal{H}{S}$ is $\frac{I'}{m}$-rich (i.e. belongs to at least $\frac{I'}{m}$ flats in $H}{\mathcal{H}{F}_i$, and is $\beta$-degenerate w.r.t. $H}{\mathcal{H}{F}_i$.
Each such point degenerates to a $\frac{\beta I'}{m}$-rich line. Let $H}{\mathcal{H}{L}$ denote that set of these lines. Then no line in $H}{\mathcal{H}{L}$ can contain more than $r_0$ points where $r_0\lesssim \frac{I^2}{mn^2}$.
\item [Step 5] We use a dyadic decomposition to find a subset of lines with many incidences with $H}{\mathcal{H}{F}_i$. Let $H}{\mathcal{H}{L}_k$ denote the set of all lines in $H}{\mathcal{H}{L}$ that contain more than $2^k$ and fewer than $2^{k+1}$ points. Then
there exists a $j$ such that
$$I'':=I(H}{\mathcal{H}{F}_i, H}{\mathcal{H}{L}_j)\gtrsim |H}{\mathcal{H}{F}_i|^{3/4}|H}{\mathcal{H}{L}_j|^{3/4}+|H}{\mathcal{H}{F}_i||H}{\mathcal{H}{L}_j|^{1/2}.$$
Indeed, assume otherwise. Using $I''\gtrsim I' /2^j\gtrsim I /2^{i+j}$ $|H}{\mathcal{H}{F}_i|\leq\frac{n}{2^i}$, $|H}{\mathcal{H}{L}_j|\leq\frac{m}{2^j}$, $2^i\leq s_0\lesssim \frac{I^2}{m^2n}$ and $2^j\leq r_0\lesssim\frac{I^2}{mn^2}$, we have
$$I\lesssim 2^{i+j} I''\lesssim 2^{i+j}\left[\left(\frac{mn}{2^{i+j}}\right)^{3/4}+\frac{n}{2^i}\left(\frac{m}{2^j}\right)^{1/2}\right]\lesssim (mn)^{3/4} \left(\frac{I^2}{m^2n}\frac{I^2}{mn^2}\right)^{1/4}+nm^{1/2}\left(\frac{I^2}{mn^2}\right)^{1/2}=2I$$
This cannot happen with an appropriate choice of constants and logarithmic factors.
\item [Step 6] Turn $I(H}{\mathcal{H}{F}_i, H}{\mathcal{H}{L}_j)$ into point-plane incidences in $\mathbb{R}^3$ by some transformation.  This means we can assume each 3-flats in $H}{\mathcal{H}{F}_i$ degenerate to a plane. Let $H}{\mathcal{H}{P}$ denote the set of all such planes. Then no plane belongs to more than $t_0$ flats in $H}{\mathcal{H}{F}_i$ where $t_0\lesssim \frac{I^2}{m^2n}$
\item[Step 7] Using a dyadic decomposition, there exists some subset $H}{\mathcal{H}{P}_k$ of planes, each belongs to at least $2^k$ and at most $2^{k+1}$ planes in $H}{\mathcal{H}{F}_i$ such that
$I''':=I(H}{\mathcal{H}{L}_j,H}{\mathcal{H}{P}_k)\gtrsim |H}{\mathcal{H}{P}_k|^{2/3}|L_j|^{2/3}+|H}{\mathcal{H}{P}_k|+|H}{\mathcal{H}{L}_j|.$
\item[Step 8] Turn $I'''$ into point-line incidences, which leads to a violation with Szemer\'edi-Trotter's theorem. This finishes our proof.
\end{itemize}
\end{proof}
\begin{remark}
Our argument does not work in six dimensions and higher because when we write down the details of step 5 in the above outline, the exponents no longer match and we do not get a contradiction.
\end{remark}

\bibliographystyle{abbrv}


Weighted de Bruijn Graphs for the Menage Problem and Its Generalizations

Abstract: We address the problem of enumeration of seating arrangements of married couples around a circular table such that no spouses sit next to each other and no k consecutive persons are of the same gender. While the case of k=2 corresponds to the classical problème des ménages with a well-studied solution, no closed-form expression for the number of seating arrangements is known when k>=3.We propose a novel approach for this type of problems based on enumeration of walks in certain algebraically weighted de Bruijn graphs. Our approach leads to new expressions for the menage numbers and their exponential generating function and allows one to efficiently compute the number of seating arrangements in general cases, which we illustrate in detail for the ternary case of k=3.

\section{Introduction}

The famous \emph{menage problem} (\emph{probl\`eme des m\'enages}) asks for the number $M_n$ of seating arrangements of $n$ married couples of opposite sex around a circular table
such that
\begin{enumerate}
\item no spouses sit next to each other;
\item females and males alternate.
\end{enumerate}
The problem was formulated by Edouard Lucas in 1891~\cite{Lucas1891}. A complete solution was first obtained by Touchard in 1934~\cite{Touchard1934}.

Let us call a couple seating next to each other \emph{close}.
The restriction of the menage problem can be equivalently stated as
\begin{enumerate}
\item there are no close couples;
\item no $k=2$ consecutive people are of the same sex.
\end{enumerate}
This reformulation allows us to generalize the menage problem to other values of $k$, such as $k=3$ which we refer to as the \emph{ternary menage problem}.
The ternary menage problem was posed by Hugo Pfoertner in 2006 as the sequence \texttt{A114939} in the OEIS~\cite{OEIS}, for which he then managed to correctly compute only the first three terms.

In this work, we propose a novel approach for the generalized menage problem based on the transfer-matrix method~\cite[Section 4.7]{Stanley1997} applied to certain algebraically weighted de Bruijn graphs.
We illustrate our approach on the classical case $k=2$, where we obtain new formulae for the menage numbers $M_n$ and their exponential generating function (EGF).
While an explicit expression (in terms of the modified Bessel functions) for the EGF was earlier derived by Wyman and Moser~\cite{Wyman1958},
they admitted it be ``quite complicated''. In contrast, our expression (and its derivation) is much simpler and can be stated in terms of a certain power series or the exponential integral function.
We further apply our approach for the ternary case $k=3$, which apparently has not been addressed in the literature before.
While the resulting formulae in this case are not that simple, they provide an efficient method for computing the corresponding number of seating arrangements,
which we used to compute many new terms for \texttt{A114939} and related sequences in the OEIS.

\section{Classical Approaches for Menage Problem}\label{Sec:AppMen}

To the best of our knowledge, there exist three major approaches for solving the menage problem, which we briefly discuss below.

\paragraph*{Ladies First.}
A straightforward approach to the menage problem is first to seat all ladies (in $2\cdot n!$ ways) and then to seat all gentlemen, obeying the close couple restriction.
This way the problem reduces to enumerating placements of
non-attacking rooks on a square board like the one shown in Fig.~\ref{Fig:Board}.
Using the rook theory~\cite[Section 2.3]{Stanley1997}, this leads to the \emph{Touchard formula}:
\begin{equation}\label{eq:Touchard}
M_n = 2 \cdot n!\cdot \sum_{k=0}^n (-1)^k \frac{2n}{2n-k} {2n-k\choose k} (n-k)!\,.
\end{equation}

\begin{figure}[t]
\begin{center}
\begin{picture}(80,80)
\thicklines
\multiput(0,0)(10,0){9}{\line(0,1){80}}
\multiput(0,0)(0,10){9}{\line(1,0){80}}
\thinlines
\multiput(0,0)(2,0){5}{\line(0,1){20}}
\multiput(10,10)(2,0){5}{\line(0,1){20}}
\multiput(20,20)(2,0){5}{\line(0,1){20}}
\multiput(30,30)(2,0){5}{\line(0,1){20}}
\multiput(40,40)(2,0){5}{\line(0,1){20}}
\multiput(50,50)(2,0){5}{\line(0,1){20}}
\multiput(60,60)(2,0){5}{\line(0,1){20}}
\multiput(70,70)(2,0){5}{\line(0,1){10}}
\multiput(70,00)(2,0){5}{\line(0,1){10}}
\end{picture}
\end{center}
\caption{A board corresponding to the menage problem with $n=8$ couples.
For a fixed seating arrangement of ladies, the seating arrangements of gentlemen are in one-to-one correspondence with the placements of $n$ non-attacking rooks at non-shaded cells.}
\label{Fig:Board}
\end{figure}

\paragraph*{Hamiltonian Cycles in Crown Graphs.}
The seating arrangements satisfying the menage problem
correspond to directed Hamiltonian cycles in the \emph{crown graph} on $2n$ vertices
obtained from the complete bipartite graph $K_{n,n}$ with removal of a perfect matching.
Here males/females represent the partite sets of $K_{n,n}$ with every male vertex connected to every female vertex, except for the spouses (corresponding to
the removed perfect matching).
For odd integers $n$, crown graphs on $2n$ vertices represent circulant graphs, where Hamiltonian cycles can be systematically enumerated~\cite{Golin2005}.

\paragraph*{Non-Sexist Inclusion-Exclusion.}
Bogart and Doyle~\cite{Bogart1986} suggested to compute $M_n$ with the inclusion-exclusion principle (e.g., see \cite[Section 2.1]{Stanley1997})
as the number of alternating male-female seating arrangements that have no close couples.
To do so, they computed the number $W_{n,j}$ of alternating male-female seating arrangements of $n$ couples with $j$ fixed couples being close as
\begin{equation}\label{eq:Wnj}
W_{n,j} = 2\cdot \frac{2n}{2n-j}\binom{2n-j}{j}\cdot j!\cdot (n-j)!^2\,,
\end{equation}
where:
\begin{itemize}
\item the factor $2$ accounts for two ways to reserve alternating seats for males and females;
\item $\frac{2n}{2n-j}\binom{2n-j}{j}$ is the number of ways to select $2j$ seats for the $j$ close couples;
\item $j!$ is the number of seating arrangements of the $j$ close couples at the $2j$ selected seats;
\item $(n-j)!^2 = (n-j)!\cdot (n-j)!$ is the number of ways to seat females and males from the other $n-j$ couples.
\end{itemize}
The inclusion-exclusion principle then implies that
\begin{equation}\label{eq:Mn1}
\begin{split}
M_n &= \sum_{j=0}^n (-1)^j\cdot \binom{n}{j}\cdot W_{n,j} \\
&= 2\cdot \sum_{j=0}^n (-1)^j\cdot \binom{n}{j}\cdot \frac{2n}{2n-j}\binom{2n-j}{j}\cdot j!\cdot (n-j)!^2\,,
\end{split}
\end{equation}
which trivially simplifies to \eqref{eq:Touchard}.

The aforementioned approaches for the menage problem
do not seem to easily extend to the ternary case,
since there is no nice male-female alternating structure anymore. In particular, the ladies-first approach does not reduce the problem to a uniform board
and there is no obvious reduction to a Hamiltonian cycle problem.
The (non-sexist) inclusion-exclusion approach is most prominent, but it is unclear what should be in place of $\frac{2n}{2n-j}\binom{2n-j}{j}$.
In order to generalize the solution to the menage problem to the ternary case, we suggest to look at this problem at a different angle as described below.

\section{De Bruijn Graph Approach for Menage Problem}

So far, a seating arrangement in the menage problem was viewed as a cyclic (clockwise) sequence of females ($f_i$) and males ($m_j$):
$$f_{i_1} \to m_{j_1} \to f_{i_2} \to m_{j_2} \to \dots \to f_{i_n} \to m_{j_n} \to f_{i_1}\,.$$
However, it can also be viewed as a cyclic sequence of \emph{pairs} of people sitting next to each other:
$$(f_{i_1},m_{j_1}) \to (m_{j_1},f_{i_2}) \to (f_{i_2},m_{j_2}) \to \dots \to (f_{i_n},m_{j_n}) \to (m_{j_n},f_{i_1}) \to (f_{i_1},m_{j_1})\,.$$

A similar idea was used by Nicolaas de Bruijn~\cite{deBruijn1946} to construct a shortest sequence, which contains every subsequence of length $\ell$ (called \emph{$\ell$-mer}) over a given alphabet.
He introduced directed graphs, now named after him, whose nodes represent $(\ell-1)$-mers and arcs represent $\ell$-mers
(the arc corresponding to an $\ell$-mer $s$ connects the prefix of $s$ with the suffix of $s$).

We employ de Bruijn graphs for $\ell=3$ for solving the menage problem. However, in contrast to conventional \emph{unweighted} de Bruijn graphs,
we introduce algebraic weights to account for (i) the balance between females and males; and (ii) the number of close couples.

\begin{figure}[t]
\begin{center}
\begin{tabular}{ccc}
\begin{tabular}{c}
\begin{tikzpicture}[->,>=stealth',auto,node distance=3cm,semithick]

  \node[state] (fm)                    {$fm$};
  \node[state] (MF) [below of=fm] {$mf^{\star}$};
  \node[state] (mf) [right of=fm] {$mf$};
  \node[state] (FM) [below of=mf] {$fm^{\star}$};

  \path (fm) edge [bend left] node {$y^{-1}$} (mf)
        (mf) edge [bend left] node[swap] {$y$} (fm)
        (fm) edge [bend left] node {$y^{-1}z$} (MF)
        (mf) edge [bend left] node {$yz$} (FM)
        (MF) edge [bend left] node[swap] {$y$} (fm)
        (FM) edge [bend left] node[swap] {$y^{-1}$} (mf);
\end{tikzpicture}
\end{tabular}
&
\qquad
&
$
A = \begin{bmatrix}
0 & y^{-1} & y^{-1}z & 0\\
y & 0 & 0 & yz\\
y & 0 & 0 & 0\\
0 & y^{-1} & 0 & 0
\end{bmatrix}
$
\end{tabular}
\end{center}
\caption{The weighted de Bruijn graph for the menage problem and its adjacency matrix $A$.}
\label{fig:deBMen}
\end{figure}

The (weighted) de Bruijn graph for the menage problem and its adjacency matrix $A$ are shown in Fig.~\ref{fig:deBMen}.
This graph has $4$ nodes labeled $fm$ (for clockwise adjacent female--male pair), $mf$ (clockwise adjacent male--female pair), and their starred variants indicating close couples.
There is an arc connecting every pair of nodes $uv$ and $vw$ (at most one of which may be starred) for $u,v,w\in\{f,m\}$.
Each such arc has an algebraic weight $y^pz^q$ with $p=\pm 1$ and $q\in\{0,1\}$ such that the degree of indeterminate $y$ accounts for the males-females balance,
while the degree of indeterminate $z$ accounts for the number of close couples. Namely, $p=1$ whenever $w=m$ (and $p=-1$ whenever $w=f$), while $q=1$ whenever $vw$ is starred.

Any seating arrangement corresponds to a cyclic sequence of nodes $fm$ and $mf$, some of which may be starred to indicate close couples.
Such sequence with $j$ close couples corresponds to a walk of length $2n$ and algebraic weight $y^0z^j$.
The transfer-matrix method~\cite[Section 4.7]{Stanley1997} implies that the number of such walks equals $[y^0z^j]\ \tr(A^{2n})$, i.e., the coefficient of $y^0z^j$ in the trace of matrix $A^{2n}$.
This leads to a new formula for $W_{n,j}$:
$$
W_{n,j} = [y^0z^j]\ \tr(A^{2n})\cdot j!\cdot (n-j)!^2\,,
$$
where the factors $j!$ and $(n-j)!^2$ bear the same meaning as in \eqref{eq:Wnj}.
Similarly to \eqref{eq:Mn1}, we then obtain
\begin{equation}\label{eq:Mnmatrix}
M_n = n!\cdot \sum_{j=0}^n (-1)^j\cdot (n-j)!\cdot [y^0z^j]\ \tr(A^{2n})\,.
\end{equation}
Comparison of \eqref{eq:Mnmatrix} and \eqref{eq:Touchard} suggests the following identity, which we will prove explicitly:
\begin{lemma}\label{th:Ay0zj}
For the matrix $A$ defined in Fig.~\ref{fig:deBMen} and any integers $n>1$, $j\geq 0$,
$$[y^0 z^j]\ \tr(A^{2n}) = 2\cdot \frac{2n}{2n-j}\cdot \binom{2n-j}{j}\,.$$
\end{lemma}
\begin{proof}
The eigenvalues of $A$ are $\frac{1\pm\sqrt{1+4z}}{2}$, each of multiplicity 2.\footnote{We remark that $A^2$ does not depend on $y$,
so it is not surprising that the eigenvalues of $A$ do not depend on $y$ either.}
It follows that
$$[y^0 z^j]\ \tr(A^{2n}) = 2\cdot [z^j]\ \left( \left(\frac{1+\sqrt{1+4z}}{2}\right)^{2n} + \left(\frac{1-\sqrt{1+4z}}{2}\right)^{2n} \right)\,.$$
We further remark that $\frac{1-\sqrt{1+4z}}{2} = -zC(-z)$ and $\frac{1+\sqrt{1+4z}}{2} =C(-z)^{-1}$,
where $C(x) = \frac{1-\sqrt{1-4x}}{2x}$ is the ordinary generating function for Catalan numbers.

Since $j\leq n$ and $n>1$, we have $[z^j]\ (-zC(-z))^{2n} = 0$. On the other hand, since  $[x^k]\ C(x)^m = \frac{m}{2k+m}\binom{2k+m}{m}$ (e.g., see~\cite[formula (5.70)]{Graham1994}),
we have
\[
\begin{split}
[z^j]\ C(-z)^{-2n} &= (-1)^j\frac{-2n}{2j-2n}\binom{2j-2n}{j} = \frac{2n}{2n-2j}\binom{2n-j-1}{j} \\
& = \frac{2n}{2n-2j}\binom{2n-j-1}{2n-2j-1} = \frac{2n}{2n-j}\binom{2n-j}{j},
\end{split}
\]
which concludes the proof.
\qed
\end{proof}

Lemma~\ref{th:Ay0zj} proves that our formula \eqref{eq:Mnmatrix} implies the Touchard formula \eqref{eq:Touchard}.
In the next section, we show that it also implies another (apparently new) formula for $M_n$.
But most importantly, the matrix formula~\eqref{eq:Mnmatrix} can be generalized for the ternary menage problem as we show in Section~\ref{sec:DeBter}.

\section{New Formulae for Menage Numbers and Their EGF}

We find it convenient to define the \emph{series Laplace transform} $\L_{x,y}$ of a function $f(x)$ as the conventional Laplace transform of $f(yt)$ (as a function of $t$) evaluated at $1$, i.e.,
$$\L_{x,y}[f] = \int_0^\infty f(yt)\cdot e^{-t}\cdot dt.$$
It can be easily seen that $\L_{x,y}[x^k] = k!\cdot y^k$ for any integer $k\geq 0$ and thus for a power series $f(x)$, we have
$$\L_{x,y}[f] = \sum_{k=0}^{\infty} k!\cdot y^k\cdot [x^k]\ f(x).$$
In particular,
$$\sum_{k=0}^{\infty} k!\cdot [x^k]\ f(x) = \L_{x,1}[f] = \int_0^\infty f(t)\cdot e^{-t}\cdot dt.$$

\begin{lemma}\label{lem:laplace}
Let $U,V$ be same-size square matrices that do not depend on indeterminate $z$. Then for any integer $n\geq 0$,
$$\sum_{j=0}^n (-1)^j\cdot (n-j)!\cdot [z^j]\ \tr((U+V\cdot z)^n)
= \int_0^\infty \tr((U\cdot t - V)^n)\cdot e^{-t}\cdot dt\,.$$
\end{lemma}
\begin{proof}
We have
$$[z^j]\ \tr((U+V\cdot z)^n) = [z^{n-j}]\ \tr((U\cdot z+V)^n) = (-1)^j\cdot [z^{n-j}]\ \tr((U\cdot z-V)^n)\,.$$
Hence
\[
\begin{split}
\sum_{j=0}^n (-1)^j\cdot (n-j)!\cdot [z^j]\ \tr((U+V\cdot z)^n) &= \sum_{j=0}^n (n-j)!\cdot [z^{n-j}]\ \tr((U\cdot z-V)^n)\\
& = \L_{z,1}[\tr((U\cdot z-V)^n)]\,,
\end{split}
\]
which concludes the proof.
\qed
\end{proof}

We are now ready to derive new closed-form expressions for the menage numbers $M_n$ and their exponential generating function.

\begin{theorem}\label{th:Mn}
For all integers $n>1$,
\begin{equation}\label{eq:Mnint}
M_n = 2\cdot n!\cdot \int_0^{\infty}  \left(  \left( \frac{t-2+\sqrt{t^2-4t}}{2} \right)^n + \left( \frac{t-2-\sqrt{t^2-4t}}{2} \right)^n \right)\cdot e^{-t}\cdot dt\,.
\end{equation}
Furthermore,
\begin{align}
\sum_{n=0}^{\infty} M_n \frac{x^n}{n!} &= -1 - 2x + 2\cdot \int_0^\infty \frac{x^2-1}{xt - (x+1)^2}\cdot e^{-t}\cdot dt\label{eq:gfint}\\
&= -1 + 2x + 2\cdot\frac{1-x}{1+x}\cdot \sum_{k=0}^{\infty} \frac{k!\cdot x^k}{(1+x)^{2k}}  \label{eq:gfser}\\
&= -1 + 2x + 2\cdot\frac{1-x^2}{x}\cdot e^{-\frac{(x+1)^2}x}\cdot \Ei\left(\frac{(x+1)^2}{x}\right)\,,  \label{eq:gfEi}
\end{align}
where $\Ei(t)$ is the exponential integral.
\end{theorem}

\begin{proof} For the matrix $A$ defined in Fig.~\ref{fig:deBMen}, we have $A^2 = U + V\cdot z$, where
$$
U = \begin{bmatrix}
 1&0&0&0\\
 0&1&0&0\\
 0&1&0&0\\
 1&0&0&0
 \end{bmatrix}
\quad\text{and}\quad
V = \begin{bmatrix}
 1&0&0&1\\
 0&1&1&0\\
 0&0&1&0\\
 0&0&0&1
 \end{bmatrix}\,.
$$
Then Lemma~\ref{lem:laplace} and formula~\eqref{eq:Mnmatrix} imply
$$M_n = n!\cdot \int_0^\infty \tr((U\cdot t - V)^n)\cdot e^{-t}\cdot dt\,.$$
Since the eigenvalues of the matrix $U\cdot t - V$ are $\frac{t-2\pm\sqrt{t^2-4t}}{2}$, each of multiplicity 2, we obtain formula \eqref{eq:Mnint}.

To derive \eqref{eq:gfint} from \eqref{eq:Mnint}, we notice that
$$\sum_{n=0}^{\infty} \left( \left( \frac{t-2+\sqrt{t^2-4t}}{2} \right)^n + \left( \frac{t-2-\sqrt{t^2-4t}}{2} \right)^n\right)\cdot x^n = 1+\frac{x^2-1}{xt - (x+1)^2}$$
and take special care of the initial values $M_0=1$ and $M_1=0$.
Expanding the last expression as a power series in $t$, we get
$$\frac{x^2-1}{xt - (x+1)^2} = \frac{1-x}{1+x}\cdot \frac{1}{1-\frac{x}{(x+1)^2}t} = \frac{1-x}{1+x}\cdot \sum_{k=0}^{\infty} \frac{x^k}{(x+1)^{2k}}\cdot t^k.$$
Applying the series Laplace transform $\L_{t,1}$, we obtain \eqref{eq:gfser}.
Expression \eqref{eq:gfEi} now follows from \eqref{eq:gfser}, since $\sum_{k=0}^{\infty} k!\cdot y^k = \frac{e^{-1/y}}{y}\cdot \Ei\left(\frac{1}{y}\right)$ (e.g., see~\cite[formula (1.1.7)]{Bleistein2010}).
\qed
\end{proof}

\section{De Bruijn Graph Approach for Ternary Menage Problem}\label{sec:DeBter}

In contrast to the menage problem, in the ternary case two females or two males can sit next to each other.
Hence, the de Bruijn graph in this case can be obtained from
the de Bruijn graph for the menage problem by adding two more nodes labeled $ff$ and $mm$, connected to the other nodes following the same rules (Fig.~\ref{fig:deBTri}).

Let $T_n$ be the number of seating arrangements of $n$ couples in the ternary menage problem.

\begin{figure}[t]
\begin{center}
\begin{tabular}{ccc}
\begin{tabular}{c}
\begin{tikzpicture}[->,>=stealth',auto,node distance=3cm,semithick]

  \node[state] (FM)                    {$fm^{\star}$};
  \node[state] (mf) [right of=FM] {$mf$};
  \node[state] (ff) [right of=mf] {$ff$};
  \node[state] (mm) [below of=FM] {$mm$};
  \node[state] (fm) [right of=mm] {$fm$};
  \node[state] (MF) [right of=fm] {$mf^{\star}$};

  \path (fm) edge [bend left] node[near start] {$y^{-1}$} (mf)
        (mf) edge [bend left] node[near start] {$y$} (fm)
        (mf) edge node {$y^{-1}$} (ff)
        (fm) edge node {$y$} (mm)

        (ff) edge [bend right] node[swap] {$yz$} (FM)
        (mm) edge [bend right] node[swap] {$y^{-1}z$} (MF)
	(FM) edge node[swap] {$y$} (mm)
	(FM) edge node {$y^{-1}$} (mf)
        (mf) edge [bend left] node[near end] {$yz$} (FM)

	(MF) edge node[swap] {$y^{-1}$} (ff)
	(MF) edge node [bend left] {$y$} (fm)
        (fm) edge [bend left] node[pos=0.6] {$y^{-1}z$} (MF)

        (mm) edge node[pos=0.4] {$y^{-1}$} (mf)
        (ff) edge node[swap] {$y$} (fm);
\end{tikzpicture}
\end{tabular}
&
\qquad
&
$B= \begin{bmatrix}
0 & y^{-1} & 0 & y & 0 & 0\\
yz & 0 & y^{-1} & 0 & y & 0\\
yz & 0 & 0 & 0 & y & 0 \\
0 & y^{-1} & 0 & 0 & 0 & y^{-1}z\\
0 & y^{-1} & 0 & y & 0 & y^{-1}z\\
0 & 0 & y^{-1} & 0 & y & 0
\end{bmatrix}
$
\end{tabular}
\end{center}
\caption{The weighted de Bruijn graph for the ternary menage problem and its adjacency matrix $B$.}
\label{fig:deBTri}
\end{figure}

\begin{theorem}\label{th:Tn}
For $n>1$, the number $T_n$ can be computed in the following ways:
\begin{equation}\label{eq:Tnmatrix}
T_n = n!\cdot \sum_{j=0}^n (-1)^j\cdot (n-j)!\cdot [y^0z^j]\ \tr(B^{2n})\,,
\end{equation}
where $B$ is defined in Fig.~\ref{fig:deBTri}; or
\begin{equation}\label{eq:TnC}
T_n = n!\cdot\int_0^{\infty} [y^n]\ \tr(B_2^{n})\cdot e^{-t}\cdot dt\,,
~~
B_2 = \begin{bmatrix}
-y& yt& t& 0& yt& -y \\
-y& y(t - 1)& 0& y^2(t - 1)& yt& -y \\
0& y(t - 1)& 0& y^2(t - 1)& 0& -y \\
-y& 0& t - 1& 0& y(t - 1)& 0 \\
-y& yt& t - 1& 0& y(t - 1)& -y \\
-y& yt& 0& y^2t& yt& -y
\end{bmatrix}\,;
\end{equation}
or
\begin{equation}\label{eq:Tnxy}
T_n = n!\cdot\int_0^{\infty} [x^ny^n]\ \frac{a(xy,t) + b(xy,t)\cdot (x+xy^2)}{c(xy,t)+d(xy,t)\cdot (x+xy^2)}\cdot e^{-t}\cdot dt\,,
\end{equation}
where
\[
\begin{split}
a(p,t) &= -2\,{p}^{5}{t}^{3}+2\,{p}^{4}{t}^{4}+4\,{p}^{5}{t}^{2}-8\,{p}^{4}{t}^{3}-2\,{p}^{5}t+12\,{p}^{4}{t}^{2}-8\,{p}^{4}t+6\,{p}^{3}t-4\,{p}^{2}{t}^{2}\\
&+16\,{p}^{2}-10\,pt+20\,p+6 \,, \\
b(p,t) &= -p^2t(2+p-t)(p-3\,t+6)\,,\\
c(p,t) &= {p}^{6}{t}^{2}-2\,{p}^{5}{t}^{3}+{p}^{4}{t}^{4}+4\,{p}^{5}{t}^{2}-4\,{p}^{4}{t}^{3}-2\,{p}^{5}t+6\,{p}^{4}{t}^{2}-4\,{p}^{4}t+2\,{p}^{3}t-{p}^{2}{t}^{2}\\
&+4\,{p}^{2}-2\,pt+4\,p+1 \,, \\
d(p,t) &= -p^2t(2+p-t)^2\,.
\end{split}
\]
\end{theorem}

\begin{proof}
Formula~\eqref{eq:Tnmatrix} is similar to \eqref{eq:Mnmatrix} and follows directly from the definition of the de Bruijn graph in Fig.~\ref{fig:deBTri}.

To avoid dealing with negative powers, we notice that $[y^0z^j]\ \tr(B^{2n})= [y^{2n}z^j]\ \tr((yB)^{2n})$.
Furthermore, the matrix $(yB)^2$ has entries that are polynomial in $y^2$ and $z$ with the degree in $z$ being at most 1,
that is $(yB)^2 = U + V\cdot z$, where matrices $U,V$ do not depend on $z$. Since the specified matrix $B_2$ equals $U\cdot t - V$ where $y^2$ is replaced with $y$,
formula~\eqref{eq:TnC} easily follows from \eqref{eq:Tnmatrix} and Lemma~\ref{lem:laplace}.

According to \cite[Corollary 4.7.3]{Stanley1997},
$$\sum_{n=0}^{\infty} \tr(B_2^{n})\cdot x^n = 6-\frac{xQ'(x)}{Q(x)},$$
where $Q(x) = \det(I - x\cdot B_2)$ and $I$ is the $6\times 6$ identity matrix.
Direct computation shows that $Q(x) = c(xy,t)+d(xy,t)\cdot (x+xy^2)$ and $6Q(x)-xQ'(x)=a(xy,t) + b(xy,t)\cdot (x+xy^2)$, implying that
$$\sum_{n=0}^{\infty} \tr(B_2^{n})\cdot x^n = \frac{a(xy,t) + b(xy,t)\cdot (x+xy^2)}{c(xy,t)+d(xy,t)\cdot (x+xy^2)}\,.$$
Substitution of this expression into \eqref{eq:TnC} yields \eqref{eq:Tnxy}.
\qed
\end{proof}

While formulae~\eqref{eq:Tnmatrix} and \eqref{eq:TnC} provide an efficient way for computing $T_n$ for a given integer $n>1$,
the special form of the rational function in \eqref{eq:Tnxy} further enables us to obtain a closed-form expression for the EGF for the numbers $T_n$.

\begin{lemma}\label{lem:abcd}
Let $a(z)$, $b(z)$, $c(z)$, $d(z)$ be polynomials such that $[z^0]\ c(z) = 1$ (i.e., $c(z)$ is invertible as a series in $z$).
Then for any integer $n\geq 0$,
$$
[x^ny^n]\ \frac{a(xy) + b(xy)\cdot (x+xy^2)}{c(xy) + d(xy)\cdot(x+xy^2)} = [p^n]\ \left(\frac{a(p)\cdot d(p)-b(p)\cdot c(p)}{d(p)\cdot \sqrt{c(p)^2  - 4\cdot p^2\cdot d(p)^2}} + \frac{b(p)}{d(p)}\right) \,.
$$
\end{lemma}

\begin{proof}
Let $p=xy$. Then $\frac{a(xy) + b(xy)\cdot (x+xy^2)}{c(xy) + d(xy)\cdot(x+xy^2)} = \tfrac{a(p) + b(p)\cdot (x+py)}{c(p) + d(p)\cdot(x+py)}$.
In the series expansion of this function, we will discard all terms with distinct degrees in $x$ and $y$, while in the remaining terms (with equal degrees in $x$ and $y$),
we will replace $xy$ with $p$ to obtain a univariate power series in $p$.
We start with the following expansion:
\[
\begin{split}
& \frac{a(p) + b(p)\cdot (x+py)}{c(p) + d(p)\cdot(x+py)}
= \frac{a(p) + b(p)\cdot (x+py)}{c(p)} \sum_{k=0}^{\infty} \left(\frac{-d(p)}{c(p)}\right)^k (x+py)^k \\
& \qquad\qquad\qquad = \frac{a(p)}{c(p)} \sum_{k=0}^{\infty} \left(\frac{-d(p)}{c(p)}\right)^k (x+py)^k + \frac{b(p)}{c(p)} \sum_{k=0}^{\infty} \left(\frac{-d(p)}{c(p)}\right)^k (x+py)^{k+1}\,.
\end{split}
\]
Here from each power of $x+py$ we extract the term with the equal degrees in $x$ and $y$ and replace it with the corresponding power of $p$. This yields
\[
\begin{split}
&\frac{a(p)}{c(p)} \sum_{k=0}^{\infty} \left(\frac{-d(p)}{c(p)}\right)^{2k} \binom{2k}{k} p^{2k} +
\frac{b(p)}{c(p)} \sum_{k=0}^{\infty} \left(\frac{-d(p)}{c(p)}\right)^{2k+1}  \binom{2k+2}{k+1} p^{2k+2} \\
&= \frac{a(p)}{c(p)}\cdot f\left( \left(\frac{d(p)}{c(p)}p\right)^2\right) - \frac{b(p)}{d(p)}\cdot \left( f\left( \left(\frac{d(p)}{c(p)}p\right)^2\right) - 1\right) \\
&= \frac{a(p)\cdot d(p)-b(p)\cdot c(p)}{c(p)\cdot d(p)}\cdot f\left( \left(\frac{d(p)}{c(p)}\cdot p\right)^2\right) + \frac{b(p)}{d(p)} \\
&= \frac{a(p)\cdot d(p)-b(p)\cdot c(p)}{d(p)\cdot\sqrt{c(p)^2 - 4\cdot p^2\cdot d(p)^2}} + \frac{b(p)}{d(p)}\,,
\end{split}
\]
where $f(z) = (1-4z)^{-1/2} = \sum_{k=0}^{\infty} \binom{2k}{k}\cdot z^k$.
By construction, the coefficient of $x^ny^n$ in the original expression equals the coefficient of $p^n$ in the last expression.
\qed
\end{proof}

\begin{theorem}\label{th:Tegf}
Let polynomials $a(p,t)$, $b(p,t)$, $c(p,t)$, and $d(p,t)$ be defined as in Theorem~\ref{th:Tn}.
Then for all $n>1$,
\begin{equation}\label{eq:Tnpn}
T_n =
n!\cdot\int_0^{\infty} [p^n]\ \left(\frac{a(p,t)\cdot d(p,t)-b(p,t)\cdot c(p,t)}{d(p,t)\cdot \sqrt{c(p,t)^2  - 4\cdot p^2\cdot d(p,t)^2}} + \frac{b(p,t)}{d(p,t)}\right) \cdot e^{-t}\cdot dt\,.
\end{equation}
Correspondingly, the exponential generating function for $T_n$ equals
\[
\begin{split}
& \sum_{n=0}^{\infty} T_n \frac{x^n}{n!} = - 2 + 2\cdot x - 2\cdot x\cdot e^{-x-2}\cdot \Ei(x+2) \\
& +
\int_0^{\infty}
\frac {\left( {t}^{3}{x}^{2}+ \left( -2\,{x}^{3}-4\,{x}^{2}-x \right) {t}^{2}+ \left( {x}^{4}+4\,{x}^{3}+7\,{x}^{2}+4\,x+3 \right) t-6\,{x}^{2}-9\,x-6 \right)\cdot e^{-t}}{(t-(x+2))
\sqrt{\left( {t}^{2}{x}^{2}-t{x}^{3}-2\,t{x}^{2}-3\,xt+4\,{x}^{2}+4\,x+1 \right)
\left( {t}^{2}{x}^{2}-t{x}^{3}-2\,t{x}^{2}+xt+1 \right)}}\ dt\,.
\end{split}
\]
\end{theorem}

\begin{proof}
Formula \eqref{eq:Tnpn} directly follows from \eqref{eq:Tnxy} and Lemma~\ref{lem:abcd}.
Multiplying \eqref{eq:Tnpn} by $\frac{x^n}{n!}$ and summing over $n$, we further get
\begin{equation}\label{eq:Tgf}
\sum_{n=0}^{\infty} T_n \frac{x^n}{n!} = -5 + 2x
+ \int_0^{\infty} \left(\frac{a(x,t)\cdot d(x,t)-b(x,t)\cdot c(x,t)}{d(x,t)\cdot \sqrt{c(x,t)^2  - 4\cdot p^2\cdot d(x,t)^2}} + \frac{b(x,t)}{d(x,t)}\right) \cdot e^{-t}\cdot dt\,,
\end{equation}
where the terms $-5 + 2x$ take care of the initial values $T_0=1$ and $T_1=0$.
While we are not aware if it is possible to simplify the integral of the term involving a square root, below we evaluate the integral of the rational term.

Expansion of $\frac{b(x,t)}{d(x,t)}$ as a power series in $t$ yields
$$\frac{b(x,t)}{d(x,t)} = \frac{x-3t+6}{x-t+2} = 3 - \frac{2x}{2+x}\cdot\frac{1}{1-\frac{t}{2+x}} = 3 - \frac{2x}{2+x}\cdot \sum_{k=0}^{\infty} \frac{t^k}{(2+x)^k}.$$
Similarly to the proof of Theorem~\ref{th:Mn}, this further allows us to evaluate the integral
$$
\int_0^{\infty} \frac{b(x,t)}{d(x,t)} \cdot e^{-t}\cdot dt = 3 - 2\cdot x\cdot e^{-x-2}\cdot \Ei(x+2).
$$
Plugging this expression into \eqref{eq:Tgf} completes the proof.
\qed
\end{proof}

\section{Computing Numerical Values}

The Online Encyclopedia of Integer Sequences~\cite{OEIS} contains a number of sequences related to the menage problem and its ternary variant:

\

\begin{tabular}{|c|l|c|}
\hline
Sequence & Terms for $n=1,2,3,\dots$ & OEIS index\\
\hline\hline
$M_n$ & $0, 0, 12, 96, 3120, 115200, 5836320, 382072320, \dots$  & \texttt{A059375} \\
\hline
$\nicefrac{M_n}{2n!}$ & $0, 0, 1, 2, 13, 80, 579, 4738, 43387, 439792, \dots$ & \texttt{A000179} \\
\hline
$\nicefrac{M_n}{2n}$ & $0, 0, 2, 12, 312, 9600, 416880, 23879520, \dots$ & \texttt{A094047} \\
\hline\hline
$T_n$ & $0, 8, 84, 3456, 219120, 19281600, 2324085120, \dots$ & \texttt{A258338} \\
\hline
$\nicefrac{T_n}{4n}$ & $0, 1, 7, 216, 10956, 803400, 83003040, \dots$  & \texttt{A114939} \\
\hline
\end{tabular}

\

While the Touchard formula \eqref{eq:Touchard} can be used to efficiently compute the menage numbers $M_n$ and associated sequences,
our formula \eqref{eq:Tnmatrix} enables the same for the numbers $T_n$. In particular, we have computed many terms of sequences \texttt{A114939} and \texttt{A258338} in the OEIS.

We also remark that the formula \eqref{eq:Tnpn} provides another way to compute $T_n$ by extracting the coefficient of $x^p$ (which is a polynomial in $t$) and applying the transform $\L_{t,1}$
(i.e., replacing every $t^k$ with $k!$).

\bibliographystyle{splncs03}

Combinatorics (math.CO); Discrete Mathematics (cs.DM)


Constant index expectation curvature for graphs or Riemannian manifolds

Abstract: An integral geometric curvature is defined as the index expectation K(x) = E[i(x)] if a probability measure m is given on vector fields on a Riemannian manifold or on a finite simple graph. Such curvatures are local, satisfy Gauss-Bonnet and are independent of any embedding in an ambient space. While realizing constant Gauss-Bonnet-Chern curvature is not possible in general already for 4-manifolds, we prove that for compact connected manifolds, constant curvature K_m can always be realized with m supported on Morse gradient fields. We give examples of finite simple graphs which do not allow for any constant m-curvature and prove that for one-dimensional connected graphs, there is a convex set of constant curvature configurations with dimension of the first Betti number of the graph. In particular, there is always a unique constant curvature solution for trees.

\section{In a nutshell}

\paragraph{}
If a probability distribution $p_x$ is given on the vertex set $V_x$ of
every complete sub-graph $x \in G$ of a finite simple graph $(V,E)$,
one obtains a curvature $K(v) = \sum_{x \in G} p_x(v) \omega(x)$ with
$\omega(x)=(-1)^{{\rm dim}(x)}$.
Such a curvature $K$ satisfies the Gauss-Bonnet formula
$\chi(G)=\sum_{x \in G} \omega(x) = \sum_{v \in V} K(v)$ for the Euler characteristic
$\chi(G)$ of the graph $(V,E)$ or its simplicial complex $G$.
If $p_x(v) \in \{ 0,1 \}$, this is a Poincar\'e-Hopf formula with integer
index values $i(v)=K(v)$ \cite{poincarehopf,parametrizedpoincarehopf,PoincareHopfVectorFields}.
If $p_x$ is the uniform distribution on each set $V_x$, it produces the
Gauss-Bonnet-Chern integrand $K(v)=\sum_{x, v \in x} \omega(x)/(|x|+1)$ \cite{cherngaussbonnet}.
Let $\mathcal{C}$ denote the set of graphs for which a probability measure
$p_x$ on $V_x$ exists for each $x \in G$ such that $K(v)$ is constant.
One can also ask to minimize the variance
${\rm Var}[K]=\sum_{v \in V} (K(v)-m)^2/|V|$, where $m$ is $\chi(G)/|V|$ is the average
curvature. The question whether a given complex $G$ is in $\mathcal{C}$ is a linear
programming problem as it attempts to find solutions of a linear system of equations
under finitely many inequality conditions which assure that the $p_x(v)$ are in the interval
$[0,1]$ and that they add up to $1$.

\begin{figure}[!htpb]
\scalebox{0.4}{\includegraphics{figures/tree.pdf}}
\scalebox{0.4}{\includegraphics{figures/circle.pdf}}
\scalebox{0.4}{\includegraphics{figures/figureeight.pdf}}
\label{treecircle}
\caption{
For a tree $G=(V,E)$, one can distribute the ``energy" value $\omega(x)=-1$ of every edge
$x \in E$ in a unique way to the two vertices. There is then a unique curvature
$K(v)=1-\sum_{x \in E, v \in x} p_x(v)$ satisfying
Gauss-Bonnet $\sum_{v \in V} K(v)=\chi(G)=1$ such that $K(v)$ is
constant $1/|V|$. For a circular graph, there is an entire interval of solutions, just
take the probability space $p_x$ the same on each edge. We chose here $p_x=\{0.3,0.7\}$.
In the case of a figure-$8$ graph, we can even tune two parameters.
}
\end{figure}

\paragraph{}
We prove here that triangle-free graphs are in $\mathcal{C}$ and give
examples of graphs outside $\mathcal{C}$. The examples outside $\mathcal{C}$
are non-manifold like so far as we have no examples yet of $d$-graphs outside $\mathcal{C}$.
We furthermore note that in the $1$-dimensional connected case, the solution set of
probability distributions solving the constant curvature equation is a
convex set of dimension $b_1=1-\chi(G)$. The integer $b_1$ is the only relevant Betti number for
one-dimensional connected complexes. In particular, the solution set
is unique for trees. One can then get probability distributions $p_x$ by
considering a probability space $(\Omega,\mu)$ of locally
injective functions $g$ (colorings) on the graph $G$ and get the curvature
$K(v)=E_{\mu}[i]$ as index expectation. We have explored in
\cite{indexexpectation,colorcurvature} how to get the standard
Gauss-Bonnet curvature as index expectation.

\paragraph{}
The constant curvature question can be ported to smooth compact manifolds by taking
a probability space $(\Omega,\mu)$ of Morse functions on $M$ and defining curvature
$K(v)=K_{\mu}(v)$ as index expectation. We have experimented with
that (see e.g. \cite{eveneuler,KnillBaltimore}) as there are various natural measures
which can be defined as such like taking heat kernel functions $f(y) = e^{-t L}(x,y)$
and let $\Omega$ be the manifold itself with probability measure $dV$.
An important example of a curvature is the Gauss-Bonnet-Chern integrand for a compact
Riemannian manifold $M$. It is not possible to realize a metric on $M$ in general which has constant
Gauss-Bonnet-Chern curvature, we have not yet found a compact connected manifold that
can not be equipped with constant index expectation curvature. See Question~(\ref{constantcurvature}).

\paragraph{}
Back to the discrete case, one can look at the question for $d$-graphs.
These finite simple graphs which are discrete manifolds in the sense that
they have the property that every unit sphere $S(v)$ is a $(d-1)$-sphere.
A $d$-sphere is then just a $d$-graph which when punctured becomes contractible.
The constant curvature problem for discrete manifolds is not yet studied.
It relates to the question on how fast the Euler characteristic of a $d$-graph
with $n$ vertices can grow as a function of $n$. This is of independent interest.

\paragraph{}
We know that for general Erdoes-R\'enyi graphs in $E(n,p)$,
the maximal Euler characteristic
in $E(n,p)$ grows exponentially along sub-sequences in $(p_k,n_k)$.
The reason is because the expectation value of the Euler characteristic on $E(n,p)$ is
explicitly given as
$$ {\rm E}_{n,p}[\chi] = \sum_{k=1}^n (-1)^{k+1} \B{n}{k} p^{\B{k}{2}} \;  $$
\cite{randomgraph}.

\paragraph{}
But the growth for $d$-graphs (discrete $d$-manifolds) appears to be unknown: a possible
super linear grow along a sub-sequence of $n$ would produce $d$-graphs for which the curvature
can not be made constant. Formulated differently, if every discrete
$d$-manifold allowed for constant curvature then the maximal Euler characteristic
$\chi(G)$ were only grow linearly. Let $X_d(n)$ denote the maximal $\chi(G)$ which
a $d$-graph with $n$ elements can have. Interesting is the following question:

\question{ How fast does $X_d(n)$ grow for $n \to \infty$?  }

\section{A trade allegory}

\paragraph{}
Before we start with the actual paper, let us look at the following distribution
problem for a finite network with nodes $V$ and connections $E$. It is equivalent
to the constant curvature problem we study here for one-dimensional networks.

\paragraph{}
Consider the following cost distribution problem for a finite simple graph $(V,E)$: \\

{\bf Assume that each connection $(a,b) \in E$ between two nodes $a,b \in V$
costs a fixed amount $1$. How do we distribute the cost for each transaction $(a,b)$
to the two parties $a$ and $b$ in order that the total cost of all parties is the same? }

\paragraph{}
Our result shows that one can solve the fair distribution problem in a unique
way if the network is a tree and that there is a $b$-dimensional set of
distribution parameters if the network has $b=b_1$ independent loops. The integer
$b_1$ is the first Betti number of the graph.

\paragraph{}
Now look at the case when the network also can have triangles (serving as two dimensional faces) but no
complete sub-graphs $K_4$ with $4$ vertices (these $K_4$ subgraphs are three dimensional tetrahedral
simplices). Let $F$ be the set of triangles. The simplicial complex $G$ defined by the network now is
the union $V \cup E \cup F$ of zero, one and two dimensional parts.
The Euler characteristic is given by the Descartes formula
$\chi(G) = \sum_{x \in G} \omega(x) = |V|-|E| + |F|$. In the
case of planar graphs where one can clearly extend the notion of face to other polygonal shapes, one has
$\chi(G)=2$ which was first secretly recorded
by Ren\'e Descartes \cite{Aczel} and then proven by Euler for planar graphs \cite{Richeson}.
A period of confusion \cite{lakatos} followed which can be attributed to
definitions of polyhedra, especially also in higher dimensions \cite{Gruenbaum2003}.

\paragraph{}
So, lets look at a finite simple graph in which there are no complete subgraphs $K_4$.
We think of it again as a trading network, in which exchanging stuff over some some connection
produces a fixed amount $1$ of cost. But now, each triangular clique produces a synergy as it allows to save
cost. Each trade triangle produces the same positive amount $1$ of profit which needs to be distributed to the
three players. The constant curvature problem is now equivalent to the following problem.

\paragraph{}
Cost distribution problem with synergy. \\

{\bf Assume each connection $(a,b)$ between two nodes produces a fixed amount $1$ of cost
and each triangular trade-relation generates the same fixed amount $1$ of synergy. How do
we split the transaction cost for each transaction to the two players and how do we split
the ``synergy bonus" for each triple of cooperating players so that every player has the same total? }

\paragraph{}
Now the situation is different and we can in general no more distribute things equally. Obviously, in
part of the ``world", where better connections and more triangles are present, one can work
more effectively. If there are other parts, where the beneficial element of the triangular
synergy is missing, it is impossible to make up for the missing synergy in that part of the
world.

\paragraph{}
The fish graph displayed in Figure~(\ref{fishgraph}) illustrate this situation.
In the main body of the fish there are triangles present which produces an obvious advantage there.
In the swim fins, where no triangles are present, it is impossible to make up for the missing
benefit. The lack of connectivity is a handicap which can not be fixed by locally distributing
the costs more effectively. One would need a non-local redistributions (a development help so to
speak) in order to equalize the cost. Now, since curvature should always be a local quantity,
this is not possible here.

\paragraph{}
This simple trade model for cost distribution could be made more realistic or adapted to other
networks. One way is to replace the ``topological cost" $\omega(x)= (-1)^{{\rm dim}(x)}$ leading to
Euler characteristic with some arbitrary cost $H(x)$, a quantity we interpreted as ``energy" in
\cite{EnergizedSimplicialComplexes}. The cost distribution problem now also depends on
the value $H(v)$ of the nodes (which in the allegory is a measure for the wealth
of the player).

\paragraph{}
In any case, the distribution problem is a linear programming problem. If there is a
solution, it can be found by a simplex method. As mentioned in the last section, one
can in the case where no solution exists to minimize the variance. This is now a
variational problem which again has constraints given by various inequalities.

\section{Introduction}

\paragraph{}
Of classical interest in Riemannian geometry are {\bf spaces of constant curvature}.
Especially well studied is the case of constant sectional curvature which leads to
space forms \cite{WolfConstantCurvature}. One can also study constant curvature curves, and other
constant curvature manifolds, where the question of course depends on what
``curvature" is. As for curvature on manifolds, besides looking at sectional curvature
leading to ``constant curvature manifolds" one can also look at manifolds with
constant Euler curvature (the curvature entering the Gauss-Bonnet-Chern theorem),
constant Ricci curvature (leading to Einstein manifolds), constant scalar curvature
or then constant mean curvature (which leads to minimal surfaces). Motivated from
physics, where curvature is associated with some sort of energy or mass, the concept
of constant curvature is some sort of equilibrium situation.

\paragraph{}
A different kind of curvature is obtained by averaging Poincar\'e-Hopf
indices $i_g$ over a probability space $(\Omega,\mu)$ of
Morse functions $g$ on $M$. The indices of Morse function are $\{-1,0,1\}$-valued
divisors on $M$. They can also be seen as signed Dirac measures meaning pure point measures supported
on finite sets. The usual Gauss curvature of a Riemannian $2$-manifold $M$ is an
example: Nash embed $M$ into a higher dimensional Euclidean space $E$ and take the probability
space of all linear functions in $E$ which is rotational invariant. One of
historically earliest cases of curvature, the (solid) angle excess for convex polytopes
geometrically realized in $E$ can be seen that way.
For almost all linear functions on $E$ one has an index defined on the vertices of the polytop.
Averaging over all linear functions gives the solid angle.

\paragraph{}
Which manifolds allow for constant index expectation curvature?
By the uniformization theorem, a $2$-manifold always allow for a constant Gauss
curvature in that way. The question whether there are
even-dimensional manifolds which do not allow for a Riemannian metric with constant
Gauss-Bonnet-Chern curvature appears to be not studied so far. Maybe it is too obvious
that this is in general not possible:  we note that this can happen already for $4$-manifolds.
But this is only given by example. We do not know for example for concrete cases like
$M=S^2 \times S^2$ whether there exists a Riemannian metric $g$ on $M$ leading to constant
Gauss-Bonnet-Chern curvature.

\paragraph{}
In comparison, as the Hopf conjectures show, it is unknown whether there is a
positive curvature metric on a space like $M=S^2 \times S^2$. The focus on
the Gauss-Bonnet-Chern integrand has been abandoned maybe because in dimension $d \geq 6$
the algebraic Hopf conjecture (the question whether one achieve
positive Gauss-Bonnet-Chern integrand if the manifold has positive curvature)
has failed: there are positive curvature 6-manifolds for which the Gauss-Bonnet-Chern
integrand can become negative at some places. (See e.g. \cite{Weinstein71}).

\paragraph{}
We were led to the index expectation curvature also through
such algebraic questions (for us mostly in the discrete).
Having many curvatures available renders the algebraic Hopf conjecture again interesting:

\question{Does every even-dimensional compact connected positive curvature manifold allow
for some positive $\mu$-curvature?}

\paragraph{}
Of course the question must be difficult as answering it affirmatively would imply the Hopf conjecture
which history has shown to be difficult.
The above question is intriguing because if a manifold has positive curvature then there is
a positive $\mu$ curvature on it (namely the constant curvature we establish).
An affirmative answer would show that
the just formulated question does not only imply
but is equivalent to the Hopf conjecture: if the Hopf conjecture holds, then we
can realize a positive $\mu$-curvature.

\paragraph{}
As for constant sectional curvature, we do not explore the discrete case except mentioning
one simple case of $d$-graphs (discrete d-dimensional manifolds in which every unit sphere
is a $(d-1)$-sphere) for which all embedded wheel graphs are isomorphic
(have the same number $k$ of vertices). If one defines
curvature as $1-k/6$ for such a section, we have looked at
positive curvature case in \cite{SimpleSphereTheorem} and shown that every
positive curvature $d$-graph is necessarily a $d$-sphere.

\paragraph{}
Which finite simple $d$-graphs have constant curvature {\bf in the strong
sense} that all embedded wheel graphs are
isomorphic? In the case $d=2$ only the octahedron (constant curvature $K=1/4$ on the 8 vertices)
and the icosahedron (constant curvature $K=1/6$ on the 12 vertices).
In the case $d=3$, it follows from the classification of regular polytopes that
there is only the 16-cell $4 S_0 = S_0+S_0+S_0+S_0$, (where $+$ is the join),
and the 600-cell which have constant curvature. In dimensions $d>3$, there is only the $d$-dimensional
cross polytop $(d+1) S_0$ again using the Schl\"afli classification of regular platonic solids in $d$-dimensions.
The reason is that if $G$ has constant curvature, then every unit sphere must have constant curvature
which forces the graphs to be Platonic. In other words:

\begin{propo}
For $d=2$ and $d=3$, there are exactly two constant curvature $d$-graphs in the
strong sense. For $d \geq 4$, there is a unique constant curvature graph in the strong sense:
the $d$-dimensional cross polytop.
\end{propo}

\paragraph{}
We will weaken the constant curvature condition (the notion that all sectional curvatures
are positive) elsewhere to become more realistic. It uses of course
 index expectation. It will allow to get discrete models of constant curvature which
look like constant curvature manifolds in the continuum and which also should lead to
more realistic sphere theorems in the discrete. Of course, such theorems then would need
pinching conditions analogue to the continuum. The discrete case is then a play ground for
analogue Hopf questions.

\paragraph{}
Integral geometric questions \cite{Santalo,Santalo1} have been studied also in combinatorial
settings \cite{KlainRota}. It produces an alternative to tensor calculus.
It allows to define classical distances for example: if a probability measure $\mu$ is given
on the space of linear functions on an Euclidean space $E$ in which a Riemannian manifold $M$
is embedded, then the distance of a curve $\gamma$ can be measured as the expectation number
of the number of intersections of hyperplanes $f=0$ with $\gamma$. This Crofton approach
\index{Crofton} recovers the Riemannian metric. It is more than natural also see curvature as an
expectation, an expectation of Poincar\'e-Hopf indices. And this has also been done classically
for a while now \cite{Blaschke,Nicoalescu}.

\paragraph{}
For manifolds, taking probability measures on Morse functions is more convenient than taking
the measure on the larger space of vector fields with finitely many isolated non-degenerate equilibrium points.
On the other hand, taking a probability space on functions is less convenient in the discrete
and it is better to work with probability spaces of vector fields. The later leads to
the frame work stated initially, where probability measures $p_x$ on simplices $x$ are given.
The simplest set-up is to distributing the curvature values $\omega(x)$ from the simplices to the vertices.
This can be done if each simplex $x$ is equipped with a probability space $p_x$
\cite{PoincareHopfVectorFields}.

\section{Constant curvature manifolds}

\paragraph{}
Let us look now at the case of smooth manifolds and ask:

\question{
Does every compact connected smooth manifold $M$ admit a constant index expectation curvature?
Is there is a probability space $(\Omega,\mu)$ of Morse functions $g: M \to \mathbb{R}$
such that the expectation $K(v)=E_{\mu}[i_g(v)]$ of the Poincar\'e-Hopf index $i_g$ divisors
on $M$ is a constant function on $M$.
\label{constantcurvature}
}

\paragraph{}
The question is not interesting in dimension $d=1$ because $M$ is then a circle
which has constant index expectation $0$, obtained by embedding $M$ as the standard
circle in the plane and taking the probability space of all
linear functions $f(x,y) = \cos(\theta) x + \sin(\theta) y$ of functions equipped with
the uniform measure. This space induces a space of Morse functions on $M$.

\paragraph{}
Now lets look at a general smooth, compact and connected manifold of dimension $d \geq 2$.
Pick a Riemannian metric on $M$ (it is well known using a partition of unity that a
smooth manifold can be equipped with a Riemannian metric by patching together metrics given
on each chart). This defines a volume measure on $M$. Normalize it so that it becomes
a probability measure $dV$ on $M$. A theorem of Brin-Feldman-Katok \cite{BrinFeldmanKatok} assures
that $M$ admits a smooth Bernoulli diffeomorphism $T$ with respect to such a volume measure.
The automorphism $T$ on the probability space $(M,\mathcal{A},dV)$ is measure theoretically conjugated
to a Bernoulli system. This theorem needs that the dimension of $M$ is bigger or equal than $2$.
Pick an arbitrary Morse function $g$ on $M$. Assume the indices of $g$
are supported on the set $m_1, \dots, m_n$ of critical points of $g$ in $M$
which are generic with respect to $T$ in the sense that all the orbits $T^k(m_j)$ are
uniformly distributed on $M$ (using a partition of unity it is easy to possibly modify the
critical points $m_j$ if they would not be generic. The points which are generic in the sense
of ergodic theory are a set of measure $1$ and therefore dense in $M$ (see e.g.
\cite{FurstenbergRecurrence,DGS} for the ergodic theory part).
Now define the sequence $g_k=g(T^k)$ of smooth maps $M \to \mathbb{R}$.
Because $T$ is a diffeomorphism $M \to M$, the chain rule assures that the translated functions
$g_k$ are all Morse. Their indices are located on the points $T^k(m_j)$. By ergodicity
already, the point measures $(1/n) \sum_{k=1}^n \delta_{m_j(T^k)}$ converge weakly
to the constant function $1$ on $M$.
The question is now whether there is an accumulation point of this sequence
$\mu_n = \frac{1}{n} \sum_{k=1}^n \delta_{g_k}$ on $\Omega$, where $\delta_{g_k}$ is
the Dirac point measure located on $g_k$.
This would only work if we had a weak-* compactness, but that requires a tightness
preventing the measure to escape.  The index expectation $K_n(v) = E_{\mu_n}[i(v)]$
would then converge to a $T$-invariant
constant curvature measure $K=\chi(G)/Vol(M)$ which because of the normalization
${\rm Vol}(M)=\int_M 1 dV = 1$ satisfies $\int_M K \; dV=\chi(G)$.

\paragraph{}
Which smooth functions $K$ on $M$ satisfying $\int_M K(x) \; dV(x) = \chi(G)$
can be realized as index expectation $K(x)=E_{\mu}[i(x)]$?
Lets try to realize a function  $K$ which has no root and is close enough to a constant.
because of compactness and connectedness of $M$, there exists a $\delta>0$ such
that $K(x) \geq \delta>0$ $-K(x) \geq \delta >0$ and all $x \in M$. If we define
a new measure $dV$ which has higher weight somewhere, and do the above construction we have also a
higher curvature value there. Let $m=\chi(G)$ be the average curvature.
Take the measure with density $dV(x) + (K(x)-m) dV$. Assume that this is positive
everywhere. Now pick the ergodic transformation from the Brin-Feldman-Katok theorem to get
an index expectation $K(x)$.

\paragraph{}
We can also ask which manifolds allow for constant curvature $K_{\mu}$ with $\mu$ supported on
a {\bf compact subset of $C^2$ functions} in $\Omega$.
We expect that not all manifolds allow for such measures and that the argument is similar
to the argument showing that there is no metric $g$ in general on a compact connected even
dimensional manifold for which the Gauss-Bonnet-Chern curvature is constant.

\section{Constant curvature graphs}

\paragraph{}
Before we look at the analogue curvature question in the discrete, let us
start with the question, which graphs have constant Euler curvature
$$  K(v) = 1+\sum_{k=0} (-1)^k \frac{v_k(S(v))}{k+1}  \; , $$
where $v_k$ counts the number of $k$-dimensional simplices in the unit sphere
$S(v)$ of $v$. (This curvature \cite{cherngaussbonnet}
is the analogue of the Gauss-Bonnet-Chern measure in the continuum and appeared
already \cite{Levitt1992}). In one dimension, connected graphs with constant curvature are
regular graphs like circular graphs $C_k$ with $k \geq 4$, the cube graph or
dodecahedron graph, the tesseract graph, the complete bipartite graphs $K_{n,n}$ which
includes $K_{1,1}=K_2$. For 2-graphs, connected examples are the icosahedron
graph and the octahedron graph.

\question{
Can we characterize the set of connected finite simple graphs for which the Euler-Levitt
curvature is constant? }

\paragraph{}
The class obviously contains all graphs $G$ for which all unit spheres $S(v)$ are isomorphic
to some fixed graph $H$. Even more generally, it contains all graphs for which
the $f$-vectors of $S(v)$ all agree. But we do not know for example, whether
this is necessary nor whether this is sufficient to have constant Euler-Levitt curvature.

\paragraph{}
The question of existence of constant curvature on a graph becomes richer if
curvature is formulated more broadly. We want the curvature function to be located
on the vertex set $V$ and that it adds up to the Euler characteristic $\chi(G) = \sum_x \omega(x)$.
We want it to be local in the sense that it only depends on the unit sphere of $x$. We also want
it to be intrinsic in the sense that it does not depend on any auxiliary space like an embedding in
some Euclidean space.

\paragraph{}
Such curvatures can be obtained by distributing the values
$\omega(x) = (-1)^{{\rm dim}(x)}$ from a simplex $x$ to the vertices in $x$. In other words,
we make each simplex $x$ a probability space and randomly distribute the ``energy value"
$\omega(x)$ to the zero-dimensional atoms of the simplex. This produces a curvature $K(v)$
on vertices which adds up to Euler characteristic. We probably got to this simple picture
of curvature in \cite{josellisknill} and not yet in \cite{cherngaussbonnet,poincarehopf}.

\paragraph{}
This set-up is simple and assures that
curvature remains local and unifies the continuum and discrete.
In the continuum, it leads to the Poincar\'e-Hopf theorem if probabilities and so curvature
is integer-valued, meaning they are divisors. Then there is the case, where the probability
measures have a uniform distribution \cite{indexexpectation,colorcurvature}.
In this case, we get the curvature we are used to in the continuum like the Gauss-Bonnet-Chern
integrand for Riemannian manifolds.

\paragraph{}
Let $G=(V,E)$ be a finite simple graph.
It turns out that if $G$ is $1$-dimensional, the Euler
characteristic alone determines how big the solution space of probability measures is.
Let $p=\{ p_x \; | \;  x \in G \}$ be the set of probability measures on
the set $G_1$ of complete sub-graphs of a graph, defining the curvature $K$. Here
is a first result. The proof is given later.

\begin{thm}
For a triangle-free connected graph, the set of measures $p$ producing constant
curvature is a convex set of dimension $1-\chi(G)$.
In particular, there is a unique measure $p$ for trees. There are examples of
graphs with triangles for which no measure $p$ produces constant curvature.
\end{thm}

\paragraph{}
Integral geometry produces lots of opportunities. One important point is deformation.
Both in the continuum as in the discrete, in order to deform space, we can either deform
the exterior derivative which changes distances via Connes metric or then we can
deform probability measures defining quantities integral geometrically.
In the first case, this can be done by differential equations, in the second case, where
we have a convex space of measures to play with, one can change distances or curvatures
with gradient flows.

\section{Curvature}

\paragraph{}
Given a {\bf finite abstract simplicial complex} $G$ and a {\bf direction} $F:G \to V$,
where $V = \bigcup_x x$ is the {\bf vertex set} of $G$, the index $i = F^*(\omega)$
is the push-forward of the signed measure $\omega(x)=(-1)^{{\rm dim}(x)}$ on $G$ which
as an integer-valued function can be seen as a divisor.  A special case is given by the
Whitney complex of a connected digraph graph $\Gamma$ without triangular cycles. In
this case $F(x)$ is the largest element on $x$ in the partial order defined by the directions.
An even more special case is if $g$ is a locally injective function on $V$ and $F(x)$ is the
vertex in $x$ where $F$ is maximal. We get then the Poincar\'e-Hopf index  which corresponds
to Poincar\'e-Hopf indices in the continuum.  See \cite{PoincareHopfVectorFields,MorePoincareHopf}
for more on this.

\paragraph{}
Averaging such indices over a probability space of directions $F$ on a graph
produces a curvature $K(v)$ on $V$. This set-up is simple but it becomes on differentiable
manifolds the classical Poincar\'e-Hopf theorem for vector fields or the Gauss-Bonnet-Chern
theorem. To see curvature as ``index expectation" is an integral geometric point of view.
The set-up allows to bridge the continuum and the discrete because the definitions of curvature
are then the same. For a differentiable manifold we can chose a probability space of Morse functions
$g$ for example and declare the expectation of $i_g(v)$ to be the curvature $K$ of $M$. If the probability
space is nice then $K$ is a smooth function as in differential geometry. If the probability space
is the space of all linear functions on an ambient Euclidean space of a Nash embedding and the Haar
induced measure is chosen on the linear functions, then $K$ is the Euler measure appearing in the
Gauss-Bonnet-Chern theorem.

\paragraph{}
Getting back to combinatorics, if $F$ is a Markov process, meaning that a probability vector
$p_x$ is given on each simplex, then the energy $\omega(x) = (-1)^{\rm dim}(x)$ is distributed
randomly from the simplices to the vertices, leading to a {\bf curvature}
$K(v) = \sum_{x, v \in x} \omega(x) p_x$. This can be abbreviated as
$$   K=A \omega $$
for the matrix $A(v,x) = p_x(v)$ which is stochastic in the
sense that all column vectors of $A$ are probability vectors. Gauss-Bonnet is
$\sum_{v \in V} K(v)=\chi(G)$, where $\chi(G)=\sum_{x \in G} \omega(x)$.
The columns of $A$ are probability vectors with the property that $p_x(v)=0$ if $v$
is not in $x$.

\paragraph{}
If all probability distribution vectors $p_x$ are constant vectors and $G$ is the Whitney
complex of a graph, then we get the Levitt curvature
$$  K(v)=1+\sum_{k=0} (-1)^k v_k(S(v))/(k+1)  \; , $$
where $v_k(A)$ is the number of $k$-dimensional simplices in $A$ and $S(v)$
is the unit sphere of $v$. For $2$-graphs, graphs in which every
unit sphere $S(x)$ is a circular graph with $4$ or more vertices, this gives the curvature
$K(v) = 1-{\rm deg}(v)/6$ which has been known since at least a century.
Historically, it appeared already in \cite{Eberhard1891} and was then considered by
Heesch \cite{Heesch}.

\paragraph{}
One can now look at {\bf positive Euler curvature graphs}, which are graphs in
which this particular curvature $K(v)$ is positive.
An other point of view is to take a measure $\mu$ on the space of locally injective functions
$g$ and define graphs for which there exists $\mu$ with $K_{\mu}(v)>0$ everywhere.
We still have to explore for which choices of probability measures $p_x$ one can get
a probability measure $\mu$ on the space $\Omega$ of locally injective functions (colorings),
such that the induced measure on $x$ is $p_x$. There are obvious cases of choices of
probabilies $p_x$ such that for $y \subset x$ the probability $p_y$ is not
compatible with $p_x$ preventing a realization as a measure on functions. In the one dimensional
case, where such compatibilities are not present, we can realize any $\{ p_x \}_{x \in G}$ choice
with a measure $\mu$ on $\Omega$.

\section{Constant curvature}

\paragraph{}
An even more general case if to look at connected simplicial complexes $G$ and curvatures $K_P$
defined by having each set $x \in X$ equipped with a probability measure $p_x$. This triggers
interest in graphs which have positive Euler characteristic but which do not allow for a
positive curvature. Here is a first basic question. If not stated otherwise, the
simplicial complex of a graph is the Whitney complex. The measure $\mu$ represents a probability
measure on ``discrete vector fields" which here is implemented through a family $p_x$ of probability
measures on the simplices of the graph. If the probability distributions come from
a probability measure $\mu$ on locally injective functions on the graph, we speak of a
index expectation curvature. In the one-dimensional case mostly covered here, the two things
are the same. Every family of probability distributions $p_x$ on the edge sets can be realized
through a probability distribution on locally injective functions. But in general the question
can be different and is unexplored.

\question{
Which connected graphs allow a constant $\mu$ curvature?
For which graphs is there a constant index expectation curvature.
}

\paragraph{}
If $K$ is a constant curvature on a graph $(V,E)$,
then by Gauss-Bonnet, it must have the value $\chi(G)/|V|$.
Complexes defined as Whitney complexes of small graphs like complete graphs,
cyclic graphs, star graphs, wheel graphs, Platonic solid graphs allow for constant
curvature and $P$ is unique. But there are examples where constant curvature is not possible:
take two graphs, where one has $\chi(G)=2$ and the other $\chi(H)=-2$
and connect them by an edge. This produces Euler characteristic $0$. But the
Euler characteristic of the positive curvature part remains positive after joining.
This is the idea behind the situation given in Figure~\ref{fishgraph}. The argument works
also for manifolds, but only for Gauss-Bonnet-Chern curvature.
We can always realize constant $\mu$ curvature for compact connected Riemannian manifolds.

\paragraph{}
We expect that for most graphs, constant curvature is not possible.
For every vertex $v$, there is a bound which curvature can take on $v$. An upper bound is
the number of positive dimensional simplices containing $v$, a lower bound
is minus the number of negative dimensional simplices containing $v$. Let $M$ be the
minimal bound and let $G$ be such that the average curvature value $\chi(G)/|V|$ is
larger than $M$. Large curvature ratios are frequent as one can see by looking at
Euler characteristic averages on Erdoes-Renyi spaces of graphs or by taking joins of graphs
for which $\chi(G+H) = -\chi(G) \chi(H)+\chi(G) +\chi(H)$ and the number of vertices add
$|V(G+H)| = |V(G)| + |V(H)|$.
One would have to distribute the values of the simplex curvatures to a larger neighborhood
in order to get a similar result as in the continuum and get constant curvature on any graph.

\paragraph{}
Deciding whether a graph allows positive curvature is an inverse problem for
Markov processes. Given all the measures $p_x$, the
curvature $K$ is an equilibrium measure. The measures $p_x$ can be seen as column vectors in
a stochastic $m \times n$ matrix, where $m=|V|$ is the number of vertices and $|G|$ is the
number of simplices in $G$. The probability vectors are the
columns of $A$ and we have $A(x,v)=0$ if $v$ is not in $x$.
We want to seen whether it is possible that $K=A \omega$ is constant.

\begin{figure}[!htpb]
\scalebox{0.6}{\includegraphics{figures/fishgraph.pdf}}
\label{fishgraph}
\caption{
This fish graph has Euler characteristic $0$ and does not allow for
constant curvature. The curvature would have to be zero everywhere
but the separated fish body has Euler characteristic $2$ while the
separated tail has Euler characteristic $-1$. Joining the two parts
by an edge lowers the Euler characteristic to $0$. The edge $e$ energy
$\omega(e)=-1$ can only be transported to the body or the tail.
The body has now minimal Euler characteristic $1$.
}
\end{figure}

\section{Energized complexes}

\paragraph{}
The question can be generalized to energized complexes \cite{EnergizedSimplicialComplexes}.
Let $G$ be a finite abstract simplicial
complex, $h: G \to \mathbb{C}$ an energy function and total energy
$H(G)=\sum_x h(x)$ extending to $H(A) = \sum_{x \in A} h(x)$ on all sub complexes of $G$
Let $P$ assign to every simplex a probability distribution
so that $G$ is a collection of finite probability distributions. Define
as before the curvature $K=P H$. This means that the energy $h(x)$ is
distributed randomly to vertices of $x$ according to the probability measure
$p_x$ on $x$. Let us call $(G,H,P)$ an {\bf energized weighted simplicial complex}.

\paragraph{}
We can now think of a constant curvature as a type of {\bf equilibrium}.
The topological case $H(x)=\omega(x)$ is just a special case.
Allowing the energy $H$ to be real or complex valued allows to think of
$H$ as a {\bf wave amplitude} or wave as in quantum mechanics. The question
is now whether there is a way to guide the energy on every simplex so
that the energy is the same on each vertex.

\question{ Which energized weighted simplicial complexes $(G,H)$ allow for
constant curvature?
}

\paragraph{}
Even for trees, the energies can not be too far away. Lets look at the
case where $G=K_2$ is the one dimensional simplex, a very simple tree
with $2$ vertices $\{1,2\}$ and $1$ edge $\{(1,2)\}$. Let $H(1)=a, H(2)=b$
and $H((1,2))=c$. Now, the total energy is $a+b+c$ and the constant curvature
would have to be $(a+b+c)/3$. We need now a $p \in [0,1]$
such that $a+p c= (a+b+c)/3$ and $b+(1-p) c = (a+b+c)/3$.

\paragraph{}
One can make the problem more intricate by linking $H$ with $P$.
One can for example define $H(x)$ to be the entropy
$S(x) = -\sum_{v \in x} p_x(v) \log(p_x(v))$ of $p_x$. A
variant is to take $H(x) = S(x) \omega(x)$.
Now, the question is whether there exists a probability distribution
$p_x$ on each simplex such that its entropy is distributed evenly.
By symmetry this happens for example if $G$ is the complete complex.

\paragraph{}
There is an other variant in which we ask the curvature to stay quantized.
The Riemann-Roch theorem for graphs is related to a chip firing game in which
divisor values can be distributed to neighboring vertices. The analogue of a
divisor is a general integer valued function $H: G \to \mathbb{Z}$.
Given such a function $H$, we can ask to distribute $H$ to the vertices and
ask to minimize the variance. One could also ask to keep curvatures integers
leading to analogues of Poincar\'e-Hopf indices.

\section{Classical questions}

\paragraph{}
In the continuum, the analogue question is which
even dimensional manifold admit constant Euler curvature entering
Gauss-Bonnet-Chern $\int_M K \; dV=\chi(M)$. Related to the Hopf
conjectures is already whether there is a metric on $S^2 \times S^2$
with constant $K$:

\question{
For which manifolds is there a metric such that
the Gauss-Bonnet-Chern integrand for $(M,g)$ is constant?
}

\paragraph{}
There are many questions in
differential geometry which asks for ``which compact Riemannian manifolds admit constant
curvature of some kind. Constant Ricci curvature gives Einstein manifolds.
Constant mean curvature surfaces produce minimal surfaces.
One can therefor ask the question for {\bf Euler curvature} which appears in the
Gauss-Bonnet-Chern theorem $\int_M K(x) \; dV =\chi(M)$ for compact even dimensional
manifolds.

\paragraph{}
Which compact 2-dimensional Riemannian manifolds have a constant Euler curvature?
By uniformization and taking universal covers in the non-orientable case,
every connected two-dimensional compact manifold allows for a constant
Euler curvature metric.

\paragraph{}
Here is a simple observation:

\begin{propo}
There are compact $4$-dimensional Riemannian manifolds $M$ which
do not admit a constant Euler curvature (Gauss-Bonnet-Chern integrand).
\end{propo}

\begin{proof}
Take two compact connected 4-manifolds $M_1,M_2$, where $M_1$ has
Euler characteristic larger or equal than $4$ and $M_2$ has Euler characteristic smaller
or equal than $-4$. Now make a connected sum $M_1 +_B M_2$ along a 4-ball $B$ obtained by
removing 4-balls $B_i$ from $M_i$ and gluing together along the boundary $3$-sphere.
When combining, we lose the Euler characteristic of the two balls and have therefore $\chi(M)=\chi(M_1) + \chi(M_2)-2=-2$.
By locality, we have to keep the Euler curvatures on $M_1$ and $M_2$. We can complement the
connecting tube $N_0$ with mostly zero Euler curvature. Now $M=N_1 \cup N_2 \cup N_0$, where $N_i=M_i \setminus B$
and $N_0$ intersect in spheres. Now assume we can equip the connected sum $M$ with a constant
curvature $K$. Because $\chi(M)=-2$ it is negative, the curvature $K$ would have to be negative.
The manifold $N_1$ has now negative curvature in the interior and must by Gauss-Bonnet-Chern
have at least normalized curvature $4$ at the boundary. The boundary however bounds a
4-ball $N_0$ of Euler characteristic $2$ which can be made arbitrary small so that the
normalized boundary curvature can be made arbitrary close to $2$.
That is incompatible with having to be $4$.
\end{proof}

\paragraph{}
The argument can be done in any even dimension larger than $2$.
This argument obviously does not work in dimension $2$ because connected $2$-manifolds
have Euler characteristic $\leq 2$. For example, when taking the connected sum of a genus $g_1$
surface with a genus $g_2$ surface, we get a surface with genus $(g_1 + g_2)$. It is only in
dimension $4$ or higher that we can realize manifolds of Euler characteristic $4$. An example
is $S^2 \times S^2$. An concrete example of a $4$-manifold with Euler characteristic $-4$
is the Cartesian product $N \times N$ of two $2$-surfaces of genus $3$.

\paragraph{}
Inverse questions about curvature are difficult in general. This is illustrated
by one of the celebrated open Hopf conjecture which asks whether there is a metric on $S^2 \times S^2$
for which the sectional curvature is positive. The question whether
there exists a metric with positive Euler curvature is not settled but we are also not aware whether
it is known whether there exists a metric on $S^2 \times S^2$ for which the Euler curvature
is constant.

\section{Existence and uniqueness}

\paragraph{}
Let us look now at the discrete $1$-dimensional case, where we have a finite simple graph $(V,E)$.
Let $G$ be the simplicial Whitney complex which is here just the union of the vertex set $V$ and edge
set $E$. The function $\omega(x) = (-1)^{{\rm dim}(x)}$ on $G$ has the total sum $\sum_x \omega(x) = \chi(G)$.
In order to realize constant curvature, we need to find a stochastic $|V| \times (|V| + |E|)$ matrix
$A$ such that
$$  A \omega = \chi(G)/|V| \;  $$
and such that $A_{vx}=0$ if $v$ is not a subset of $x$.
This is a system of $m$ equations which together with the probability assumption $\sum_{v \in x} p_x(v)=1$
produces $m+n$ equations. There are $\sum_x {\rm dim}(x)+1$ unknowns $A_{ij}$. So, there is a
large dimensional space of solutions but the question is whether we can get solutions
satisfying $A_{ij} \geq 0$.  We see:

\begin{propo}
The existence problem of constant $\mu$ curvature on a finite simple
graph is a linear programming problem.
\end{propo}

\paragraph{}
Example:
Let $G=\{ (1),(2),(3),(12),(23)\}$ be the smallest line graph. There are two parameters $p,q$ and
we have to solve  $A \left[ \begin{array}{c} 1 \\ 1 \\ 1\\ -1 \\ -1 \end{array} \right]
                  = \left[ \begin{array}{c} 1/3 \\ 1/3 \\ 1/3   \end{array} \right]$,
for the $3 \times 5$ matrix:
$$ A = \left[  \begin{array}{cccccc}
              1 & 0 & 0 & p   & 0 \\
              0 & 1 & 0 & 1-p & q \\
              0 & 0 & 1 & 0   & 1-q \end{array} \right]  \; . $$
This leads to the three equation s $1-p=1/3, 1-(1-p)-q = 1/3, 1-(1-q)=1/3$
which gives $p=2/3,q=1/3$.

\paragraph{}
Assume we find $P$ such that $P \omega = K$ is constant. Is this unique?
The set of solutions $P$ is a convex set. The inverse problem for the
stochastic matrix $P$ with constraint that $p_x(v)=0$ if $v$ is not in $x$
can have infinitely many solutions or have a unique solution.

\begin{thm}
If $G$ is a one-dimensional simplicial complex which is a tree, then
there is a unique probability space in each edge for which curvature is constant.
\end{thm}
\begin{proof}
Proof by induction. There is nothing to prove if the tree is a seed $K_1$, meaning
that there is no edge. The proof goes by induction with respect to the number of
edges. Assume the statement has been proven for graphs with $n$ edges,
take a graph with $n+1$ edges, pick leaf, an end point $x$ of the tree which has only one neighbor. Since
the curvature has to be $1/|V|$ we know $p_x$ on the edge $e$ leading to $x$. This
defines the probability space on this edge. Now take the equilibrium measure which is
given on the rest by induction.
\end{proof}

\paragraph{}
We can also see it from linear algebra: we have a free variable for every edge given $|E|$ variables.
and $|V|$ equations where one of them is automatically satisfied by the
Gauss-Bonnet formula. So, we have the same number of variables than equations.
We can not have $|E| < |V|-1$ for one dimensional connected complexes
as this would imply $\chi(G)>1$ and we know that $\chi(G)=b_0-b_1 = 1-b_1 \leq 1$.
Indeed, the Betti number $b_1$ matters:

\begin{thm}
For a one-dimensional complex, the solution space of probability measures $P$
satisfying the constant curvature equation $P \omega = K$ is $b_1$-dimensional.
\end{thm}
\begin{proof}
Use induction with respect to the number $b_1$ of loops. It is easier for induction
to prove a slightly stronger statement. Lets call a vertex $v$ in a graph with
vertex degree $1$ a ``leave". Leaves are vertices with energy $\omega(v)=1$. We
can more generally assign to a leaf an energy $H(v) \in [0,1]$. With $H(x)=\omega(x)$
for the other simplices in the graph, we have the total energy $H(G)=\sum_x H(x)$.
It is now smaller than $\chi(G)$. Still, we can distribute the energies of the edges
around to get constant curvature. We prove this statement by induction.
In the case of $b_1=0$ loops we have a tree for which we have uniqueness in producing
the curvature. Also this case can be proven by induction with respect to the number of vertices:
just cut one leave and the corresponding stem edge to that leave to get the statement for one vertex less.
For a tree we can even replace the energy $\omega(v)=1$
of a finite number $k$ of ``leaf vertices" (a vertex with vertex degree 1), with $\omega(v)=0$ and lower
the total energy from $\chi(G)=1$ to $1-k$. Now, we can realize the constant curvature $(1-k)/n$
everywhere.  By cutting a loop by removing an edge $e$ we obtain two more leaves
and moving $\omega(e)=-1$ to one of the two vertices, we get a graph with one loop less for which
the energy at one leaf is $0$.
For any generator $\gamma$ of the fundamental group we have a one-parameter choice to
shift around probabilities around $\gamma$. This shows that we have a $b_1$ dimensional
space of solutions. Alternatively, we can make $b_1$ cuts to get a tree and for each
cut, removing an edge $e=(a,b)$, we have a choice how to distribute the energy
$\omega(e)=-1$ to the two boundary points.
\end{proof}

\paragraph{}
Here are some examples. \\

1) In the case of a star graph $S_3 = \{ (1),(2),(3),(4),(12),(13),(14) \}$
which is an example of a tree, we have a $4 \times 7$ matrix
$$ P = \left[  \begin{array}{ccccccc}
              1 & 0 & 0 & 0   & p   &  q  & r   \\
              0 & 1 & 0 & 0   & 1-p &  0  & 0   \\
              0 & 0 & 1 & 0   & 0   & 1-q & 0   \\
              0 & 0 & 0 & 1   & 0   &  0  & 1-r \\
  \end{array} \right]  \; . $$
The constant curvature equation
$P [1,1,1,1,-1,-1,-1]= [1,1,1,1]/4$ has only one solution $P$
which is given by $p=q=r=1/4$.

\paragraph{}
2) In the case of a circular graph
$C_n$, we have an entire interval of solutions. Just pick the same probability
space in each case. For example, for the cyclic complex
$C_3 = \{ (1),(2),(3),(12),(23),(31) \}$, we have
$$ P = \left[  \begin{array}{cccccc}
              1 & 0 & 0 & p   & 0   & 1-r \\
              0 & 1 & 0 & 1-p & q   &  0  \\
              0 & 0 & 1 & 0   & 1-q &  r  \\ \end{array} \right]  \; . $$

\paragraph{}
3) Let us now look at the case of the triangle $K_3$ which is obtained
from $C_3$ by adding a $2$-dimensional cell
$K_3 = \{ (1),(2),(3),(12),(23),(31),(123)\}$. We have
$$ P = \left[  \begin{array}{ccccccc}
              1 & 0 & 0 & p   & 0   & 1-r & s \\
              0 & 1 & 0 & 1-p & q   &  0  & t \\
              0 & 0 & 1 & 0   & 1-q &  r  & 1-s-t \\ \end{array} \right]  \; . $$
In this case, we can chose $p,q,r$ and $t,s$ is determined. Since there are three
free variables $p,q,r$, there is also here no uniqueness. In general, for higher dimensional
spaces it is easier to distribute out curvature so that it becomes constant.

\bibliographystyle{plain}