Pairwise optimal coupling of multiple random variables

Abstract: We generalize the optimal coupling theorem to multiple random variables: Given a collection of random variables, it is possible to couple all of them so that any two differ with probability comparable to the total-variation distance between them. In a number of cases we show that the disagreement probability we achieve is the best possible. The proofs of sharpness rely on new results in extremal combinatorics, which may be of independent interest.

\section{Introduction}

A \textbf{coupling} of a collection of random variables $(X_i)_{i\in I}$ is a set of variables $(X'_i)_{i\in I}$ on some common probability space with the given marginals, i.e.\ $X_i$ and $X'_i$ have the same law.
We omit the primes when there is no risk of confusion.
Thus, we think of a coupling as a construction of random variables $(X_i)_{i\in I}$ with prescribed laws.

The \textbf{total variation distance} between two random variables $X$ and $Y$ is defined as
\[
  d_{\mathrm TV}(X,Y) = \sup_A \big\{|\P(X\in A) - \P(Y\in A)|\big\},
\]
where the supremum is over all (measurable) sets $A$.
The fundamental, classical theorem relating the total variation distance to coupling is the following.

\begin{thm}
  \label{T:couple2}
  For any two random variables $X$ and $Y$, there exists a coupling such that $\P(X\neq Y) = d_{\mathrm TV}(X,Y)$.
  Moreover, this is the smallest possible value of $\P(X\neq Y)$ for any coupling.
\end{thm}

As remarked, technically the coupling is a construction of random variables $X'$ and $Y'$ on some probability space with measure $\P'$ so that $X$ and $X'$ have the same law, and similarly $Y$ and $Y'$.
However, following common practice in probability theory, we do not stress the distinction between $X$ and $X'$.
Thus, we use $\P$ for the new probability measure and $X$ and $Y$ for the new variables.
This is a slight abuse of notation which should not cause any difficulty.

\cref{T:couple2} is very simple, and could even be called folklore.
According to Lindvall's overview of Doeblin's life and work \cite{Lind1}, couplings and \cref{T:couple2} originated in Doeblin's work in the 30's.
Since that time, coupling has become an important tool in probability theory with numerous applications.
We refer the reader to \cite{fdH,Lind} for a partial review of applications of couplings.

\medskip

The starting point for the present work is the following observation, which while basic, seems to be unknown:
When coupling more than two random variables, the total variation bound cannot in general be achieved simultaneously for all pairs.
(While the term \emph{coupling} hints at having two random variables, it is standard practice to use it also for larger collections.)
For example, let $X\in\{0,1\}$, $Y\in\{0,2\}$ and $Z\in\{1,2\}$ each be uniform on the two possible values.
Then $d_{\mathrm TV}(X,Y)=d_{\mathrm TV}(X,Z)=d_{\mathrm TV}(Y,Z)=\frac 12$.
However, in any coupling of $\{X,Y,Z\}$, at least two of the three pairs are unequal.
Thus,
\[ \P(X\neq Y) + \P(X\neq Z) + \P(Y\neq Z) \geq 2 ,\]
and the disagreement probabilities are not all equal to $\frac 12$.

Our first result is a generalization of \cref{T:couple2} with a slightly higher probability of disagreement.
In certain cases, the given bound is best possible.

\begin{thm}\label{T:main}
  For any countable collection $\mathcal S$ of real random variables, there exists a coupling such that, for any $X,Y \in \mathcal S$,
  \[
    \P(X \neq Y) \leq \frac{2d_{\mathrm TV}(X,Y)}{1+d_{\mathrm TV}(X,Y)} .
  \]
\end{thm}

We remark that both assumptions of this theorem can be relaxed:
The requirement that $\mathcal S$ is countable can be dropped for random variables taking values in a countable set $A$, and similarly for continuous random variables.
Similarly, the assumption that the random variables are real can be relaxed in various ways, including in particular the case of $\mathbb R^d$-valued random variables.

\cref{T:main} is proved in \cref{sec:couplings}.
Somewhat curiously, there are two fairly different constructions of couplings, both of which realize the bound in the theorem.
One construction is more naturally adapted to discrete random variables and the other to continuous.
While both constructions achieve lower disagreement probabilities in some cases, the worst-case disagreement probability is the same in both.
The two constructions are described in \cref{sec:couplings}.

The fact that the bound of \cref{T:main} comes up in different constructions raises the possibility that it is optimal.
For a function $f \colon [0,1]\to[0,1]$, let us say that $f$ is a \textbf{disagreement bound} if for any finite collection of random variables there is a coupling of the variables so that any two of them, say $X$ and~$Y$, satisfy
\[ \P(X\neq Y) \leq f(d_{\mathrm TV}(X,Y)) .
\]
Note that by taking limits it follows that the same bound on disagreement probabilities can be achieved for countable families of random variables.
Then \cref{T:main} states that
\[ F(x) := \frac{2x}{1+x} \]
is a disagreement bound.
It is natural to ask whether there are any smaller disagreement bounds.
The trivial lower bound (see \cref{T:couple2}) is that any disagreement bound must have $f(x)\geq x$ for all $x$.
The example presented before \cref{T:main}, of three variables each taking two possible values, shows that any disagreement bound must have $f(\frac 12)\geq \frac 23 = F(\frac 12)$.
More generally, we show (see \cref{prop:1/n-bound,prop:k/n-bound}) that any disagreement bound must have $f(x) \ge F(x)$ for $x=\frac1n$ for all positive integers $n$, as well as some other rational numbers.
We do not know whether such a pointwise bound holds at every point $x \in (0,1)$.
Nevertheless, we provide a lower bound at any point $x$ (see \cref{prop:all-x-bound}), which improves on the trivial lower bound $f(x)\geq x$, and is asymptotic to $F(x)$ as $x \to 0$.
Moreover, we show that $F$ is weakly optimal, in the sense that no disagreement bound can simultaneously improve on $F$ everywhere:

\begin{prop}\label{prop:optimal-bound}
  If a disagreement bound is pointwise smaller-or-equal than $F$, then it coincides with~$F$.
\end{prop}

\paragraph{Relation to multi-marginal optimal transport.}

Optimal transport gives rise to a theory analogous to couplings, with many parallels.
For example, Kantorovich's duality theorem is the equivalent to \cref{T:couple2}.
The question of optimal couplings of multiple random variables is closely related to the problem of multi-marginal optimal transport.
The terminology used in that context is different from the probabilistic terminology that we use.
In multi-marginal optimal transport, one is given a \emph{cost function} $\phi \colon \mathbb R^d\times\mathbb R^d \to [0,\infty)$ and probability measures $\mu_1,\dots,\mu_n$ on $\mathbb R^d$.
Most commonly, one studies convex cost functions such as $\phi(x,y)=\|x-y\|_p^q$.
For total variation distances, the relevant cost function is $\phi(x,y) = \mathbf{1}_{x\neq y}$.
(Even more generally, there would be a cost function on $n$-tuples $\phi \colon (\mathbb R^d)^n\to[0,\infty)$, though the case of a pairwise cost is already of interest.)

A \emph{plan} is a probability measure $\mu$ on $(\mathbb R^d)^n$ whose projections are the given $\mu_1,\dots,\mu_n$.
If $\mu_i$ is taken to be the law of a random variable $X_i$, then a plan is nothing other than a coupling of the random variables.
The objective is to determine the infimum $\inf_\mu \sum_{i,j} \int \phi(x_i,x_j) d\mu$, and find optimal $\mu$.
This value is clearly at least $\sum_{i,j} \inf_\mu \int \phi(x_i,x_j) d\mu$.
In probabilistic terms, we let $d_\phi(X_i,X_j) := \inf \mathbb E_\mu \phi(X_i,X_j)$, where the infimum is over all couplings, so that the statement is
\[
\inf_\mu \sum_{i,j} \mathbb E_\mu \phi(X_i,X_j) \geq
\sum_{i,j} d_\phi(X_i,X_j).
\]
It is natural to ask how far apart the two quantities above can be.
It is a simple observation that
\begin{equation}
  \label{eq:MMOT}
  \inf_\mu \sum_{i,j} \mathbb E_\mu \phi(X_i,X_j) \leq
  2c \sum_{i,j} d_\phi(X_i,X_j),
\end{equation}
where $c$ is any constant such that $\phi(x,z) \le c(\phi(x,y)+\phi(y,z))$ for all $x,y,z \in \mathbb R^d$.
Indeed, if one uniformly picks $k\in\{1,\dots,n\}$ and uses the optimal pairwise coupling of each $X_i$ with $X_k$, one gets the bound \eqref{eq:MMOT}.
The main difference between the multi-marginal optimal transport problem and the one we consider is that we aim to get a good upper bound on $\mathbb E_\mu \phi(X_i,X_j)$ for every $i$ and $j$, and not merely on the sum.
We refer the reader to \cite{Pass} for an introduction to multi-marginal optimal transport.

\section{Coupling constructions}
\label{sec:couplings}

In this section, we prove \cref{T:main}.
We give two different constructions of couplings, each of which leads to a proof of \cref{T:main}.
We write $a \wedge b$ and $a \vee b$ for the minimum and maximum of $a$ and $b$, respectively.

\subsection{Coupling I}

Our first construction of a coupling is especially suited for continuous  random variables, i.e., which have a density function.
We say that a random variable $X$ is continuous with respect to a measure $\mu$ if there is a density function $g$ such that $\P(X\in A)=\int_A g \,d\mu$.
Note that we do not require $\mu$ to be the Lebesgue measure.
Thus, if $\mu$ is the counting measure on some set, then $X$ is continuous with respect to $\mu$ if it is discrete and supported in that set.

\begin{prop}\label{P:couplingI}
  Let $\mu$ be a $\sigma$-finite measure on $\mathbb R^d$.
  For any collection $\mathcal S$ of random variables, all continuous with respect to $\mu$, there exists a coupling such that, for any $X,Y \in \mathcal S$ with densities $g,h$,
  \begin{equation}
    \label{eq:coup1_pr}
    \P(X \neq Y) = F(d_{\mathrm TV}(X,Y)) - \frac{1}{1+d_{\mathrm TV}(X,Y)} \int_{\mathbb R^d} (g \wedge h) \cdot |\P(X=x)-\P(Y=x)| \, d\mu(x) .
  \end{equation}
  In particular, if $\mu$ has no atoms, then
  $\P(X \neq Y) = F(d_{\mathrm TV}(X,Y))$.
\end{prop}

\cref{P:couplingI} gives a coupling of all continuous random variables, but can also yield a coupling of a family of discrete variables taking values in some countable set by using continuity with respect to the counting measure.
Thus, \cref{P:couplingI} gives a proof of \cref{T:main} in the continuous and discrete cases.
We emphasize that the coupling applies even when $\mathcal S$ consists of uncountably many variables.
For countably many arbitrary real random variables, a limiting procedure can be used to get a coupling with the same disagreement bound, thus proving \cref{T:main}; see \cref{sec:proof-main-thm}.
We also remark that Coupling I is not restricted to $\mathbb R^d$ -- the same construction works in any $\sigma$-finite measure space.

\begin{proof}
  Let $\mathcal S=\{X_i\}_i$ and let the density of $X_i$ be $f_i$.
  We begin with a $(d+2)$-dimensional Poisson process.
  Specifically, let $\mathcal A$ be a Poisson point process with intensity $\mu\times\Leb\times\Leb$ on $\mathbb R^d \times\mathbb R_+\times\mathbb R_+$, where $\Leb$ is the Lebesgue measure on $\mathbb R_+$.
  We denote the points of $\mathcal A$ as $(x,s,t)$, and think of the third coordinate as a time coordinate.
  Given the set $\mathcal A$, define $\mathcal A_i := \{(x,s,t) \in \mathcal A : s\leq f_i(x)\}$.
  We define the random variables by $X_i=x$ if $(x,s,t)\in\mathcal A_i$ has the minimal $t$ among all points of $\mathcal A_i$.
  If $\mathcal A_i$ does not have a unique point with minimal $t$, we assign $X_i$ an arbitrary value.
  This happens if $\mathcal A_i$ is empty, or has multiple points with equal minimal $t$, or has no point with $t$-coordinate equal to the infimum of all $t$-coordinates.
  All of these have probability $0$, so the value of $X_i$ on these events does not affect its law or the disagreement probabilities.

  To see that $X_i$ has the required law (so that the above is indeed a coupling), think of points $(x,s)$ appearing at rate $1$ in time, and intensity $\mu\times\Leb$ on the half plane.
  Points with $s > f_i(x)$ are ignored.
  Points with $s\leq f_i(x)$ appear at total rate $1$, so there is almost surely a first such point.
  The probability that the $x$-coordinate of the first such point is in some set $A$ is $\int_A f_i(x) dx = \P(X_i\in A)$, as required.

  \medskip

  Let $X$ and $Y$ be two of the variables with densities $g$ and $h$, respectively, and let $\alpha := d_{\mathrm TV}(X,Y)$.
  To see that the disagreement probability is at most $F(\alpha)$, consider the first point $(x,s)$ to appear that has $s\leq g(x)\vee h(x)$.
  If it happens that $s\leq g(x)\wedge h(x)$, then we get $X=Y=x$.
  Otherwise, this point determines the value of either $X$ or $Y$, and some later point determines the value of the other.
Consequently, for any measurable set $A$,
  \begin{equation}\label{eq:1}
  \P(X=Y \in A\text{ and the same point determines both $X$ and $Y$}) = \frac{\int_A (g \wedge h) d\mu}{\int_{\mathbb R^d} (g \vee h) d\mu} .
  \end{equation}
  Since $\int_{\mathbb R^d} (g\wedge h) d\mu = 1-\alpha$ and $\int_{\mathbb R^d} (g\vee h) d\mu = 1+\alpha$, we deduce that
  \[ \P(X=Y) \geq \frac{1-\alpha}{1+\alpha} = 1-F(\alpha) .\]

  Let $(x,s,t)$ be a point that determines one of $X$ or $Y$, but not the other.
  For continuous random variables, or more generally when $\mu$ has no atoms, the probability that the point $(x',s',t')$ that determines the other has $x=x'$ is zero, so that $\P(X\neq Y) = F(\alpha)$.
  When $\mu$ has atoms, this event may have a non-zero probability.
  The event that $X=Y=x$, and $X$ is determined by a point $(x,s,t)$ and $Y$ determined by a later point $(x,s',t')$ (i.e. $t'>t$) happens if and only if $h(x) < s \le g(x)$ and $s' \le h(x)$, and no earlier points determine $X$ or $Y$.
  The probability that the first point to determine $X$ or $Y$ determines $X$ but not $Y$ is $\frac{\alpha}{1+\alpha}$.
  Conditioned on this, $X$ and $Y$ are independent, with $X$ having density
  $\frac {g-h}\alpha \mathbf{1}_{g>h} d\mu$, and with the law of $Y$ being unchanged.
  Thus,
  \[ \P(X=Y \in A\text{ and $X$ is determined before $Y$}) = \frac{1}{1+\alpha} \int_A (g-h) \mathbf{1}_{g>h} \cdot \P(Y=x) \, d\mu(x) .\]
  A similar formula holds when $g<h$ with $Y$ determined first.
  Combining the two, we get that the probability that $X=Y \in A$ but they are determined by distinct points is
  \[ \frac{1}{1+\alpha} \int_A |g-h| \cdot (\P(X=x)\wedge \P(Y=x)) \, d\mu(x). \]
  Rewriting the above integrand and using~\eqref{eq:1}, we obtain that
  \begin{equation}\label{eq:1b}
  \P(X=Y \in A) = \frac{1}{1+\alpha} \int_A (g \wedge h) \cdot (1+ |\P(X=x)-\P(Y=x)|) \, d\mu(x) ,
  \end{equation}
  from which the proposition follows.
\end{proof}

\subsection{Coupling I\!I}

We give now a second construction of a coupling of random variables, which is especially suited for discrete random variables.

\begin{prop}\label{P:couplingII}
 For any collection $\mathcal S$ of random variables taking values in a common countable set, there exists a coupling such that, for any $X,Y \in \mathcal S$,
\begin{equation}\label{eq:couplingII}
\P(X=Y) = \sum_u \left(\sum_v \frac{\P(X=v)}{\P(X=u)} \vee \frac{\P(Y=v)}{\P(Y=u)}\right)^{-1} .
\end{equation}
Moreover, this expression is at least $1-F(d_{\mathrm TV}(X,Y))$.
\end{prop}

We emphasize that we do not assume that $\mathcal S$ is a countable collection, but rather only that all random variables in $\mathcal S$ are supported in a fixed countable set.
Indeed, our construction gives a coupling of \emph{all} random variables  supported in the given set.
As explained below (after \cref{P:couplingI}), this coupling can be extended to non-discrete random variables by a limiting procedure.
This proves the existence of a coupling with the desired properties when $\mathcal S$ consists of countably many real random variables; see \cref{sec:proof-main-thm}.

\begin{proof}
  Suppose that the random variables take values in a countable set $U$.
  Let $\{E_u\}_{u\in U}$ be independent $\Exp(1)$ random variables.
  Fix a random variable $X\in\mathcal S$ and denote $p_u := \P(X=u)$.
  Now define
  \[
    X := \argmin_{u \in U} \left\{\frac{E_u}{p_u} \right\},
  \]
  i.e., $X=u$ if $u$ is the minimizer of $\frac{E_u}{p_u}$.
  If there are multiple values of $u$ achieving the minimum, or if there is no minimizer, we pick a value for $X$ arbitrarily.
  Both of these are null events for any fixed $X \in \mathcal S$. When the collection $\mathcal S$ is uncountable, it may happen that there is always some variable in $\mathcal S$ for which one of these events occurs, but this does not cause any problems.
  Standard properties of exponential variables imply that for any distribution $\{p_u\}$, the event that $\frac{E_u}{p_u}$ is smaller than $\frac{E_v}{p_v}$ for every $v\neq u$ has probability $p_u$.
  Thus, the variable $X$ constructed above has the required distribution, and therefore this defines a coupling of all the random variables in~$\mathcal S$.

  We now show that this coupling satisfies~\eqref{eq:couplingII}.
  To this end, fix $X,Y\in\mathcal S$ and denote $p_u := \P(X=u)$ and $q_u:=\P(Y=u)$ for $u \in U$.
  Let us find an expression for $\P(X=Y=u)$ for a fixed $u \in U$.
  By the definition of the coupling, $\{X=Y=u\}$ is almost surely the event that $\frac{E_u}{p_u} \le \frac{E_v}{p_v}$ and $\frac{E_u}{q_u} \le \frac{E_v}{q_v}$ for every $v \in U$. Thus,
  \[ \P(X=Y=u) = \P\left( \frac{E_v}{E_u} \ge \frac{p_v}{p_u} \vee \frac{q_v}{q_u} \text{ for all }v \in U \right) .\]
  This is the probability that an exponential random variable with intensity 1 is the smallest among a family of independent exponential random variables with parameters $(\lambda_v)_v$, where $\lambda_v := \frac{p_v}{p_u} \vee \frac{q_v}{q_u}$ (note that $\lambda_u=1$). It then follows from standard properties of exponential random variables that this probability is $(\sum_v \lambda_v)^{-1}$. Hence,
  \begin{equation}\label{eq:2}
  \P(X=Y=u) = \left(\sum_v \frac{p_v}{p_u} \vee \frac{q_v}{q_u}\right)^{-1} .
  \end{equation}
  Summing over $u \in U$ yields~\eqref{eq:couplingII}.

  It remains to show that the right-hand side of~\eqref{eq:couplingII} is at least $1-F(d_{\mathrm TV}(X,Y))$. To see this, we first observe that $1-F(x)=\frac{1-x}{1+x}$ and that
  \[
    \sum_u p_u \wedge q_u =  1-d_{\mathrm TV}(X,Y)
    \qquad \text{and} \qquad
    \sum_u p_u \vee q_u =  1+d_{\mathrm TV}(X,Y).
  \]
  Thus, it suffices to show that
  \begin{equation}\label{eq:3}
    \sum_u \left(\sum_v \frac{p_v}{p_u} \vee \frac{q_v}{q_u}\right)^{-1} \ge \frac{\sum_u p_u \wedge q_u}{\sum_{v} p_v \vee q_v} .
  \end{equation}
  This follows immediately from the inequality $\frac ab \vee \frac cd \le \frac{a \vee c}{b \wedge d}$.
  \end{proof}

\subsection{Proof of \cref{T:main}}
\label{sec:proof-main-thm}

\begin{proof}
Coupling I proves \cref{T:main} in the discrete and continuous cases. Coupling I\!I\ also proves \cref{T:main} in the discrete case.
To obtain a coupling with the desired disagreement bound for a countable collection of arbitrary real random variables, we apply a limiting argument.
One may discretize the variables to multiples of $\varepsilon$, and take a limit of the joint distribution as $\varepsilon\to 0$.
Let us make this precise.

Let $\mathcal S = \{X_i\}_{i \in \mathbb N}$ be a countable collection of real random variables.
  Let $X_i^{(\varepsilon)}$ be a discretization of $X_i$, by rounding down to a multiple of $\varepsilon$, so that $X_i^{(\varepsilon)} = \varepsilon \lfloor X_i/\varepsilon\rfloor$.
  For any $\varepsilon>0$, the variables $(X_i^{(\varepsilon)})_{i \in \mathbb N}$ constitute a family of variables taking values in $\varepsilon\mathbb Z$.
  By either \cref{P:couplingI} or \ref{P:couplingII}, these random variables can be coupled so that the desired disagreement bound holds.
  Let $\P_\varepsilon$ be the resulting law of the sequence $(X_i^{(\varepsilon)})_{i\in\mathbb N} \in \mathbb R^\mathbb N$.
  Since for each $i$, $X_i^{(\varepsilon)}$, the $i$-th marginal of $\P_\varepsilon$, is tight with respect to $\varepsilon$, there is a subsequential weak limit of the measures $\P_\varepsilon$ as $\varepsilon\to 0$.
  Denote such a limit by $\P$, so that $\P$ is a probability measure on $\mathbb R^\mathbb N$.

  We claim that $\P$ is the desired coupling, with the variables being the marginals, namely, $X_i$ is the $i$-th coordinate.
  It is clear that each $X_i$ has the required law.
  To see that $\P(X_i\neq X_j)$ satisfies the claimed bound, note that for any $\varepsilon>0$, we have $d_{\mathrm TV}(X_i,X_j) \geq d_{\mathrm TV}(X_i^{(\varepsilon)},X_j^{(\varepsilon)})$.
  Thus, since $F$ is increasing,
  \begin{align*}
    \P(X_i\neq X_j)
    &\leq \limsup_{\varepsilon\to0} \P_\varepsilon(X_i\neq X_j)
   \leq F(d_{\mathrm TV}(X_i^{(\varepsilon)},X_j^{(\varepsilon)}))
    \leq F(d_{\mathrm TV}(X_i,X_j)).
    \qedhere
  \end{align*}
\end{proof}

Let us make a remark concerning the assumptions of \cref{T:main}. A similar construction can work also if the random variables take values in some space $\Omega$ other than $\mathbb R$.
The requirement is that it is possible to approximate variables taking values in $\Omega$ by discrete random variables in a way that decreases total variation distances, and that it is possible to take weak limits of measures on $\Omega^\mathbb N$. In particular, this works for $\Omega=\mathbb R^d$ with $d \ge 2$.

\subsection{Comparison of the couplings}

The two coupling share various features beyond the fact that they both achieve the disagreement bound~$F$, but (except in degenerate cases) they are not the same coupling.

While Coupling I is very intuitive and the fact that it achieves the disagreement bound $F$ is more transparent, there are good reasons to consider Coupling I\!I\ as well.
This is made clear by considering the case of random variables with common finite support.
Consider the collection $\mathcal S$ of all random variables taking values in $\{1,\dots,n\}$.
The set $\mathcal S$ is naturally described by the $(n-1)$-dimensional simplex $\Delta_n := \{ (a_1,\dots,a_n) \in [0,1]^n : \sum_i a_i =1 \}$ so that we may identify each random variable $X \in \mathcal S$ with a point in $\Delta_n$.
A point in the simplex is a convex combination of the corners, and the coefficients (also refered to as barycentric coordinates) are the probabilities of the different values.
A coupling of the random variables in $\mathcal S$ may be described as a random partition $A_1,\dots,A_n$ of the simplex so that $X = i$ for those variables $X\in A_i$.
The validity of the coupling says that a point $X=(a_1,\dots,a_n)$ has $\P(X\in A_i) = a_i$ for all $i$.
The disagreement bounds are a control on the probability that nearby points (in the total-variation metric) are not in the same set of the partition.

Let us describe the two couplings using this terminology.
In Coupling I, each value $i\in\{1,\dots,n\}$ has a Poisson point process in $\mathbb R_+\times\mathbb R_+$, with points $(i,s,t)$.
The value assigned to the random variable $X$ with coordinates $(a_1,\dots,a_n)$ is the $i$ associated with the point of minimal $t$ such that $s\leq a_i$.
We may clearly ignore points with $s>1$.
We can then think of the remaining points as arriving at random times, each with a random uniform $i$ and uniform $s\in[0,1]$.
When at time $t$ we see a point $(i,s,t)$, the value $i$ is assigned to all $X$ with $a_i\geq s$ which have not already been assigned a value at an earlier time.
The set $\{X : a_i\geq s\}$ is a smaller simplex of size $s$ sharing the $i$-th corner of the full simplex.
An example is shown in \cref{fig:triangles}(a), where several such steps are visible.

\begin{figure}
	\centering
	\includegraphics[scale=0.6]{triangles.pdf}
	\caption{An illustration of the two couplings for three-valued random variables.
          The associated partitions of the simplex are depicted.
          (a) Coupling I may be described by the overlapping ``territorial claims''.
          (b) In Coupling I\!I, the pivot point is uniform in the simplex.}
	\label{fig:triangles}
\end{figure}

While Coupling I is very simple to describe and understand, the resulting partition of the simplex is evidently somewhat complex.
In particular, the parts of the partition are not necessarily convex (though they are star-like).
Coupling~I\!I, while less transparent in its construction, yields a remarkably simple partition.
The interfaces between the parts $A_i$ are given by relations on the ratios, with $A_i$ adjacent to $A_j$ where $E_i/a_i = E_j/a_j$ (where $E_i$ are the exponentials used in the construction).
This is a hyperplane passing through all but two vertices of the simplex.
Indeed, the entire partition is determined by a unique point $U$ where $E_i/a_i$ is the same for all $i$.
Since $E_i$ are independent exponential random variables, $U$ is a uniform point in the simplex.
The hyperplanes passing though $U$ and any $n-2$ of the corners give the partition of the simplex.
This is shown in \cref{fig:triangles}(b).

\paragraph{Sharpness of couplings.}
Both Coupling I and Coupling I\!I\ satisfy that $\P(X \neq Y) \le F(d_{\mathrm TV}(X,Y))$ for any two random variables $X$ and $Y$, and for both constructions there are pairs of random variables for which they do no better.

For Coupling I, in the case of continuous random variables with respect to the Lebesgue measure, or for any $\mu$ with no atoms, Coupling I achieves the disagreement bound $F$ precisely, and no better.
As remarked above, we can also use Coupling I in the discrete case, where the random variable $X_i$ has density $f_i$ with respect to the counting measure.
In this case, it is possible that $X=Y$ even if distinct points $(x,s,t)$ and $(x',s',t')$ determine their value, since it may happen that $x=x'$. Indeed, the second term on the right-hand side of~\eqref{eq:coup1_pr} is zero if and only if, for every $x$, either $\P(X=x)$ and $\P(Y=x)$ are equal or one of them is zero.

For Coupling I\!I, suppose that $\mathcal S$ consists of discrete random variables taking values in $U$.
An inspection of the inequality used in~\eqref{eq:3} reveals that there is equality in~\eqref{eq:3} if and only if $p_u=q_u$ or $p_u \wedge q_u = 0$, which is the same condition as for Coupling I.
In any other case, both couplings yield a disagreement probability which is strictly smaller than $F(d_{\mathrm TV}(X,Y))$.

Since the two couplings achieve the worst-case disagreement probability $F$ in the same cases, it is natural to ask how they compare in general.
It turns out that Coupling I\!I\ is not only geometrically simpler as seen in \cref{fig:triangles}, but also achieves better disagreement probabilities than Coupling I for any pair of discrete random variables.
In fact, for any two discrete random variables $X$ and $Y$ and any value $u$, the probability that $X=Y=u$ is at least as large under Coupling~I\!I\ than under Coupling~I. This is seen by comparing the formulas~\eqref{eq:1b} and~\eqref{eq:2}. Denote $p_v := \P(X=v)$ and $q_v := \P(Y=v)$. We must show that
\[ (1+|p_u-q_u|) \cdot (p_u \wedge q_u) \cdot \sum_v \frac{p_v}{p_u} \vee \frac{q_v}{q_u} \le \sum_v p_v \vee q_v .\]
Suppose without loss of generality that $p_u \le q_u$ and consider the set $S := \{ v : \frac{p_v}{p_u} \le \frac{q_v}{q_u} \}$. Then $p_v \le q_v$ for $v \in S$, so that $\sum_v p_v \vee q_v \ge 1 + \sum_{v \in S} (q_v - p_v)$. It thus suffices to show that
\[ (1 + q_u - p_u) \cdot \left(\tfrac{p_u}{q_u} \sum_{v \in S} q_v + \sum_{v \notin S} p_v\right) \le 1 + \sum_{v \in S} (q_v - p_v) .\]
Using that $\sum_{v \notin S} p_v = 1 - \sum_{v \in S} p_v$, we see that it suffices that
\[ q_u - p_u \le \sum_{v \in S} \left(q_v - p_v - (1 + q_u - p_u)(\tfrac{p_u q_v}{q_u} - p_v) \right) .\]
Using the assumption that $p_u \le q_u$ and rewriting the summand as $\frac{1}{q_u}(q_u-p_u)(q_v-p_uq_v+p_vq_u)$, we see that every term in the sum is non-negative. Since $u \in S$, the inequality is easily seen to hold.

\paragraph{$k$-tuple disagreements.}
We have shown that both couplings are ``nearly optimal'' for disagreements among pairs of random variables. In fact, both couplings are also nearly optimal (in a similar sense) for disagreements among $k$-tuples of random variables.
Namely, for any $k$ random variables $X_1,\dots,X_k$, the probability they are not all equal under either coupling is comparable to its smallest possible value $\alpha := 1-\sum_u \P(X_1=u) \wedge \dots \wedge \P(X_k=u)$ (given by the optimal coupling of $X_1,\dots,X_k$ and no others).
Precisely, under either coupling, we have
\[ \P(X_1,\dots,X_k\text{ are not all equal}) \le \frac{k\alpha}{1+(k-1)\alpha} \le k \alpha .\]
This follows from
\[ \P(X_1=\dots=X_k) \ge \frac{\sum_u \P(X_1=u) \wedge \dots \wedge \P(X_k=u)}{\sum_u \P(X_1=u) \vee \dots \vee \P(X_k=u)} ,\]
which can be shown for Coupling~I by a similar computation as in~\eqref{eq:1} and for Coupling~I\!I\ by a similar computation as in~\eqref{eq:2} and~\eqref{eq:3}.

For certain collections $\mathcal S$ of random variables, the latter bound cannot be improved.
For example, consider the set $\mathcal S$ of $n \ge k$ random variables $S_1,\dots,S_n$ such that each $S_i$ is uniform on $\{1,\dots,n\} \setminus \{i\}$.
In any coupling of $S_1,\dots,S_n$, there exists a subset $X_1,\dots,X_k$ of the random variables for which the reverse inequality holds.
To see this, note that the number of subsets $I \subset \{1,\dots,n\}$ of size $k$ for which not all $\{S_i\}_{i \in I}$ are equal is always at least $\binom{n-1}{k-1}$.
Thus, in any coupling, there must be such a subset $I$ for which the probability of this event is at least $\binom{n-1}{k-1} / \binom{n}{k} = k/n$.
On the other hand, for any $k$ of the random variables $X_1,\dots,X_k$,
\[ \frac{\sum_u \P(X_1=u) \wedge \dots \wedge \P(X_k=u)}{\sum_u \P(X_1=u) \vee \dots \vee \P(X_k=u)} = \frac{(n-k)/(n-1)}{n/(n-1)} = 1 - \frac{k}{n} .\]

\section{Optimality of disagreement bounds}
\label{sec:optimality}

In this section, we investigate the optimality of \cref{T:main}.
As noted, it is natural to ask whether there are any disagreement bounds smaller than $F$.
The first set of results are lower bounds on $f(x)$ for any single $x$, and we do not believe these are optimal for generic $x$.
The second set of results lead to \cref{prop:optimal-bound}, which states that there is no disagreement bound that is less than $F$ globally.

\subsection{Local optimality of $F$}

The trivial lower bound (see \cref{T:couple2}) is that any disagreement bound must have $f(x)\geq x$ for all $x$.
The example presented just before \cref{T:main}, of three variables each taking two possible values, shows that any disagreement bound must have $f(\frac 12)\geq \frac 23 = F(\frac 12)$.
This is generalized by the following.

\begin{prop}\label{prop:1/n-bound}
  Any disagreement bound $f$ must have
  \[
    f(\tfrac1n) \geq F(\tfrac1n) = \tfrac{2}{n+1} \qquad\text{for any integer $n \ge 1$}.
  \]
  In particular, $ax$ is a disagreement bound for $a=2$, but not for any smaller $a$.
\end{prop}

\begin{proof}
  Consider the case when $\mathcal S$ consists of $n+1$ random variables $X_0,\dots,X_n$, where each $X_i$ is uniform on $\{0,\dots,n\} \setminus \{i\}$.
  Then $d_{\mathrm TV}(X_i,X_j)=\frac{1}{n}$ for any $i \neq j$.
  However, it is impossible for all variables $X_i$ to be equal, and therefore at least $n$ of the $\binom{n+1}{2}$ pairs must disagree.
  Thus, under any coupling,
  \[
    \sum_{i < j} \P(X_i \neq X_j) \ge n,
  \]
  and hence, $\P(X_i\neq X_j) \geq \frac{2}{n+1}$ for some $i \neq j$.
\end{proof}

The above proposition shows that $F$ provides the best possible value for a disagreement bound at any inverse integer. We do not know whether an analogous statement holds at every point $x \in (0,1)$. Nevertheless, we are able to provide a lower bound at any point $x$, which improves on the trivial lower bound $x$, and nearly matches $F(x)$ for small $x$.
See \cref{fig:bounds} for a comparison between $F$ and our lower bounds.

\begin{figure}
  \centering
  \includegraphics[width=.5\textwidth]{graph.pdf}
  \caption{The disagreement bound $F(x)$ is shown in blue.
    Our pointwise lower bound on any disagreement bound is in red.
    The increasing segments are from \cref{prop:all-x-bound} and the decreasing segments from \cref{cor:pointwise-bound}.}
  \label{fig:bounds}
\end{figure}

\begin{prop}\label{prop:all-x-bound}
  Any disagreement bound $f$ must have
  \[
  f(x) \ge \frac{2x}{1+\frac{1}{\lfloor \frac1x \rfloor}}
  \qquad\text{for any $x \in (0,1)$}.
  \]
  In particular, any disagreement bound $f$ satisfies $\liminf_{x \to 0} \frac{f(x)}{x} \ge 2$.
\end{prop}

\begin{proof}
  We use a variant of the construction from the proof of \cref{prop:1/n-bound}.
  Fix $x \in (0,1)$, $n \ge 1$ and $\varepsilon \ge 0$ such that $n(x+\varepsilon)=1-\varepsilon$.
  Consider the case when~$\mathcal S$ consists of $n+1$ random variables $X_0,\dots,X_n$, where each $X_i$ takes the value $i$ with probability $\varepsilon$, and takes any other value with probability $x+\varepsilon$.
  Then $d_{\mathrm TV}(X_i,X_j)=x$ for any $i \neq j$.
  Let $\P$ be some coupling of these variables. Observe that the variables $X_i$ are all equal with probability at most $(n+1)\varepsilon = 1-nx$.
  Thus, with probability at least $nx$, they are not all equal, in which case at least $n$ of the $\binom{n+1}{2}$ pairs must disagree. Therefore,
  \[
    \sum_{i<j} \P(X_i \neq X_j) \ge n^2 x,
  \]
  and hence, $\P(X_i\neq X_j) \geq \frac{2nx}{n+1}$ for some $i \neq j$.
  Taking the largest $n$ compatible with a given $x$, namely $n=\lfloor \frac1x \rfloor$, yields the inequality.
\end{proof}

One may think of Proposition~\ref{prop:all-x-bound} as converting the pointwise bound at $x=\frac 1n$ from Proposition~\ref{prop:1/n-bound} to a slightly worse pointwise bound at any point $x<\frac 1n$.
In fact, a similar perturbation argument shows that any pointwise lower bound can converted to a slightly worse pointwise lower bound at any other point. This will be a simple consequence of the following.

\begin{prop}\label{prop:perturbed-disagreement-bound}
Let $f$ be a disagreement bound and let $0 \le \delta \le \varepsilon \le 1$. Define
\[ \tilde{f}(x) := f((1-\varepsilon)x + \delta) + 2\varepsilon .\]
Then $\tilde{f}$ is also a disagreement bound.
\end{prop}
\begin{proof}
 Let $\mathcal S$ be a finite collection of random variables. To show that $\tilde f$ is a disagreement bound, we need to exhibit a coupling of the variables in $\mathcal S$ so that $\P(X \neq Y) \le \tilde{f}(d_{\mathrm TV}(X,Y))$ for any $X,Y \in \mathcal S$.
Consider the set $U$ of all numbers $u$ such that $\P(X=u)=0$ for all $X \in \mathcal S$ and choose elements $\{c(X)\}_{X \in \mathcal S}$ in $U$ and an additional element $c \in U$, all distinct from each other.
In order to use that $f$ is a disagreement bound, for each $X \in \mathcal S$, we define a new random variable $X'$ by letting $X'$ equal $X$ with probability $1-\varepsilon$, equal $c(X)$ with probability $\delta$, and otherwise equal $c$. Note that $d_{\mathrm TV}(X',Y') = (1-\varepsilon) d_{\mathrm TV}(X,Y) + \delta$. Since $f$ is a disagreement bound, there exists a coupling of the prime variables so that $\P(X' \neq Y') \le f(d_{\mathrm TV}(X',Y'))$ for any $X'$ and $Y'$. Consider the coupling of the original variables obtained by taking $X$ to equal $X'$ if $X' \notin \{c,c(X)\}$ and otherwise equal to an independent copy of $X$. It is straightforward that this indeed yields a coupling of the variables in $\mathcal S$. Since $\P(X \neq X')=\varepsilon$, we have that $\P(X \neq Y) \le f(d_{\mathrm TV}(X',Y')) + 2\varepsilon = \tilde{f}(d_{\mathrm TV}(X',Y'))$. Thus, we have obtained a coupling with the required bound on the disagreement probabilities.
\end{proof}

\begin{corollary}\label{cor:pointwise-bound}
  Let $g$ be the pointwise infimum over all disagreement bounds $f$.
  Then
  \[ -\frac{2}{1-x} \le \frac{g(y)-g(x)}{y-x} \le \frac{2}{y} \qquad \text{for any } 0<x<y<1 . \]
  Consequently, for $x\in[\frac{1}{n},\frac{1}{n-1}]$, we have
  \[ g(x) \geq \max\left( \frac{2(n-1)x}{n}\ ,\  \frac{4n}{n^2-1} - \frac{2nx}{n-1} \right) . \]
\end{corollary}

\begin{proof}
  By Proposition~\ref{prop:perturbed-disagreement-bound}, we have
  $g(x) \le g((1-\varepsilon)x+\delta) + 2\varepsilon$ for any $x \in (0,1)$ and $0 \le \delta \le \varepsilon \le 1$.
  Taking $\delta=0$ and $\varepsilon=s/x$ yields that $g(x) \le g(x-s) + 2s/x$ for $s \in (0,x)$.
  Taking $\delta=\varepsilon=s/(1-x)$ yields that $g(x) \le g(x+s)+2s/(1-x)$ for $s \in (0,1-x)$.

  The bounds in the conclusion are from \cref{prop:all-x-bound} and from taking $x=\frac1n$ in the first part.
\end{proof}

\subsection{Combinatorial improvements}

By more careful combinatorial analysis, we get the following extension of \cref{prop:1/n-bound} which shows that $F(x)$ is a lower bound at rational points in which the denominator is large in comparison to the numerator.

\begin{prop}\label{prop:k/n-bound}
  Any disagreement bound $f$ must have
  \[
  f(\tfrac kn) \geq F(\tfrac kn) = \tfrac{2k}{n+k} \qquad\text{for any integers $k \ge 2$ and $n \ge 3k^2+6k$}.
  \]
\end{prop}

We next introduce a combinatorial lemma which we require for the proof of \cref{prop:k/n-bound}.
Fix $1 \le k \le n$.
Let $S_{n,k}$ be the collection of all $I\subset\{1,\dots,n+k\}$ of size $n$.
The Hamming \textbf{distance} between two sets $I$ and $J$ in $S_{n,k}$ is defined by
\[ d(I,J) := |I\setminus J| = |J\setminus I| .\]
A pair of sets $I$ and $J$ in $S_{n,k}$ are called \textbf{distant} if $d(I,J) = k$ (this is the maximal possible distance).
A \textbf{$(n,k)$-assignment} is a selection of an element from each $I$ in $S_{n,k}$, namely, $z=(z_I)_{I\in S_{n,k}}$ with $z_I \in I$.
For such an assignment, we denote by $D_m(z)$ the number of \textbf{distance-$m$ disagreements}, defined by
\[ D_m(z) := \# \Big\{ (I,J) : d(I,J)=m \text{ and }z_I \neq z_J \Big\} .\]
In the remainder of this section, we focus on distant disagreements, corresponding to the case $m=k$.
Note that these are ordered pairs, and that the total number of distant pairs is the multinomial coefficient
\[ \binom{n+k}{k,k} = \frac{(n+k)!}{k!^2(n-k)!} .\]

Using this notation, the proof of \cref{prop:1/n-bound} relied on the simple fact that any $(n,1)$-assignment has at least $n$ distant disagreement pairs.
Equivalently, at least a $F(\frac1n)$-fraction of distant pairs disagree.
The following lemma shows that, when $n$ is large is comparison to $k$, any $(n,k)$-assignment has at least a $F(\frac kn)$-fraction of distant disagreements.

\begin{lemma}\label{lem:disagreement-large-n}
  Let $a=1/\log \frac 32 \approx 2.466$.
  For any $k \ge 2$, $n \ge ak^2+6k$ and $(n,k)$-assignment $z$, we have
  \begin{equation}\label{eq:disjoint-disagreement-bound}
    D_k(z) \ge \frac{2k}{n+k} \cdot \binom{n+k}{k,k} .
  \end{equation}
\end{lemma}

The bound $n\geq ak^2+O(k)$ is an artifact of the following proof, and can no doubt be improved.
This bound is motivated by the idea that up to a permutation of the elements $\{1,\dots,n+k\}$, the way to minimize disagreements is to take $z_I = \min(I)$, for which there is equality in~\eqref{eq:disjoint-disagreement-bound}.
We do not know what the minimal $n$ above which this assignment minimizes $D_k(z)$ is.
We note however that~\eqref{eq:disjoint-disagreement-bound} does not necessarily hold for small~$n$.
For example, the $(3,2)$-assignment $z$ given by $z_{\{i,j,k\}} = 2(i+j+k) \pmod{5}$ has $|D_2(z)|=20$, compared to $24$ for $z_I=\min(I)$.

\begin{proof}
  At the heart of the proof is the observation that, when $n$ is large enough, most sets $I$ contain any given element and most pairs of sets are distant.
  Suppose for a contradiction that there is a counterexample to the lemma, and let $z$ be an assignment with minimal possible $D_k(z)$.
  Without loss of generality, we assume that the most common value among the $z_I$ is $1$, and let
  \[ N_1 := \# \{I : z_I=1\} \]
  be the number of times it appears.
  Since each $z_I$ agrees with at most $N_1$ other variables, by considering distant pairs $(I,J)$ having $z_I=z_J$, it is clear that
  \[ \binom{n+k}{k,k} - D_k(z) \le N_1 \cdot \binom{n+k}{k} .\]
  Therefore,
  \begin{equation}\label{eq:N-lower-bound}
    N_1
    \ge \frac{\left(1-\frac{2k}{n+k}\right)\binom{n+k}{k,k}}{\binom{n+k}{k}}
    = \frac{n-k}{n+k} \cdot \binom{n}{k} .
  \end{equation}
  Note that, if $n$ is large enough, this shows that most $I$ have $z_I=1$.

  We claim that minimality of $D_k(z)$ implies that every $I$ such that $1\in I$ has $z_I=1$.
  Indeed, suppose some $I$ has $1\in I$ and $z_I\neq 1$, and consider an assignment $z'$ which equals $z$ except that $z'_I=1$.
  This modification introduces at most $2\left[\binom{n+k}{k}-N_1\right]$ new distant disagreement pairs (the $2$ is since these are ordered pairs).
  Among the total $\binom{n+k}{k}$ sets $J$, there are $\binom{n-1}{k}$ sets $J$ that are both distant from $I$ and contain $1$.
  Among those, at most $\binom{n+k}{k}-N_1$ do not have $z_J=1$.
  Thus, the number of eliminated distant disagreement pairs is at least
  $2\left[\binom{n-1}{k} + N_1 - \binom{n+k}{k}\right]$.
  This contradicts minimality of $D_k(z)$ when
  \[ \binom{n+k}{k}-N_1 < \binom{n-1}{k} + N_1 - \binom{n+k}{k} .\]
  In light of \eqref{eq:N-lower-bound} this holds when
  \[ \binom{n+k}{k} < \frac12 \binom{n-1}{k} + \frac{n-k}{n+k}\binom{n}{k} .\]
  Using $\binom{n+k}{k} \leq e^{k^2/(n-k)} \binom{n}{k}$, this is seen to hold when $e^{k^2/(n-k)} < \frac{(n-k)(3n+k)}{2n(n+k)}$, which in turn holds for every $n\geq ak^2 + 6k$.

  Thus, we have proved that a counterexample with minimal $D_k(z)$ has $z_I=1$ for every $I$ with $1\in I$.
  Hence, the number of distant disagreement pairs is at least twice the number of distant pairs $(I,J)$ having $1\in I$ and $1\not\in J$, the latter being
  $\binom{n+k-1}{k,k-1} = \frac{k}{n+k} \binom{n+k}{k,k}$.
\end{proof}

We are now ready to prove \cref{prop:k/n-bound}.

\begin{proof}[Proof of \cref{prop:k/n-bound}]
  The proof uses yet another variant of the construction from the proof of \cref{prop:1/n-bound}.
  Let $\mathcal S$ consist of $\binom{n+k}{k}$ random variables $\{X_I\}_{I \subset \{1,\dots,n+k\}, |I|=n}$, where each $X_I$ is uniform on $I$.
  Then $d_{\mathrm TV}(X_I,X_J)=\frac{k}{n}$ for distant $I$ and $J$.
  Let $\P$ be any coupling of these variables.
  Since $X=(X_I)_I$ is a $(n,k)$-assignment, \cref{lem:disagreement-large-n} implies that, almost surely,
  \[ D_k(X) \ge F\left(\tfrac kn\right) \cdot \binom{n+k}{k,k} .\]
  In other words, the fraction of distant pairs $(I,J)$ with $X_I\neq X_J$ is at least $F(\frac kn)$.
  Thus, there exist distant $I$ and $J$ such that $\P(X_I\neq X_J) \geq F(\frac kn)$.
\end{proof}

\subsection{Global optimality of $F$}

Our goal now is to prove \cref{prop:optimal-bound}.
The main step is the following.

\begin{prop}\label{prop:optimal-bound-step}
  Fix $1 \le k \le n$, and let $c_m$ be the probability that $d(I,J)=m$, where $I$ and $J$ are two independently chosen uniform subsets of $\{1,\dots,n+k\}$ of size $|I|=|J|=n$.
  Then any disagreement bound $f$ satisfies
  \[ \sum_{m=1}^k c_m f(\tfrac mn) \ge \sum_{m=1}^k c_m F(\tfrac mn) .\]
  Moreover, for any $\varepsilon \in (0,1)$,
  \[ \sum_{m=1}^k c_m f\left(\tfrac {(1-\varepsilon)m}n \right) \ge \left(1-3\varepsilon^{2/3} \right) \cdot \sum_{m=1}^k c_m F\left(\tfrac mn \right) .\]
\end{prop}

Let us see how \cref{prop:optimal-bound} follows from \cref{prop:optimal-bound-step}.

\begin{proof}[Proof of \cref{prop:optimal-bound}]
  Let $f$ be a disagreement bound such that $f \le F$.
  The first part of \cref{prop:optimal-bound-step} immediately implies that $f(x)=F(x)$ for every rational $x \in (0,1)$.
  Indeed, if $k/n$ is a rational number with minimal $k$ such that $f(\frac{k}{n}) < F(\frac{k}{n})$, then the proposition is violated with that $k$ and $n$.

  Since there is no obvious monotonicity or continuity for disagreement bounds, the rest of the proof relies on a perturbative argument to address the case of irrational points.
  Let $x \in (0,1)$ be irrational.
  For arbitrary $n$, let $m$ be such that
  \[ \tfrac{m-1}n < x < \tfrac mn .\]
  Set $\varepsilon := 1 - \frac{nx}m$ so that $x=(1-\varepsilon) \frac mn$ and $0<\varepsilon<\frac1m < \frac1{nx}$.
  We henceforth regard $x,m,n,\varepsilon$ as fixed, and we aim to choose a suitable $k$ for which to apply \cref{prop:optimal-bound-step}.
  By standard estimates (using Sterling's approximation), there exists some $k\in[m,n]$ such that $c_m \ge \frac c{\sqrt n}$, where $c>0$ is an absolute constant which does not depend on~$n$.
  With this choice of $k$, by the second part of \cref{prop:optimal-bound-step}, we have
  \[ \sum_{i=1}^k c_i f\left(\tfrac {ix}m \right) \ge \big(1-\tfrac{3}{(nx)^{2/3}} \big) \cdot \sum_{i=1}^k c_i F\left(\tfrac in \right) .\]
  Since $f(\frac{ix}m) \le F(\frac{ix}m) \le F(\frac in) \le 1$ for all $1 \le i \le k$, we obtain that
  \[ c_m(F(x) - f(x)) \le \sum_{i=1}^k c_i \left( F\left(\tfrac {ix}m \right) - f\left(\tfrac {ix}m \right) \right) \le  \tfrac{3}{(nx)^{2/3}} \cdot \sum_{i=1}^k c_i F\left(\tfrac in \right) \le \tfrac{3}{(nx)^{2/3}} .\]
  By the lower bound on $c_m$, we have $F(x)-f(x) \le \frac{3}{cn^{1/6}x^{2/3}}$.
  Since $n$ may be taken arbitrarily large, it follows that $f(x)=F(x)$.
\end{proof}

The proof of \cref{prop:optimal-bound-step} requires additional combinatorial lemmas.
We have seen in \cref{lem:disagreement-large-n} that, when $n$ is large is comparison to $k$, any $(n,k)$-assignment has at least a $F(\frac kn)$-fraction of distant disagreements, i.e., $D_k(z) \geq F(\frac kn) \binom{n+k}{k,k}$.
The analogous statement for distance-$m$ pairs is that the number of distance-$m$ disagreements is that it is at least a $F(\frac mn)$-fraction of all distance-$m$ pairs, i.e.,
\[ D_m(z) \ge F\left(\tfrac mn\right) \cdot \binom{n+k}{m,m,k-m} .\]
While we have no proof of this inequality for any particular $m$, the following lemmas establish a linear combination of these bounds for different $m$'s.

\begin{lemma}\label{lem:disagreement}
  For any $(n,k)$-assignment $z$, we have
  \begin{equation}\label{eq:agreement-bound2}
    \sum_{m=1}^k D_m(z) \ge \sum_{i=0}^{k-1} 2\binom{n+i}{i+1} \binom{n+i}{i} .
  \end{equation}
\end{lemma}

\begin{proof}
  We seek a lower bound on the total number of disagreements $D:=\sum_{m=1}^k D_m(z)$.
  For $i \in \{1,\dots,n+k\}$, let $N_i$ be the number of variables $z_I$ that equal~$i$.
  Without loss of generality, we may assume that $N_1 \ge N_2 \ge \dots \ge N_{n+k}$.
  The number of disagreements is precisely
  \[ D = \sum_{i \neq j} N_i N_j = \binom{n+k}{k}^2 - \sum_i N_i^2 .\]
  We claim that the above is minimized by the ``greedy'' assignment $z_I = \min(I)$ which has
  \[ N_i = \binom{n+k-i}{k-i+1} \qquad \text{for $i\leq k+1$} ,\]
  and $N_i=0$ for $i>k+1$.
  Indeed, minimizing $D$ is equivalent to maximizing $\sum_i N_i^2$.
  To see that the greedy choice maximizes this latter quantity, note that if
  $a\geq b$ then $(a+1)^2 + (b-1)^2 > a^2+b^2$.
  Since $N_i$ are decreasing, if $z_I \neq \min(I)$ for some $I$, then decreasing $z_I$ will increase $\sum N_i^2$.

  Finally, the number of $I$ with $\min(I)>i$ is $\binom{n+k-i}{k-i}$, and so for the greedy assignment we have
  \[ D = \sum_i 2N_i \sum_{j>i} N_j
  = \sum_{i=1}^k 2\binom{n+k-i}{k-i+1}\binom{n+k-i}{k-i} . \]
  The lemma follows after a change of the index of summation.
\end{proof}

\begin{lemma}\label{lem:combi-identity}
  For any $n,k \ge 1$, we have
  \[ \sum_{i=0}^{k-1} \binom{n+i}{i+1} \binom{n+i}{i} = \sum_{m=1}^k \frac{m}{n+m} \cdot \binom{n+k}{m,m,k-m} .\]

\end{lemma}

\begin{proof}
Let $E$ denote the set of ordered pairs $(I,J)$ of subsets of $\{1,\dots,n+k\}$ such that $|I|=k$, $|J|=k-1$ and $\min (I^c) = \min (J^c)$. Here and and below, all complements are taken within $\{1,\dots,n+k\}$. We show that both sides of the desired equality count the number of elements in $E$.

We begin with the left-hand side.
Since the $i$-th term in the sum is easily seen to count the number of $(I,J) \in E$ such that $\min (I^c) = k-i$, it follows that the left-hand side equals $|E|$.

We now turn to the right-hand side, which may be rewritten as
\[ \sum_{m=1}^k \binom{n+k}{k-m} \binom{n+m-1}{m-1} \binom{n}{m} .\]
Let us show that the $m$-th term in the sum counts the number of $(I,J) \in E$ such that $|I \setminus J|=m$. Indeed, $\binom{n+k}{k-m}$ is the number of ways to choose $S=I \cap J$, and given any such choice, noting that neither $I$ nor $J$ can contain the number $s := 1+\min (S^c)$, we see that $\binom{n+m-1}{m-1}$ is the number of ways to choose $J \setminus S$ (which must be disjoint from $S \cup \{s\}$) and $\binom nm$ is then the number of ways to choose $I \setminus S$ (which must be disjoint from $J \cup \{s\}$).
\end{proof}

\cref{lem:disagreement,lem:combi-identity} will allow us to deduce the first part of \cref{prop:optimal-bound-step} rather easily.
For the second part of \cref{prop:optimal-bound-step}, we also require a perturbed version of \cref{lem:disagreement}.
Towards this, define a \textbf{$(n,k,\varepsilon)$-assignment} to be an assignment $z=(z_I)_I$ of a number $z_I \in I \cup \{0\}$ to each set $I \subset \{1,\dots,n+k\}$ of size $n$ such that $z_I = 0$ for at most $\varepsilon \binom {n+k}k$ such $I$.
In particular, a $(n,k,0)$-assignment is simply a $(n,k)$-assignment.
The definition of $D_m(z)$ extends to $(n,k,\varepsilon)$-assignments unchanged.

\begin{lemma}\label{lem:disagreement-perturb}
  For any $(n,k,\varepsilon)$-assignment, we have
  \[ \sum_{m=1}^k D_m(z) \ge \left(1-\varepsilon^2 \tfrac{(n+k)^2}{n^2}\right) \cdot \sum_{i=0}^{k-1} 2\binom{n+i}{i+1} \binom{n+i}{i} .\]
\end{lemma}

\begin{proof}
  Let $D=\sum_{m=1}^k D_m(z)$ denote the total number of disagreements.
  For $i \in \{0,1,\dots,n+k\}$, let $N_i$ be the number of variables that equal~$i$ and, as in the proof of \cref{lem:disagreement}, assume that $N_1 \ge N_2 \ge \dots \ge N_{n+k}$. Let $s$ be the maximal number such that $N_s \ge N_0$.
  The total number of disagreements is
  \[ D = \sum_{i \neq j} N_i N_j .\]
  The argument used in the proof of \cref{lem:disagreement} may be applied again:
  For any $I$ such that $z_I\not\in\{0,\min(I)\}$, changing the value of $z_I$ to $\min(I)$ will reduce the total number of disagreements.
  Similarly, for any $I$ such that $z_I=0$ and $\min(I) \le s$, changing $z_I$ to $\min(I)$ will also decrease the number of disagreements.
  It follows that $D$ is minimized by an assignment that has $z_I=\min(I)$ for all $I$ such that $\min(I) \le s$.
  For any such assignment, we have that
  \[ N_i = \binom{n+k-i}{k-i+1} \qquad\text{for } 1 \le i \le s \qquad\text{and}\qquad N_0 > \binom{n+k-s-1}{k-s} .\]
  We henceforth assume that $z$ is such an assignment.
  Thus, for $1\le i \le s$,
  \[ N_i (N_{i+1}+\dots+N_n+N_0) = \binom{n+k-i}{k-i+1}\binom{n+k-i}{k-i} .\]
  Summing these, we find that
  \[ D \geq \sum_{i=1}^s 2\binom{n+k-i}{k-i+1}\binom{n+k-i}{k-i} = \sum_{i=k-s}^{k-1} 2\binom{n+i}{i+1}\binom{n+i}{i} .\]
  Hence, to show for some $\delta>0$ that
  \begin{equation}\label{eq:disagree-pert-1}
    D \ge (1-\delta) \sum_{i=0}^{k-1} 2\binom{n+i}{i+1} \binom{n+i}{i} ,
  \end{equation}
  it suffices to show that
  \[ \sum_{i=s}^{k-1} \binom{n+i-s}{i-s+1} \binom{n+i-s}{i-s} \le \delta \sum_{i=0}^{k-1} \binom{n+i}{i+1} \binom{n+i}{i} .\]
  Comparing the summand on the left-hand side with the summand on the right-hand side, we see that the term-by-term ratios are increasing so that it suffices to show that
  \begin{equation}\label{eq:disagree-pert-2}
    \binom{n+k-s-1}{k-s}\binom{n+k-s-1}{k-s-1} \le \delta \binom{n+k-1}{k} \binom{n+k-1}{k-1} .
  \end{equation}
  Using that $\binom{n+k-s-1}{k-s} < N_0 \le \varepsilon \binom {n+k}k$, we obtain that
  \[ \frac{\binom{n+k-s-1}{k-s}\binom{n+k-s-1}{k-s-1}}{\binom{n+k-1}{k} \binom{n+k-1}{k-1}} = \frac{\binom{n+k-s-1}{k-s}^2}{\binom{n+k}{k}^2} \cdot \frac{(n+k)^2(k-s)}{n^2 k} < \varepsilon^2 \cdot \frac{(n+k)^2}{n^2}  ,\]
  establishing~\eqref{eq:disagree-pert-2}, and hence also~\eqref{eq:disagree-pert-1}, with $\delta = \varepsilon^2 \frac{(n+k)^2}{n^2}$.
\end{proof}

We are now ready to prove \cref{prop:optimal-bound-step}.

\begin{proof}[Proof of \cref{prop:optimal-bound-step}]
  The first part uses the same construction as in the proof of \cref{prop:k/n-bound}.
  Let $\mathcal S$ consist of $\binom{n+k}{k}$ random variables $\{X_I\}_{I \subset \{1,\dots,n+k\}, |I|=n}$, where each $X_I$ is uniform on $I$.
  Then
  \[ d_{\mathrm TV}(X_I,X_J) = \tfrac{d(I,J)}{n} \qquad \text{for any $I$ and $J$}.\]
  By \cref{lem:disagreement,lem:combi-identity}, under any coupling of the variables in $\mathcal S$, almost surely,
  \[ \sum_{m=0}^k D_m(X)
  \ge \sum_{m=0}^k F\left(\tfrac mn\right) \cdot \binom{n+k}{m,m,k-m}
  = \sum_{I,J} F\left(d_{\mathrm TV}(X_I,X_J)\right) .\]
  Hence, by considering a coupling $\P$ for which $\P(X_I \neq X_J) \le f(d_{\mathrm TV}(X_I,X_J))$ for all $I$ and $J$, and taking expectation, we obtain that
  \[ \sum_{I,J} f\left(d_{\mathrm TV}(X_I,X_J)\right) \ge \sum_{I,J} \P(X_I \neq X_J) \ge \sum_{I,J} F\left(d_{\mathrm TV}(X_I,X_J)\right) .\]
  Since the fraction of the terms where $d_{\mathrm TV}(X_I,X_J)=\frac mn$ is $c_m$, this establishes the first part of the proposition.

  \medskip

  To deal with the case when $\varepsilon>0$, we slightly modify the random variables, similarly to the proof of \cref{prop:all-x-bound}, by letting $X_I$ take the value $0$ with probability $\varepsilon$, and otherwise be uniform on $I$.
  Then
  \[ d_{\mathrm TV}(X_I,X_J) = (1-\varepsilon) \cdot \tfrac{d(I,J)}{n} \qquad\text{for any $I$ and $J$} .\]
  Let $\P$ be a coupling for which $\P(X_I \neq X_J) \le f(d_{\mathrm TV}(X_I,X_J))$ for all $I$ and $J$.
  Let $L$ be the number of variables $X_I$ which equal 0.
  \cref{lem:disagreement-perturb} implies that on the event that $L \le \delta \binom {n+k}k$, i.e., on the event that $X$ is a $(n,k,\delta)$-assignment,
  \[ \sum_{m=0}^k D_m(X)
  \ge \big(1-4\delta^2 \big) \sum_{I,J} F\left(\tfrac{d(I,J)}{n}\right) ,\]
  where we used that $k \le n$.
  By Markov's inequality, $\P\big(L \ge \delta \binom {n+k}k\big) \le \frac{\varepsilon}{\delta}$.
  Thus,
  \begin{align*}
  \sum_{I,J} f\left(d_{\mathrm TV}(X_I,X_J)\right)
   \ge \mathbb E \sum_{m=0}^k D_m(X)
   \ge \big(1-\tfrac\varepsilon\delta\big)\big(1-4\delta^2\big) \sum_{I,J} F\left(\tfrac{d(I,J)}{n}\right) .
  \end{align*}
  Taking $\delta = \frac12 \varepsilon^{1/3}$ now yields the proposition.
\end{proof}

\section{Open Questions}

As noted, we are unable to show that $F$ is the optimal disagreement bound in the strong sense:

\begin{question}
  Is every disagreement bound pointwise larger-or-equal than $F$?
\end{question}

In light of \cref{prop:optimal-bound}, this is equivalent to the following question.

\begin{question}
Let $f_1$ and $f_2$ be two disagreement bounds. Is the pointwise minimum $f_1 \wedge f_2$ also a disagreement bound?
\end{question}

The examples used to give some of the lower bounds above give rise to some questions in extremal combinatorics.
For example, towards bounding $f(\frac23)$, suppose for each set $I\subset\{1,\dots,n\}$ of size $|I|=3$, we assign a number $z_I\in I$.
The number of pairs $(I,J)$ with $|I\cap J|=1$ is $\binom{n}{1,2,2} = \frac{n_5}{4}$, where $n_5 = \frac{n!}{(n-5)!}$.
Among these, consider the number $Q$ of pairs $(I,J)$ such that $z_I=z_J$ is the unique element in $I \cap J$.

\begin{question}
  What is the maximal value of $Q$? Is $Q \leq (\frac45 + o(1)) \frac{n_5}{4}$?
\end{question}

A positive answer would imply that $f(\frac23) \ge \frac45 = F(\frac23)$.
Taking $z_I = \min(I)$ gives $Q = \frac{n_5}{5}$.
A careful modification of $z_I$ only when $\min(I) \geq n-4$ can give $Q = \frac{n_5}{5}+4$, which may perhaps be the maximum possible for every $n$.

Finally, we raise the question of extending our results to multi-marginal optimal transport with general cost functions:

\begin{question}
  Given a cost function $\phi$, for which $f$ does it hold that, for any finite collection of random variables taking values in $\mathbb R^d$, there exists a coupling $\mu$ of the variables such that $\mathbb E_\mu \phi(X,Y) \le f(d_\phi(X,Y))$ for every two variables $X$ and $Y$ in the collection?
\end{question}

\subsection*{Acknowledgements.}

OA is supported in part by NSERC.
We are grateful to Russ Lyons for helpful comments on earlier versions of this manuscript, and to Alessio Figalli and Young-Heon Kim for pointing out the bound \eqref{eq:MMOT} in the context of multi-marginal optimal transport.

Probability (math.PR); Combinatorics (math.CO)