Subdifferential under scalar affine composition (source code)

= Subdifferential under scalar affine composition
{title2=$\partial[h(c^Tx+b)]=c\partial h(c^Tx+b)$}

For a finite <convex function> $h:\mathbb R\to\mathbb R$, the <function> $f(x)=h(c^Tx+b)$ is <convex>. The <subgradient inequality> gives $c\partial h(u)\subseteq\partial f(x)$, where $u=c^Tx+b$. Conversely, every <subgradient> $g$ of $f$ annihilates $\ker c^T$, because $f$ is constant on lines in those directions. For $c\ne0$, write $g=cv$ and test the subgradient inequality at $y=x+(t-u)c/\|c\|_2^2$; this proves $v\in\partial h(u)$. For $c=0$, $f$ is constant and both sides are $\{0\}$ since a finite <convex> <function> on the real line has a nonempty <subdifferential> everywhere.