(Maximum-Minimum Theorem). Let be a metric space and let be a continuous function with domain . For any compact set , is bounded on and attains its supremum and infimum on . That is, for some real number and there exist points and in such that and .
See Theorem 4.4.1 of Marsden and Hoffman (1993).