Skip to content
Tutorials Center
My learning

Topics

Lesson 20 of 37 ยท Continuity

The Intermediate Value Theorem

Prove the Intermediate Value Theorem from the least upper bound property, then turn the proof into a bisection root finder and see why continuity is essential.

If you walk from sea level to the top of a hill, you must pass through every height in between. The Intermediate Value Theorem (IVT) says this about continuous functions. It looks obvious, yet it fails over the rational numbers, so its proof must use the completeness of โ„. This lesson proves it, and then uses the proof as an algorithm.

Statement

Theorem (IVT). Let f : [a, b] โ†’ โ„ be continuous. If y lies between f(a) and f(b), then there is c โˆˆ [a, b] with f(c) = y.

It is enough to prove the case f(a) < 0 < f(b) and find c with f(c) = 0: for a general y, apply that case to f - y (or to y - f when f(a) > y > f(b)).

Proof by supremum

Assume f(a) < 0 < f(b). Let

Text
S = { x โˆˆ [a, b] : f(x) < 0 }.

S contains a and is bounded above by b, so c = sup S exists by completeness, and c โˆˆ [a, b]. We show f(c) = 0 by ruling out the other two cases.

  1. Suppose f(c) < 0. Then c โ‰  b (because f(b) > 0). By continuity at c with ฮต = -f(c) > 0, there is ฮด > 0 such that f(x) < 0 for all x within ฮด of c. Then points slightly larger than c lie in S, contradicting that c is an upper bound.
  2. Suppose f(c) > 0. Then c โ‰  a. By continuity there is ฮด > 0 with f(x) > 0 for all x โˆˆ (c - ฮด, c]. So no point of S lies in (c - ฮด, c], and c - ฮด is an upper bound of S smaller than c, a contradiction.

Hence f(c) = 0. โˆŽ

The two cases both use one fact: a continuous function that is negative (or positive) at a point stays negative (or positive) in a neighborhood. This is called local sign preservation.

Over โ„š the theorem is false. Take f(x) = xยฒ - 2 on the rationals in [0, 2]: f(0) < 0 < f(2), but no rational c has f(c) = 0. The supremum โˆš2 is missing from โ„š.

The proof as an algorithm: bisection

A cleaner constructive proof halves the interval repeatedly. Start with [aโ‚€, bโ‚€] = [a, b] where f(aโ‚€) < 0 < f(bโ‚€). Let m be the midpoint. If f(m) = 0 stop. If f(m) < 0 keep [m, bโ‚€], otherwise keep [aโ‚€, m]. Each step keeps a sign change and halves the length, so the endpoints converge to a common limit c, and continuity forces f(c) = 0.

The width after n steps is (b - a) / 2โฟ, so the error is guaranteed to shrink by half each step.

Python Bisection root finder with a guaranteed error bound

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Fixed points from the IVT

A fixed point of g is a number x with g(x) = x. If g : [a, b] โ†’ [a, b] is continuous then g has a fixed point: apply the IVT to h(x) = g(x) - x, which satisfies h(a) = g(a) - a โ‰ฅ 0 and h(b) = g(b) - b โ‰ค 0.

Python Fixed point of cos on [0, 1]

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Why continuity cannot be dropped

Let f(x) = -1 for x < 0.5 and f(x) = 1 for x โ‰ฅ 0.5 on [0, 1]. It changes sign, but never equals 0. Running bisection on it would home in on the jump at 0.5 and return a number where f is not close to 0. The sign change guaranteed by the theorem needs continuity to become a root. Also, the IVT says nothing about uniqueness: f(x) = xยณ - x on [-2, 2] takes the value 0 three times.

Another consequence: the image of an interval under a continuous function is an interval (or a single point), because it contains every value between any two of its values.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which property of the real numbers is the essential ingredient in the proof of the IVT?

    The proof defines c as the supremum of a set. Over the rationals this supremum may not exist, and the IVT fails.
  2. 2. After n steps of bisection on [a, b], the interval has width:

    Each step halves the width.
  3. 3. A continuous g maps [0, 1] into [0, 1]. Which function does the IVT use to find a fixed point?

    h(0) is at least 0 and h(1) is at most 0, so h has a zero, and h(x) = 0 means g(x) = x.
  4. 4. Which function on [0, 1] changes sign but has no root?

    That step function is discontinuous at 0.5, so the IVT does not apply, and indeed it never takes the value 0.

Summary

  • IVT: a continuous f on [a, b] takes every value between f(a) and f(b).
  • The proof takes c = sup{x : f(x) < 0} and uses local sign preservation to exclude f(c) < 0 and f(c) > 0.
  • Bisection is the constructive form: the error halves each step.
  • Continuity of g(x) - x gives fixed points; continuity is essential, and completeness of โ„ is what the proof needs.

Next: The Extreme Value Theorem