Tutorials › Real Analysis › Prove the Extreme Value Theorem

Comprehensive Proof Practicum · Tutorial 971 of 1000

Prove the Extreme Value Theorem

Learn how compactness guarantees that a continuous function’s supremum and infimum are actual values of the function.

Advanced 9 min read

What You'll Learn

  • State the Extreme Value Theorem for compact metric spaces
  • Prove boundedness of a continuous function on a compact set using sequences
  • Use a maximizing sequence and sequential compactness to attain a supremum
  • Obtain minimum attainment by applying the maximum result to the negative function
  • Apply Heine-Borel to conclude the theorem on closed bounded intervals
  • Recognize why continuity and compactness are both necessary

From Intermediate Values to Extreme Values

The Intermediate Value Theorem shows that continuity on an interval forces a function to take every value between its endpoint values. A different question is whether the function reaches its largest and smallest values at all. Continuity alone does not guarantee this: a continuous function on an open interval can approach a limiting value without ever attaining it. Compactness supplies the missing condition.

We prove a slightly more general result than the closed-interval version. The proof uses the Sequential Compactness of a Compact Metric Space, established earlier in this course: every sequence in a compact metric space has a subsequence converging to a point of that space. It also uses the Epsilon Characterization of the Supremum. The key idea is to choose points where the function values approach their supremum, then use compactness to obtain a limit point and continuity to identify its function value.

Definition: A function \(f:K\to\mathbb R\) attains its maximum on \(K\) if there is a point \(x_{\max}\in K\) such that \(f(x)\leq f(x_{\max})\) for every \(x\in K\). It attains its minimum on \(K\) if there is a point \(x_{\min}\in K\) such that \(f(x_{\min})\leq f(x)\) for every \(x\in K\).

Attainment is stronger than having a supremum or infimum. A supremum is a least upper bound for the set of function values; it need not itself be a function value. The Extreme Value Theorem says that when the domain is nonempty and compact and the function is continuous, both bounds are attained.

A Continuous Function on a Compact Set Is Bounded

Before taking the supremum of the function values, we must know that those values are bounded above. Rather than assume boundedness, we establish it from compactness and continuity. This argument also illustrates a useful contradiction pattern: an unbounded function would produce a sequence of inputs whose function values escape every bound, while compactness gives a convergent subsequence of those inputs.

Lemma (Boundedness on a Compact Metric Space): Let \(K\) be a nonempty compact metric space, and let \(f:K\to\mathbb R\) be continuous. Then \(f(K)\) is bounded.

Proof. Suppose, to the contrary, that \(f(K)\) is unbounded. For each positive integer \(n\), choose \(x_n\in K\) such that \(|f(x_n)|>n\). By the Sequential Compactness of a Compact Metric Space, there is a subsequence \((x_{n_k})\) converging to some \(x\in K\). Continuity of \(f\) at \(x\) implies that \(f(x_{n_k})\to f(x)\).

Every convergent real sequence is bounded, so the sequence \((f(x_{n_k}))\) must be bounded. But \(n_k\geq k\), and therefore \(|f(x_{n_k})|>n_k\geq k\) for every positive integer \(k\). These values are not bounded, a contradiction. Thus \(f(K)\) is bounded. \(\square\)

The point \(x\) in this proof belongs to \(K\), not merely to a larger space. That is essential: continuity identifies the limiting function value at \(x\) only if \(x\) is in the domain. Sequential compactness provides precisely this guarantee.

The Extreme Value Theorem

Theorem (Extreme Value Theorem): Let \(K\) be a nonempty compact metric space, and let \(f:K\to\mathbb R\) be continuous. Then \(f\) is bounded and attains both its maximum and its minimum on \(K\).

Proof. The boundedness lemma shows that \(f(K)\) is bounded. It is nonempty because \(K\) is nonempty. Thus \(s=\sup f(K)\) exists as a real number. For each positive integer \(n\), the Epsilon Characterization of the Supremum gives a point \(x_n\in K\) such that \(s-\frac{1}{n}<f(x_n)\leq s\).

$$ s-\frac{1}{n}<f(x_n)\leq s $$

Sequential compactness gives a subsequence \((x_{n_k})\) converging to some \(x_{\max}\in K\). By continuity, \(f(x_{n_k})\to f(x_{\max})\). Also, the displayed inequalities imply \(f(x_{n_k})\to s\): the values are at most \(s\), and their distance below \(s\) is less than \(1/n_k\leq1/k\), which tends to zero. By uniqueness of sequence limits, \(f(x_{\max})=s\). Since \(s\) is an upper bound for \(f(K)\), every \(x\in K\) satisfies \(f(x)\leq s=f(x_{\max})\). Hence \(f\) attains its maximum.

To obtain a minimum, define \(g:K\to\mathbb R\) by \(g(x)=-f(x)\). The function \(g\) is continuous because \(f\) is continuous. The maximum part of the proof gives a point \(x_{\min}\in K\) such that \(g(x)\leq g(x_{\min})\) for every \(x\in K\). Substituting \(g=-f\) and reversing the inequality gives \(f(x_{\min})\leq f(x)\) for every \(x\in K\). Thus \(f\) attains its minimum as well. \(\square\)

The proof does not assume that \(f(K)\) is closed. Instead, it constructs a sequence of values approaching the supremum and shows that compactness and continuity force the supremum to be one of the values. This distinction matters: boundedness alone gives a supremum, but does not ensure that the supremum is attained.

Worked Example: Finding Both Extremes of a Quadratic

Consider \(f(x)=x^2-4x+1\) on \([0,5]\). The interval is nonempty, closed, and bounded, so the Heine-Borel Theorem says it is compact. The polynomial is continuous, so the Extreme Value Theorem guarantees that \(f\) attains a maximum and a minimum on this interval.

To identify them, complete the square: \(f(x)=(x-2)^2-3\). For every \(x\in[0,5]\), \((x-2)^2\geq0\), so \(f(x)\geq-3\). Equality holds at \(x=2\), which belongs to the interval; indeed, \(f(2)=2^2-4(2)+1=4-8+1=-3\). This is the minimum.

For the maximum, \((x-2)^2\leq9\) on \([0,5]\), because the distance from \(x\) to \(2\) is at most \(3\). Therefore \(f(x)\leq9-3=6\). Equality holds at \(x=5\): \(f(5)=5^2-4(5)+1=25-20+1=6\). Thus the maximum is \(6\), attained at \(x=5\), and the minimum is \(-3\), attained at \(x=2\). The theorem guarantees attainment; the algebra identifies the points and values in this example.

Worked Example: A Rational Function on a Closed Interval

Let \(f(x)=\frac{1}{1+x^2}\) on \([-2,3]\). The interval is compact by the Heine-Borel Theorem. The denominator satisfies \(1+x^2\geq1>0\) for every real \(x\), so the function is defined and continuous throughout the interval. The Extreme Value Theorem therefore guarantees both a maximum and a minimum.

On \([-2,3]\), we have \(0\leq x^2\leq9\). Hence \(1\leq1+x^2\leq10\). Taking reciprocals of these positive quantities gives \(\frac{1}{10}\leq\frac{1}{1+x^2}\leq1\). The upper bound is attained at \(x=0\), since \(f(0)=1/(1+0^2)=1\). The lower bound is attained at \(x=3\), since \(f(3)=1/(1+3^2)=1/10\). Thus the maximum is \(1\) and the minimum is \(1/10\).

This example shows that the maximum and minimum need not occur at opposite endpoints. The theorem promises that suitable points exist somewhere in the interval; locating them may require additional information about the function.

Worked Example: Extremes on a Compact Set That Is Not an Interval

Let \(K=\{-2,0,3\}\) and \(f(x)=x^2-x\) for \(x\in K\). A finite set is compact: from any open cover, choose one covering set for each of its finitely many points, giving a finite subcover. The function is the restriction of a polynomial, so it is continuous on \(K\). The Extreme Value Theorem applies even though \(K\) is not an interval.

Direct substitution gives \(f(-2)=(-2)^2-(-2)=4+2=6\), \(f(0)=0^2-0=0\), and \(f(3)=3^2-3=9-3=6\). These are all the values of \(f\) on \(K\). Consequently, the minimum is \(0\), attained at \(x=0\), and the maximum is \(6\), attained at both \(x=-2\) and \(x=3\).

A maximum or minimum need not be attained at a unique point. The theorem asserts the existence of at least one point for each extreme value, not uniqueness.

Applying the Theorem to Closed Intervals

Corollary (Extreme Value Theorem on a Closed Interval): If \(a\leq b\) and \(f:[a,b]\to\mathbb R\) is continuous, then there are \(x_{\min},x_{\max}\in[a,b]\) such that \(f(x_{\min})\leq f(x)\leq f(x_{\max})\) for every \(x\in[a,b]\).

Proof. The interval \([a,b]\) is closed and bounded, including when \(a=b\). By the Heine-Borel Theorem, it is compact. It is nonempty because \(a\in[a,b]\). Apply the Extreme Value Theorem with \(K=[a,b]\). It gives points \(x_{\min},x_{\max}\in[a,b]\) attaining the minimum and maximum, respectively. Combining the two inequalities gives the stated conclusion. \(\square\)

When \(a=b\), the interval has just one point. Both extremes are attained there, and the conclusion remains valid. Including this case avoids relying on a hidden assumption that the interval has positive length.

Why the Hypotheses Matter

Compactness and continuity have distinct jobs. Compactness supplies convergent subsequences whose limits remain in the domain. Continuity transfers convergence of inputs to convergence of function values. The proof uses both: without compactness, a sequence approaching the supremum might escape the domain; without continuity, a convergent sequence of inputs need not have function values converging to the value at its limit.

For example, \(f(x)=x\) is continuous on the noncompact interval \((0,1)\), but has no maximum there. Every value is less than \(1\), and values can be chosen arbitrarily close to \(1\), so \(\sup f((0,1))=1\); however, \(1\notin(0,1)\). It also has no minimum, since its infimum is \(0\), which is not in the domain. This does not contradict the theorem: the domain is not compact.

Another common error is to confuse boundedness with attainment. A bounded set of values has a supremum and an infimum, but either can fail to be a value of the function. The maximizing-sequence argument is the step that closes this gap. A reliable proof checks that the domain is nonempty and compact, verifies continuity, and then uses compactness to obtain a limit point for a sequence approaching the relevant bound.

1
Check the domain.
Confirm that it is nonempty and compact; for a closed interval in \(\mathbb R\), use the Heine-Borel Theorem.
2
Check continuity.
Continuity is what will identify the limit of function values with the function value at the limit point.
3
Approach the supremum.
Choose inputs whose values lie within \(1/n\) of the supremum, then take a convergent subsequence.
4
Handle the minimum.
Apply the maximum argument to the continuous function \(-f\), then reverse the inequality.

Check Your Understanding

Use the proof and examples above to answer the following questions.

  1. Why must the function values be bounded before their supremum can be used in the proof?
  2. How does sequential compactness ensure that the limit of the selected subsequence belongs to the domain?
  3. Why do the inequalities \(s-\frac{1}{n}<f(x_n)\leq s\) imply that the selected function values approach \(s\)?
  4. How does applying the maximum result to \(-f\) establish that \(f\) attains a minimum?
  5. Why does the function \(f(x)=x\) on \((0,1)\) not contradict the Extreme Value Theorem?