Canonical: https://knowlpedia.com/convex-analysis/subdifferential/

# Subdifferential

The set of all subgradients of a convex function at a point, defined by global supporting inequalities.

A **subdifferential** of a [convex function](https://knowlpedia.com/convex-analysis/convex-function-via-epigraph/) \(f:\mathbb{R}^n\to(-\infty,+\infty]\) at a point \(x\) in its [effective domain](https://knowlpedia.com/convex-analysis/domain-and-epigraph-proper-function/) is the set
\[
\partial f(x)
\;=\;
\bigl\{g\in\mathbb{R}^n:\ f(z)\ge f(x)+\langle g,\,z-x\rangle \text{ for all } z\in\mathbb{R}^n\bigr\}.
\]

Any \(g\in\partial f(x)\) is called a [subgradient](https://knowlpedia.com/convex-analysis/subgradient/) of \(f\) at \(x\).

Geometrically, \(g\in\partial f(x)\) encodes a [supporting hyperplane](https://knowlpedia.com/convex-analysis/supporting-hyperplane-convex-function/) to the epigraph of \(f\) at \((x,f(x))\), with normal determined by \(g\) (compare [hyperplane](https://knowlpedia.com/convex-analysis/hyperplane/)). If \(f\) is differentiable at \(x\) (in the sense of the [derivative](https://knowlpedia.com/real-analysis/derivative/) / [differentiable map](https://knowlpedia.com/real-analysis/differentiable-map/)), then \(\partial f(x)=\{\nabla f(x)\}\).

## Examples

- For \(f(x)=|x|\) on \(\mathbb{R}\), one has \(\partial f(0)=[-1,1]\) and \(\partial f(x)=\{\mathrm{sign}(x)\}\) for \(x\ne 0\).
- If \(f=\delta_C\) is the indicator of a closed convex set \(C\), then \(\partial f(x)\) consists of outward normal vectors to \(C\) at \(x\) (and is empty if \(x\notin C\)).
