# An issue with Weierstrass theorem's proof (extreme value theorem)

I'm having some issues while I try to understand Weierstrass theorem's proof.

Theorem
If a real-valued function $f$ is continuous in the closed and bounded interval $[a,b]$, then $f$ must attain a maximum and a minimum, each at least once.

Proof
By the boundedness theorem, $f$ is bounded from above, hence, by the Dedekind-completeness of the real numbers, the least upper bound (supremum) $M$ of $f$ exists. It is necessary to find a $d$ in $[a,b]$ such that $\color{red}{M = f(d)}$. Let $n$ be a natural number. As $M$ is the least upper bound, $M – 1/n$ is not an upper bound for $f$. Therefore, there exists $d_n$ in $[a,b]$ so that $M – 1/n < f(d_n)$. This defines a sequence $\left\{d_n\right\}$. Since $M$ is an upper bound for $f$, we have $M – 1/n < f(d_n) ≤ M$ for all $n$. Therefore, the sequence $\left\{f(d_n)\right\}$ converges to $M$.

The Bolzano–Weierstrass theorem tells us that there exists a subsequence $\left\{d_{n_k}\right\}$, which converges to some $d$ and, as $[a,b]$ is closed, $d$ is in $[a,b]$. Since $f$ is continuous at $d$, the sequence $\left\{f(d_{n_k})\right\}$ converges to $f(d)$. But $\left\{f(d_{n_k})\right\}$ is a subsequence of $\left\{f(d_n)\right\}$ that converges to $M$, so $M = f(d)$. Therefore, $f$ attains its supremum $M$ at $d$.

(excerpted from Wikipedia)

My book has a similar proof, but it treats separately the cases $M \in \mathbb{R}$ and $M = +\infty$. But since $f$ is continuous on $[a, b]$ I can't think of an example in which $M$ would equal infinity. Is it really necessary to have two cases like that? If no, what is a simple argument that excludes the case $M \notin \mathbb{R}$?

• Perhaps your book hasn't yet proved the "boundedness theorem" and wants to establish that along the way? – Hoot Dec 29 '14 at 10:10
• @Hoot: Does the boundedness theorem exclude the case $M = +\infty$? I thought that it said that every continuous function on a closed interval had a supremum, without specifying its nature. – rubik Dec 29 '14 at 10:11
• @rubik: which statement are you referring to? (The one from Wikipedia, again does state the bounds are real.) – Clement C. Dec 29 '14 at 10:22
• It wouldn't be much of a theorem in that case -- if you allow this $\sup_{x \in [a, b]} f(x)$ to formally be $+\infty$ then you don't need any conditions on $f$ to be able to write $\sup_{x \in [a, b]} f(x)$. I really suspect that the difference between your book and Wikipedia is one of organization of the material. – Hoot Dec 29 '14 at 22:47
• Can you give the title of your book ? – Tony Piccolo Dec 30 '14 at 0:12