Darboux's Theorem

lean4-proofcalculusvisualization
f(a)<m<f(b)    c(a,b):  f(c)=mf'(a)<m<f'(b)\implies\exists\,c\in(a,b):\;f'(c)=m

Statement

Let f:RRf : \mathbb{R} \to \mathbb{R} be differentiable on [a,b][a, b] (with one-sided derivatives at endpoints). If f(a)<m<f(b)f'(a) < m < f'(b) (or f(b)<m<f(a)f'(b) < m < f'(a)), then there exists c(a,b)c \in (a, b) such that

f(c)=mf'(c) = m

Derivatives satisfy the Intermediate Value Property even when the derivative is not continuous. This distinguishes derivatives from arbitrary functions.

Visualization

A striking example: f(x)=x2sin(1/x)f(x) = x^2 \sin(1/x) for x0x \neq 0, f(0)=0f(0) = 0.

The derivative is f(x)=2xsin(1/x)cos(1/x)f'(x) = 2x\sin(1/x) - \cos(1/x) for x0x \neq 0 and f(0)=0f'(0) = 0.

Near x=0x = 0, the term cos(1/x)-\cos(1/x) oscillates between 1-1 and 11 without converging, so ff' is not continuous at 00. Yet ff' achieves every value in [1,1][-1, 1] near 00:

  f'(x) near x=0 (schematic)

  1 |  .    .    .    .   ← peaks of cos(1/x) oscillation
    |
  0 |--+--+--+--+--+--+-- ← f'(0) = 0
    |
 -1 |    .    .    .   .  ← troughs
    +------------------------
       x → 0

For the simpler case f(x)=x2f(x) = x^2 on [0,1][0, 1]: f(0)=0f'(0) = 0, f(1)=2f'(1) = 2, and every m(0,2)m \in (0, 2) is achieved at c=m/2c = m/2:

mmc=m/2c = m/2f(c)=2cf'(c) = 2c
0.50.250.5 ✓
1.00.501.0 ✓
1.50.751.5 ✓

Proof Sketch

  1. Reduce to minimum: Without loss of generality assume f(a)<m<f(b)f'(a) < m < f'(b). Define g(x)=f(x)mxg(x) = f(x) - mx, so g(a)<0<g(b)g'(a) < 0 < g'(b).
  2. Attain minimum: gg is continuous on [a,b][a, b] (differentiability implies continuity), so by the Extreme Value Theorem it attains its minimum at some c[a,b]c \in [a, b].
  3. Interior point: Since g(a)<0g'(a) < 0, the function gg is decreasing at aa, so gg takes smaller values just to the right of aa; hence cac \neq a. Similarly g(b)>0g'(b) > 0 means gg is increasing at bb, so cbc \neq b.
  4. Zero derivative: At the interior minimum cc, by Fermat's criterion g(c)=0g'(c) = 0, i.e., f(c)=mf'(c) = m.

Connections

  • Intermediate Value TheoremIntermediate Value Theoremf(a)yf(b)c[a,b]:  f(c)=yf(a) \le y \le f(b) \Rightarrow \exists\, c \in [a,b]:\; f(c) = yA continuous function on a closed interval hits every value between its endpointsRead more → — Darboux's theorem is the IVT analogue for derivatives; the proof uses compactness, not IVT directly
  • Mean Value TheoremMean Value Theoremc(a,b)  :  f(c)=f(b)f(a)ba\exists\, c \in (a,b)\;:\; f'(c) = \frac{f(b)-f(a)}{b-a}There exists a point where the instantaneous rate of change equals the average rate of changeRead more → — the MVT implies the derivative cannot skip values: if f(a)<m<f(b)f'(a) < m < f'(b), the MVT applied to fmxf - mx forces a critical point
  • Extreme Value TheoremExtreme Value TheoremfC(K),K compact    x,xK:  f(x)=minf=f(x)maxff\in C(K),\,K\text{ compact}\implies\exists\,x_*,x^*\in K:\;f(x_*)=\min f=f(x^*)\leq\max fA continuous function on a compact set attains its maximum and minimum valuesRead more → — the proof uses the extreme value theorem to find an interior minimum of the auxiliary function g(x)=f(x)mxg(x) = f(x) - mx

Lean4 Proof

import Mathlib.Analysis.Calculus.Darboux

/-- Darboux's theorem: if `f' a < m < f' b` then `f' c = m` for some interior `c`.
    Wraps Mathlib's `exists_hasDerivWithinAt_eq_of_gt_of_lt`. -/
theorem darboux_theorem {f f' :   } {a b : } (hab : a  b)
    (hf :  x  Set.Icc a b, HasDerivWithinAt f (f' x) (Set.Icc a b) x)
    {m : } (hma : f' a < m) (hmb : m < f' b) :
    m  f' '' Set.Ioo a b :=
  exists_hasDerivWithinAt_eq_of_gt_of_lt hab hf hma hmb