This question mainly deals with subdifferential of a convex function with respect to the cost function $c(x,y)=\frac{|x-y|^2}{2}$
I want to compute the cost-subdifferential $\partial^{c}\phi$ of the cost-convex function
$\phi(x)=\max\{-|x-y_0|^2,|x-y_1|^2\}$
For a cost function $c:X\times Y \longrightarrow R, \phi:X\longrightarrow R$ is called cost-convex, if there exists another function $\psi:Y\longrightarrow R$ such that $\phi(x)=\sup_{y\in Y} -c(x,y)- \psi(y)$.
Moreover, at point $x\in \mathbb{R}^n$ the subdifferential at $x$ is;
$ \partial^{c}\phi(x)=\{y\in Y |\phi(z)\geq \phi(x)-c(z,y)+c(x,y)\quad \forall z\in X\} $
Any help would be appreciated.