In calculus, the extreme value theorem states that if a real-valued functionis bounded on that interval; that is, there exist real numbersIn a formulation due to Karl Weierstrass, this theorem states that a continuous function from a non-empty compact space to a subset of the real numbers attains a maximum and a minimum.The extreme value theorem was originally proven by Bernard Bolzano in the 1830s in a work Function Theory but the work remained unpublished until 1930.Bolzano's proof consisted of showing that a continuous function on a closed interval was bounded, and then showing that the function attained a maximum and a minimum value.[1] The following examples show why the function domain must be closed and bounded in order for the theorem to apply.in the last two examples shows that both theorems require continuity onis said to be compact if it has the following property: from every collection of open setsThis is usually stated in short as "every open cover ofThe Heine–Borel theorem asserts that a subset of the real line is compact if and only if it is both closed and bounded.Correspondingly, a metric space has the Heine–Borel property if every closed and bounded set is also compact.The concept of a continuous function can likewise be generalized.Given these definitions, continuous functions can be shown to preserve compactness:[2] Theorem — Ifattains its supremum and infimum on any (nonempty) compact setSlightly more generally, this is also true for an upper semicontinuous function., the existence of the lower bound and the result for the minimum ofAlso note that everything in the proof is done within the context of the real numbers.is bounded, the Bolzano–Weierstrass theorem implies that there exists a convergent subsequenceis an interval of non-zero length, closed at its left end byTherefore, there must be a point x in [a, b] such that f(x) = M. ∎ In the setting of non-standard calculus, let N be an infinite hyperinteger.Consider its partition into N subintervals of equal infinitesimal length 1/N, with partition points xi = i /N as i "runs" from 0 to N. The function ƒ is also naturally extended to a function ƒ* defined on the hyperreals between 0 and 1.An arbitrary real point x lies in a suitable sub-interval of the partition, namelyand by the completeness property of the real numbers has a supremum inis a non-empty interval, closed at its left end byand consider the following two cases: If the continuity of the function f is weakened to semi-continuity, then the corresponding half of the boundedness theorem and the extreme value theorem hold and the values –∞ or +∞, respectively, from the extended real number line can be allowed as possible values.Theorem — If a function f : [a, b] → [–∞, ∞) is upper semi-continuous, then f is bounded above and attains its supremum.In the proof of the boundedness theorem, the upper semi-continuity of f at x only implies that the limit superior of the subsequence {f(xnk)} is bounded above by f(x) < ∞, but that is enough to obtain the contradiction.In the proof of the extreme value theorem, upper semi-continuity of f at d implies that the limit superior of the subsequence {f(dnk)} is bounded above by f(d), but this suffices to conclude that f(d) = M. ∎Theorem — If a function f : [a, b] → (–∞, ∞] is lower semi-continuous, then f is bounded below and attains its infimum.A real-valued function is upper as well as lower semi-continuous, if and only if it is continuous in the usual sense.