Let be an open cover of . Since is compact we can extract a finite subcover .
If any one of the 's equals then any will serve as a Lebesgue number.
Otherwise for each , let , note that is not empty, and define a function by .
Since is continuous on a compact set, it attains a minimum .
The key observation is that, since every is not contained in some , the extreme value theorem shows . Now we can verify that this is the desired Lebesgue number.
If is a subset of of diameter less than , then there exists such that , where denotes the ball of radius centered at (namely, one can choose as any point in ). Since there must exist at least one such that . But this means that and so, in particular, .