Intermediate Value Theorem

lean4-proofcalculusvisualization
f(a)yf(b)c[a,b]:  f(c)=yf(a) \le y \le f(b) \Rightarrow \exists\, c \in [a,b]:\; f(c) = y

Statement

If ff is continuous on the closed interval [a,b][a, b] and yy is any value strictly between f(a)f(a) and f(b)f(b), then there exists at least one c[a,b]c \in [a, b] with f(c)=yf(c) = y.

Equivalently, the image f([a,b])f([a, b]) contains the interval [min(f(a),f(b)),max(f(a),f(b))][\min(f(a), f(b)),\, \max(f(a), f(b))].

Visualization

Sign-change detection — the most common application:

xxp(x)=x3x1p(x) = x^3 - x - 1Sign
01-1-
11-1-
255++
1.30.1970.197++
1.20.272-0.272-
1.320.297...0.297...++
1.320.035\approx 0.035++

Sign changes from - to ++ on [1,2][1, 2], so by IVT a root c(1,2)c \in (1, 2) exists (the actual root is c1.3247c \approx 1.3247).

p(x) = x³ - x - 1

 5 |                     *  (2, 5)
   |
 0 +······················ ← root c ≈ 1.32
   |              *
-1 | * ···· *
   +--+--+--+--+--+--+--
      0  0.5  1  1.5  2

Bisection algorithm exploits IVT: repeatedly halve [a,b][a, b] at the sign-change bracket to converge on cc.

Proof Sketch

  1. WLOG f(a)yf(b)f(a) \le y \le f(b) (the reversed case is symmetric).
  2. Define S={x[a,b]:f(x)y}S = \{x \in [a, b] : f(x) \le y\}. SS is non-empty (contains aa) and bounded above by bb.
  3. Let c=supSc = \sup S. By definition acba \le c \le b.
  4. Show f(c)=yf(c) = y by contradiction: if f(c)<yf(c) < y, continuity gives a neighbourhood where f<yf < y, contradicting c=supSc = \sup S. If f(c)>yf(c) > y, similarly contradicts the definition of cc as a supremum.
  5. Conclude f(c)=yf(c) = y and c[a,b]c \in [a, b].

Connections

  • 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 → — Rolle's Theorem (used in MVT's proof) relies on IVT to locate extrema
  • Fundamental Theorem of CalculusFundamental Theorem of Calculusabf(x)dx=f(b)f(a)\int_a^b f'(x)\,dx = f(b) - f(a)Integration and differentiation are inverse operationsRead more → — continuity hypotheses in FTC are validated via IVT arguments
  • L’Hôpital's Rule — the squeeze step in L'Hôpital's proof uses IVT to trap cxc_x between aa and xx
  • Taylor's TheoremTaylor's Theoremf(x)=k=0nf(k)(x0)k!(xx0)k+Rn(x)f(x) = \sum_{k=0}^{n} \frac{f^{(k)}(x_0)}{k!}(x-x_0)^k + R_n(x)Approximate smooth functions by polynomials with explicit error boundsRead more → — existence of the Lagrange remainder point cc follows from IVT applied to an auxiliary function
  • Chain RuleChain Ruleddx[f(g(x))]=f(g(x))g(x)\frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x)Differentiate composite functions by peeling layersRead more → — continuity (a prerequisite for the chain rule) is IVT's core hypothesis

Lean4 Proof

import Mathlib.Topology.Order.IntermediateValue

open Set

/-- Intermediate Value Theorem: a continuous function on `[a, b]` takes every value
    between `f a` and `f b`. Wraps Mathlib's `intermediate_value_Icc`. -/
theorem ivt {f :   } {a b : } (hab : a  b)
    (hf : ContinuousOn f (Icc a b)) :
    Icc (f a) (f b)  f '' Icc a b :=
  intermediate_value_Icc hab hf