Let $X,Y$ be Polish spaces and $\mathcal P(X)$ the space of all Borel probability measures on $X$.
- Fix $\mu\in \mathcal P(X), \nu \in \mathcal P(Y)$. Let $\gamma \in \Pi(\mu, \nu)$, i.e., $\gamma \in \mathcal P(X \times Y)$ whose marginal on $X$ is $\mu$ and that on $Y$ is $\nu$.
- Let $c:X \times Y \to \mathbb R$ and $\varphi:X \to \mathbb R \cup\{-\infty\}$ be measurable. Let $\psi:Y \to \mathbb R \cup\{-\infty\}$ which is not necessarily measurable.
- We assume $\varphi (x) + \psi (y) = c(x, y)$ for $\gamma$-a.e. $(x, y) \in X \times Y$. This means there is a Borel subset $S$ of $X \times Y$ such that $\gamma (S) = 1$, $\varphi (x), \psi(y) \neq \pm\infty$, and $\varphi (x) + \psi (y) = c(x, y)$ for all $(x, y) \in S$.
At page 84 of Villani's Optimal Transport: Old and New, the author constructs a measurable $\psi': Y \to \mathbb R \cup \{\pm\infty\}$ such that $\psi (y) = \psi' (y)$ for $\nu$-a.e. $y\in Y$ as follows.
The measurability of $\psi$ is subtle also, and at the present level of generality it is not clear that this function is really Borel measurable. However, it can be modified on a $\nu$-negligible set so as to become measurable. Indeed, $\varphi (x) + \psi (y) = c(x, y)$ for $\gamma$-almost surely, so if one disintegrates $\gamma (\mathrm dx, \mathrm dy)$ as $\gamma(\mathrm d x | y) \nu(\mathrm d y)$, then $\psi(y)$ will coincide, $\nu(\mathrm d y)$-almost surely, with the Borel function $$ \psi'(y):=\int_{X}[c(x, y) - \varphi (x)] \gamma(\mathrm d x | y). $$
The disintegration theorem applies when the integrand is either non-negative measurable or bounded measurable. I could not see how the map $$ (x, y) \mapsto c(x, y) - \varphi (x) $$ qualifies here. Could you elaborate on my confusion?