Tutorials › Real Analysis › Extreme Values on Compact Sets

Compactness · Tutorial 292 of 1000

Extreme Values on Compact Sets

See how compactness turns bounded function values into attained extreme values, and why a continuous positive function on a compact set stays uniformly above zero.

Intermediate 10 min read

What You'll Learn

  • Distinguish a supremum or infimum from an attained maximum or minimum
  • Prove the Extreme Value Theorem using compactness and approximating sequences
  • Find extrema on intervals and finite compact sets
  • Recognize why extrema need not be unique
  • Use a positive minimum to obtain a uniform lower bound
  • Identify what can fail when the domain is not compact

From Bounded Values to Attained Extremes

The previous tutorial established that a continuous function on a compact set is bounded. Boundedness says that the function values fit between some finite lower and upper bounds. It does not, by itself, say that either bound is a value the function actually takes. The stronger conclusion for compact domains is that a continuous function attains both its largest and smallest values.

The key step is to approach a supremum by a sequence of function values. Compactness supplies a convergent subsequence of the corresponding domain points, and continuity transfers that convergence to the function values. The limit point in the domain then realizes the supremum. The same reasoning gives the minimum.

Definition: Let \(K\subseteq\mathbb{R}\) and \(f:K\to\mathbb{R}\). A point \(x_{\max}\in K\) is a point of maximum of \(f\) on \(K\) if \(f(x)\leq f(x_{\max})\) for every \(x\in K\). The value \(f(x_{\max})\) is the maximum value of \(f\) on \(K\), denoted \(\max_{x\in K}f(x)\). A point of minimum and a minimum value, denoted \(\min_{x\in K}f(x)\), are defined by reversing the inequality. A maximum or minimum is an attained value: it must be equal to \(f(x)\) for some \(x\in K\).

For a nonempty bounded set of real numbers, the supremum and infimum exist by completeness of \(\mathbb{R}\). But they need not belong to the set. For instance, the set of values of \(f(x)=x\) on \((0,1)\) has supremum \(1\) and infimum \(0\), but neither is attained. The distinction between a least upper bound and a maximum is exactly what compactness will resolve.

The Extreme Value Theorem

We use two earlier results. The Compact Functions Are Bounded Theorem gives boundedness of the values of a continuous function on a compact set. The Compact Sets Are Sequentially Compact Theorem says that every sequence in a compact set has a subsequence converging to a point of that set. We also use the Sequential Preservation of Continuity Lemma: if points of the domain converge to a point where \(f\) is continuous, their function values converge to the function value at the limit.

Theorem (Extreme Value Theorem): Let \(K\subseteq\mathbb{R}\) be nonempty and compact, and let \(f:K\to\mathbb{R}\) be continuous. Then \(f\) attains both a maximum and a minimum on \(K\).

Proof. By the Compact Functions Are Bounded Theorem, \(f(K)\) is bounded and nonempty. Let \(S=\sup f(K)\). For each positive integer \(n\), the number \(S-1/n\) is not an upper bound for \(f(K)\); otherwise it would be an upper bound smaller than the least upper bound \(S\). Thus there is a point \(x_n\in K\) such that

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

The sequence \((x_n)\) lies in \(K\). By sequential compactness, it has a subsequence \((x_{n_k})\) converging to some \(x_{\max}\in K\). Continuity at \(x_{\max}\), together with the Sequential Preservation of Continuity Lemma, gives

$$ f(x_{n_k})\longrightarrow f(x_{\max}). $$

At the same time, the inequalities defining the sequence imply

$$ 0\leq S-f(x_{n_k})<\frac{1}{n_k}. $$

Since the indices \(n_k\) increase without bound, \(1/n_k\to0\), so \(f(x_{n_k})\to S\). Limits of real sequences are unique; hence \(f(x_{\max})=S\). As \(S\) is an upper bound for \(f(K)\), \(f(x)\leq f(x_{\max})\) for every \(x\in K\). Therefore \(f\) attains its maximum.

To obtain the minimum, apply the maximum result to the continuous function \(-f\) on \(K\). There is a point \(x_{\min}\in K\) at which \(-f\) has its maximum. Thus \(-f(x)\leq -f(x_{\min})\) for every \(x\in K\), which is equivalent to \(f(x)\geq f(x_{\min})\). So \(f\) attains its minimum as well. \(\square\)

The nonempty hypothesis matters: if \(K\) is empty, there is no point \(x_{\max}\) or \(x_{\min}\) in the domain. Compactness is also doing more than providing bounds. It ensures that the sequence chosen to approach the supremum has a subsequence whose limit remains inside \(K\), where the function is defined.

Worked Examples

Worked Example: A Quadratic with an Interior Maximum

Let \(K=[-1,3]\) and define \(f(x)=4-(x-1)^2\). The interval is compact, and the polynomial \(f\) is continuous, so the Extreme Value Theorem guarantees a maximum and a minimum. The bounds \(-1\leq x\leq3\) give \(-2\leq x-1\leq2\), and therefore \(0\leq(x-1)^2\leq4\). It follows that

$$ 0\leq 4-(x-1)^2\leq4. $$

At \(x=1\), \(f(1)=4-(1-1)^2=4\), so the upper bound is attained and is the maximum. At the endpoints, \(f(-1)=4-(-2)^2=0\) and \(f(3)=4-2^2=0\), so the lower bound is attained and is the minimum. This example shows that an extremum need not occur at an endpoint: the maximum occurs at the interior point \(1\).

Worked Example: A Rational Function with Two Points of Maximum or Minimum

Consider \(g(x)=x/(1+x^2)\) on \(K=[-2,2]\). The denominator satisfies \(1+x^2\geq1\), so it never vanishes; consequently \(g\) is continuous on the compact interval. For any real \(x\), the square \((|x|-1)^2\) is nonnegative, which gives \(2|x|\leq1+x^2\). Dividing by the positive quantity \(2(1+x^2)\) yields

$$ \left|\frac{x}{1+x^2}\right|\leq\frac{1}{2}. $$

Thus \(-1/2\leq g(x)\leq1/2\) throughout \(K\). Direct substitution verifies equality at two points:

$$ g(1)=\frac{1}{1+1^2}=\frac{1}{2}, \qquad g(-1)=\frac{-1}{1+(-1)^2}=-\frac{1}{2}. $$

Therefore the maximum is \(1/2\) and the minimum is \(-1/2\). The two distinct points show that an extremum need not be unique. The Extreme Value Theorem guarantees the existence of extremal values, not a unique point where each value occurs.

Worked Example: Extrema on a Finite Compact Set

Let \(K=\{-4,-1,2,5\}\) and define \(h(x)=x^2-3x\). Every finite subset of \(\mathbb{R}\) is compact, and \(h\) is continuous. Evaluating at each point gives

$$ \begin{aligned} h(-4)&=(-4)^2-3(-4)=16+12=28,\\ h(-1)&=(-1)^2-3(-1)=1+3=4,\\ h(2)&=2^2-3(2)=4-6=-2,\\ h(5)&=5^2-3(5)=25-15=10. \end{aligned} $$

The image is \(h(K)=\{28,4,-2,10\}\). Comparing these four values shows that the maximum is \(28\), attained at \(-4\), and the minimum is \(-2\), attained at \(2\). On a finite set we can check every value directly; the theorem is especially useful when the compact domain has infinitely many points.

A Uniform Positive Lower Bound

Attainment of a minimum has a useful consequence: if a continuous function is positive at every point of a compact domain, then its values cannot approach zero without reaching a positive minimum. In particular, positivity at each point becomes a single lower bound that works throughout the domain.

Theorem (Positive Continuous Functions on Compact Sets Have a Positive Minimum): Let \(K\subseteq\mathbb{R}\) be compact, and let \(f:K\to\mathbb{R}\) be continuous with \(f(x)>0\) for every \(x\in K\). If \(K\neq\varnothing\), there is a number \(c>0\) such that \(f(x)\geq c\) for every \(x\in K\). If \(K=\varnothing\), the inequality holds vacuously for any \(c>0\).

Proof. If \(K=\varnothing\), take \(c=1\); there are no points at which the inequality could fail. Suppose now that \(K\neq\varnothing\). By the Extreme Value Theorem, \(f\) attains its minimum at some \(x_{\min}\in K\). Set \(c=f(x_{\min})\). The hypothesis says \(f(x_{\min})>0\), so \(c>0\). Since \(x_{\min}\) is a point of minimum, \(f(x)\geq f(x_{\min})=c\) for every \(x\in K\). This proves the claimed uniform lower bound. \(\square\)

For example, \(r(x)=2+x^2\) is positive and continuous on \([-3,1]\). Since \(x^2\geq0\), \(r(x)\geq2\), and equality occurs at \(x=0\), which belongs to the interval. The theorem explains why some positive constant works on the whole compact domain; the direct calculation identifies the best such constant in this example.

Why Compactness Matters

A continuous function on a noncompact set can be bounded without attaining its supremum or infimum. On \((0,1)\), the function \(f(x)=x\) is continuous and satisfies \(0<f(x)<1\). Its supremum is \(1\) and its infimum is \(0\), but there is no \(x\in(0,1)\) with \(f(x)=1\) or \(f(x)=0\). The missing endpoints are precisely the points that would realize these bounds. This does not contradict the Extreme Value Theorem, because \((0,1)\) is not compact.

A common pitfall is to conclude that a supremum is attained merely because the function is bounded. Boundedness gives a finite supremum, while attainment requires an argument that a suitable limiting point lies in the domain. In the proof, compactness supplies that point through a convergent subsequence, and continuity ensures its function value is the limiting extremal value.

Another important distinction is between an extremal value and an extremizing point. The maximum value and minimum value are unique as real numbers, but the points where they occur may not be unique, as the rational-function example demonstrates. The theorem guarantees at least one point for each extreme value; it makes no claim about how many such points there are.

The Extreme Value Theorem is a foundational consequence of compactness: local continuity, together with the global structure of a compact domain, ensures that the boundary values of the range are included. The positive-minimum result is one practical form of this principle. Whenever a continuous quantity is strictly positive on a compact set, it is bounded away from zero by one fixed positive number.

Check Your Understanding

Use the definitions and results in this tutorial to answer the following questions.

  1. What extra condition distinguishes a maximum from a supremum?
  2. In the proof of the Extreme Value Theorem, why can one choose \(x_n\in K\) with \(f(x_n)>S-1/n\)?
  3. Where does compactness enter the sequence-based proof, and where does continuity enter?
  4. Can a continuous function on a compact set attain its maximum at more than one point? Give an example from the tutorial.
  5. Why does a continuous function that is positive everywhere on a nonempty compact set have a uniform positive lower bound?
  6. Why does \(f(x)=x\) on \((0,1)\) not contradict the Extreme Value Theorem?