Local minimum (source code)

= Local minimum
{title2=$f(x)\geq f(x_*)\quad\text{near }x_*$}

= Local minima
{synonym}

A <real-valued function> $f:D\to\mathbb R$, with $D\subseteq\mathbb R^n$, has a local minimum at $x_*$ if some $\delta>0$ satisfies
$$
f(x)\geq f(x_*)\qquad\text{for all }x\in D\text{ with }\|x-x_*\|<\delta.
$$
Equality is allowed; a <strict local minimum> excludes equality at every other sufficiently nearby point. The comparison uses a <neighbourhood> relative to the <domain of a function>. On an <open set>, this is an ordinary small ball around $x_*$. At an endpoint, only points belonging to the <domain of a function> are tested. Some elementary texts reserve "local" for <interior> points; here endpoints are allowed under the relative convention, but the zero-<gradient> condition still requires an <interior> point.

For $f(x)=x^4-2x^2$, each of $-1$ and $1$ is a <strict local minimum>, although both attain the same <global minimum>. For $h(x)=|x|$, zero is a <strict local minimum> despite the missing <derivative>. Thus the definition compares values and does not require <differentiability>.

A <local minimum> describes a valley that cannot be improved by a sufficiently small move; <mathematical optimization> also asks whether a better value lies farther away. At a smooth <interior> <local minimum>, the <gradient> is zero. If the <function> is twice continuously <differentiable> nearby, its <Hessian matrix> is <positive semidefinite>: restrict to a line through the point and its second <derivative> is nonnegative. The converse fails for a degenerate <Hessian matrix>, as $-x^4$ at zero shows.