Monotonic function (source code)

= Monotonic function
{wiki}

= Monotone function
{synonym}

= Monotone
{synonym}

= Monotonicity
{synonym}

A <real-valued function> $f:D\to\mathbb R$, with <domain of a function> $D\subseteq\mathbb R$ in the usual order of the <real numbers>, is a <monotonic function> if it is either a <nondecreasing function> throughout $D$ or a <nonincreasing function> throughout $D$. The same direction must work for every pair $x<y$ in $D$. Being a <strictly increasing function> on one part and a <strictly decreasing function> on another does not make the whole <function> <monotone>: for example, $x^2$ on the <real line> changes direction at zero. A <constant function> is both a <nondecreasing function> and a <nonincreasing function>.

The word "increasing" is ambiguous across textbooks: some allow equal outputs and some require unequal outputs. Use <nondecreasing function> for the weak inequality and <strictly increasing function> for the strict inequality; use <nonincreasing function> and <strictly decreasing function> in the other direction. Neither <continuity> nor <differentiability> is part of the definition of a <monotonic function>.

Strict <monotonicity> gives <injectivity>, so an equation $f(x)=b$ has at most one solution and an <inverse function> exists on the <image of a function>. Weak <monotonicity> permits repeated outputs and jumps. In <probability theory>, a <cumulative distribution function> is a <nondecreasing function>; its <quantile function> uses a generalized inverse to handle those flat parts and jumps. <Monotonicity> alone does not guarantee <continuity>, even for a <strictly increasing function>.

\Image[/monotonicity-strict-and-weak.png]
{title=Strict and weak monotonicity: cubic functions, flat portions, and a step}
{description=The <strictly increasing function> $x^3$ and <strictly decreasing function> $-x^3$ never repeat an output. The <nondecreasing function> $\min(1,\max(0,x))$ has flat <intervals>, and the <step function> $F(x)=0$ for $x<0$, $F(x)=1$ for $x\geq0$ is a <discontinuous> <cumulative distribution function>. The open and closed circles specify its value at the jump; no vertical segment belongs to its graph.}