Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 36 · Connectedness

The Intermediate Value Theorem, Topologically

See the intermediate value theorem as a one-line consequence of connectedness, then use bisection, fixed points and antipodal temperatures in code.

In calculus the intermediate value theorem (IVT) says that a continuous function on an interval that takes values a and b also takes every value between them. The usual proof is a hands-on argument with suprema. Topology gives a shorter and more general proof: the image of a connected set is connected, and the connected subsets of the real line are intervals.

This lesson derives the theorem that way, then turns it into three programs: a root finder, a fixed-point finder and a "same temperature on opposite sides of the Earth" detector.

The one-line proof

Theorem (IVT). Let X be a connected space and f: X → ℝ continuous. If f(p) = a and f(q) = b for some p, q ∈ X and c lies between a and b, then f(x) = c for some x ∈ X.

Proof. The image f(X) is a connected subset of ℝ, so it is an interval. An interval containing a and b contains everything between them, so c ∈ f(X). ∎

Two things changed from the calculus version. The domain can be any connected space, not just an interval. And the proof is not about intervals and suprema but about the structure of clopen sets.

The hypotheses are essential. On the disconnected set [0, 1] ∪ [2, 3] the function equal to 0 on the first piece and 1 on the second is continuous but never takes the value 1/2.

Root finding by bisection

Suppose f is continuous on [a, b] and f(a), f(b) have opposite signs. By the IVT there is a root. Bisection shrinks the interval around one: evaluate the midpoint, keep the half where the sign changes.

Python Bisection: the IVT as an algorithm

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.

Note the last line: the function x² + 1 has no real root, and the code refuses to run because there is no sign change to exploit. The IVT guarantees a root only when the hypothesis holds.

Fixed points on an interval

Corollary. Every continuous f: [0, 1] → [0, 1] has a fixed point (a point with f(x) = x).

Define g(x) = f(x) − x. Then g(0) = f(0) ≥ 0 and g(1) = f(1) − 1 ≤ 0. By the IVT, g has a zero. That zero is a fixed point of f.

This is the one-dimensional case of Brouwer's fixed point theorem: every continuous map from a closed disk to itself has a fixed point. The higher-dimensional version needs algebraic topology, but the interval version needs only connectedness.

Opposite points with equal values

Let T be a continuous function on a circle, say the temperature around the equator. Claim: there are two diametrically opposite points with the same temperature.

Write the circle as angles θ ∈ [0, 2π] with T(0) = T(2π). Let g(θ) = T(θ) − T(θ + π). Then g(0) = T(0) − T(π) and g(π) = T(π) − T(2π) = −g(0). So g takes values of opposite signs (or is zero at 0), and the IVT gives a θ with g(θ) = 0.

Python Finding two opposite points with the same value

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.

The same argument shows, for example, that on any closed curve in the plane there are two points at opposite ends of a diameter where a continuous measurement agrees. In two dimensions the analogous statement (the Borsuk–Ulam theorem) says that a continuous map from a sphere S² to the plane sends some pair of antipodal points to the same value. It is much harder to prove.

What can go wrong

  • A disconnected domain. As above, the IVT fails for functions on [0, 1] ∪ [2, 3].
  • A discontinuous function. f(x) = 0 for x < 1/2 and 1 for x ≥ 1/2 jumps over 1/4. Its image {0, 1} is not connected.
  • Rational domains. f(x) = x² − 2 on ℚ changes sign between 1 and 2 but has no rational root, because ℚ is not connected.

The last example shows that the IVT secretly encodes completeness of the reals: it is a statement about ℝ, not about ℚ.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the topological proof of the IVT?

    The connected subsets of ℝ are intervals, so the image f(X) of a connected X contains every value between two of its values.
  2. 2. Why does f(x) = x² − 2 on the rationals fail to have a root between 1 and 2?

    f changes sign on [1, 2] ∩ ℚ, but the only root is √2, which is not rational. The domain ℚ is disconnected.
  3. 3. To prove that continuous f: [0,1] → [0,1] has a fixed point, which auxiliary function works?

    g(0) = f(0) ≥ 0 and g(1) = f(1) − 1 ≤ 0, so the IVT gives a zero of g, which is a fixed point of f.
  4. 4. In the equator-temperature problem, which function changes sign?

    g(θ) = T(θ) − T(θ + π) satisfies g(π) = −g(0), so it has a zero, giving two opposite points with equal temperature.

Summary

  • Connected domain plus continuity gives the IVT: the image is an interval.
  • Bisection turns the IVT into a root-finding algorithm that needs a sign change.
  • Every continuous self-map of [0, 1] has a fixed point.
  • On a circle, a continuous function takes equal values at some pair of opposite points.
  • The theorem fails for disconnected domains such as ℚ.

Next: Path-Connectedness