  Given a metric measure space $(X,\mathsf{d},\mathfrak{m})$ and a lower
semicontinuous, lower bounded function $k\colon X\to\mathbb{R}$, we prove the
equivalence of the synthetic approaches to Ricci curvature at $x\in X$ being
bounded from below by $k(x)$ in terms of
  $\bullet$ the Bakry-\'Emery estimate $\Delta\Gamma(f)/2 - \Gamma(f,\Delta f)
\geq k\,\Gamma(f)$ in an appropriate weak formulation, and
  $\bullet$ the curvature-dimension condition $\mathrm{CD}(k,\infty)$ in the
sense Lott-Sturm-Villani with variable $k$.
  Moreover, for all $p\in(1,\infty)$, these properties hold if and only if the
perturbed $p$-transport cost \begin{equation*}
W_p^{\underline{k}}(\mu_1,\mu_2,t):=\inf_{(\mathsf{b}^1,\mathsf{b}^2)}
\mathbb{E}\Big[\mathrm{e}^{\int_0^{2t} p \underline{k}\left(\mathsf{b}^1_{r},
\mathsf{b}^2_{r}\right)/2\,\mathrm{d} r}
\mathsf{d}^p\!\left(\mathsf{b}^1_{2t},\mathsf{b}^2_{2t} \right)\!\Big]^{1/p}
\end{equation*} is nonincreasing in $t$. The infimum here is taken over pairs
of coupled Brownian motions $\mathsf{b}^1$ and $\mathsf{b}^2$ on $X$ with given
initial distributions $\mu_1$ and $\mu_2$, respectively, and
$\underline{k}(x,y) := \inf_\gamma \int_0^1 k(\gamma_s)\,\mathrm{d} s$ denotes
the "average" of $k$ along geodesics $\gamma$ connecting $x$ and $y$.
  Furthermore, for any pair of initial distributions $\mu_1$ and $\mu_2$ on
$X$, we prove the existence of a pair of coupled Brownian motions
$\mathsf{b}^1$ and $\mathsf{b}^2$ such that a.s. for every $s,t\in[0,\infty)$
with $s\leq t$, we have \begin{equation*}
\mathsf{d}\!\left(\mathsf{b}_t^1,\mathsf{b}_t^2\right)\leq
\mathrm{e}^{-\int_s^t
\underline{k}\left(\mathsf{b}_r^1,\mathsf{b}_r^2\right)/2\,\mathrm{d} r}
\mathsf{d}\!\left(\mathsf{b}_s^1,\mathsf{b}_s^2\right)\!. \end{equation*}
