Is a finite convex function subdifferentiable everywhere? Let $X$ be a (infinite-dimensional) Hilbert space and $f:X\to\mathbb{R}$ be convex. Then is $f$ subdifferentiable everywhere in $X$?
I have looked at Non-subdifferentiable convex function on a normed space and it is clear that there are counterexamples when $f$ can take value $+\infty$. However, what about finite convex functions?
The answer by Tom suggests that convex functions should be subdifferentiable on their relative interior - does someone have a reference and/or proof for this?
 A: Let $\tilde{\mathbf{x}}\in\text{ri}(\text{dom}(f))$. Since the vector $(\tilde{\mathbf{x}}, f(\tilde{\mathbf{x}}))\subseteq\mathbb{R}^n\times\mathbb{R}$ is on the relative boundary of $\text{epi}(f)$, it follows by the supporting hyperplane theorem that there exists a separating hyperplane between $(\tilde{\mathbf{x}}, f(\tilde{\mathbf{x}}))$ and $\text{epi}(f)$, meaning that there exists a nonzero vector $(\mathbf{p},-\alpha)$ for which \begin{equation}\tag{1}
\mathbf{p}^T\tilde{\mathbf{x}}-\alpha f(\tilde{\mathbf{x}})\geq\mathbf{p}^T\mathbf{x}-\alpha t,\quad \forall (\mathbf{x},t)\in\text{epi}(f).
\end{equation}
Since $(\tilde{\mathbf{x}}, f(\tilde{\mathbf{x}}))$ is on the boundary of $\text{epi}(f)$ it follows that $(\tilde{\mathbf{x}}, f(\tilde{\mathbf{x}})+1)\in \text{epi}(f)$ as well. Hence we can plug $\mathbf{x}=\tilde{\mathbf{x}}$ and $t=f(\tilde{\mathbf{x}})+1$ to the equation above and get
$$\mathbf{p}^T\tilde{\mathbf{x}}-\alpha f(\tilde{\mathbf{x}})\geq\mathbf{p}^T\tilde{\mathbf{x}}-\alpha(f(\tilde{\mathbf{x}})+1 )\quad \iff \alpha\geq 0. $$
After showing that $\alpha\geq 0$ we need to prove that $\alpha\neq 0$. Denote $A_f=\text{aff}(\text{dom}f)$. Since $\text{epi}(f)\subseteq A_f\times\mathbb{R}$ and a supporting hyperplane $(\mathbf{p},-\alpha)$ by definition does not contain $\text{epi}(f)$, it does not contain $A_f\times\mathbb{R}$ as well. Now consider the affine combination $\mathbf{y}_{\lambda}=(1-\lambda)\tilde{\mathbf{x}}+\lambda\mathbf{y},\;\lambda\in\mathbb{R}$. The points in this line all lie in the affine set $A_f$ and $\mathbf{y}_{\lambda}\to\tilde{\mathbf{x}}$ as $\lambda\to 0$. Since $\tilde{\mathbf{x}}\in\text{ri}(\text{dom}(f))$, for small values of $|\lambda|$ the points $\mathbf{y}_{\lambda}$ lie in $\text{dom}(f)$. Hence we can plug $\mathbf{y}_{\lambda}$ into $(1)$ and get (after some  algebra)
$$\lambda\mathbf{p}^T(\tilde{\mathbf{x}}-\mathbf{y})-\alpha(f(\tilde{\mathbf{x}})-f(\mathbf{y}_{\lambda}))\geq 0.\tag{2}$$
Inequality $(2)$ must hold for sufficiently small positive and negative values of $\lambda$. As long as $\alpha>0$ there is no problem and the inequality still holds$^\textbf{**}$. Assume in contradiction that $\alpha=0$. Then $(2)$ becomes $\lambda\mathbf{p}^T(\tilde{\mathbf{x}}-\mathbf{y})\geq 0$ which cannot hold for both positive and negative values of $\lambda$.
Take a deep breath, we're almost done :)
After establishing that $\alpha>0$ we can divide $(1)$ by it to get
$$f(\mathbf{x})\geq f(\tilde{\mathbf{x}})+\mathbf{g}^T(\mathbf{x}-\tilde{\mathbf{x}}),\quad \forall \mathbf{x}\in\text{dom}(f)$$
where $\mathbf{g}=\mathbf{p}/\alpha$. Thus $\mathbf{g}\in\partial f(\tilde{\mathbf{x}})$, establishing the non-emptiness of $\partial f(\tilde{\mathbf{x}})$.
$^\textbf{**}$If you analyze $f(\mathbf{y}_{\lambda})$ you notice it's monotone decreasing in $\lambda<0$ (it increases as $\lambda$ moves away from zero in the negative direction), hence offsetting the change of sign from $\lambda\mathbf{p}^T(\tilde{\mathbf{x}}-\mathbf{y})$.
