<figure><img src="image_1.png" /></figure>

HAL
open science

# A Consistent Extension of Discrete Optimal Transport Maps for Machine Learning Applications

Lucas de Lara, Alberto González-Sanz, Jean-Michel Loubes

► To cite this version:

Lucas de Lara, Alberto González-Sanz, Jean-Michel Loubes. A Consistent Extension of Discrete Optimal Transport Maps for Machine Learning Applications. 2021. hal-03142788

HAL Id: hal-03142788

https://hal.science/hal-03142788

Preprint submitted on 16 Feb 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
# A CONSISTENT EXTENSION OF DISCRETE OPTIMAL TRANSPORT MAPS FOR MACHINE LEARNING APPLICATIONS

Lucas De Lara$^{(1)*}$ and Alberto González-Sanz$^{(2)*}$ and Jean-Michel Loubes$^{(3)*}$

IMT, Université de Toulouse III France

$^{(1)}$lucas.de_lara@math.univ-toulouse.fr

$^{(2)}$alberto.gonzalez sanz@math.univ-toulouse.fr

$^{(3)}$loubes@math.univ-toulouse.fr

## ABSTRACT

Optimal transport maps define a one-to-one correspondence between probability distributions, and as such have grown popular for machine learning applications. However, these maps are generally defined on empirical observations and cannot be generalized to new samples while preserving asymptotic properties. We extend a novel method to learn a consistent estimator of a continuous optimal transport map from two empirical distributions. The consequences of this work are two-fold: first, it enables to extend the transport plan to new observations without computing again the discrete optimal transport map; second, it provides statistical guarantees to machine learning applications of optimal transport. We illustrate the strength of this approach by deriving a consistent framework for transport-based counterfactual explanations in fairness.

**Keywords:** Optimal Transport, Counterfactuals, Explanability, Fairness.

## 1 Introduction

Over the last past years, Optimal Transport (OT) methods have grown popular for machine learning applications. Signal analysis [Kolouri et al., 2017], domain adaptation [Courty et al., 2017], transfer learning [Gayraud et al., 2017] or fairness in machine learning [Jiang et al., 2020, Gordaliza et al., 2019] for instance have proposed new methods that make use of optimal transport maps. Given two distributions $\mu$ and $\nu$ satisfying some assumptions, such a map $T$ has the property of *pushing forward* a measure to another in the sense that if a random variable $X$ follows the distribution $\mu$, then its image $T(X)$ follows the distribution $\nu$. This map comes as a tool to transform the distribution of observations.

However, since only empirical distributions are observed, the continuous optimal transport is transformed into an empirical problem. Optimal transport for empirical distributions has been widely studied from both a theoretical and a computational point of view. We refer for instance to Peyré et al. [2019] and references therein. The obtained empirical maps between observations suffer some important drawbacks when implementing machine learning methods relying on OT. As they are one-to-one correspondences between the points used to compute the optimal transport, they are only defined on these observations, preventing their use for new inputs.

To cope with this issue, either the map must be recomputed for each new data set or one must use a continuous approximation extending the empirical map to observations out of the support of the empirical distribution. Previous research on the latter topic includes GAN approximations of the OT map [Black et al., 2020] and

<footnote>*Research partially supported by the AI Interdisciplinary Institute ANITI, which is funded by the French "Investing for the Future - PIA3" program under the Grant agreement ANR-19-PI3A-0004.</footnote>
Monte-Carlo approximations of the dual parameters [Chiappa and Pacchiano, 2021]. However, these methods don't provide consistent estimators, in the sense that the obtained transport plans are not asymptotically close to the continuous OT map as the sample size increases.

In this paper, we propose to fill the gap between continuous and empirical transport by considering a statisti-
cally consistent interpolation of the OT map for discrete measures. On the basis of the interpolation provided
in del Barrio et al. [2020a], we generalize their results and prove that it is possible to learn from empirical
observations a suitable OT map for machine learning methods. We then utilize this interpolation to derive the
first consistent framework for empirically-based counterfactual explanations to audit the fairness of binary
classifiers, extending the work in Black et al. [2020].

2 Learning an OT map for new observations

Let $\mu_0$ and $\mu_1$ be two unknown probability measures on $\mathbb{R}^d$ whose respective supports are denoted by $\mathcal{X}_0$ and $\mathcal{X}_1$. In this section, we address the problem of learning the optimal transport map between $\mu_0$ and $\mu_1$ from data points.

2.1 Background in Optimal Transport

Let $\|\cdot\|$ denote the euclidean norm associated with the scalar product $\langle \cdot, \cdot \rangle$. The optimal transport map between $\mu_0$ and $\mu_1$ with respect to the squared euclidean cost is defined as the solution to the following Monge problem:

$$
\min_{T: T_{\#}\mu_0 = \mu_1} \int_{\mathbb{R}^d} \|x - T(x)\|^2 d\mu_0(x), \quad (1)
$$

where $T_{\#}\mu_0 = \mu_1$ denotes that $T$ pushes forward $\mu_0$ to $\mu_1$, namely $\mu_1(B) := \mu_0(T^{-1}(B))$ for any measurable set $B \subset \mathbb{R}^d$. Suppose that $\mu_0$ is absolutely continuous with respect to the Lebesgue measure $\ell_d$ in $\mathbb{R}^d$, and that both $\mu_0$ and $\mu_1$ have finite second order moments. Theorem 2.12 in Villani [2003] states that there exists an unique solution to (1) $T: \mathcal{X}_0 \to \mathbb{R}^d$ called the *Brenier map*. This map coincides $\mu_0$-almost surely with the gradient of a convex function, and in consequence has a *cyclically monotone graph*. Recall that set $S \subset \mathbb{R}^d \times \mathbb{R}^d$ is cyclically monotone if any finite set $\{(x_k, y_k)\}_{k=1}^N \subset S$ satisfies

$$
\sum_{k=1}^{N-1} \langle y_k, x_{k+1} - x_k \rangle + \langle y_N, x_1 - x_N \rangle \le 0.
$$

Such a set is contained in the graph of the *subdifferential* of a convex function, see [Rockafellar, 1970]. The *subdifferential* at a point $x \in \mathbb{R}^d$ of a convex function $\psi$ is defined as the set

$$
\partial \psi(x) := \{y \in \mathbb{R}^d | \forall z \in \mathbb{R}^d, \psi(z) - \psi(x) \geq \langle y, z - x \rangle\}.
$$

We say that a multivalued map $F: \mathbb{R}^d \to 2^{\mathbb{R}^d}$ is cyclically monotone if its graph is.

In a practical setting, we only have access to samples from $\mu_0$ and $\mu_1$, and consequently we can't solve (1). However, we can compute a discrete optimal transport map between the empirical measures. Consider two $n$-samples $\{x_1^0, \dots, x_n^0\}$ and $\{x_1^1, \dots, x_n^1\}$ respectively drawn from $\mu_0$ and $\mu_1$. They define the empirical measures

$$
\mu_0^n := \frac{1}{n} \sum_{k=1}^{n} \delta_{x_k^0} \quad \text{and} \quad \mu_1^n := \frac{1}{n} \sum_{k=1}^{n} \delta_{x_k^1}.
$$

The discrete Monge problem between $\mu_0^n$ and $\mu_1^n$ is

$$
\min_{T_n \in \mathcal{T}_n} \frac{1}{n} \sum_{k=1}^{n} \|x_k^0 - T_n(x_k^0)\|^2, \qquad (2)
$$

where $T_n$ denotes the set of bijections from $\{x_i^0\}_{i=1}^n$ to $\{x_i^1\}_{i=1}^n$. Problem (2) defines an unique solution $T_n$ referred as the *discrete* optimal transport map between the two samples. This solution is such that $\{(x_k^0, T_n(x_k^0))\}_{k=1}^n$ is cyclically monotone.

In this paper, we focus on the problem of estimating the optimal transport map $T$ solving (1). As mentioned in the introduction, the solution $T_n$ to (2) is not a suitable estimator because it has finite input and output spaces, whereas $T$ maps the whole domains. As a consequence, the empirical map cannot generalize to new observations. This limitation triggered the need for regularized approaches: a topic we explore next.
## 2.2 Smooth Interpolation

The heuristic approximation of a continuous OT map proposed in Black et al. [2020] handles new observations and has a satisfying empirical behaviour, but is not guaranteed to converge to the true OT map as the sample size increases. The problem of constructing an approximation able to generalize to new observations while being statistically consistent crucially raises the question of which properties of continuous optimal transport must be preserved by the empirical estimator.

Recall that in one dimension the continuous optimal transport map between two probability measures is a non-decreasing function $T$ such that $T_\mu = \mu_1$. Then, natural extensions and regularization are made by preserving that property. In several dimensions, the cyclically monotone property substitutes the non-decreasing one. For the purpose of generalizing the notion of distribution function to higher dimensions, del Barrio et al. [2020a] designed such an extension of $T_n$ that converges to $T$ as the sample size increases. We briefly present the construction hereafter, and refer to del Barrio et al. [2020a] for further details.

The idea is to extend the discrete map $T_n: \{x_i^0\}_{i=1}^n \to \{x_i^1\}_{i=1}^n$ to a continuous one $\bar{T}_n: \mathbb{R}^d \to \mathbb{R}^d$ by regularizing a piece-wise constant approximation of $T_n$. The first step consists in solving (2) and permuting the observations so that for every $i \in \{1, \dots, n\}$, $T_n(x_i^0) = x_i^1$. Once the samples are aligned, we look for the parameters $\varepsilon_0$ and $\psi \in \mathbb{R}^n$ defined as the solutions to the linear program

$$ \max_{\psi \in \mathbb{R}^n, \varepsilon_0 \in \mathbb{R}} \text{s.t. } \langle x_i^0, x_i^1 - x_j^1 \rangle \ge \psi_i - \psi_j + 2\varepsilon_0, \quad i \ne j. \quad (3) $$

Recall that $\{(x_i^0, x_i^1)\}_{i=1}^n$ is cyclically monotone, and consequently is contained in the graph of the subdifferential of some convex function. Since this is a finite set, there exist several convex functions satisfying this property. For any of them denoted by $\bar{\varphi}_n$, its convex conjugate $\bar{\varphi}_n^* := \sup_{z \in \mathbb{R}^d} \{\langle z, \cdot \rangle - \bar{\varphi}_n(z)\}$ is such that

$$ \bar{\varphi}_n^*(x_i^1) - \bar{\varphi}_n^*(x_j^1) \le \langle x_i^0, x_i^1 - x_j^1 \rangle. $$

The idea behind (3) is to find the most regular candidate convex function $\bar{\varphi}_n$ by maximizing the strict convexity of $\bar{\varphi}_n^*$. Proposition 3.1 in del Barrio et al. [2020a] implies that (3) is feasible. In practice, we solve (3) by applying Karp's algorithm [Karp, 1978] on its dual formulation:

$$ \begin{array}{ll} \min_{z_{i,j}:i \ne j} & \displaystyle \sum_{i,j:i \ne j} z_{i,j} \langle x_i^0, x_i^1 \rangle \\ \text{s.t.} & \displaystyle \sum_{j:j \ne i} (z_{i,j} - z_{j,i}) = 0, \\ & \displaystyle \sum_{i,j:i \ne j} z_{i,j} = 1, z_{i,j} \ge 0, i,j = 1, \dots, n. \end{array} \quad (4) $$

Next, define the following convex function

$$ \tilde{\varphi}_n(x) := \max_{1 \le i \le n} \{\langle x, x_i^0 \rangle - \psi_i\}. \quad (5) $$

Note that $\nabla \tilde{\varphi}_n$, wherever it is well-defined, is a piece-wise constant interpolation of $T_n$. To obtain a regular interpolation defined everywhere and preserving the cyclical monotonicity we consider the Moreau-Yosida regularization of $\tilde{\varphi}_n$ given by

$$ \varphi_n(x) := \inf_{z \in \mathbb{R}^d} \{\tilde{\varphi}_n(z) + \frac{1}{2\varepsilon_0} \|z - x\|^2\}. $$

Such a regularization is differentiable everywhere. Then, the mapping from $\mathbb{R}^d$ to $\mathbb{R}^d$ defined as $\bar{T}_n := \nabla \varphi_n$ satisfies the following properties:

1. $\bar{T}_n$ is continuous,
2. $\overline{T}_n$ is cyclically monotone,

3. for all $i \in \{1, \dots, n\}$, $\overline{T}_n(x_i^0) = x_i^1 = T_n(x_i^0)$,

4. for all $x \in \mathbb{R}^d$, $\overline{T}_n(x)$ belongs to the convex hull of $\{x_1^1, \dots, x_n^1\}$.

A more explicit expression of $\overline{T}_n$ can be derived using the gradient formula of Moreau-Yosida regularizations. For $g: \mathbb{R}^d \to \mathbb{R} \cup \{+\infty\}$ a proper convex lower-semicontinuous function, the proximal operator of $g$ is defined on $\mathbb{R}^d$ by

$$ \operatorname{prox}_g(x) := \arg \min_{z \in \mathbb{R}^d} \{g(z) + \frac{1}{2} \|z - x\|^2\}. \quad (6) $$

Note that it is well-defined since the minimized function is strictly convex. Then, according to Theorem 2.26 in Rockafellar and Wets [2009] we have

$$ \overline{T}_n(x) = \frac{1}{\varepsilon_0} (x - \operatorname{prox}_{\varepsilon_0 \varphi_n}(x)). \quad (7) $$

The interpolation of each new input $x$ is numerically computed by solving the optimization problem $\operatorname{prox}_{\varepsilon_0 \varphi_n}(x)$. As a consequence, generalizing with $\overline{T}_n$ is not computationally free as we must compute proximal operators. Let's benchmark this approach against classical discrete OT.

Suppose for instance that after constructing $T_n$ on $\{x_i^0\}_{i=1}^m$ and $\{x_i^1\}_{i=1}^m$ we must generalize the OT map on a new sample $\{\bar{x}_i^0\}_{i=1}^m \sim \mu_0$ such that $m \le n$. Without additional observations from $\mu_1$, we are limited to: computing for each $\bar{x}_i^0$ its closest counterpart in $\{x_j^1\}_{j=1}^n$—which would deviate from optimal transport; computing the OT map between $\{\bar{x}_i^0\}_{i=1}^m$ and an $m$-subsample of $\{x_j^1\}_{j=1}^n$—which would be greedy. With an additional sample $\{\bar{x}_i^1\}_{i=1}^m$ from $\mu_1$, we could upgrade $T_n$ to a $T_{n+m}$ by recomputing the empirical OT map between the $(n+m)$-samples. However, this would cost $O((n+m)^3)$ in computer time, require new observations, and not be a natural extension of $T_n$. On the other hand, building the interpolation $\overline{T}_n$ with Karp's algorithm has a running-time complexity of $O(n^3)$: the same order as for $T_n$. Then, to generalize the transport to $\{\bar{x}_i^0\}_{i=1}^m$ with $\overline{T}_n$, we must solve $m$ optimization problems, one for each $\operatorname{prox}_{\varepsilon_0 \varphi_n}(\bar{x}_i^0)$. As this amount to minimizing a function which is Lipschitz with constant $\max_{1 \le i \le n} \|x_i^1\| + \varepsilon_0^{-1}$ and strongly convex with constant $\varepsilon_0^{-1}$, an $\epsilon$-optimal solution can be obtained in $O(\epsilon^{-1})$ steps with a subgradient descent [Bubeck, 2017]. Since evaluating $\partial \varphi_n$ at each step of the descent costs $n$ operations, computing the transport interpolation with precision $\epsilon$ of an $m$-sample has a computational complexity of order $O(mn\epsilon^{-1})$. Note also that this methods is hyper-parameter free, and as such is more convenient than prior regularized approaches. In addition, the obtained map is a statistically relevant estimator: we show hereafter that the theoretical interpolation (7) converges to the continuous OT map under mild assumptions.

## 2.3 Consistency of the estimator

We provide an extension of Proposition 3.3 in del Barrio et al. [2020a]. While the original result ensures the convergence of the interpolation $\overline{T}_n$ to $T$ in the case where $\mu_1$ is the spherical uniform law over the $d$-dimensional unit open ball, we prove that the consistency holds in more general settings.

**Theorem 1.** Let $\dot{\mathcal{X}}_0$ and $\dot{\mathcal{X}}_1$ be the respective interiors of $\mathcal{X}_0$ and $\mathcal{X}_1$, and $T$ the optimal transport map between $\mu_0$ and $\mu_1$. The following hold:

1. Assume that $\mathcal{X}_0$ is convex such that $\mu_0$ has positive density on its interior. Then, for $\mu_0$-almost every $x$,

$$ \overline{T}_n(x) \xrightarrow{n \to \infty} T(x). $$

2. Additionally assume that $T$ is continuous on $\dot{\mathcal{X}}_0$, and that $\mathcal{X}_1$ is compact. Then, for any compact set $C$ of $\mathbb{R}^d$,
$$ \sup_{x \in C} ||\overline{T}_n(x) - T(x)|| \xrightarrow{n \to \infty} 0. $$

In particular, provided that $\mathcal{X}_0$ is compact, the convergence is uniform on the support.

3. Further assume that $\mathcal{X}_1$ is a strictly convex set, then

$$ \sup_{x \in \mathbb{R}^d} ||\overline{T}_n(x) - T(x)|| \xrightarrow{n \to \infty} 0. $$

The proof falls naturally into three parts, each one dedicated to the different points of Theorem 1. The first point is a consequence of Theorem 2.8 in Del Barrio et al. [2019] and Theorem 25.7 in Rockafellar [1970], which entail that the convergence of $\{\varphi_n\}_{n \in \mathbb{N}}$ to $\varphi$ extends to their gradients. The proofs of the second and third points follow the guidelines of the one in del Barrio et al. [2020a]. The idea is to replace the unit ball by a compact set, and then a strictly convex set. We refer to the appendix for a complete description of this proof, as well as for all the other theoretical claims introduced in this paper.

**Remark 1.** We briefly discuss the assumptions of Theorem 1. Thanks to a recent work [González-Sanz et al., 2021], the convexity of $\mathcal{X}_0$ can be relaxed to having a connected support with negligible boundary.

Note that the second and third points of this theorem require a continuous optimal transport map $T$ to ensure the uniform convergence of the estimator. Caffarelli's theory [Caffarelli, 1990, 1991, 1992, Figalli, 2017] provides sufficient conditions for this to hold. Suppose that $\mathcal{X}_0$ and $\mathcal{X}_1$ are compact convex, and that $\mu_0$ and $\mu_1$ respectively admit $f_0$ and $f_1$ as density functions. If there exist $\Lambda \ge \lambda > 0$ such that for all $x \in \mathcal{X}_0$, $y \in \mathcal{X}_1$

$$ \lambda \le f_0(x), f_0^{-1}(x), f_1(y), f_1^{-1}(y) \le \Lambda, $$

then $T$ is continuous. For the non compact cases some results can be found in Figalli and Kim [2010], del Barrio et al. [2020b], Cordero-Erausquin and Figalli [2019].

# 3 Applications

In this section, we focus on the problem of repairing and auditing the bias of a trained binary classifier. Let $(\Omega, \mathcal{A}, \mathbb{P})$ be a probability space. The random vector $X : \Omega \to \mathbb{R}^d$ represents the observed features, while the random variable $S : \Omega \to \{0, 1\}$ encodes the observed sensitive or protected attribute which divides the population into a supposedly disadvantaged class $S = 0$ and a default class $S = 1$. The random variable $S$ is supposed to be non-degenerated. The two measures $\mu_0$ and $\mu_1$ are respectively defined as $\mathcal{L}(X|S = 0)$ and $\mathcal{L}(X|S = 1)$. The predictor is defined as $\hat{Y} := h(X, S)$, where $h : \mathbb{R}^d \times \{0, 1\} \to \{0, 1\}$ is deterministic. We consider a setting in which $\hat{Y} = 1$ and $\hat{Y} = 0$ respectively represent a favorable and a disadvantageous outcome.

## 3.1 Data processing for Fair learning using Optimal Transport

The standard way to deal with Fairness in Machine Learning is to measure it by introducing fairness measures. Among them, the disparate impact (DI) has received particular attention to determine whether a binary decision does not discriminate a minority corresponding to $S = 0$, see for instance in Zafar et al. [2017]. This corresponds to the notion of statistical parity introduced in Dwork et al. [2012]. For a classifier $h$ with values in $\{0, 1\}$, set $DI(h, X, S)$ as

$$ \frac{\min(\mathbb{P}(h(X, S) = 1 | S = 0), \mathbb{P}(h(X, S) = 1 | S = 1))}{\max(\mathbb{P}(h(X, S) = 1 | S = 1), \mathbb{P}(h(X, S) = 1 | S = 0))} $$

This criterion is close to 1 when statistical parity is ensured while the smaller the disparate, the more discrimination for the minority group. Obtaining fair predictors can be achieved by several means, one consisting in pre-processing the data by modifying the distribution of the inputs. Originally inspired by Feldman et al. [2015], this method proved in Gordaliza et al. [2019] consists in removing from the data the dependency with respect to the sensitive variable. This can be achieved by constructing two optimal transport maps, $T_0$ and $T_1$, satisfying $T_{0\#}\mu_0 = \mu_B$ and $T_{1\#}\mu_1 = \mu_B$, where $\mu_B$ is the Wasserstein barycenter of $\mu_0$ and $\mu_1$. The algorithm is then trained on the dataset of the modified observations following the distribution of the barycenter, which guarantees that $h(T_S(X), S)$ satisfies the statistical parity criterion.
Using the estimator we propose in this work enables to compute for any new observation $(x, s)$ a prediction $h(T_{n,s}(x), s)$ with theoretical guarantees. Note that the same framework applies when considering post-processing of outcome of estimators (or scores of classifiers) which are then pushed towards a fair representer. We refer for instance to Le Gouic et al. [2020] for the regression case or to Chiappa et al. [2020] for the classification case.

## 3.2 Consistency of Counterfactual Explanations

A sharper approach to fairness is to explain the discriminatory behaviour of the predictor. Black et al. [2020] started laying out the foundations of auditing binary decision-rules with transport-based mappings. Their Flip Test is an auditing technique for uncovering discrimination against protected groups in black-box classifiers. It is based on two types of objects: the Flip Sets, which list instances whose output changes had they belonged to the other group, and the Transparency Reports, which rank the features that are associated with a disparate treatment across groups. Crucially, building these objects requires assessing counterfactuals, statements on potential outcomes had a certain event occurred [Lewis, 1973]. The machine learning community mostly focused on two divergent frameworks for computing counterfactuals: the nearest counterfactual instances principle, which models transformations as minimal translations [Wachter et al., 2017], and Pearl's causal reasoning, which designs alternative states of things through surgeries on a causal model [Pearl et al., 2016]. While the former implicitly assumes that the covariates are independent, hence fails to provide faithful explanations, the latter requires a fully specified causal model, which is a very strong assumption in practice. To address these shortcomings, Black et al. [2020] proposed substituting causal reasoning by matching the two groups with a one-to-one mapping $T: \mathbb{R}^d \to \mathbb{R}^d$, for instance an optimal transport map. However, because the GAN approximation they use for the OT map does not come with convergence guarantees, their framework for explainability fails to be statistically consistent. We fix this issue next. More precisely, after presenting this framework, we show that natural estimators of an optimal transport map, such as the interpolation introduced in Section 2.2, lead to consistent explanations as the sample size increases.

### 3.2.1 Definitions

In contrast to Black et al. [2020], we present the framework from a non-empirical viewpoint. The following definitions depend on the choice of the binary classifier $h$ and the mapping $T$.

**Definition 1.** For a given binary classifier $h$, and a measurable function $T: \mathbb{R}^d \to \mathbb{R}^d$, we define

* the FlipSet as the set of individuals whose $T$-counterparts are treated unequally

$$F(h, T) = \{x \in \mathbb{R}^d | h(x, 0) \neq h(T(x), 1)\},$$

* the positive FlipSet as the set of individuals whose $T$-counterparts are disadvantaged

$$F^{+}(h, T) = \{x \in \mathbb{R}^d | h(x, 0) > h(T(x), 1)\},$$

* the negative FlipSet as the set of individuals whose $T$-counterparts are advantaged

$$F^{-}(h, T) = \{x \in \mathbb{R}^d | h(x, 0) < h(T(x), 1)\}.$$

When there is no ambiguity, we may omit the dependence on $T$ and $h$ in the notation.

The Flip Set characterizes a set of counterfactual explanations w.r.t. an intervention $T$. Such explanations are meant to reveal a possible bias towards $S$. The partition into a positive and a negative Flip Set sharpens the analysis by controlling whether $S$ is an advantageous attribute or not in the decision making process. As $S = 0$ represents the minority, one can think of the negative partition as the occurrences of negative discrimination, and the positive partition as the occurrences of positive discrimination. Black et al. [2020] noted that the relative sizes of the empirical positive and negative Flip Sets quantified the lack of statistical parity. Following their proof, we give a generalization of their result to the continuous case:

**Proposition 1.** Let $h$ be a binary classifier. If $T: \mathcal{X}_0 \to \mathcal{X}_1$ satisfies $T_{\#}\mu_0 = \mu_1$, then

$$\begin{align*}
& \mathbb{P}(h(X, S) = 1 | S = 0) - \mathbb{P}(h(X, S) = 1 | S = 1) \\
& = \\
& \mathbb{P}(X \in F^{+} | S = 0) - \mathbb{P}(X \in F^{-} | S = 0).
\end{align*}$$
However, the interest of such sets lies in their explanatory power rather than being proxies for determining fairness scores. By analyzing the mean behaviour of $I-T$ for points in a Flip Set, one can shed light on the features that mattered the most in the decision making process. A Transparency Report indicates which coordinates change the most, in intensity and in frequency, when applying $T$ to a Flip Set. In what follows, for any $x = (x_1, \dots, x_d)^T \in \mathbb{R}^d$ we define $\text{sign}(x) := (\text{sign}(x_1), \dots, \text{sign}(x_d))^T$ the sign function on vectors.

**Definition 2.** Let $\star$ be in $\{-, +\}$, $h$ be a binary classifier and $T: \mathcal{X}_0 \to \mathbb{R}^d$ be measurable map. Assume that $\mu_0$ and $T_\star\mu_0$ have finite first-order moments. The Transparency Report is defined by the mean difference vector

$$ \Delta_{\text{diff}}^{*}(h, T) = \mathbb{E}_{\mu_0}[X - T(X) | X \in F^{*}(h, T)] \\ = \frac{1}{\mu_0(F^{*}(h, T))} \int_{F^{*}(h, T)} (x - T(x)) d\mu_0(x), $$

and the mean sign vector

$$ \Delta_{\text{sign}}^{*}(h, T) = \mathbb{E}_{\mu_0}[\text{sign}(X - T(X)) | X \in F^{*}(h, T)] \\ = \frac{1}{\mu_0(F^{*}(h, T))} \int_{F^{*}(h, T)} \text{sign}(x - T(x)) d\mu_0(x). $$

The first vector indicates how much the points moved; the second shows whether the direction of the transportation was consistent. We upgrade the notion of Transparency Report by introducing new objects extending the Flip Test framework.

**Definition 3.** Let $\star$ be in $\{-, +\}$, and $T: \mathcal{X}_0 \to \mathbb{R}^d$ be measurable. Assume that $\mu_0$ and $T_\star\mu_0$ have finite first order moments. The difference Reference Vector is defined as

$$ \Delta_{\text{diff}}^{\text{ref}}(T) := \mathbb{E}_{\mu_0}[X - T(X)] = \int (x - T(x)) d\mu_0(x). $$

and the sign Reference Vector as

$$ \Delta_{\text{sign}}^{\text{ref}}(T) := \mathbb{E}_{\mu_0}[\text{sign}(X - T(X))] \\ = \int \text{sign}(x - T(x)) d\mu_0(x). $$

The auditing procedure can be summarized as follows: (1) compute the Flip Sets and evaluate the lack of statistical parity by comparing their respective sizes; (2) if the Flip Sets are unbalanced, compute the Transparency Report and the Reference Vectors; (3) identify possible sources of bias by looking at the largest components of $\Delta_{\text{diff}}^{*}(h, T) - \Delta_{\text{sign}}^{*}(h, T)$ and $\Delta_{\text{sign}}^{*}(h, T) - \Delta_{\text{diff}}^{*}(h, T)$. While the original approach would have directly analyzed the largest components of the Transparency Report, the aforementioned procedure scales the uncovered variations with a reference. This benchmark is essential. It contrasts the disparity between paired instances with different outcomes to the disparity between the protected groups; thereby, pointing out the actual treatment effect of the decision rule. We give an example to illustrate how the Reference Vectors act as a sanity check for settings where the Transparency Report fails to give explanations.

**Example 1.** Let $g$ be the standard gaussian measure on $\mathbb{R}^2$, and define $\mu_0 := (-2, -1)^T + g$ and $\mu_1 := (2, 1)^T + g$, so that $\delta := \mathbb{E}(\mu_0 - \mu_1) = -(4, 2)^T$. Set $T$ as the Brenier map between $\mu_0$ and $\mu_1$, and suppose that the decision rule is $h(x_1, x_2, s) := \mathbf{1}_{\{x_2>0\}}$. In this scenario, $T$ is the uniform translation $I - \delta$, and we have

$$ F^{-}(h, T) = \{(x_1, x_2)^T \in \mathbb{R}^2 | -2 < x_2 < 0\}, \\ F^{+}(h, T) = \emptyset. $$

Clearly, the predictor $h$ is unfair towards $\mu_0$, since the negative FlipSet outsizes the positive one. In this case, the vector $\Delta_{\text{diff}}^{-}(h, T)$ is simply equal to

$$ \Delta_{\text{diff}}^{-}(h, T) = \frac{1}{\mu_0(F^{-}(h, T))} \int_{F^{-}(h, T)} \delta d\mu_0(x) \\ = \delta = (-4, -2)^T. $$
A misleading analysis would state that, because $| - 4| > | - 2|$, the Transparency Report has uncovered a potential bias towards the first coordinate. This would be inaccurate, since the classifier only takes into account the second variable. This issue comes from the fact that in this homogeneous case, the Transparency Report only reflects how the two conditional distributions differ, and does not give any insight on the decision rule. Our benchmark approach detects such shortcomings by systematically comparing the Transparency Report to the Reference Vectors. In this setting we have $\Delta_{\text{diff}}^{\text{ref}}(T) = \delta$, thus $\Delta_{\text{diff}}^{\bar{}}(h, T) - \Delta_{\text{diff}}^{\text{ref}}(T) = 0$, which means that the FlipTest does not give insight on the decision making process.

To sum-up, we argue that it is the deviation of $\Delta_{\text{diff}}^{\bar{}}(h, T)$ from $\Delta_{\text{diff}}^{\text{ref}}(T)$, and not $\Delta_{\text{diff}}^{\bar{}}(h, T)$ alone, that brings to light the possible bias of the decision rule. Note that $T_{\star} \mu_0 = \mu_1$ entails $\Delta_{\text{diff}}^{\text{ref}}(T) = \mathbb{E}[X|S = 0] - \mathbb{E}[X|S = 1]$, which does not depend on $T$. Still, we define the Reference Vector with an arbitrary $T$ because in practice we operate with an estimator that only approximates the push-forward condition.

### 3.2.2 Convergence

The first step for implementing the Flip Test technique is computing an estimator $T_{n_0, n_1}$ of the chosen matching function $T$. In theory, the matching is not limited to an optimal transport map, but must define an intuitively justifiable notion of counterpart.

**Definition 4.** Let $T: \mathbb{R}^d \to \mathbb{R}^d$ satisfy $T_{\star} \mu_0 = \mu_1$, and $T_{n_0, n_1}$ be an estimator of $T$ built on a $n_0$-sample from $\mu_0$ and a $n_1$-sample from $\mu_1$. $T_{n_0, n_1}$ is said to be $T$-admissible if

1. $T_{n_0, n_1}: \mathcal{X} \to \mathcal{X}$ is continuous on $\mathcal{X}_0$,

2. $T_{n_0, n_1}(x) \xrightarrow{a.s.} T(x)$ for $\mu_0$-almost every $x$.

According to Theorem 1, the smooth interpolation $\bar{T}_n$ is an admissible estimator of the optimal transport map $T$ under mild assumptions.

The second step consists in building empirical versions of the Flip Sets and Transparency Reports for $h$ and $T_{n_0, n_1}$ using $m$ data points from $\mu_0$. The consistency problem at hand becomes two-fold: w.r.t. to $m$ the size of the sample, and w.r.t. to the convergence of the estimator $T_{n_0, n_1}$. Proving this consistency is crucial, as $T_{n_0, n_1}$ satisfies the push-forward condition at the limit only.

Consider a $m$-sample $\{x_i^0\}_{i=1}^m$ drawn from $\mu_0$. We define the empirical counterparts of respectively the negative Flip Set, the positive Flip Set, the mean difference vector, the mean sign vector, and the Reference Vectors for arbitrary $h$ and $T$. For any $\star \in \{-, +\}$, they are given by

$$F_m^*(h, T) := \{x_i^0\}_{i=1}^m \cap F^*(h, T),$$

$$\Delta_{\text{diff},m}^*(h, T) := \frac{\sum_{i=1}^m \mathbf{1}_{F^*(h, T)}(x_i^0)(x_i^0 - T(x_i^0))}{|F_m^*(h, T)|},$$

$$\Delta_{\text{sign},m}^*(h, T) := \frac{\sum_{i=1}^m \mathbf{1}_{F^*(h, T)}(x_i^0)\text{sign}(x_i^0 - T(x_i^0))}{|F_m^*(h, T)|},$$

$$\Delta_{\text{diff},m}^{\text{ref}}(T) := \frac{1}{m} \sum_{i=1}^{m} (x_i^0 - T(x_i^0)),$$

$$\Delta_{\text{sign},m}^{\text{ref}}(T) := \frac{1}{m} \sum_{i=1}^{m} \text{sign}(x_i^0 - T(x_i^0)).$$

Note that the first four equalities correspond to the original definitions from Black et al. [2020]. The strong law of large numbers implies the convergence almost surely of each of these estimators, as precised in the following proposition.

**Proposition 2.** Let $\star \in \{-, +\}$, $h$ be a binary classifier, and $T$ a measurable function. The following convergences hold
$$ \frac{|F_m^*(h, T)|}{m} \xrightarrow[m \to +\infty]{\mu_0-a.s.} \mu_0(F^*(h, T)), $$

$$ \Delta_{\mathrm{diff},m}^*(h, T) \xrightarrow[m \to +\infty]{\mu_0-a.s.} \Delta_{\mathrm{diff}}^*(h, T), $$

$$ \Delta_{\mathrm{sign},m}^*(h, T) \xrightarrow[m \to +\infty]{\mu_0-a.s.} \Delta_{\mathrm{sign}}^*(h, T), $$

$$ \Delta_{\mathrm{diff},m}^{\mathrm{ref}}(T) \xrightarrow[m \to +\infty]{\mu_0-a.s.} \Delta_{\mathrm{diff}}^{\mathrm{ref}}(T), $$

$$ \Delta_{\mathrm{sign},m}^{\mathrm{ref}}(T) \xrightarrow[m \to +\infty]{\mu_0-a.s.} \Delta_{\mathrm{sign}}^{\mathrm{ref}}(T). $$

In particular, these convergences hold for an admissible estimator $T_{n_0,n_1}$. To address the further convergence w.r.t. $n_0$ and $n_1$, we first introduce a new definition.

**Definition 5.** A binary classifier $\tilde{h} : \mathbb{R}^d \to \{0, 1\}$ is separating with respect to a measure $\nu$ on $\mathbb{R}^d$ if

$$ 1. H_0 := \tilde{h}^{-1}(\{0\}) \text{ and } H_1 := \tilde{h}^{-1}(\{1\}) \text{ are closed or open,} $$

$$ 2. \nu(\overline{H_0} \cap \overline{H_1}) = 0. $$

We argue that except in pathological cases that are not relevant in practice, machine learning always deals with such classifiers. For example, thresholded versions of continuous functions, which account for most of the machine learning classifiers (e.g. SVM, neural networks...), are separating with respect to Lebesgue continuous measures. As for a very theoretical example of non-separating classifier, one could propose the indicator of the rational numbers, which is not separating with respect to the Lebesgue measure. Working with classifiers $h$ such that $h(\cdot, 1)$ is separating w.r.t. $\mu_1$ fixes the regularity issues one might encounter when taking the limit in $h(T_{n_0,n_1}(\cdot), 1)$. More precisely, it ensures that the set of discontinuity points of $h$ is $\mu_1$-negligible. As $T_{\#}\mu_0 = \mu_1$ and since $T_{n_0,n_1} \to T$ $\mu_0$-almost everywhere, the following continuous mapping result holds:

**Proposition 3.** Let $\tilde{h} : \mathbb{R}^d \to \{0, 1\}$ be a separating classifier w.r.t. $\mu_1$, and $T_{n_0,n_1}$ a $T$-admissible estimator. Then, for $\mu_0$-almost every $x$

$$ \tilde{h}(T_{n_0,n_1}(x)) \xrightarrow[n_{0,n_1} \to +\infty]{a.s.} \tilde{h}(T(x)). $$

Next, we make a technical assumption for the convergence of the Transparency Report. Let $\{e_1, \dots, e_d\}$ be the canonical basis of $\mathbb{R}^d$, and define for every $k \in \{1, \dots, d\}$ the set $\Lambda_k(T) := \{x \in \mathbb{R}^d | \langle x - T(x), e_k \rangle = 0\}$.

**Assumption 1.** For every $k \in \{1, \dots, d\}$, $\mu_0(\Lambda_k(T)) = 0$.

Any Lebesgue continuous measure satisfies Assumption 1. This is crucial for the convergence of the mean sign vector, as it ensures that the points of discontinuity of $x \mapsto \mathrm{sign}(x - T(x))$ are negligible. We now turn to our main consistency result.

**Theorem 2.** Let $\star \in \{-, +\}$, $h$ be a binary classifier such that $h(\cdot, 1)$ is separating w.r.t. $\mu_1$, and $T_{n_0,n_1}$ a $T$-admissible estimator. The following convergences hold

$$ \mu_0(F^*(h, T_{n_0,n_1})) \xrightarrow[n_{0,n_1} \to +\infty]{a.s.} \mu_0(F^*(h, T)), $$

$$ \Delta_{\mathrm{diff}}^*(h, T_{n_0,n_1}) \xrightarrow[n_{0,n_1} \to +\infty]{a.s.} \Delta_{\mathrm{diff}}^*(h, T), $$

$$ \Delta_{\mathrm{diff}}^{\mathrm{ref}}(T_{n_0,n_1}) \xrightarrow[n_{0,n_1} \to +\infty]{a.s.} \Delta_{\mathrm{diff}}^{\mathrm{ref}}(T). $$

If Assumption 1 holds, then additionally

$$ \Delta_{\mathrm{sign}}^*(h, T_{n_0,n_1}) \xrightarrow[n_{0,n_1} \to +\infty]{a.s.} \Delta_{\mathrm{sign}}^*(h, T), $$

$$ \Delta_{\mathrm{sign}}^{\mathrm{ref}}(T_{n_0,n_1}) \xrightarrow[n_{0,n_1} \to +\infty]{a.s.} \Delta_{\mathrm{sign}}^{\mathrm{ref}}(T). $$
As $h$ is binary, the probability of the negative Flip Set can be written as $\mu_0(F^{-}(h, T_{n_0,n_1})) = \int [1-h(x, 0)]h(T_{n_0,n_1}(x), 1)d\mu_0(x)$. Note that the integrated function $[1-h(\cdot, 0)]h(T_{n_0,n_1}(\cdot), 1)$ is dominated by the constant 1. Then, it follows from Proposition 3 that this sequence of functions converges $\mu_0$-almost everywhere to $[1-h(\cdot, 0)]h(T(\cdot), 1)$ when $n_0, n_1 \to +\infty$. By the dominated convergence theorem, we conclude that $\mu_0(F^{-}(h, T_{n_0,n_1})) \xrightarrow{n_0, n_1 \to +\infty} \mu_0(F^{-}(h, T))$. The same argument holds for the positive Flip Sets. The proofs of the other convergences follow the same reasoning, using Proposition 3 and Assumption 1 to apply the dominated convergence theorem.

As aforementioned, the assumptions of Theorem 2 are not significantly restrictive in practice. Thus, the Flip Test framework is tailored for implementations.

# 4 Conclusion

We addressed the problem of constructing a statistically approximation of the continuous optimal transport map. We argued that this has strong consequences for machine learning applications based on OT, as it renders possible to generalize discrete optimal transport on new observations while preserving its key properties. We illustrated that using the proposed extension ensures the statistical consistency of OT-based frameworks, and as such derived the first consistency analysis for observation-based counterfactual explanations.

# References

* Emily Black, Samuel Yeom, and Matt Fredrikson. Fliptest: Fairness testing via optimal transport. In *Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency*, FAT* '20, page 111–121, New York, NY, USA, 2020. Association for Computing Machinery. ISBN 9781450369367. doi: 10.1145/3351095.3372845. URL https://doi.org/10.1145/3351095.3372845.

* Sébastien Bubeck. Convex optimization: Algorithms and complexity. *Foundations and Trends in Machine Learning*, 8, 2017.

* Luis A Caffarelli. A localization property of viscosity solutions to the monge-ampere equation and their strict convexity. *Annals of mathematics*, 131(1):129–134, 1990.

* Luis A Caffarelli. Some regularity properties of solutions of monge ampere equation. *Communications on pure and applied mathematics*, 44(8-9):965–969, 1991.

* Luis A Caffarelli. The regularity of mappings with a convex potential. *Journal of the American Mathematical Society*, 5(1):99–104, 1992.

* Silvia Chiappa and Aldo Pacchiano. Fairness with continuous optimal transport, 2021.

* Silvia Chiappa, Ray Jiang, Tom Stepleton, Aldo Pacchiano, Heinrich Jiang, and John Aslanides. A general approach to fairness with optimal transport. In *AAAI*, pages 3633–3640, 2020.

* Dario Cordero-Erausquin and Alessio Figalli. Regularity of monotone transport maps between unbounded domains, 2019.

* N. Courty, R. Flamary, D. Tuia, and A. Rakotomamonjy. Optimal transport for domain adaptation. *IEEE Transactions on Pattern Analysis and Machine Intelligence*, 39(9):1853–1865, 2017. doi: 10.1109/TPAMI.2016.2615921.

* Eustasio Del Barrio, Jean-Michel Loubes, et al. Central limit theorems for empirical transportation cost in general dimension. *The Annals of Probability*, 47(2):926–951, 2019.

* Eustasio del Barrio, Juan A. Cuesta-Albertos, Marc Hallin, and Carlos Matrán. Center-outward distribution functions, quantiles, ranks, and signs in $\mathbb{R}^d$, 2020a.

* Eustasio del Barrio, Alberto González-Sanz, and Marc Hallin. A note on the regularity of optimal-transport-based center-outward distribution and quantile functions. *Journal of Multivariate Analysis*, 180:104671, 2020b.
Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness through awareness. In *Proceedings of the 3rd innovations in theoretical computer science conference*, pages 214–226, 2012.

S. A Feldman, M. and Friedler, J. Moeller, C. Scheidegger, and S. Venkatasubramanian. Certifying and removing disparate impact. In *Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining*, pages 259–268. ACM, 2015.

Alessio Figalli. *The Monge-Ampère equation and its applications*. 2017.

Alessio Figalli and Young-Heon Kim. Partial regularity of brenier solutions of the monge-ampere equation. *Discrete Contin. Dyn. Syst*, 28(2):559–565, 2010.

Nathalie TH Gayraud, Alain Rakotomamonjy, and Maureen Clerc. Optimal transport applied to transfer learning for p300 detection. In *BCI 2017-7th Graz Brain-Computer Interface Conference*, page 6, 2017.

Alberto González-Sanz, Eustasio del Barrio, and Jean-Michel Loubes. Central limit theorems for general transportation costs, 2021.

Paula Gordaliza, Eustasio Del Barrio, Gamboa Fabrice, and Jean-Michel Loubes. Obtaining fairness using optimal transport theory. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, *Proceedings of the 36th International Conference on Machine Learning*, volume 97 of *Proceedings of Machine Learning Research*, pages 2357–2365, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/gordaliza19a.html.

Ray Jiang, Aldo Pacchiano, Tom Stepleton, Heinrich Jiang, and Silvia Chiappa. Wasserstein fair classification. In *Uncertainty in Artificial Intelligence*, pages 862–872. PMLR, 2020.

Richard M Karp. A characterization of the minimum cycle mean in a digraph. *Discrete mathematics*, 23(3): 309–311, 1978.

Soheil Kolouri, Se Rim Park, Matthew Thorpe, Dejan Slepcev, and Gustavo K Rohde. Optimal mass transport: Signal processing and machine-learning applications. *IEEE signal processing magazine*, 34(4):43–59, 2017.

T Le Gouic, J Loubes, and P Rigollet. Projection to fairness in statistical learning. *arXiv preprint arXiv:2005.11720*, 2020.

David Lewis. Causation. *Journal of Philosophy*, 70(17):556–567, 1973.

Judea Pearl, Madelyn Glymour, and Nicholas P Jewell. *Causal inference in statistics: A primer*. John Wiley & Sons, 2016.

Gabriel Peyré, Marco Cuturi, et al. Computational optimal transport: With applications to data science. *Foundations and Trends® in Machine Learning*, 11(5-6):355–607, 2019.

R Tyrrell Rockafellar. *Convex analysis*. Number 28. Princeton university press, 1970.

R Tyrrell Rockafellar and Roger J-B Wets. *Variational analysis*, volume 317. Springer Science & Business Media, 2009.

Cédric Villani. *Topics in optimal transportation*. Number 58. American Mathematical Soc., 2003.

Cédric Villani. *Optimal Transport: Old and New*. Number 338 in Grundlehren der mathematischen Wissenschaften. Springer, Berlin, 2008. ISBN 978-3-540-71049-3. OCLC: ocn244421231.

Sandra Wachter, Brent Mittelstadt, and Chris Russell. Counterfactual explanations without opening the black box: Automated decisions and the gdpr. *Harv. JL & Tech.*, 31:841, 2017.

M B Zafar, I Valera, M Gomez Rodriguez, and K P Gummadi. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. In *Proceedings of the 26th International Conference on World Wide Web*, pages 1171–1180. International World Wide Web Conferences Steering Committee, 2017.
# A Proofs of Section 2

## A.1 Intermediary result

We first introduce a proposition adapted from del Barrio et al. [2020a] to suit our setting. In what follows, we denote by $N_C(x) := \{y \in \mathbb{R}^d | \forall x' \in C, \langle y, x' - x \rangle \le 0\}$ the normal cone at $x$ of the convex set $C$.

**Proposition 4.** Suppose that $\mathcal{X}_1$ is a compact convex set. Let $x_n = \lambda_n u_n \in \mathbb{R}^d$ where $0 < \lambda_n \to +\infty$ and $u_n \in \partial \mathcal{X}_1 \to u$ as $n \to +\infty$. Note that by compactness of the boundary, necessarily $u \in \partial \mathcal{X}_1$. If $(T(x_n))_{n \in \mathbb{N}}$ has a limit $v$ (taking a subsequence if necessary), then $v \in \partial \mathcal{X}_1$, and $u \in N_{\mathcal{X}_1}(v) \ne \{0\}$.

*Proof.* Taking subsequences if necessary, we can assume that $T(x_n) \to v$ for some $v \in \mathcal{X}_1$. The monotonicity of $T$ implies that for any $x \in \mathbb{R}^d$, $\langle x_n - x, T(x_n) - T(x) \rangle \ge 0$. In particular, for any $w \in T(\mathbb{R}^d)$, $\langle x_n - T^{-1}(w), T(x_n) - w \rangle \ge 0$. This can be written as $\langle u_n - \frac{1}{\lambda_n} T^{-1}(w), T(x_n) - w \rangle \ge 0$. Taking the limit leads to $\langle u, v - w \rangle \ge 0$. Define $H := \{w \in \mathbb{R}^d | \langle u, w - v \rangle \le 0\}$ which is a closed half-space. As $T$ pushes $\mu_0$ towards $\mu_1$, $T(\mathbb{R}^d)$ contains a dense subset of $\mathcal{X}_1$. Since $H$ is closed, this implies that $\mathcal{X}_1 \subset H$ and $v \in \mathcal{X}_1 \cap H$. Consequently, $H$ is a supporting hyperplane of $\mathcal{X}_1$ and $v \in \partial \mathcal{X}_1$. Now, write the inclusion $\mathcal{X}_1 \subset H$ as $\forall w \in \mathcal{X}_1$, $\langle u, w - v \rangle \le 0$. Denote by $N_{\mathcal{X}_1}(x)$ the normal cone of $\mathcal{X}_1$ at an arbitrary point $x \in \mathbb{R}^d$. Conclude by noting that the above inequality reads $u \in N_{\mathcal{X}_1}(v)$. The cone does not narrow down to $\{0\}$ as $v$ does not belong to $\mathcal{X}_1$. □

## A.2 Proof of Theorem 1

We now turn to the proof of the main theorem.

*Proof.* Recall that $\mu_0$ and $\mu_1$ are probability measures on $\mathbb{R}^d$ with respective supports $\mathcal{X}_0$ and $\mathcal{X}_1$. We denote their interiors by $\mathcal{X}_0$ and $\mathcal{X}_1$, and their boundaries by $\partial \mathcal{X}_0$ and $\partial \mathcal{X}_1$. We assume the measures to be absolutely continuous with respect to the Lebesgue measure. Recall that there exists an unique map $T$ such that $T_\mu \mu_0 = \mu_1$ and $T = \nabla \varphi \mu_0$-almost everywhere for some convex function $\varphi$ called a *potential*. We denote by $\text{dom}(\nabla \varphi)$ the set of differentiable points of $\varphi$ which satisfies $\mu_0(\text{dom}(\nabla \varphi)) = 1$, according to Theorem 25.5 in Rockafellar [1970].

Conversely, there also exists a convex function $\psi$ such $S$, the Brenier's map from $\mu_1$ to $\mu_0$, can be written as $S := \nabla \psi \mu_1$-almost everywhere. In addition, $S$ can be related to $T$ through the potential functions. Concretely, $\psi$ coincides with the convex conjugate $\varphi^*(y) = \sup_{x \in \mathbb{R}^d} \{\langle x, y \rangle - \varphi(x)\}$ of $\varphi$. We can then fix this function for $u \in \mathbb{R}^d \setminus \mathcal{X}_1$ using the lower semi-continuous extension on the support. This defines a specific $\varphi$ (hence a specific solution $T$) as

$$ \varphi(x) := \sup_{u \in \mathbb{R}^d} \{\langle x, u \rangle - \varphi^*(u)\} = \sup_{u \in \mathcal{X}_1} \{\langle x, u \rangle - \varphi^*(u)\}. \quad (8) $$

Let $\{x_i^0\}_{i=1}^n$ and $\{x_i^1\}_{i=1}^n$ be $n$-samples drawn from respectively $\mu_0$ and $\mu_1$, defining empirical measures $\mu_0^n$ and $\mu_1^n$. Without loss of generality, assume that the samples are ordered such that $T_n: x_i^0 \mapsto x_i^1$ is the unique solution to the corresponding discrete Monge problem. Consider the interpolation $\overline{T}_n$. We pay attention to the properties it satisfies:

1. $\overline{T}_n = \nabla \varphi_n$ where $\varphi_n$ is continuously differentiable,

2. $\overline{T}_n$ is cyclically monotone,

3. for all $i \in \{1, \dots, n\}$, $\overline{T}_n(x_i^0) = x_i^1 = T_n(x_i^0)$,

4. for all $x \in \mathbb{R}^d$, $\overline{T}_n(x) \in \text{conv}(\{x_1^1, \dots, x_n^1\})$.

Following the decomposition of Theorem 1 the proof will be divided into three steps.
**Step 1: Point-wise convergence.** Assume that the support $\mathcal{X}_0$ is a convex set. Recall that $\overline{T}_n = \nabla\varphi_n$ everywhere and $T = \nabla\varphi$ $\mu_0$-almost everywhere. We prove the point-wise convergence of $\{\overline{T}_n\}_{n\in\mathbb{N}}$ to $T$ in two steps: first, we show the point-wise convergence of $\{\varphi_n\}_{n\in\mathbb{N}}$ to $\varphi$; second, we do the same for $\{\nabla\varphi_n\}_{n\in\mathbb{N}}$ to $\nabla\varphi$.

Theorem 5.19 in Villani [2008] implies that

$$ \gamma^n = (I \times T_n)_\sharp \mu_0^n \xrightarrow[n \to +\infty]{w} \gamma = (I \times T)_\sharp \mu_0, $$

where $w$ denotes the weak convergence of probability measures. It follows from Theorem 2.8 in Del Barrio et al. [2019] that for all $x \in \dot{\mathcal{X}}_0$ the limit $\lim_{n \to +\infty} \varphi_n(x) = \varphi(x)$ holds after centering.

Theorem 25.5 in Rockafellar [1970] states that for all $x \in \text{dom}(\nabla\varphi)$ there exist an open convex subset $C$ such that $x \in C \subset \text{dom}(\nabla\varphi)$. Take an arbitrary $x \in \dot{\mathcal{X}}_0 \cap \text{dom}(\nabla\varphi)$ and consider such a subset $C$ containing $x$. Since $\varphi$ is finite and differentiable in $C$, we can apply Theorem 25.7 in Rockafellar [1970] to conclude that $\nabla\varphi(x) = \lim_{n \to +\infty} \nabla\varphi_n(x)$. To sum-up, the desired equality holds in $\dot{\mathcal{X}}_0 \cap \text{dom}(\nabla\varphi)$, in consequence $\mu_0$-almost surely (recall that the border of a convex set is Lebesgue negligible).

**Step 2: Uniform convergence on the compact sets.** Further assume that $\nabla\varphi$ is continuous on $\dot{\mathcal{X}}_0$, and that the support $\mathcal{X}_1$ is a compact set. Set $K_1 = \sup_{x \in \mathcal{X}_1} ||x||$. This implies that for any $x \in \mathbb{R}^d$, $||\overline{T}_n(x)|| \le \max_{1 \le i \le n} ||x_i^1|| \le K_1$. Then $||\nabla\varphi_n(x)|| \le K_1$ for all $n \in \mathbb{N}$ and $x \in \mathbb{R}^d$. In consequence the sequence $\{\varphi_n\}_{n\in\mathbb{N}}$ is equicountinous with the topology of convergence on the compact sets. Arzela-Ascoli's theorem applied on the compact sets of $\mathbb{R}^d$ implies that the sequence is relatively compact in the topology induced by the uniform norm on the compact sets. Let $\rho$ be any cumulative point of $\{\varphi_n\}_{n\in\mathbb{N}}$. Then, there exists a sub-sequence of $\{\varphi_n\}_{n\in\mathbb{N}}$ converging to $\rho$. Abusing notation, we keep denoting the sub-sequence by $\{\varphi_n\}_{n\in\mathbb{N}}$. The previous step implies that $\varphi = \rho$ and $\nabla\varphi = \nabla\rho$ on $\mathcal{X}_0$. Next, we show that this equality holds on $\mathbb{R}^d \setminus \mathcal{X}_0$.

The continuity of the transport map implies that $\dot{\mathcal{X}}_0 \subset \text{dom}(\nabla\varphi)$. Hence, by convexity, for every $z \in \mathbb{R}^d$ and $u = \nabla\varphi(x) = \nabla\rho(x) \in \nabla\varphi(\dot{\mathcal{X}}_0)$,

$$ \rho(z) \ge \rho(x) + \langle u, z - x \rangle = \langle u, x \rangle - \varphi^*(u), \quad (9) $$

where the equality comes from the equality case of the Fenchel-Young theorem. As $\mu_0(\dot{\mathcal{X}}_0) = 1$, the push-forward condition $\nabla\varphi_\sharp\mu_0 = \mu_1$ implies that $\mu_1(\nabla\varphi(\dot{\mathcal{X}}_0)) = 1$ and consequently $\nabla\varphi(\dot{\mathcal{X}}_0)$ is dense in $\mathcal{X}_1$. It follows that

$$ \rho(z) \ge \sup_{u \in \nabla\varphi(\dot{\mathcal{X}}_0)} \{\langle u, z \rangle - \varphi^*(u)\} = \sup_{u \in \mathcal{X}_1} \{\langle x, u \rangle - \varphi^*(u)\} = \varphi(z) \quad \text{for every } z \in \mathbb{R}^d. \quad (10) $$

To get the upper bound, set $z \in \mathbb{R}^d$ and $u_n = \nabla\varphi_n(z) = \overline{T}_n(z)$. Since $\overline{T}_n(z) \in \text{conv}(\{x_1^1, \dots, x_n^1\})$, then $u_n \in \mathcal{X}_1$. Fenchel-Young equality once again implies that $\langle x, u_n \rangle = \varphi_n(x) + \varphi_n^*(u_n)$. This gives that

$$ \varphi_n(x) \le \sup_{u \in \dot{\mathcal{X}}_1} \{\langle u, x \rangle - \varphi_n^*(u)\} = \tilde{\varphi}_n(x), $$

where $\tilde{\varphi}_n$ is the Legendre transform of

$$ \tilde{\varphi}_n^* : u \mapsto \begin{cases} \varphi_n^*(u) & \text{if } u \in \dot{\mathcal{X}}_1, \\ +\infty & \text{otherwise.} \end{cases} $$

Since $\nabla\varphi^*$ is the Brenier map from $\mu_1$ to $\mu_0$, then Theorem 2.8 in Del Barrio et al. [2019] implies that $\lim_{n \to +\infty} \varphi_n^*(u) = \varphi^*(u) = \lim_{n \to +\infty} \tilde{\varphi}_n^*(u)$ for every $u \in \dot{\mathcal{X}}_1$. Outside $\dot{\mathcal{X}}_1$ we have $\tilde{\varphi}_n^*(u) = +\infty = \varphi^*(u)$ by definition. Hence, the sequence $\{\tilde{\varphi}_n^*\}_{n\in\mathbb{N}}$ converges point-wise to $\varphi^*$ over $\mathbb{R}^d$. According to Theorem 7.17 in together with Theorem 11.34 in Rockafellar and Wets [2009] the same convergence holds for their conjugates. This means that for any $x \in \mathbb{R}^d$ we have $\lim_{n \to +\infty} \tilde{\varphi}_n(x) = \varphi(x)$. This leads to $\rho(x) \le \varphi(x)$ for every $x \in \mathbb{R}^d$, hence $\rho = \varphi$. We conclude, using Theorem 25.7 in Rockafellar [1970], that $\overline{T}_n = \nabla\varphi_n$ converges uniformly to $T = \nabla\varphi$ over compact sets of $\mathbb{R}^d$, in particular over $\mathcal{X}_0$ if it is compact.
**Step 3: Uniform convergence on $\mathbb{R}^d$.** Further assume that the support $\mathcal{X}_1$ is a strictly convex set. To prove the result it suffices to show that, for every $w \in \mathbb{R}^d$,

$$ \sup_{x \in \mathbb{R}^d} |\langle \bar{T}_n(x) - T(x), w \rangle| \xrightarrow{n \to +\infty} 0. $$

Let's assume that on the contrary, there exist $\varepsilon > 0$, $w \neq 0$, and $\{x_n\}_{n \in \mathbb{N}} \subset \mathbb{R}^d$ such that

$$ |\langle \bar{T}_n(x_n) - T(x_n), w \rangle| > \varepsilon \quad (11) $$

for all $n$. Necessarily, the sequence $\{x_n\}_{n \in \mathbb{N}}$ is unbounded. If not, we could extract a convergent subsequence so that, by using the point-wise convergence and the continuity of the transport functions, the left-term of (11) would tend to zero. Taking subsequences if necessary, we can assume that $x_n = \lambda_n u_n$ where $\lim_{n \to +\infty} u_n = u$ where $u_n, u \in \partial \mathcal{X}_1$ and $0 < \lambda_n \to +\infty$. By compactness of $\mathcal{X}_1$ and Proposition 4, $\bar{T}_n(x_n) \to z \in \mathcal{X}_1$ and $T(x_n) \to y \in \partial \mathcal{X}_1$. Let $\tau > 0$ so that by monotonicity

$$ \langle \bar{T}_n(x_n) - \bar{T}_n(\tau u_n), (\lambda_n - \tau)u_n \rangle \geq 0. $$

For $n$ large enough so that $\lambda_n > \tau$ we have

$$ \langle \bar{T}_n(x_n) - T(\tau u_n), u_n \rangle + \langle T(\tau u_n) - \bar{T}_n(\tau u_n), u_n \rangle \geq 0. $$

The second term tends to zero, leading to

$$ \langle z - T(\tau u), u \rangle \geq 0. $$

As this holds for any $\tau > 0$, we can take $\tau_n = \lambda_n \to +\infty$ to get

$$ \langle z - y, u \rangle \geq 0. \quad (12) $$

According to Proposition 4, $u \in N_{\mathcal{X}_1}(y)$ with $u \neq 0$. In particular, as $z \in \mathcal{X}_1$, we have that $\langle u, z - y \rangle \leq 0$, which implies that $\langle u, z - y \rangle = 0$. This means that $u \perp z - y$ and $u \in N_{\mathcal{X}_1}(y)$. Hence, $z - y$ belongs to the tangent plane of $\partial \mathcal{X}_1$ at $y$ while $z \in \mathcal{X}_1$. Besides, $\mathcal{X}_1$ is strictly convex, implying that $z = y$. This contradicts at the limit with (11). $\square$

## B Proof of Section 3

Proof of Proposition 1.

*Proof.* Note that

$$ F^{-}(h, T) = \{h(x, 0) = 0 \text{ and } h(T(x), 1) = 1\} = \{h(T(x), 1) = 1\} - \{h(x, 0) = 1 \text{ and } h(T(x), 1) = 1\}. $$

Similarly

$$ F^{+}(h, T) = \{h(x, 0) = 1 \text{ and } h(T(x), 1) = 0\} = \{h(x, 0) = 1\} - \{h(x, 0) = 1 \text{ and } h(T(x), 1) = 1\}. $$

Taking the measures we get

$$ \mu_0(F^{-}) - \mu_0(F^{+}) = \mu_0(\{x \in \mathbb{R}^d | h(T(x), 1) = 1\}) - \mu_0(\{x \in \mathbb{R}^d | h(x, 0) = 1\}). $$

Using the fact that $T_\#\mu_0 = \mu_1$ we have
$$ \mu_0(\{x \in \mathbb{R}^d | h(T(x), 1) = 1\}) = \mu_1(\{x \in \mathbb{R}^d | h(x, 1) = 1\}). $$

This leads to

$$ \mu_0(F^-) - \mu_0(F^+) = \mu_1(\{x \in \mathbb{R}^d | h(x, 1) = 1\}) - \mu_0(\{x \in \mathbb{R}^d | h(x, 0) = 1\}). $$

Which concludes the proof.

<figure><img src="image_2.png" /></figure>

### Proof of Proposition 2.

*Proof.* Let $\star \in \{-, +\}$. The empirical probability of the Flip Set is

$$ \frac{|F_m^*(h, T)|}{m} = \frac{1}{m} \sum_{i=1}^{m} \mathbf{1}_{F^*(h, T)}(x_i^0). $$

By the strong law of large numbers,

$$ \frac{1}{m} \sum_{i=1}^{m} \mathbf{1}_{F^*(h,T)}(x_i^0) \xrightarrow{\mu_0-a.s.} \mathbb{E}_{\mu_0} [\mathbf{1}_{F^*(h,T)}(X)] = \mu_0(F^*(h,T)). $$

This concludes the first part of the proof. We now turn to the Transparency Report, and show the convergence of the mean difference vector, as the proof is equivalent for the mean sign vector. The empirical estimator can be written as

$$ \Delta_{\text{diff},m}^{*}(h,T) = \frac{m}{|F_m^*(h,T)|} \times m^{-1} \sum_{i=1}^{m} \mathbf{1}_{F^*(h,T)}(x_i^0)(x_i^0 - T(x_i^0)). $$

Then, by the strong law of large numbers we have

$$ \frac{m}{|F_m^*(h,T)|} \times m^{-1} \sum_{i=1}^{m} \mathbf{1}_{F^*(h,T)}(x_i^0)(x_i^0 - T(x_i^0)) \xrightarrow{\mu_0-a.s.} \frac{1}{\mu_0(F^*(h,T))} \int_{F^*(h,T)} (x-T(x))d\mu_0(x), $$

where by definition

$$ \frac{1}{\mu_0(F^*(h,T))} \int_{F^*(h,T)} (x-T(x))d\mu_0(x) = \Delta_{\text{diff}}^*(h,T). $$

The proof for the Reference Vectors is identical, even simpler as $h$ is not involved.

<figure><img src="image_3.png" /></figure>

### Proof of Proposition 3.

*Proof.* Throughout this proof, we work with a given realization $T_{n_0,n_1} := T_{n_0,n_1}^{(\omega)}$ of the random estimator for an unimportant arbitrary $\omega \in \Omega$. Without loss of generality, consider that $H_0$ is open and $H_1$ is closed. Recall that by T-admissibility, the sequence $T_{n_0,n_1}(x)$ converges for $\mu_0$-almost every $x$. We aim at showing that for $\mu_0$-almost every $x$

$$ \tilde{h}(T_{n_0,n_1}(x)) \xrightarrow{n_0,n_1 \to +\infty} \tilde{h}(T(x)). $$

For any $x \in \mathcal{X}_0$ there are only two different cases.
**Case 1:** For any $n_0$ and $n_1$ large enough, $T_{n_0,n_1}(x) \in H_1$. Then at the limit, $T(x) \in H_1$, meaning that the expected convergence holds for this $x$.

**Case 2:** For any $n_0$ and $n_1$ large enough, $T_{n_0,n_1}(x) \in H_0$. Then at the limit, either $T(x) \in H_0$ or $T(x) \in H_1$. If $T(x) \in H_0$, the expected convergence holds for this $x$. If $T(x) \in H_1$, necessarily $T(x) \in \overline{H_0} \cap H_1$. As $\mu_1(\overline{H_0} \cap H_1) = 0$ and $\mu_1 = \mu_0 \circ T^{-1}$, this only occurs for $x$ in a $\mu_0$-negligible set.

Any other cases would contradict with the convergence of $T_{n_0,n_1}(x)$. Consequently, the expected convergence holds $\mu_0$-almost everywhere.

□

**Proof of Theorem 2.**

*Proof.* In this proof as well we work with a given realization $T_{n_0,n_1} := T_{n_0,n_1}^{(\omega)}$ of the random estimator for an unimportant arbitrary $\omega \in \Omega$. Let's show the result for $\star = -$ as the proof is equivalent for $\star = +$. Because $h$ is binary, the probability of the Flip Set can be written as

$$ \mu_0(F^{-}(h, T_{n_0,n_1})) = \mathbb{E}_{\mu_0}[\mathbf{1}_{\{F^{-}(h, T_{n_0,n_1})\}}] = \int [1 - h(x, 0)]h(T_{n_0,n_1}(x), 1)d\mu_0(x). $$

Note that the integrated function $[1 - h(\cdot, 0)]h(T_{n_0,n_1}(\cdot), 1)$ is dominated by the constant 1. Then, it follows from Proposition 3 that this sequence of functions converges $\mu_0$-almost everywhere to $[1 - h(\cdot, 0)]h(T(\cdot), 1)$ when $n_0, n_1 \to +\infty$. By the dominated convergence theorem, we conclude that

$$ \mu_0(F^{-}(h, T_{n_0,n_1})) \xrightarrow[n_{0},n_{1} \to +\infty]{} \mu_0(F^{-}(h, T)). $$

We now turn to the mean difference vector,

$$ \Delta_{\text{diff}}^{-}(h, T_{n_0, n_1}) = \frac{1}{\mu_0(F^{-}(h, T_{n_0, n_1}))} \int_{F^{-}(h, T_{n_0, n_1})} (x - T_{n_0, n_1}(x)) d\mu_0(x). $$

We already proved that the left fraction converges to $\mu_0(F^{-}(h, T))^{-1}$. To deal with the integral, we exploit once again the fact that $h$ is binary to write

$$ \int_{F^{-}(h, T_{n_0, n_1})} (x - T_{n_0, n_1}(x)) d\mu_0(x) = \int [1 - h(x, 0)] h(T_{n_0, n_1}(x), 1) (x - T_{n_0, n_1}(x)) d\mu_0(x). $$

Note that the sequence of functions $x \mapsto x - T_{n_0,n_1}(x)$ converges $\mu_0$-almost everywhere to $x \mapsto x - T(x)$. This is where 3 comes into play to ensure the convergence $\mu_0$-everywhere of the integrated function. This enables to apply the dominated convergence theorem to conclude that

$$ \Delta_{\text{diff}}^{-}(h, T_{n_0, n_1}) \xrightarrow[n_{0},n_{1} \to +\infty]{} \Delta_{\text{diff}}^{-}(h, T). $$

We finally address the case of the mean sign vector:

$$ \Delta_{\text{sign}}^{-}(h, T_{n_0, n_1}) = \int [1 - h(x, 0)] h(T_{n_0, n_1}(x), 1) \text{sign}(x - T_{n_0, n_1}(x)) d\mu_0(x). $$

The approach is the same as for the mean difference vector. The only crucial distinction to handle is the convergence of the sequence $x \mapsto \text{sign}(x - T_{n_0,n_1}(x))$ to $x \mapsto \text{sign}(x - T(x))$, which is not trivial as the sign function is discontinuous wherever a coordinate of its argument equals zero. We follow a similar reasoning as for the proof of Proposition 3 to show the convergence $\mu_0$-almost everywhere. The only pathological case happens when $x - T(x)$ ends up on a canonical axis, that is to say when $x \in \Lambda_k(T)$. If Assumption 1 holds, this occurs only for $x$ in a $\mu_0$-negligible set. Consequently, for $\mu_0$-almost every $x$
$$ \mathrm{sign}(x - T_{n_0, n_1}(x)) \xrightarrow[n_{n_0, n_1} \to +\infty]{} \mathrm{sign}(x - T(x)). $$

To conclude, we apply Proposition 3 along with the dominated convergence theorem to obtain

$$ \Delta_{\mathrm{sign}}^{-}(h, T_{n_0, n_1}) \xrightarrow[n_{n_0, n_1} \to +\infty]{} \Delta_{\mathrm{sign}}^{-}(h, T). $$

The proof for the Reference Vectors is identical, even simpler as $h$ is not involved. $\square$

<figure><img src="image_4.png" /></figure>