Inequalities and higher order convexity

Abstract: We study the following problem: given n real arguments a1, ..., an and n real weights w1, ..., wn, under what conditions does the inequality w1 f(a1) + w2 f(a2) + ... + wn f(an) >= 0 hold for all functions f with nonnegative kth derivative for some given integer k? Using simple combinatorial techniques, we can prove many generalizations of theorems ranging from the Fuchs inequality to the criterion for Schur convexity.

\section{Introduction}

The theory of majorization is remarkably rich and complete, culminating in Karamata's inequality \cite{karamata}, Muirhead's inequality \cite{muirhead}, and the theory of Schur-convex functions \cite{schur} (Karamata's inequality is also known as the Hardy-Littlewood-Polya inequality \cite{inequalities}). It therefore seems natural to try to generalize it to functions with a higher order of convexity. In particular, we study the following problem:

Given $n$ real arguments $a_1, ..., a_n$ and $n$ real weights $w_1, ..., w_n$, under what conditions does the inequality
\[
w_1f(a_1) + w_2f(a_2) + \cdots + w_nf(a_n) \ge 0
\]
hold for all functions $f$ satisfying $f^{(k)}\ge0$ for some given integer $k$?

\section{Basics of higher order convex functions}

Higher order convexity was introduced by Popoviciu, who defined it in terms of the divided differences of a function. Divided differences are defined inductively as follows:
\begin{align*}
[a_1; f] =& f(a_1)\\
[a_1, ..., a_{n+1}; f] =& \frac{[a_1, ..., a_n; f] - [a_2, ..., a_{n+1}; f]}{a_1 - a_{n+1}}.
\end{align*}
He then defined a $k-1$th order convex function to be one with all $k+1$ order divided differences positive. If the function has a $k$th derivative, then it is known that such functions are exactly those for which $f^{(k)} > 0$ \cite{convex}. For simplicity, we will only deal with functions with nonnegative $k$th derivative, although these results can be extended to all $k-1$th order convex functions.

Intuitively, the prototypical increasing function is a step function, while the prototypical convex function is the absolute value function. More generally, the prototypical functions with positive $k+1$th derivative are functions such as the following:

\begin{definition}
\[
(x)_+^k := \begin{cases}
x^k&\text{if } x>0,\\
0&\text{if } x\leq 0.\end{cases}
\]
\end{definition}

\begin{lemma}\label{classification}
For all $f:[a,b] \to \RR$ with $f^{(k)} \geq 0$, there is a nondecreasing function $\alpha:[a,b] \to \RR$ and a $k-1$th degree polynomial $P$ such that
\[
f(x) = P(x) + \int_{t=a}^b (x-t)_+^{k-1} d\alpha(t).
\]
\end{lemma}
\begin{proof}
We prove by induction that we can in fact take $\alpha(t) = \frac{f^{(k-1)}}{(k-1)!}$. For the base case $k = 1$, we have
\[
\int_{t=a}^b (x-t)_+^0 \, df(t) = \int_{t=a}^x df(t) = f(x) - f(a).
\]
Now assume that it is proven for $k$, and we will prove it for $k+1$:
\begin{align*}
&\frac1{k!}\int_{t=a}^b (x-t)_+^k \, df^{(k)}(t)\\
= &\frac1{k!}\left[(x-t)_+^kf^{(k)}(t)\right]_{t=a}^b - \frac1{k!}\int_{t=a}^b f^{(k)}(t) \, d(x-t)_+^k\\
= &-\frac1{k!}(x-a)^kf^{(k)}(a) + \frac{k}{k!}\int_{t=a}^b (x-t)_+^{k-1} \, df^{(k-1)}(t),
\end{align*}
where the last integral is equal to $f(x)$ plus a polynomial of degree $k-1$ by the induction hypothesis.
\end{proof}

\begin{remark}
This lemma can be extended to arbitrary $k-1$th order convex functions if we interpret the integral as a Stieltjes integral, but the proof is more technical (see Bullen's paper, Corollary 8 \cite{criterion}).
\end{remark}

Our strategy from here on is to reduce proving an inequality on arbitrary $k-1$th order convex functions to proving it for the prototypical functions of the form $(x-t)_+^{k-1}$.

\begin{definition}
Given real arguments $a_1, a_2, ..., a_n$, real weights $w_1, w_2, ..., w_n$, and a positive integer $k$, let
\[
r_k(x) := \sum_{i=1}^n w_i (a_i - x)_+^{k-1}.
\]
\end{definition}

\begin{lemma}\label{auxiliaries}
Given real arguments $a_1, a_2, ..., a_n \in [a,b]$, real weights $w_1, w_2, ..., w_n$, and a positive integer $k$,
\[
\sum_{i=1}^n w_i f(a_i) \geq 0
\]
for all functions $f:[a,b] \to \RR$ with $f^{(k)} \geq 0$ iff
\[
\sum_{i=1}^n w_i a_i^j = 0 \text{ for integers } 0 \leq j < k \text{, and}
\]
\[
r_k(x) \geq 0 \text{ for all } x.
\]
\end{lemma}
\begin{proof}
Setting $f(x) = \pm x^j$ for $1 \leq j < k$ and $f(x) = (x-t)_+^{k-1}$, we see that both conditions are necessary. For the other direction, let $P$ and $\alpha:[a,b] \to \RR$ be as in Lemma \ref{classification}. Then we have
\begin{align*}
\sum_{i=1}^n w_i f(a_i) &= \sum_{i=1}^n w_i \left(P(a_i) + \int_{t=a_n}^{a_1} \! (a_i-t)_+^{k-1} d\alpha(t)\right)\\
&= \sum_{i=1}^n w_i P(a_i) + \int_{t=a_n}^{a_1} \left(\sum_{i=1}^n w_i (a_i-t)_+^{k-1}\right) d\alpha(t)\\
&= \int_{t=a_n}^{a_1} \! r_k(t) \, d\alpha(t) \geq 0. \qedhere
\end{align*}
\end{proof}

Using this lemma, it is \emph{in principle} possible to test the truth of an inequality by carefully analyzing $r_k(x)$ (using, say, the theory of Sturm chains). For instance, a complete classification of inequalities on functions with $f''' \ge 0$ is given by the following:

\begin{theorem}\label{useless}
Given real arguments $a_1 > a_2 > \cdots > a_n \in [a,b]$, and real weights $w_1, w_2, ..., w_n$ such that
\[
\sum_{i=1}^n w_i = \sum_{i=1}^n w_ia_i = \sum_{i=1}^n w_ia_i^2 = 0,
\]
a necessary and sufficient condition for the inequality
\[
\sum_{i=1}^n w_if(a_i) \ge 0
\]
to be true for every function $f:[a,b] \to \RR$ with $f''' \ge 0$ is that
\[
(\sum_{i=1}^j w_i)(\sum_{i=1}^j w_ia_i^2) \ge (\sum_{i=1}^j w_ia_i)^2
\]
for all $j$ such that $(\sum_{i=1}^j w_i)a_j \ge \sum_{i=1}^j w_ia_i \ge (\sum_{i=1}^j w_i)a_{j+1}$.
\end{theorem}
\begin{proof}
By Lemma \ref{auxiliaries}, we just need to find the condition for $r_3$ to be nonnegative on $[a,b]$. The conditions imply that $r_3$ is $0$ outside of the interval $[a,b]$, so if it is ever negative then it must have a local minimum in some interval $[a_{j+1},a_j]$. $r_3$ is quadratic on each interval, so we must then have $r_3'(a_{j+1}) \le 0 \le r_3'(a_j)$, and the minimum of $r_3$ on this interval can be easily computed (the details are left to the reader).
\end{proof}

\section{A simple trick}

A little experimentation with small cases indicates that, generally, $r_k(x)$ is always positive or always negative when $n$ is small - there just aren't enough variables for it to change sign. Formally,

\begin{definition}
The number of \emph{sign changes} of a function $f:[a,b] \to \RR$, is the maximum number $n$ such that there exist real numbers $a_1 \geq a_2 \geq \cdots \geq a_{n+1} \in [a,b]$ with $f(a_i)f(a_{i+1}) < 0$ for $1 \leq i \leq n$.
\end{definition}

\begin{lemma}\label{wiggles}
If a differentiable nonconstant function $f:[a,b] \to \RR$ is such that $f(a) = f(b) = 0$, then either $f$ has strictly fewer sign changes than $f'$, or both $f$ and $f'$ have an infinite number of sign changes.
\end{lemma}
\begin{proof}
This is an easy consequence of the mean value theorem.
\end{proof}

Now for the main result:

\begin{theorem}\label{counting}
Given real arguments $a_1 > a_2 \geq a_3 \geq \cdots \geq a_n \in [a,b]$, real weights $w_1, w_2, ..., w_n$, and a positive integer $k$ such that $w_1 > 0$,
\[
\sum_{i=1}^n w_i a_i^j = 0 \text{ for all integers } 0 \leq j < k,
\]
and such that one of the following three conditions is satisfied:
\begin{itemize}
\item There are at most $k$ sign changes in the sequence $w_1, w_2, ..., w_n$.
\item There are at most $k-1$ sign changes in the sequence $w_1, w_1+w_2, ..., w_1+\cdots+w_n$.
\item There are at most $k-2$ sign changes in the sequence $w_1a_1 - w_1a_1, (w_1a_1 + w_2a_2) - (w_1 + w_2)a_2, ..., (w_1a_1 + \cdots + w_na_n) - (w_1 + \cdots + w_n)a_n$.
\end{itemize}
Then we have
\[
\sum_{i=1}^n w_i f(a_i) \geq 0
\]
for all functions $f:[a,b] \to \RR$ with $f^{(k)} \geq 0$.
\end{theorem}
\begin{proof}
From the assumption $\sum_{i=1}^n w_i a_i^j = 0$, we see that $r_j(a) = r_j(b) = 0$ for all $1 \leq j \leq k$.

It's easy to see that the first condition implies the second condition, by a discrete analog of Lemma \ref{wiggles}.

To understand the second condition, note that $r_1$ is a step function taking the values $w_1, w_1+w_2, ..., w_1+\cdots+w_n$, so the number of sign changes in this sequence is the same as the number of sign changes of $r_1$.

To understand the third condition, note that $r_2$ is a piecewise linear function taking the value $0$ outside the interval $[a,b]$ and that the values of $r_2$ at the points where its slope changes are given by the sequence $w_1a_1 - w_1a_1, (w_1a_1 + w_2a_2) - (w_1 + w_2)a_2, ..., (w_1a_1 + \cdots + w_na_n) - (w_1 + \cdots + w_n)a_n$, so the number of sign changes of this sequence is the same as the number of sign changes of $r_2$.

Now, since $r_j'(x) = jr_{j-1}(x)$, we get from repeated application of Lemma \ref{wiggles} that for each $j$, the number of sign changes of $r_j(x)$ is at most $k-j$, so $r_k$ has $0$ sign changes. Thus, since $r_k(a_2) = w_1(a_1-a_2)^{k-1} > 0$, $r_k(x)$ must be nonnegative for all $x$. At this point, we simply apply Lemma \ref{auxiliaries} to finish the proof.
\end{proof}

\begin{remark}
Based on the proof, we can also see that if
\[
\sum_{i=1}^n w_i a_i^j = 0 \text{ for all integers } 0 \leq j < k,
\]
then there can't be fewer than $k-1$ sign changes in the sequence $w_1, w_1+w_2, ..., w_1+\cdots+w_n$.
\end{remark}

\section{Applications}

\begin{corollary}\label{smooth1}
Given real numbers $a_1, a_2, ..., a_k \in [a,b]$ and $b_1, b_2, ..., b_k \in [a,b]$ such that
\[
\sum_{i=1}^k a_i^j = \sum_{i=1}^k b_i^j \text{ for all integers } 1 \leq j < k,
\]
the following are equivalent:
\begin{enumerate}
\item $\sum_{i=1}^k a_i^k \geq \sum_{i=1}^k b_i^k\\$
\item $\max \{a_i\}_{i=1}^k \geq \max \{b_i\}_{i=1}^k\\$
\item $\sum_{i=1}^k f(a_i) \geq \sum_{i=1}^k f(b_i) \text{ for all functions } f:[a,b] \to \RR$ \text{ with } $f^{(k)} \geq 0.$
\end{enumerate}
\end{corollary}

The $k = 3$ case of Corollary \ref{smooth1} was originally proved by Vasile C{\^{\i}}rtoaje, using the identity
\[
f(x) + f(y) + f(z) - f(a) - f(b) - f(c)=\frac 1{2}(xyz-abc)f'''(w)
\]
for some $w$ in the smallest interval containing all of $a, b, c, x, y, z$ \cite{vasc}.

In general, it's easy to see that the third bullet point of Corollary \ref{smooth1} implies the other two bullet points by plugging in $f(x) = x^k$ or $f(x) = (x-\max\{a_i\}_{i=1}^k)_+^{k-1}$, and that since we can't have equality in either of the first two bullet points when the sets $\{a_i\}_{i=1}^k, \{b_i\}_{i=1}^k$ are different (by the fundamental theorem of algebra applied to the polynomials $\prod_{i=1}^k(x-a_i)$ and $\prod_{i=1}^k(x-b_i)$) the reverse implications will hold if we can prove that $r_k$ has no sign changes. Thus, Corollary \ref{smooth1} follows from the argument of the next Corollary upon setting $a_{k+1} = b_{k+1}$.

\begin{corollary}\label{smooth2}
Given real numbers $a_1 \geq a_2 \geq \cdots \geq a_{k+1} \in [a,b]$ and $b_1 \geq b_2 \geq \cdots \geq b_{k+1} \in [a,b]$ with $a_1 \ge b_1$ and $(-1)^k a_{k+1} \le (-1)^k b_{k+1}$ such that
\[
\sum_{i=1}^{k+1} a_i^j = \sum_{i=1}^{k+1} b_i^j \text{ for all integers } 1 \leq j < k,
\]
we have
\[
\sum_{i=1}^{k+1} f(a_i) \geq \sum_{i=1}^{k+1} f(b_i)
\]
for all functions $f:[a,b] \to \RR$ with $f^{(k)} \geq 0$.
\end{corollary}
\begin{proof}
Let $c_1 \geq c_2 \geq \cdots \geq c_{2k+2}$ be the union of the $a_i$s and the $b_i$s, and let $w_j$ be either $1$ or $-1$, depending on whether $c_j$ was originally an $a_i$ or a $b_i$. By Theorem \ref{counting}, it's enough to show that the sequence $w_1, w_1+w_2, ..., w_1+\cdots+w_{2k+2}$ has at most $k-1$ sign changes.

Assume, for the sake of contradiction, that $w_1, w_1+w_2, ..., w_1+\cdots+w_{2k+2}$ has at least $k$ sign changes. Then we must have a sequence $i_1 \leq i_2 \leq \cdots \leq i_{k+1}$ such that $(w_1+\cdots+w_{i_j})(w_1+\cdots+w_{i_{j+1}}) < 0$ for all $j$. Then $i_{j+1} \geq i_j+2$, so $2k+2 > i_{k+1} \geq i_k+2 \geq \cdots \geq i_1+2k \geq 2k+1$ ($i_{k+1} \neq 2k+2$, because $w_1+\cdots+w_{2k+2} = 0$). Thus, we must have $i_1 = 1$, $i_{k+1} = 2k+1$, and $(-1)^kw_1(w_1+\cdots+w_{2k+1}) > 0$. On the other hand, since $c_1 = a_1$, we have $w_1 = 1 > 0$, and similarly $w_1+\cdots+w_{2k+1} = -w_{2k+2} = (-1)^{k+1}$, a contradiction.
\end{proof}

A similar argument gives us the following Corollary, but instead we will directly derive it from Corollary \ref{smooth2}:

\begin{corollary}\label{gensen2}
Given real arguments $a_1 > a_2 > \cdots > a_{k+2} \in [a,b]$ and weights $w_1, w_2, ..., w_{k+2}$  with $w_1 \geq 0$ and $(-1)^kw_{k+2} \geq 0$ such that
\[
\sum_{i=1}^{k+2} w_i a_i^j = 0 \text{ for all } 0 \leq j < k,
\]
we have
\[
\sum_{i=1}^{k+2} w_i f(a_i) \geq 0
\]
for all functions $f:[a,b] \to \RR$ with $f^{(k)} \geq 0$.
\end{corollary}
\begin{proof}
Let $p_1, p_2 ..., p_{k+2}:[-\epsilon, \epsilon] \to \RR$ be monotone, differentiable functions such that $p_i(0) = a_i$, $p_1'(0) = w_1$, $p_{k+2}'(0) = w_{k+2}$, and
\[
\sum_{i=1}^{k+2} p_i(x)^j
\]
is constant for integers $1 \leq j < k+1$. Then, since $p_1$ is increasing and $(-1)^{k+1}p_{k+2}$ is decreasing, we can apply Corollary \ref{smooth2} to see that the function $\alpha:[-\epsilon, \epsilon] \rightarrow \RR$ given by
\[
\alpha(x) = \sum_{i=1}^{k+2} F(p_i(x))
\]
is increasing for any functions $F:[a,b] \to \RR$ with $F^{(k+1)} \geq 0$. Differentiating with respect to $x$ at $0$, we get that
\[
\sum_{i=1}^{k+2} p_i'(0)F'(a_i) \geq 0.
\]
Since the $p_i'(0)$s satisfy the same $k$ independent linear equations as the $w_i$s, $p_1'(0) = w_1$, and $p_{k+2}'(0) = w_{k+2}$, we get that $p_i'(0) = w_i$ for all $i$. Now we just take $F$ such that $F' = f$ to finish the proof.
\end{proof}

Just for fun, let's derive the weighted analogue of Corollary \ref{smooth1} with a completely elementary method (i.e., without depending on Lemma \ref{classification}):

\begin{corollary}\label{gensen}
Given real arguments $a_1 > a_2 > \cdots > a_{k+1} \in [a,b]$ and weights $w_1, w_2, ..., w_{k+1}$  with $w_1 \geq 0$ such that
\[
\sum_{i=1}^{k+1} w_i a_i^j = 0 \text{ for all } 0 \leq j < k,
\]
we have
\[
\sum_{i=1}^{k+1} w_i f(a_i) \geq 0
\]
for all functions $f:[a,b] \to \RR$ with $f^{(k)} \geq 0$.
\end{corollary}
\begin{proof}
We use induction on $k$. When $k = 1$, the Corollary follows trivially from the fact that $f$ is increasing, while for $k = 2$ it is just a restatement of the weighted Jensen inequality on two variables. Assume that it is true for $k-1$. We can assume that $a_{k+1} = 0$ without loss of generality. Now, define a new function $h:[a,b] \to \RR$ by
\[
h(t) := \sum_{i=1}^{k+1} w_i f(ta_i).
\]
Since $h(0) = 0$, it is enough to show that $h'(t) \geq 0$ for $0 \leq t \leq 1$. But $h'(t)$ is just
\[
\sum_{i=1}^k w_ia_i f'(ta_i),
\]
since $a_{k+1} = 0$. Now we see that the arguments $ta_1 \geq ta_2 \geq \cdots \geq ta_k$, the weights $w_1a_1, w_2a_2, ..., w_ka_k$ and the function $f'$ satisfy the conditions of the Corollary for $k-1$, so we can apply the induction hypothesis to see that $h'(t) \geq 0$.
\end{proof}

Corollary \ref{gensen} is, in fact, a restatement of the fact that $[a_1, ..., a_{k+1}; f]$ is positive for functions with positive $k$th derivative. Using only this fact, one can prove the following theorem, which can be found in Popoviciu's book \cite{convex}:

\begin{theorem}\label{Big Hammer}
Given real arguments $a_1 > a_2 > \cdots > a_n \in [a,b]$, real weights $w_1, w_2, ..., w_n$, and a given integer $k$ such that
\[
\sum_{i=1}^n w_i a_i^j = 0 \text{ for all } 0 \leq j < k \text{, and}
\]
\[
\sum_{i=1}^j w_i (a_i - a_{j+1})(a_i - a_{j+2})\cdots(a_i - a_{j+k-1}) \geq 0
\text{ for all } 1 \leq j \leq n-k,
\]
we have
\[
\sum_{i=1}^n w_i f(a_i) \geq 0
\]
for all functions $f:[a,b] \to \RR$ with $f^{(k)} \geq 0$.
\end{theorem}
\begin{proof}
The theorem follows directly from the following identity:
\[
\sum_{j=1}^n w_j f(a_j) = \sum_{j=1}^{n-k}(a_j-a_{j+k})
\left(\sum_{i=1}^j w_i (a_i - a_{j+1})\cdots(a_i - a_{j+k-1})\right)[a_j, ..., a_{j+k}; f].
\]
The proof of this identity is left as an exercise to the reader.
\end{proof}

\begin{remark}\label{counter}
When $k = 2$, Theorem \ref{Big Hammer} is equivalent to what Darij Grinberg calls the weighted Karamata inequality \cite{darij}. Plugging in the functions $f(x) = (x-a_{j+1})_+$, we see that in the case $k = 2$, the condition given is both necessary and sufficient.

Since the condition from Corollary \ref{gensen2} is both necessary and sufficient, and equivalent to the condition in Theorem \ref{Big Hammer} whenever $n \leq k+2$, we can easily see that any inequality not following from Theorem \ref{Big Hammer} must have $k \geq 3$, $n \geq k+3 \geq 6$. A simple example of such an inequality with $k = 3$, $n = 6$ is the following:
\[
f(6) - 3f(5) + 3f(4) - 3f(2) + 3f(1) - f(0) \geq 0,
\]
which, though it doesn't satisfy the conditions of Theorem \ref{Big Hammer}, can easily be seen to be true by adding $-f(3) + f(3)$ to the left hand side, giving the equivalent inequality $6[6, 5, 4, 3; f] + 6[3, 2, 1, 0; f] \geq 0$.
\end{remark}

The condition given in Theorem \ref{Big Hammer}, although easier to check than the condition of Lemma \ref{auxiliaries}, is still inconvenient because of the need to order all of the variables involved. On the other hand, to apply inequalities such as the Karamata inequality or the Fuchs inequality \cite{fuchs}, one only needs to order the variables occurring on each side of the inequality before applying the corresponding theorem. The next theorem is an attempt to find a simpler condition for inequalities on functions with nonnegative third derivative.

\begin{theorem}\label{small hammer}
Given weights $w_1, ..., w_n$, real numbers $a_1 \geq \cdots \geq a_n \in [a,b]$, and real numbers $b_1 \geq \cdots \geq b_n \in [a,b]$ such that $\min(a_i, b_i) \geq \max(a_{i+1}, b_{i+1})$,
\[
\sum_{i=1}^n w_ia_i = \sum_{i=1}^n w_ib_i \text{, }
\sum_{i=1}^n w_ia_i^2 = \sum_{i=1}^n w_ib_i^2 \text{, and}
\]
\[
\sum_{i=1}^j w_i(a_i-a_{j+1})(a_i-b_{j+1}) \geq \sum_{i=1}^j w_i(b_i-a_{j+1})(b_i-b_{j+1})
\]
for all $1 \leq j < n$, we have
\[
\sum_{i=1}^n w_if(a_i) \geq \sum_{i=1}^n w_if(b_i).
\]
for all functions $f:[a,b] \to \RR$ with $f''' \ge 0$.
\end{theorem}
\begin{proof}[Proof 1, using Theorem \ref{Big Hammer}]
Notice that the last set of conditions make up every other condition from the second set of conditions of Theorem \ref{Big Hammer}. We can assume without loss of generality that $b_j = \min(a_j, b_j)$, and $a_{j+1} = \max(a_{j+1}, b_{j+1})$ (by swapping them and negating the weights, if necessary). We would like to prove that, given
\begin{align}
\label{eq1}\sum_{i=1}^j w_i(a_i-a_j)(a_i-b_j) \geq& \sum_{i=1}^j w_i(b_i-a_j)(b_i-b_j) \text{ and}\\
\label{eq2}\sum_{i=1}^j w_i(a_i-a_{j+1})(a_i-b_{j+1}) \geq& \sum_{i=1}^j w_i(b_i-a_{j+1})(b_i-b_{j+1}) \text{, we have}\\
\label{eq3}\sum_{i=1}^j w_i(a_i-b_j)(a_i-a_{j+1}) \geq& \sum_{i=1}^j w_i(b_i-b_j)(b_i-a_{j+1}).
\end{align}
Suppose first that we have the inequality
\begin{equation}
\tag{*}\label{*} \sum_{i=1}^j w_ia_i \geq \sum_{i=1}^j w_ib_i,
\end{equation}
and note that it is equivalent to the inequality
\[
(a_j-a_{j+1})\sum_{i=1}^j w_i(a_i-b_j) \geq (a_j-a_{j+1})\sum_{i=1}^j w_i(b_i-b_j).
\]
Adding this to (\ref{eq1}), we get (\ref{eq3}).

Similarly, suppose that we have the opposite inequality
\begin{equation}
\tag{**}\label{**} \sum_{i=1}^j w_ia_i \leq \sum_{i=1}^j w_ib_i,
\end{equation}
and note that it is equivalent to the inequality
\[
(b_{j+1}-b_j)\sum_{i=1}^j w_i(a_i-b_j) \geq (b_{j+1}-b_j)\sum_{i=1}^j w_i(b_i-b_j).
\]
Adding this to (\ref{eq2}), we get (\ref{eq3}).

Since at least one of the two inequalities (\ref{*}), (\ref{**}) is true, (\ref{eq3}) must be true if both (\ref{eq1}) and (\ref{eq2}) are true.
\end{proof}
\begin{proof}[Proof 2]
Applying Abel Summation twice, we find that
\begin{align*}
&\sum_{i=1}^n w_i(f(a_i)-f(b_i))\\
= &\sum_{j=1}^n \left(\sum_{i=1}^j w_ia_i -w_ib_i\right)
\left(\frac{f(a_j)-f(b_j)}{a_j-b_j}-\frac{f(a_{j+1})-f(b_{j+1})}{a_{j+1}-b_{j+1}}\right)\\
= &\sum_{j=1}^n \left(\sum_{i=1}^j w_i(a_i-a_{j+1})(a_i-b_{j+1})-w_i(b_i-a_{j+1})(b_i-b_{j+1})\right) \times\\
&\left(\frac{\frac{f(a_j)-f(b_j)}{a_j-b_j}-\frac{f(a_{j+1})-f(b_{j+1})}{a_{j+1}-b_{j+1}}}{a_j+b_j-a_{j+1}-b_{j+1}}
-\frac{\frac{f(a_{j+1})-f(b_{j+1})}{a_{j+1}-b_{j+1}}-\frac{f(a_{j+2})-f(b_{j+2})}{a_{j+2}-b_{j+2}}}{a_{j+1}+b_{j+1}-a_{j+2}-b_{j+2}}\right).
\end{align*}
Thus, it suffices to show that
\[
\frac{\frac{f(a_j)-f(b_j)}{a_j-b_j}-\frac{f(a_{j+1})-f(b_{j+1})}{a_{j+1}-b_{j+1}}}{a_j+b_j-a_{j+1}-b_{j+1}} \geq
\frac{\frac{f(a_{j+1})-f(b_{j+1})}{a_{j+1}-b_{j+1}}-\frac{f(a_{j+2})-f(b_{j+2})}{a_{j+2}-b_{j+2}}}{a_{j+1}+b_{j+1}-a_{j+2}-b_{j+2}}.
\]
Plugging in $f(x) = 1$, $x$, and $x^2$, we get equality. Assume, as in the first proof, that $a_j \ge b_j \ge \cdots \ge b_{j+2}$, collect everything on the left hand side of the inequality, and let $w_{2i}$ be the weight on $f(a_{j+i})$, and $w_{2i+1}$ be the weight on $f(b_{j+i})$. Since $w_{2i} + w_{2i+1} = 0$, only three of the partial sums of the weights are nonzero, so there are at most 2 sign changes among the partial sums of the weights, and thus by Theorem \ref{counting} we are done.
\end{proof}

The corresponding unweighted inequality (proved by applying the previous theorem with integer weights) is:

\begin{corollary}\label{superize}
Given real numbers $a_1 \geq \cdots \geq a_n$, and real numbers $b_1 \geq \cdots \geq b_n$ such that either $\min(a_i, b_i) \geq \max(a_{i+1}, b_{i+1})$ or $\{a_i, b_i\} = \{a_{i+1}, b_{i+1}\}$ for all $i$,
\[
\sum_{i=1}^n a_i = \sum_{i=1}^n b_i \text{, }
\sum_{i=1}^n a_i^2 = \sum_{i=1}^n b_i^2 \text{, and}
\]
\[
\sum_{i=1}^j (a_i-a_j)(a_i-b_j) \geq \sum_{i=1}^j (b_i-a_j)(b_i-b_j) \text{ for all } j,
\]
we have
\[
\sum_{i=1}^n f(a_i) \ge \sum_{i=1}^n f(b_i).
\]
\end{corollary}

\begin{example}
The inequality $f(11) + f(8) + f(8) + f(7) + f(3) + f(1) \geq f(10) + f(10) + f(6) + f(6) + f(6) + f(0)$, for functions with $f''' \ge 0$, doesn't follow directly from Corollary \ref{superize} (because $(a_3, b_3) = (8, 6)$ and $(a_4, b_4) = (7, 6)$), but if we add $f(7)$ to both sides, then we can apply Corollary \ref{superize} to check that it is true.
\end{example}

\section{Maximal and minimal expressions}

Fix a number $k \ge 3$, a number $n \ge k$, and reals $s_1, ..., s_{k-1}$, and let $S_k$ be the set $\{(x_1, ..., x_n) \in \mathbb{R}^n | x_1 \ge x_2 \ge \cdots \ge x_n, \sum_{i=1}^n x_i^j = s_j \text{ for } j = 1, ..., k-1\}$, with the topology induced from $\mathbb{R}^n$. We can define a partial ordering on $S$ by

\begin{definition}
Let $a = (a_1, ..., a_n)$, $b = (b_1, ..., b_n)$, then we say $a \succ_k b$ if, for all functions $f$ with $f^{(k)} \ge 0$, we have
\[
\sum_{i=1}^n f(a_i) \ge \sum_{i=1}^n f(b_i).
\]
\end{definition}

An immediate question that comes to mind about this ordering is this one: are there elements $x_{min}, x_{max} \in S_k$ such that for all $x \in S_k$, $x_{max} \succ_k x \succ_k x_{min}$? If so, what do they look like? Since any $x$ determines the set $S_k$ containing it, we speak of maximal and minimal $x$ without specifying $S_k$ explicitly (other than mentioning the value of $k$).

First, let's see what happens when $n = k$:

\begin{lemma}\label{1d}
If $x \in S_k$ locally maximizes the function $\sum_{i=1}^k x_i^k$, then there exists an $i$ such that $x_{2i} = x_{2i+1}$, and if $x$ locally minimizes it then there exists an $i$ such that $x_{2i-1} = x_{2i}$.
\end{lemma}
\begin{proof}
Consider the polynomial $p(t) = (t-x_1)(t-x_2)\cdots(t-x_k)$. If we vary the constant term of this polynomial while keeping the other coefficients fixed, then as long as it still has $k$ real roots $y_1, ..., y_n$ we will have $y \in S_k$ and $y \succ_k x$ iff the constant term was increased (by Corollary \ref{smooth1} and Newton's identities). Then we can increase the constant term while keeping all of the roots real iff there are no double roots at which the second derivative of the polynomial is $\ge 0$, and can decrease the constant term iff there are no double roots at which the second derivative is $\le 0$, and these conditions are clearly equivalent to the conditions given in the statement of the Lemma.
\end{proof}

Note that if an element $x \in S_k$ is maximal with respect to our ordering (no longer restricting ourselves to the case $n = k$), then for any $k$ integers $1 \le i_1 < \cdots < i_k \le n$, $x' = (x_{i_1}, ..., x_{i_k})$ must be maximal in the set $S_k'$ containing it, and thus by Lemma \ref{1d} and Corollary \ref{smooth1}, there is some integer $j$ such that $x_{i_{2j}} = x_{i_{2j+1}}$ (the corresponding statement is also true for minimal $x$, with the roles of even and odd indices reversed). Now, we can classify all maximal elements as follows:

\begin{theorem}\label{extreme}
For any $x \in S_k$, the following conditions are equivalent:
\begin{enumerate}
\item $x$ locally maximizes the function $\sum_{i=1}^n x_i^k$ in $S_k$.
\item There exist integers $1 = i_1 \le \cdots \le i_k = n+1$ such that $x_{i_j} = x_{i_j+1} = \cdots = x_{i_{j+1}-1}$ and $i_{2j} - i_{2j-1} \in \{0, 1\}$ for each $j$.
\item For all $y \in S_k$, $x \succ_k y$.
\end{enumerate}
\end{theorem}
\begin{proof}
$(1) \implies (2)$ For any integer $i$, let $s(i)$ be the smallest integer larger than $i$ such that $x_{s(i)} \ne x_i$ (or $n+1$ if no such number exists). We inductively form the sequence $i_1, ..., i_k$ by setting $i_1 = 1$, and $i_{j+1} = s(i_j)$ unless $j$ is odd and $s(i_j) \le n$, in which case we set $i_{j+1} = i_j+1$. Then, if $i_k \ne n+1$, we immediately see that the vector $(x_{i_1}, ..., x_{i_k})$ is not maximal in the set $S_k'$ containing it, a contradiction. The sequence $i_1, ..., i_k$ satisfies the required conditions.

$(2) \implies (3)$ Surprisingly, this is nothing more than an application of Theorem \ref{counting}! Let $sc(i)$ be the number of sign changes in the partial sums of the weights up to (but not including) the first partial sum containing the weight corresponding to $x_i$. Then it's easy to check that $sc(i_2) \le 1$, $sc(i_{2j+2}) \le sc(i_{2j}) + 2$, and, if k is odd, $sc(i_k) \le sc(i_{k-1})+1$ (they all follow from the fact that the partial sums are integers, so it takes at least two consecutive weights of the same sign for the partial sum to cross $0$). Thus, $sc(i_k) \le k-1$, so all that we have left to check for Theorem \ref{counting} is that $x_1 > y_1$ if $x \ne y$. But this must be the case, because otherwise $sc(i_2) = 0$, so $sc(i_k) < k-1$, contradicting the remark following Theorem \ref{counting}.

$(3) \implies (1)$ Obvious.
\end{proof}

A similar classification applies to minimal elements, with the roles of even and odd reversed once again. In the $k = 3$ case, this theorem is a special case of the $n-1$ Equal Variable Principle, due to Vasile C{\^{\i}}rtoaje, which states that a maximal element $x$ has $x_1 \ge x_2 = \cdots = x_n$, while a minimal element has $x_1 = \cdots = x_{n-1} \ge x_n$, even in a more general setting where $S$ is defined by fixing the sum of first powers and $p$th powers (of course, the condition that the third derivative is positive is replaced with a different condition: that $f'(x^{\frac{1}{p-1}})$ is convex) \cite{equal}.

We also have the following unexpected bonuses:

\begin{corollary}\label{connect}
$S_k$ is a connected set.
\end{corollary}
\begin{proof}
Every connected subset of $S_k$ is compact, and thus contains a point $x$ which is a local maximum of $\sum_{i=1}^n x_i^k$. Thus, this point $x$ is maximal with respect to our ordering on $S_k$. All that's left is to prove that maximal elements are unique (because then any two connected sets contain the same maximal element $x$). Suppose $y$ is another maximal element, let $i$ be the first integer such that $x_i \ne y_i$, and consider the function $f(z) = (z-\frac{x_i+y_i}{2})_+^{k-1}$ to find a contradiction.
\end{proof}

\begin{corollary}\label{point}
If $n \ge k$, then $S_k$ consists a single point iff $S_k$ contains a point which is maximal or minimal in $S_{k-1} = \{(x_1, ..., x_n) \in \mathbb{R}^n | x_1 \ge x_2 \ge \cdots \ge x_n, \sum_{i=1}^n x_i^j = s_j \text{ for } j = 1, ..., k-2\}$.
\end{corollary}
\begin{proof}
One direction is obvious. The other direction follows from a restatement of the second condition in Theorem \ref{extreme}: to any vector $x$, we can associate a string of $a$s and $b$s by assigning each block of equal coordinates of $x$ an $a$ if it has length $1$, and a $ba$ if it has length more than $1$. Then $x$ is extremal iff there is a way to insert $a$s and $b$s such that the transformed string is alternating $a$s and $ba$s and contains at most $k-1$ $a$s (maximal if it starts with an $a$, minimal if it starts with a $b$). If $S_k$ contains only one point, then it must be both maximal and minimal, so its corresponding string is a substring of both $abaa...a$ and $baaba...a$ containing at least one $b$ (if there was no $b$, then it would contain $n$ $a$s). But any maximal common substring of those containing at least one $b$ is one of the two such strings with $k-2$ $a$s (we can prove this by induction: either it's an $a$ followed by a maximal common substring of the two such strings with $k-2$ $a$s, or it doesn't start with an $a$, in which case it's a substring of $abaaba...$ without the first $a$. In either case, it's a substring of one of those two strings with $k-2$ $a$s.) Thus it's either maximal or minimal for $k-1$.
\end{proof}

\section{Increasing paths}

Another natural question to ask about $S_k$, digressing from our main aim of solving inequalities, is the question of whether $x \succ_k y$ implies that $x$ and $y$ are connected by an increasing path (the last section can easily be used to prove this when $x$ is maximal or $y$ is minimal). For $k = 1$ this is obvious, and for $k = 2$, it follows from the theory of majorization. It also holds when $n = k$, as is easily seen from the fact that $S_k$ is connected along with Corollary \ref{smooth1}. We might guess that this is in fact true for all $n, k$, offering as evidence proofs in the cases $n = k+1$ and $k = 3$:

\begin{theorem}\label{path2}
If $n = k+1$, then for any $a, b \in S_k$ such that $a \succ_k b$, there is a continuous function $p:[0, 1] \to S_k$ such that $p(0) = b, p(1) = a$ and $p(t_1) \succ_k p(t_0)$ for $t_1 \ge t_0$.
\end{theorem}
\begin{proof}
Let $q:[0, 1] \to S_k$ be any increasing path from $b$ to a maximal element of $S_k$, and let $t$ be the first time such that either the largest coordinate of $q(t)$ equals the largest coordinate of $a$ or the smallest coordinate of $q(t)$ equals the smallest coordinate of $a$. Then by Corollary \ref{smooth2}, we still have $a \succ_k q(t)$, so we can find an increasing path connecting $q(t)$ and $a$ (by canceling the equal coordinates and applying the fact that there is always an increasing path when $n = k$).
\end{proof}

\begin{theorem}\label{path}
For any $a, b \in S_3$ such that $a \succ_3 b$, there is a continuous function $p:[0, 1] \to S_3$ such that $p(0) = b, p(1) = a$ and $p(t_1) \succ_3 p(t_0)$ for $t_1 \ge t_0$.
\end{theorem}
\begin{proof}
Suppose $a, b$ are a counterexample with minimal $n$. Then $a_i \ne b_j$ for any $i, j$. Let $m$ be the first integer such that $b_1 > a_m$. Define $r_3(x) = \sum_{i=1}^n (x-a_i)_+^2 - \sum_{i=1}^n (x-b_i)_+^2$, and let $x_0$ be the first real number less than $a_1$ such that $r_3(x_0) = 0$. We will prove first that if $r_3(x) \ge 0$ for all $x$, then $a_{m+1} > x_0$:

Let $y$ be the largest real less than $a_1$ such that $r_3'(y) \le 0$, then clearly $b_1 > y > x_0$ and $r_3''(y) < 0$. Also, we must have $r_3'(x_0) = 0$ and $r_3''(x_0) > 0$ (from the nonnegativity of $r_3$), so there must be at least two components of $a$ between $y$ and $x_0$ (since $r_3''$ is always an even integer, and increases by two for every component of $a$). Thus, since $a_{m-1} > b_1 > y$, we have $a_{m+1} = a_{m-1+2} > x_0$.

Thus, we can continuously decrease $(a_{m-1}, a_m, a_{m+1})$ with respect to our ordering without invalidating the inequality (since $r_3$ will stay the same outside the interval $[a_{m-1}, a_{m+1}]$ and never hits zero inside that interval), until one of $a_{m-1}, a_m, a_{m+1}$ is equal to some $b_i$. This happens by the time $(a_{m-1}, a_m, a_{m+1})$ becomes minimal, since $a_{m-1} > b_1 > a_m$. Then we can use induction to find a path from here.
\end{proof}

As a Corollary, we get a slight generalization of Schur Convexity:

\begin{corollary}\label{schur}
For any symmetric function $f: \mathbb{R}^n \to \mathbb{R}$, we have $f(a) \ge f(b)$ whenever $a \succ_3 b$ if and only if
\[
\left(\frac{\frac{\partial f}{\partial x_1}-\frac{\partial f}{\partial x_2}}{x_1-x_2} - \frac{\frac{\partial f}{\partial x_2}-\frac{\partial f}{\partial x_3}}{x_2-x_3}\right)(x_1-x_3) \ge 0
\]
for all $x_1, x_2, x_3 \in \mathbb{R}$.
\end{corollary}
\begin{proof}
The given condition is (locally) equivalent to the condition that
\[
f(x_1, x_2, x_3, a_4, ..., a_n) \succ_3 f(y_1, y_2, y_3, a_4, ..., a_n)
\]
whenever $(x_1, x_2, x_3) \succ_3 (y_1, y_2, y_3)$, and by the proof of Theorem \ref{path} we can form a (finite) chain of inequalities of this form, starting from $a$ and ending at $b$, as long as $a \succ_3 b$.
\end{proof}

Unfortunately, the proofs of the existence of increasing paths for $k = 3$ and $n=k+1$ don't generalize - in both cases, the paths found are built up by changing $k$ variables at a time. For instance, the following class of inequalities can't be proven by following such paths:

\begin{theorem}\label{six}
For any $x, y, z, a, b, c \ge 0$ such that $x^2+y^2+z^2 = a^2+b^2+c^2$ and $x^3+y^3+z^3 = a^3+b^3+c^3$, we have
\[
(x, y, z, -z, -y, -x) \succ_4 (a, b, c, -c, -b, -a)
\]
iff $\max(x, y, z) \ge \max(a, b, c)$.
\end{theorem}
\begin{proof}
The proof is based on Theorem \ref{counting}. There are at most five sign changes in the partial sums of the weights, so $r_3 = \frac{r_4'}{3}$ for this inequality has at most three sign changes. But $r_4$ is symmetric around $0$, so $r_4'$ has at most one sign change in $(0, \infty)$, and the given conditions are equivalent to $r_4(0) = r_4'(0) = 0$, so $r_4$ has no sign changes in $(0, \infty)$, and thus $r_4$ is always the same sign. Since $r_4(\max(a,b,c)) > 0$ when $\max(x, y, z) \ge \max(a, b, c)$, we see that in this case $r_4(t) \ge 0$ for all $t$. (The theorem still holds when $x^3+y^3+z^3 \ge a^3+b^3+c^3$, but we only need this version of the theorem for our counterexample.)
\end{proof}

\begin{example}
Now consider the path $p(t) = (x(t), y(t), z(t), -z(t), -y(t), -x(t))$ defined by the differential equations $\frac{dx}{dt} = \frac{1}{x(x-y)(x-z)}$ (and similarly for $\frac{dy}{dt}, \frac{dz}{dt}$). It's easy to see that then $\frac{d}{dt}(x^2+y^2+z^2) = \frac{d}{dt}(x^3+y^3+z^3) = 0$, and for any function $f$ with $f^{(4)} \ge 0$, we have
\[
\frac{d}{dt} \sum_{i=1}^6 f(p_i(t)) = [x(t), y(t), z(t), 0; f'] + [0, -x(t), -y(t), -z(t); f'].
\]
If there was some increasing path from $p(t)$ to $p(t+\epsilon)$ made by changing only $4$ variables at a time, this would imply that the above expression could be written as a positive linear combination of expressions of the form $[p_i(t), p_j(t), p_k(t), p_l(t); f']$. Plugging in $x(t) = 3, y(t) = 2, z(t) = 1$, we see that then Theorem \ref{Big Hammer} would be sufficient to prove that $f'(3) - 3f'(2) + 3f'(1) - 3f'(-1) + 3f'(-2) - f'(-3) \ge 0$, but we've already seen (Remark \ref{counter}) that this is not the case, contradiction.
\end{example}

\begin{conjecture}
For any integers $n, k$, reals $s_1, ..., s_{k-1}$, and any $a, b \in S_k = \{(x_1, ..., x_n) \in \mathbb{R}^n | x_1 \ge x_2 \ge \cdots \ge x_n, \sum_{i=1}^n x_i^j = s_j \text{ for } j = 1, ..., k-1\}$ such that $a \succ_k b$, there is a continuous function $p:[0, 1] \to S_k$ such that $p(0) = b, p(1) = a$ and $p(t_1) \succ_k p(t_0)$ for $t_1 \ge t_0$.
\end{conjecture}

Inequalities and higher order convexity


Tight bounds on the threshold for permuted k-colorability

Abstract: If each edge (u,v) of a graph G=(V,E) is decorated with a permutation pi_{u,v} of k objects, we say that it has a permuted k-coloring if there is a coloring sigma from V to {1,...,k} such that sigma(v) is different from pi_{u,v}(sigma(u)) for all (u,v) in E. Based on arguments from statistical physics, we conjecture that the threshold d_k for permuted k-colorability in random graphs G(n,m=dn/2), where the permutations on the edges are uniformly random, is equal to the threshold for standard graph k-colorability. The additional symmetry provided by random permutations makes it easier to prove bounds on d_k. By applying the second moment method with these additional symmetries, and applying the first moment method to a random variable that depends on the number of available colors at each vertex, we bound the threshold within an additive constant. Specifically, we show that for any constant epsilon > 0, for sufficiently large k we have2 k ln k - ln k - 2 - epsilon < d_k < 2 k ln k - ln k - 1 + epsilon.In contrast, the best known bounds on d_k for standard k-colorability leave an additive gap of about ln k between the upper and lower bounds.

\section{Introduction}

We consider random graphs $G(n,m)$ with $n$ vertices and $m$ edges
chosen uniformly without replacement.  We give each edge $(u,v)$ an
arbitrary orientation, and then associate it with a uniformly random
permutation $\pi_{u,v} \in S_k$, where $S_k$ denotes the group of
permutations of $k$ objects.  A \emph{permuted $k$-coloring} of this
decorated graph is a function $\sigma: V \to \{1,\ldots,k\}$ such
that $\sigma(v) \ne \pi_{u,v}(\sigma(u))$ for all edges $(u,v)$.  For
convenience we will sometimes reverse the orientation of an edge, and
write $\pi_{v,u} = \pi_{u,v}^{-1}$ when $u$ and $v$ are distinct.

We conjecture that there is a sharp threshold for the existence of
such a coloring in terms of the average degree $d=2m/n$:
\begin{conjecture}
\label{conj:threshold}
For each $k \ge 3$ there is a constant $d_k$ such that
\[
\lim_{n \to \infty} \Pr\left[\mbox{$G(n,m=dn/2)$ has a permuted $k$-coloring}\right]
= \begin{cases} 1 & d < d_k \\ 0 & d > d_k \, , \end{cases}
\]
\end{conjecture}
\noindent
where the probability space includes both the graph $G(n,m)$ and the set of permutations $\{\pi_{u,v}\}$.  Moreover, we conjecture that $d_k$ is also the threshold for standard graph $k$-colorability, which is the special case where $\pi_{u,v}$ is the identity permutation for all $u,v$:
\begin{conjecture}
\label{conj:same}
For the same $d_k$ as in Conjecture~\ref{conj:threshold},
\[
\lim_{n \to \infty} \Pr\left[\mbox{$G(n,m=dn/2)$ has a standard $k$-coloring}
\right]
= \begin{cases} 1 & d < d_k \\ 0 & d > d_k \, , \end{cases}
\]
\end{conjecture}

Why might these two thresholds be the same?  First note that if $G$ is a tree, we can ``unwind'' the permutations on the edges, changing them all to the identity, by permuting the colors at each vertex.  For any set of permutations $\{\pi_{u,v}\}$, this gives a one-to-one map from permuted colorings to standard colorings.  Since sparse random graphs are locally treelike, for almost all vertices $v$ we can do this transformation on a neighborhood of radius $\Theta(\log n)$ around $v$.  The effect on $v$'s neighborhood of the other vertices' colors is then the same as it would be in standard graph coloring, except that the colors on the boundary are randomly permuted.

In particular, suppose we choose a uniformly random coloring of a tree, erase the colors in its interior, and choose a new uniformly random coloring with the same boundary conditions.  The \emph{reconstruction threshold} is the degree $d$ above which this new coloring retains a significant amount of information about the original coloring~\cite{bhatnagar,sly}, and it is closely related to the clustering transition~\cite{recon-cluster}.  Since we can unwind the permutations on a tree, permuted $k$-colorability and standard $k$-colorability trivially have the same reconstruction threshold.

For another argument, consider the following alternate way to choose the permutations on the edges.  First choose a uniformly random permutation $\pi_u$ at each vertex $u$.  Then, on each edge $(u,v)$, let $\pi_{u,v} = \pi_u^{-1} \pi_v$.  (Algebraically, $\pi_{u,v}:E \to S_k$ is the coboundary of $\pi_u:V \to S_k$.)  Since $c(u) = \pi_{u,v}(c(v))$ if and only if $\pi_u(c(v)) = \pi_v(c(v))$, a local change of variables again gives a one-to-one map from permuted colorings to standard ones.  Now note that choosing $\pi_{u,v}$ in this way yields a uniform joint distribution on any set of edges that does not include a cycle; for instance, on a graph of girth $g$ the $\pi_{u,v}$ are $(g-1)$-wise independent and uniform.  Since most loops in a sparse random graph are long, we might hope that this distribution on the $\{\pi_{u,v}\}$ is the same, for all practical purposes, as the uniform distribution.

Finally, perhaps the most convincing argument for Conjecture~\ref{conj:same} comes from statistical physics.  Using cavity field equations to analyze the asymptotic behavior of message-passing algorithms such as belief propagation and survey propagation, we can derive thresholds for satisfiability or colorability~\cite{mezard-zecchina,mertens-mezard-zecchina,mulet}, as well as other thresholds such as clustering, condensation, and freezing~\cite{lenka-col,krzakala:etal:pnas}.  However, assuming that there is an equal density of vertices of each color, the cavity field equations for $k$-coloring in a random graph are identical to those for permuted $k$-coloring~\cite{lenka-potts,lenka-boettcher}: they simply express the fact that each edge $(u,v)$ forbids $u$ from taking a single color that depends on the color of $v$.

Thus if the physics picture is correct---and parts of it have been shown rigorously (e.g.~\cite{ach-aco-rt,amin-catch,amin-lenka})---then colorings and permuted colorings have the same ``thermodynamics'' on sparse random graphs, and hence the same thresholds for colorability, as well as for clustering, condensation, and freezing.

Conjecture~\ref{conj:same} is attractive because it is easier, given current methods, to prove tight bounds on the threshold for permuted $k$-coloring than it is for standard $k$-coloring.
First we recall a simple upper bound.  Let $X$ denote the number of permuted $k$-colorings.  Since the permutations are chosen independently, the probability that any given coloring $\sigma$ is proper is $(1-1/k)^m$.  (Indeed, this is true of any multigraph with $m$ edges.) Thus the expected number of colorings is
\begin{equation}
\label{eq:expx}
\mathbb{E}[X] = k^n (1-1/k)^m = \left[ k (1-1/k)^{d/2} \right]^n \, .
\end{equation}
This is exponentially small if $k (1-1/k)^{d/2} < 1$, in which case $X=0$ with high probability by Markov's inequality.  Thus
\begin{equation}
\label{eq:upper}
d_k \le \frac{2 \ln k}{-\ln (1-1/k)} < 2 k \ln k - \ln k \, .
\end{equation}

Using the second moment method, we will prove a lower bound on $d_k$ that is an additive constant below this upper bound.  We also improve the upper bound, using a random variable that depends on the number of available colors at each vertex.  Our results show that, for any constant $\varepsilon > 0$ and $k$ sufficiently large,
\[
2 k \ln k - \ln k - 2 - \varepsilon \le d_k \le 2 k \ln k - \ln k - 1 + \varepsilon \, .
\]
In contrast, the best known lower bound on the threshold for standard $k$-colorability is roughly $\ln k$ below the first moment upper bound.

To simplify our arguments, we work in a modified random graph model $\tilde{G}(n,m)$ where the $m$ edges are chosen uniformly with replacement, and the endpoints of each edge are chosen uniformly with replacement from the $n$ vertices.  As a consequence, both self-loops and multiple edges occur with nonzero probability.  Note that, unlike standard $k$-colorability, a self-loop at a vertex $v$ does not necessarily render the graph uncolorable: it simply means that $\sigma(v)$ cannot be a fixed point of the permutation on the loop, i.e., $\sigma(v) \ne \pi_{v,v}(\sigma(v))$.

However, if $\pi_{v,v}$ is the identity then coloring is impossible, and this occurs with probability $1/k!$.  Similarly, if $u$ and $v$ have $k$ edges between them, then with constant probability the permutations on these edges make a coloring impossible.  As a consequence, the probability that $\tilde{G}(n,m)$ with random permutations has a permuted $k$-coloring is bounded below $1$.

Our bounds proceed by showing that $\tilde{G}(n,m)$ is permuted-$k$-colorable with probability $\Omega(1)$ if $d$ is sufficiently small, and is not permuted-$k$-colorable with high probability if $d$ is sufficiently large.  In the sparse case $m=O(n)$, $\tilde{G}(n,m)$ is simple with probability $\Omega(1)$, in which case it coincides with $G(n,m)$.  Thus, assuming that Conjecture~\ref{conj:threshold} is true, these values of $d$ are bounds on the threshold $d_k$ for $G(n,m)$.

The rest of the paper is organized as follows.  In Section~\ref{sec:second} we give our second moment lower bound.  In Section~\ref{sec:first} we give our upper bound, which uses a random variable that depends on the number of available colors.  In Section~\ref{sec:iso}, we prove an isoperimetric inequality relevant to this random variable.  We defer the parts of our proofs that are ``mere calculus'' to Section~\ref{sec:calculus}.

\section{The second moment lower bound}
\label{sec:second}

As in the simple first moment upper bound, let $X$ denote the number of permuted $k$-colorings of a random multigraph $\tilde{G}(n,m)$ with uniformly random permutations on its edges.  The Cauchy-Schwarz inequality applied to $X \cdot \; \mathbf{1}_{\{X > 0\}}$  gives
\[
\Pr[X > 0] \ge \frac{\mathbb{E}[X]^2}{\mathbb{E}[X^2]} \, .
\]
Our goal is to show that $\mathbb{E}[X^2] / \mathbb{E}[X]^2 = O(1)$, so that a permuted coloring exists with probability $\Omega(1)$, for a certain value of $d$.  Assuming Conjecture~\ref{conj:threshold}, \emph{i.e.,} that a threshold $d_k$ exists, any such $d$ is a lower bound on $d_k$.

Computing the second moment $\mathbb{E}[X^2]$ requires us to sum, over all pairs of colorings $\sigma, \tau$, the probability $P(\sigma,\tau)$ that both $\sigma$ and $\tau$ are proper.  Since the edges of $\tilde{G}$ and their permutations are chosen independently, we have
\[
P(\sigma,\tau) = p(\sigma, \tau)^m \, ,
\]
where $p(\sigma, \tau)$ is the probability that a random edge $(u,v)$, with a random permutation $\pi$, is satisfied by both colorings.  That is,
\[
p(\sigma, \tau) = \Pr_{u,v,\pi}\left[ \sigma(u) \ne \pi(\sigma(v)) \text{ and } \tau(u) \ne \pi(\tau(v)) \right] \, .
\]
For random constraint satisfaction problems where each variable takes one of two values, such as $k$-SAT or hypergraph $2$-coloring~\cite{ach-moore,ach-moore-hyp,ach-peres}, $p(\sigma, \tau)$ is a function $p(\zeta)$ just of the overlap between $\sigma$ and $\tau$, i.e., the fraction $\zeta$ of variables on which they agree.  The second moment can then be bounded by maximizing a function of $\zeta$, which is typically a simple calculus problem.

For pairs of $k$-colorings, however, $p(\sigma, \tau)$ depends on a $k$-by-$k$ matrix of overlaps, where $\zeta_{i,j}$ is the fraction of vertices $v$ such that $\sigma(v)=i$ and $\tau(v)=j$.  Computing the second moment then requires us to bound a function of roughly $k^2$ variables, a difficult high-dimensional maximization problem.  Achlioptas and Naor~\cite{ach-naor} used convexity arguments to bound this function on the Birkhoff polytope, showing that
\[
d_k \ge 2 (k-1) \ln (k-1) \approx 2 k \ln k - 2 \ln k \, .
\]
This leaves an additive gap of about $\ln k$ between the upper and lower bounds.  Note, however, that this bound is tight enough to determine, almost surely, the chromatic number $\chi(G)$ as a function of the average degree to one of two possible integers, namely $k$ or $k+1$ where $k$ is the smallest integer such that $2k \ln k > d$.  Achlioptas and Moore extended these arguments to random regular graphs~\cite{ach-moore-reg}, determining $\chi(G)$ as a function of $d$ to $k$, $k+1$, or $k+2$.

For permuted colorings, the second moment calculation is much easier.  The random permutations create additional local symmetries, making $p(\sigma, \tau)$ a function only of the fraction $\zeta$ on which the two colorings agree.  Thus we just have to maximize a function of a single variable.  As a consequence, we can prove a lower bound on $d_k$ that matches the upper bound~\eqref{eq:upper} within an additive constant.

\begin{theorem}
For any $\varepsilon > 0$, for sufficiently large $k$ we have
\begin{equation}
\label{eq:lower}
d_k > 2 k \ln k - \ln k - 2 - \varepsilon \, .
\end{equation}
\end{theorem}

\begin{proof}
To compute the second moment, we sum over all $k^n {n \choose k} (k-1)^{n-z}$ pairs of colorings that agree at $z$ of the $n$ vertices.  We say that such a pair has overlap $\zeta = z/n$.  Then
\begin{equation}
\label{eq:second-sum}
\mathbb{E}[X^2] = k^n \sum_{z=0}^n {n \choose z} (k-1)^{n-z} \,p(z/n)^m \, ,
\end{equation}
where $p(\zeta)$ is the probability that a random edge, with a random permutation, is satisfied by both colorings.  Inclusion-exclusion gives
\[
p(\zeta) = \zeta^2 \left( 1-\frac{1}{k} \right) + 2 \zeta (1-\zeta) \left( 1-\frac{2}{k} \right) + (1-\zeta)^2 \left( 1-\frac{2}{k}+\frac{1}{k(k-1)} \right) \, .
\]
Note that
\[
p(1/k) = \left( 1-\frac{1}{k} \right)^2 \, ,
\]
corresponding to the fact that two independently random colorings typically have overlap $\zeta = 1/k+o(1)$.

We proceed as in~\cite{ach-moore}.  Approximating the sum~\eqref{eq:second-sum} with an integral and using~\eqref{eq:expx} gives
\begin{equation}
\label{eq:second-int}
\frac{\mathbb{E}[X^2]}{\mathbb{E}[X]^2}
\sim \frac{1}{\sqrt{n}} \sum_{z=0}^n \mathrm{e}^{\phi(z/n) n}
\sim \sqrt{n} \int_0^1 \mathrm{d}\zeta \,\mathrm{e}^{\phi(\zeta) n} \, ,
\end{equation}
where $\sim$ hides multiplicative constants, where
\[
\phi(\zeta) = h(\zeta) + (1-\zeta) \ln (k-1) - \ln k + \frac{d}{2} \ln \frac{p(\zeta)}{(1-1/k)^2} \, ,
\]
and where $h(\zeta) = -\zeta \ln \zeta - (1-\zeta) \ln (1-\zeta)$ is the entropy function.  Applying Laplace's method to the integral~\eqref{eq:second-int} then gives
\[
\frac{\mathbb{E}[X^2]}{\mathbb{E}[X]^2} \sim \frac{\mathrm{e}^{\phi(\zeta_{\max}) n}}{\sqrt{|\phi''(\zeta_{\max})|}} \, ,
\]
where $\zeta_{\max} = \textrm{argmax}_{\zeta \in [0,1]} \phi(\zeta)$ is the global maximum of $\phi(\zeta)$, assuming that it is unique and that $\phi''(\zeta_{\max}) < 0$.

We have $\phi(1/k) = 0$, so if $\zeta_{\max} = 1/k$ and $\phi''(1/k) < 0$ then $\mathbb{E}[X^2] / \mathbb{E}[X]^2 = O(1)$ and $\Pr[X > 0] = \Omega(1)$. The proof is then completed by the following lemma:
\begin{lemma}
\label{lem:psi}
For any constant $\varepsilon > 0$, if $d = 2 k \ln k - \ln k - 2 - \varepsilon$ and $k$ is sufficiently large, $\phi''(1/k) < 0$ and $\phi(\zeta) < 0$ for all $\zeta \ne 1/k$.
\end{lemma}
\noindent
We defer the proof of this lemma to Section~\ref{sec:calculus}.
\end{proof}

\section{An improved first moment upper bound}
\label{sec:first}

In this section we apply the first moment method to a weighted random variable, and improve the upper bound~\eqref{eq:upper} on $d_k$ by a constant.  Specifically, we will prove the following theorem:
\begin{theorem}
\label{thm:upper}
For any $\varepsilon > 0$, for sufficiently large $k$ we have
\begin{equation}
\label{eq:betterupper}
d_k < 2 k \ln k - \ln k - 1 + \varepsilon \, .
\end{equation}
\end{theorem}

We define our random variable as follows.  Every coloring (proper or not) of $n$ vertices with $k$ colors is an element of $[k]^n$ where $[k]=\{1,2,\dots,k\}$.  Thus the set of colorings is an $n$-cube of side $k$, with a dimension for each vertex.  The set of \emph{proper} colorings is some subset of this cube, $S \subset [k]^n$.  The classic first moment argument we reviewed above computes the expected number of proper (permuted) colorings, $X=|S|$.  Here we define a new random variable, where each proper coloring is given a weight that depends on the ``degree of freedom'' at each vertex, i.e., the number of colors that vertex could take if the colors of all other vertices stayed fixed.

For any proper coloring $\sigma$, for each vertex $v$, let $c(\sigma, v)$ denote the number of colors available for $v$ if its neighbors are colored according to $\sigma$.  That is,
\[
c(\sigma, v) = k - \abs{ \{ \pi_{u,v}(\sigma(u)) \,|\, (u,v) \in E \} } \, .
\]
Note that if there are multiple edges between $u$ and $v$, they can each forbid $v$ from taking a color.  If $v$ has a self-loop, we think of it as denying a color to itself, in each direction:
\begin{equation}
\label{eq:self-loop}
c(\sigma, v) = k - \abs{ \{ \pi_{u,v}(\sigma(u)) \,|\, (u,v) \in E, u \ne v \} \cup \{ \pi_{v,v}(\sigma(v)), \pi_{v,v}^{-1}(\sigma(v)) } \, .
\end{equation}
If $\sigma$ is a proper coloring, we have $c(\sigma, v) \ge 1$ for all $v$, since $v$'s current color $\sigma(v)$ is available.  Let
\[
w(\sigma)
= \begin{cases}\prod_{v} \left( 1 / c(\sigma, v) \right)
& \mbox{if $\sigma$ is proper} \\
0 & \mbox{otherwise} \, ,
\end{cases}
\]
and let
\[
Z= \sum_{\sigma \in [k]^n} w(\sigma) \, .
\]

Why this random variable?  The expected number of colorings $\mathbb{E}[X]$ can be exponentially large, even above the threshold where $\Pr[X > 0]$ is exponentially small.  But close to the threshold, solutions come in clusters, where some vertices are free to flip back and forth between several available colors.  In a cartoon where each cluster is literally a subcube of $[k]^n$, a cluster containing a coloring $\sigma$ contributes $\prod_v c(\sigma,v)$ to $X$, but only $1$ to $Z$.  Thus, roughly speaking, $Z$ counts the number of clusters rather than the number of colorings.  Since the sizes of the clusters vary, $Z$ has smaller fluctuations than $X$ does, and hence gives a tighter upper bound on $d_k$.  We note that ``cluster counting'' random variables of other sorts have been studied elsewhere, such as satisfying assignments with a typical fraction of free variables~\cite{amin-catch} and certain kinds of partial assignments~\cite{maneva-sinclair}.

In this same cartoon where clusters are subcubes, $Z$ also counts the number of \emph{locally maximal} colorings, i.e., those colorings where no vertex $v$ can be flipped to a ``higher'' color $q > \sigma(v)$, since such colorings correspond to the highest corner of the cluster.  Bounds on $d_3$ were derived by counting locally maximal 3-colorings in~\cite{ach-molloy,kaporis,dubois-mandler}, culminating in $d_3 \le 4.937$.  The bounds we derive below are slightly weaker for $k=3$, yielding $d_3 \le 5.011$, since we treat the degrees of the vertices as independent rather than conditioning on the degree distribution.  Nevertheless, computing $\mathbb{E}[Z]$ gives a considerably simpler argument for general $k$.

Clearly $Z > 0$ if and only if $S \ne \emptyset$.  However, in Section~\ref{sec:iso} we prove the following:
\begin{lemma}
\label{lem:iso}
If $S \ne \emptyset$ then $Z \ge 1$.
\end{lemma}
\noindent
Applying Markov's inequality, we see that
\[
\Pr\left[ \mbox{$G$ has a permuted $k$-coloring} \right] =
\Pr\left[Z \ge 1\right]
\le \mathbb{E}[Z] \, ,
\]
and any $d$ such that $\mathbb{E}[Z] < 1$ is an upper bound on the threshold $d_k$.  Thus we will prove Theorem~\ref{thm:upper} by computing $\mathbb{E}[Z]$.

Given the symmetry provided by the random edge permutations, the expected weight $\mathbb{E}[w(\sigma)]$ of any given coloring is independent of $\sigma$.  By linearity of expectation and the fact that any given $\sigma$ is proper with probability $(1-1/k)^m$, we then have
\[
\mathbb{E}[Z]
= k^n \,\mathbb{E}[w(\sigma)]
= k^n (1-1/k)^m \,\mathbb{E}[w(\sigma) \,|\, \mbox{$\sigma$ proper} ] \, .
\]
Thus we are interested in the conditional expectation
\[
\mathbb{E}[w(\sigma) \,|\, \mbox{$\sigma$ proper} ]
= \mathbb{E}\left[ \left. \prod_{v} \frac{1}{c(\sigma, v)} \right| \mbox{$\sigma$ proper} \right]  \, .
\]

\begin{lemma}
\label{lem:availablecolors}
Let $\sigma$ be a permuted $k$-coloring. For any vertex $v$, the conditional distribution of the number of available colors $c(\sigma, v)$ is a function only of $v$'s degree. In particular it does not depend on $\sigma$.
\end{lemma}

\begin{proof} For each neighbor $u$ of $v$, there is a uniformly random permutation $\pi = \pi_{u,v}$ such that $v$ is blocked from having the color $\pi(\sigma(u))$.  Since $\sigma$ is proper, we know that $\pi(\sigma(u)) \ne \sigma(v)$.  Subject to this condition, $\pi$ is uniformly random among the permutations such that $\pi(\sigma(u)) \ne \sigma(v)$, and thus $\pi(\sigma(u))$ is uniformly random among the colors other than $\sigma(v)$.  In particular, it does not depend on $\sigma(u)$.

We can think of the forbidden colors $\pi(\sigma(u))$ as balls, and the colors other than $\sigma(v)$ as bins.  We toss $\deg v$ balls independently and uniformly into these $k-1$ bins, one for each edge $(u,v)$.  Then $c(v)$ is the number of empty bins, plus one for $\sigma(v)$.
\end{proof}

\begin{lemma}
\label{lem:indep}
Let $\sigma$ be a permuted $k$-coloring, $(u, v)$ an edge, and $\pi =\pi_{u,v}$ the associated random permutation. Then $\pi(\sigma(u))$ and $\pi^{-1}(\sigma(v))$ are independent, and are uniform over $[k]-\sigma(v)$ and $[k]-\sigma(u)$ respectively.
\end{lemma}

\begin{proof}
Since $\sigma$ is proper, the conditional distribution of $\pi$ is uniform among all permutations such that $\pi(\sigma(u)) \ne \sigma(v)$ and $\pi^{-1}(\sigma(v)) \ne \sigma(u)$.  For any pair of colors $q, q'$ with $q \ne \sigma(v)$ and $q' \ne \sigma(u)$, there are exactly $(k-2)!$ permutations $\pi$ such that $\pi(\sigma(u))=q$ and $\pi^{-1}(\sigma(v))=q'$.  Thus all such pairs $(q,q')$ are equally likely, and the pair $\big( \pi(\sigma(u)), \pi^{-1}(\sigma(v)) \big)$ is uniform in $([k]-\sigma(v)) \times ([k]-\sigma(u))$.
\end{proof}

Note that Lemmas~\ref{lem:availablecolors} and~\ref{lem:indep} apply even to self-loops.  That is, if $\pi = \pi_{v,v}$ is uniformly random, then $\pi(\sigma(v))$ and $\pi^{-1}(\sigma(v))$ are independent and uniform in $[k]-\sigma(v)$.  Thus a self-loop corresponds to two balls, each of which can forbid a color.  Since a self-loop increases $v$'s degree by $2$, it has the same effect as two edges incident to $v$ would have.  Indeed, this is why we defined $c(\sigma,v)$ as in~\eqref{eq:self-loop}.

Now let $\{\deg v \,|\, v \in V\}$ denote the degree sequence of $G$.  By Lemmas~\ref{lem:availablecolors} and~\ref{lem:indep}, the numbers of available colors at the vertices $c(\sigma, v)$ are conditionally independent if their degrees are fixed.  Thus
\begin{align*}
\mathbb{E}[w(\sigma) \,|\, \mbox{$\sigma$ proper}, \{\deg v\} ]
&= \mathbb{E}\left[ \left. \prod_{v} \frac{1}{c(\sigma, v)} \,\right| \mbox{$\sigma$ proper}, \{\deg v\} \right] \\
&= \prod_v \mathbb{E}\left[ \left. \frac{1}{c(\sigma,v)} \,\right| \mbox{$\sigma$ proper}, \deg v \right] \\
&= \prod_v \sum_{c=1}^k \frac{Q(\deg v, k, c)}{c} \, ,
\end{align*}
where $Q(\deg v,k,c)$ denotes the probability that $v$ has $c$ available colors if it has $\deg v$; that is, the probability that if we toss $\deg v$ balls into $k-1$ bins, then $c-1$ bins will be empty.  Thus
\[
\mathbb{E}[w(\sigma) \,|\, \mbox{$\sigma$ proper} ]
= \mathbb{E}_{\{\deg v\}} \prod_v \sum_{c=1}^k \frac{Q(\deg v, k, c)}{c} \, ,
\]
where the expectation is taken over the distribution of degree sequences in $\tilde{G}(n,m)$.

The degree of any particular vertex in $\tilde{G}(n,m=dn/2)$ is asymptotically Poisson with mean $d$.
The degrees of different vertices are almost independent, as the next lemma shows.
\begin{lemma}\label{lem:degdist}
The joint probability distribution of the degree sequence of $\tilde{G}(n,m=dn/2)$ is the same as that of $n$ independent
Poisson random variables of mean $d$, conditioned on their sum being $2m$.
\end{lemma}

\begin{proof}
We can generate $\tilde{G}(n,m=dn/2)$ as follows.  There are $n$ bins, one for each vertex.  We throw $2m$ balls uniformly and independently into the bins, and pair up consecutive balls to define the edges of the graph.
The degree of each vertex is the number of balls in the corresponding bin.  The joint distribution of these occupancies is the product of $n$ independent Poisson distributions with mean $d$, conditioned on the total number of balls being $2m$; see e.g.~\cite[Theorem 5.6]{mitz-upf}.
\end{proof}

The sum of $n$ independent Poisson variables of mean $d$ equals its mean $nd=2m$ with probability $O(1/\sqrt{m})=O(1/\sqrt{n})$.  Conditioning on an event that holds with probability $P$ increases the expectation by at most $1/P$, so
\begin{align}
\mathbb{E}[w(\sigma) \,|\, \mbox{$\sigma$ proper} ]
&= \mathbb{E}_{\{\deg v\}} \prod_v \sum_{c=1}^k \frac{Q(\deg v, k, c)}{j}
\nonumber \\
&= O(\sqrt{n}) \left( \mathbb{E}_{\deg v} \sum_{c=1}^k \frac{Q(\deg v, k, c)}{c} \right)^{\!n} \, ,
\label{eq:sqrtn}
\end{align}
where in the second line $\deg v$ is Poisson with mean $d$.  Since our goal is to show that $\mathbb{E}[Z]$ is exponentially small, the $\sqrt{n}$ factor will be negligible.

Now consider a balls and bins process with $k-1$ bins.  If the total number of balls is Poisson with mean $d$, then the number of balls in each bin is Poisson with mean $d/(k-1)$, and these are independent.  The probability that any given bin is empty, i.e., that any given color $q \ne \sigma(v)$ is available, is
\[
r = \mathrm{e}^{-d/(k-1)} \, .
\]
The number of empty bins is binomially distributed as $\mathrm{Bin}(k-1,r)$, so
\[
Q(\deg v,k,c) = {k-1 \choose c-1} \,r^{c-1} \,(1-r)^{k-c} \, ,
\]
and
\begin{align*}
\mathbb{E}_{\deg v} \sum_{c=1}^k \frac{Q(\deg v, k, c)}{c}
&= \sum_{c=1}^k \frac{1}{c} {k-1 \choose c-1} \,r^{c-1} \,(1-r)^{k-c} \\
&= \frac{1}{kr} \sum_{j=1}^k {k \choose c} \,r^c \,(1-r)^{k-c} \\
&= \frac{1}{kr} \left( 1-(1-r)^k \right) \, .
\end{align*}

Putting everything together, we have
\begin{align*}
\mathbb{E}[Z] & = k^n \left(1-\frac{1}{k}\right)^m \mathbb{E}[w(\sigma) \,|\, \mbox{$\sigma$ proper} ] \\
&= O(\sqrt{n}) \,k^n \left( 1-\frac{1}{k} \right)^{dn/2}
\left( \frac{1}{kr} \left(1-(1-r)^k \right)\right)^n \\
& = O(\sqrt{n}) \left(1-\frac{1}{k} \right)^{dn/2} \mathrm{e}^{dn/(k-1)}
\left(1-(1-\mathrm{e}^{-d/(k-1)})^k \right)^n \, .
\end{align*}
Taking the logarithm and dividing by $n$, in which case we can ignore the polynomial term $\sqrt{n}$, yields the following function of $d$:
\begin{equation}
\label{eqn:logEZ}
f(d) := \lim_{n \to \infty} \frac{\ln \mathbb{E}[Z]}{n}
= \frac{d}{2} \ln\left(1-\frac{1}{k}\right) + \frac{d}{k-1} +
\ln\left( 1-\left(1-\mathrm{e}^{-d/(k-1)}\right)^k\right) \, .
\end{equation}
If $f(d) < 0$ then $\mathbb{E}[Z]$ is exponentially small, so any such $d$ is an upper bound on $d_k$.  We prove the following lemma in Section~\ref{sec:calculus}:
\begin{lemma}
\label{lem:lfm}
For any constant $\varepsilon > 0$, if $d = 2 k \ln k - \ln k - 1 + \varepsilon$ and $k$ is sufficiently large, then $f(d) < 0$.
\end{lemma}
\noindent
This completes the proof of Theorem~\ref{thm:upper}.

\section{An isoperimetric inequality}
\label{sec:iso}

In this section we prove Lemma~\ref{lem:iso}.  It has nothing to do with colorings; it is simply a kind of isoperimetric inequality that applies to any subset of $[k]^n$.  If $k=2$, it is the classic isoperimetric inequality on the Boolean $n$-cube.  That is, given $S \subseteq \{0,1\}^n$, for each $\sigma \in S$ let $\partial(\sigma)$ be the set of neighbors $\sigma' \in S$ that differ from $\sigma$ on a single bit.  Then
\[
\sum_{\sigma \in S} 2^{-|\partial(\sigma)|} \ge 1
\]
if and only if $S \ne \emptyset$.

First, some notation.  Let $V=\{1,\ldots,n\}$, and think of each element of $[k]^n$ as a function $\sigma:V \to [k]$.  Let $S \subseteq [k]^n$.  For each $\sigma \in S$ and $1 \le v \le n$, let $\partial_S(\sigma,v)$ denote the set of elements of $S$ that are ``neighbors of $\sigma$ along the $v$ axis,'' i.e., that agree with $\sigma$ everywhere other than at $v$.  That is,
\[
\partial_S(\sigma,v) = \left\{ \sigma' \in S \mid \forall u \ne v : \sigma'(u) = \sigma(u) \right\} \, .
\]
Let $c_S(\sigma,v)$ denote the number of such neighbors,
\[
c_S(\sigma,v) = \abs{\partial_S(\sigma,v)} \, ,
\]
and define the weight function $w_S$ as follows:
\[
w_S(\sigma)
= \begin{cases}\prod_{v} \left( 1 / c_S(\sigma, v) \right)
& \mbox{if $\sigma \in S$} \\
0 & \mbox{if $\sigma \notin S$} \, .
\end{cases}
\]
Then define the weight of the entire set as
\[
Z(S) = \sum_{\sigma \in [k]^n} w_S(\sigma).
\]

\begin{lemma}
\label{lem:iso0}
If $S \ne \emptyset$ then $Z(S) \ge 1$.
\end{lemma}

\begin{proof}
If $S = [k]^n$, then $w_S(\sigma) = 1/k^n$ and $Z(S) = 1$.  Thus our goal will to enlarge $S$ until $S=[k]^n$, showing that $Z(S)$ can only decrease at each step.
For a given $\sigma$ and $v$, let $\Cyl_v(\sigma)$ denote the set of $\tau \in [k]^n$ that we can obtain by letting $\sigma(v)$ vary arbitrarily:
\[
\Cyl_v(\sigma)= \left\{\tau \in [k]^n \mid \mbox{$\tau(u)=\sigma(u)$ for all $u \ne v$} \right\} \, .
\]
In particular, $\Cyl_v(\sigma) = \Cyl_v(\sigma')$ if and only if $\sigma' \in \partial_S(\sigma,v)$.
Similarly, let $\Cyl_v(S)$ be the ``thickening'' of $S$ along the $v$ axis,
\begin{align*}
\Cyl_v(S)
&= \bigcup_{\sigma \in S} \Cyl_v(\sigma) \, .
\end{align*}
We claim that this thickening can only decrease $Z$.  That is, for any $S \ne \emptyset$ and any $v$,
\[
Z(S) \ge Z(\Cyl_v S) \, .
\]
To see this, let $T=\Cyl_v(S)$.  Each $\sigma \in S$ contributes $c_v(\sigma,v)$ times to the union $\bigcup_{\sigma \in S} \Cyl_v(\sigma)$, so
\begin{equation}
\label{eq:zt}
Z(T) = \sum_{\sigma \in S} \frac{1}{c_S(\sigma,v)} \,w_T(\Cyl_v(\sigma)) \, .
\end{equation}
Since each $\sigma \in T$ has $c_T(\sigma,v)=k$, each $\tau \in \Cyl_v(\sigma)$ has $c_T(\tau,u) \ge c_S(\sigma,u)$ for all $u \ne v$, and $|\!\Cyl_v(\sigma)| = k$, we have
\[
w_T(\Cyl_v(\sigma)) \le k \,\frac{c_S(\sigma,v)}{k} \,w_S(\sigma) = c_S(\sigma,v) \,w_S(\sigma) \, .
\]
Combining this with~\eqref{eq:zt} gives
\[
Z(T) = \sum_{\sigma \in S} \frac{1}{c_S(\sigma,v)} \,w_T(\Cyl_v(\sigma)) \le \sum_{\sigma \in S} w_S(\sigma) = Z(S) \, .
\]
To complete the proof, let $T_0 = S$, and for each $1 \le v \le n$ let $T_v = \Cyl_v(T_{v-1})$.  Then $T_n = [k]^n$, and
\[
Z(S) = Z(T_0) \ge Z(T_1) \ge \cdots \ge Z(T_n) = 1 \, . \qedhere
\]
\end{proof}

\begin{proof}[Proof of Lemma~\ref{lem:iso}.]
Let $S$ be the set of permuted $k$-colorings.  The number of available colors $c(\sigma,v)$ we defined in Section~\ref{sec:first} is almost identical to $c_S(\sigma,v)$ as defined in Lemma~\ref{lem:iso0}.  The only difference is that in Section~\ref{sec:first}, if $v$ has a self-loop then it forbids two of its own colors, namely $\pi_{v,v}(\sigma(v))$ and $\pi_{v,v}^{-1}(v)$.  Removing these self-loops can only increase $c(\sigma,v)$ and thus decrease $Z$, so if $S \ne \emptyset$ then $Z \ge 1$ by Lemma~\ref{lem:iso0}.
\end{proof}

\section{A little calculus}
\label{sec:calculus}

\begin{proof}[Proof of Lemma~\ref{lem:psi}]
Recall that
\[
\phi(\zeta) = h(\zeta) + (1-\zeta) \ln (k-1) - \ln k + \frac{d}{2} \ln \frac{p(\zeta)}{(1-1/k)^2} \, .
\]
We upper bound $\phi(\zeta)$ with a simpler function.  We have
\[
\frac{p(\zeta)}{(1-1/k)^2} - 1 = \frac{(k \zeta-1)^2}{(k-1)^3} \le \frac{1}{k-1} \, ,
\]
and if $-1 < x \le 1/(k-1)$ the third-order Taylor series gives
\[
\ln (1+x) \le x - \frac{x^2}{2} + \frac{x^3}{3}  = x - \frac{x^2}{2} \left(1-\frac{2x}{3}\right) \le x - \frac{x^2}{2} \left( 1-\frac{2}{3(k-1)} \right)
:= \ell(x) \, .
\]
Therefore, we have $\phi(\zeta) \le \psi(\zeta)$ where
\[
\psi(\zeta) = h(\zeta) + (1-\zeta) \ln (k-1) - \ln k + \frac{d}{2} \,\ell\!\left( \frac{(k \zeta-1)^2}{(k-1)^3} \right) \, .
\]
This upper bound is tight at $\zeta = 1/k$, where
\[
\psi(1/k) = \phi(1/k) = 0 \, .
\]
We remark that using the first-order Taylor series $\ln (1+x) \le x$, or equivalently $\ell(x) = x$, yields a weaker lower bound on $d_k$, about $\ln k$ below the first moment upper bound.

Except for the entropy function, the dependence of $\psi(\zeta)$ on $\zeta$ is polynomial, making its derivatives significantly simpler than those of $\phi$.  First we note that
\[
\psi''(1/k) = \frac{k^2}{(k-1)^3} \,\left(d-(k-1)^2 \right) \, .
\]
Thus if $d < (k-1)^2$, we have
\[
\phi''(1/k) \le \psi''(1/k) < 0 \, .
\]
Next, if $k \ge 2$ then the fourth derivative of $\psi(\zeta)$ is negative throughout the unit interval,
\[
\psi''''(\zeta) = - 2 \left( \frac{1}{\zeta^3} + \frac{1}{(1-\zeta)^3} + d k^4 \frac{3k-5}{(k-1)^7} \right) < 0 \, .
\]
As a consequence, $\psi(\zeta)$ has at most two local maxima in the unit interval, one of which is at $\zeta = 1/k$.  Our goal is to locate the other local maximum, which we denote $\zeta_2$, and to show that $\psi(\zeta_2) < 0$.

Assume that $d$ is $2+\varepsilon$ below the first moment upper bound for some constant $\varepsilon$,
\[
d = 2 k \ln k - \ln k - 2 - \varepsilon \, ,
\]
and set
\[
\zeta_2 = 1-\frac{a}{k}
\]
for a constant $a$.  Then using Taylor series gives
\begin{align*}
\psi'(1-a/k)
&=  \ln \frac{a}{k} - \ln \left(1-\frac{a}{k} \right) - \ln (k-1) + \frac{dk(k-1-a)}{(k-1)^3} \,\ell'\!\left( \frac{(k-1-a)^2}{(k-1)^3} \right) \\
&= \ln a - 2 \ln k + d \left( \frac{1}{k} + \frac{1-a}{k^2} \right) + O(1/k) \\
&= \ln a + (1-2a) \frac{\ln k}{k} + O(1/k) \, .
\end{align*}
For any constant $a \ne 0$, for sufficiently large $k$ this is positive if $a > 1$ and negative if $a < 1$.  Therefore, $\zeta_2 = 1-a/k$ where $a$ tends to $1$ as $k \to \infty$, roughly as $a \approx k^{1/k}$.

Finally, again setting $d= 2 k \ln k - \ln k - 2 - \varepsilon$, some more Taylor series give
\begin{align*}
\psi(1-a/k)
&= h(a/k) + \frac{a}{k} \,\ln (k-1) - \ln k + \frac{d}{2} \,\ell\!\left( \frac{(k-1-a)^2}{(k-1)^3} \right) \\
&= \frac{1}{k} \left( a - a \ln a + 2 a \ln k \right) + O(1/k^2) - \ln k + \frac{d}{2} \left( \frac{1}{k} + \frac{1-4a}{2k^2} + O(1/k^3) \right) \\
&= \frac{1}{k} \left(a - a \ln a - 1 - \frac{\varepsilon}{2} \right) + O\!\left( \frac{\ln k}{k^2} \right) \\
&\le -\frac{\varepsilon}{2k} + O\!\left( \frac{\ln k}{k^2} \right) \, ,
\end{align*}
where we used $a - a \ln a \le 1$ for all $a > 0$.  Thus for any constants $a > 0$ and $\varepsilon > 0$, when $k$ is sufficiently large $\psi(1-a/k)$ is negative, showing that $\psi(\zeta) < 0$ in the vicinity of $\zeta_2$.  This completes the proof.
\end{proof}

\begin{proof}[Proof of Lemma~\ref{lem:lfm}]
Recall that
\[
f(d)
= \frac{d}{2} \ln\left(1-\frac{1}{k}\right) + \frac{d}{k-1} + \ln \left( 1-\left(1-\mathrm{e}^{-d/(k-1)}\right)^k\right) \, .
\]
Setting
\[
d = 2k \ln k - \ln k - 1 + \varepsilon \, ,
\]
we have
\[
\mathrm{e}^{-d/(k-1)} = k^{-2} \,k^{-1/(k-1)} \,\mathrm{e}^{(1-\varepsilon)/(k-1)}
= k^{-2} + O(k^{-3} \log k) \, .
\]
Taking the binomial series to second order gives
\begin{align*}
\left(1-\mathrm{e}^{-d/(k-1)}\right)^k &= 1-k \mathrm{e}^{-d/(k-1)} + {k \choose 2} \,\mathrm{e}^{-2d/(k-1)} + O(k^3 \mathrm{e}^{-3d/(k-1)})\\
&=1-k \mathrm{e}^{-d/(k-1)} + \frac{k(k-1)}{2} \,\mathrm{e}^{-2d/(k-1)} + O(k^{-3}) \, .
\end{align*}
Plugging this into the last term of $f(d)$ and using the Taylor series for $\ln (1-x)$ gives
\begin{align*}
\ln\left( 1-\left(1-\mathrm{e}^{-d/(k-1)}\right)^k\right)
&= \ln\left( k \mathrm{e}^{-d/(k-1)} - \frac{k(k-1)}{2} \,\mathrm{e}^{-2d/(k-1)} + O(k^{-3})\right) \\
&= \ln k-\frac{d}{k-1}+ \ln \left(1 - \frac{(k-1)}{2} \,\mathrm{e}^{-d/(k-1)} + O(k^{-2}) \right) \\
&= \ln k-\frac{d}{k-1} - \frac{(k-1)}{2} \,\mathrm{e}^{-d/(k-1)} + O(k^{-2}) \\
&= \ln k-\frac{d}{k-1} - \frac{1}{2k} + O(k^{-2} \log k) \, ,
\end{align*}
and plugging this back in to $f(d)$ gives
\begin{equation}
\label{eq:f2}
f(d)
= \frac{d}{2} \ln\left(1-\frac{1}{k}\right) + \ln k - \frac{1}{2k} + O(k^{-2} \log k) \, .
\end{equation}
The second order Taylor series for $\ln (1-x)$ gives
\begin{align*}
\frac{d}{2} \ln\left(1-\frac{1}{k}\right)
&= \left(k\ln k - \frac{\ln k}{2} - \frac{1-\varepsilon}{2}\right)\left(-\frac{1}{k} -\frac{1}{2k^2} +O(k^{-3})\right) \\
&= -\ln k + \frac{1-\varepsilon}{2k} + O(k^{-2} \log k) \, .
\end{align*}
Finally, putting this in~\eqref{eq:f2} gives
\[
f(d) = -\frac{\varepsilon}{2k} + O(k^{-2} \log k) \, .
\]
For any constant $\varepsilon > 0$, this is negative for sufficiently large $k$, completing the proof.
\end{proof}

\section*{Acknowledgments.}  We benefited from conversations with Tom Hayes; with Lenka Zdeborov\'a and Florent Krz\c{a}kala on the Potts spin glass; and with Alex Russell and Dimitris Achlioptas on isoperimetric inequalities.  This work was partly supported by the McDonnell Foundation and the National Science Foundation.  Part of this work was done in 2008 while the third author was a student at Carnegie Mellon and a Research Experience for Undergraduates intern at the Santa Fe Institute.

Combinatorics (math.CO); Statistical Mechanics (cond-mat.stat-mech); Computational Complexity (cs.CC); Probability (math.PR)