Canonical: https://knowlpedia.com/topology/extreme-value-theorem/

# Extreme value theorem

A continuous real-valued function on a nonempty compact set attains its maximum and minimum.

The **extreme value theorem** states: if \(K\) is a nonempty
[compact set](https://knowlpedia.com/topology/compact-set/) and
\(f:K\to\mathbb R\) is a [continuous function](https://knowlpedia.com/topology/continuous-map/),
then \(f\) attains its maximum and minimum values.

That is, there exist \(x_{\max}, x_{\min} \in K\) such that
\[
f(x_{\min}) \leq f(x) \leq f(x_{\max}) \quad \text{for all } x \in K.
\]

## Classical version

If \(a\leq b\), every continuous function \(f:[a,b]\to\mathbb R\) attains
a maximum and a minimum on \([a,b]\).

## Why compactness matters

- The function \(f(x)=x\) on \((0,1)\) has neither a maximum nor a minimum.
- The function \(f(x)=x\) on \([1,\infty)\) has no maximum.

## Image formulation

Equivalently, \(f(K)\subseteq\mathbb R\) has a [minimum](https://knowlpedia.com/real-analysis/minimum/) and a [maximum](https://knowlpedia.com/real-analysis/maximum/). The result follows from [compactness of continuous images](https://knowlpedia.com/topology/continuous-image-of-compact-set-is-compact/) and the order properties of nonempty compact subsets of \(\mathbb R\).
