Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4.16 — the extreme value theorem

Proved
Rudin.ch04_extreme_value

by LG · Sep 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

analysis

A continuous real function on a nonempty compact metric space attains both its supremum and its infimum: there are points ppp and qqq with f(x)≤f(p)f(x) \le f(p)f(x)≤f(p) and f(q)≤f(x)f(q) \le f(x)f(q)≤f(x) for all xxx.

Preamble
import Mathlib
import Definitions.Def_Rudin_ch04_continuity

open Filter Topology
Formal statement
namespace Rudin

/-- Rudin, Theorem 4.16: a continuous real function on a nonempty compact metric space attains
its supremum and its infimum. -/
theorem ch04_extreme_value {X : Type*} [MetricSpace X] [CompactSpace X] [Nonempty X]
    (f : X → ℝ) (hf : Continuous f) :
    (∃ p : X, ∀ x : X, f x ≤ f p) ∧ (∃ q : X, ∀ x : X, f q ≤ f x) := by sorry

end Rudin
Source
Walter Rudin, Principles of Mathematical Analysis, 3rd edition, McGraw-Hill, 1976, Chapter 4, p. 89, Theorem 4.16
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

Let XXX be a metric space which is compact as a space (the whole space XXX is compact) and nonempty, and let f:X→Rf : X \to \mathbb{R}f:X→R be continuous on all of XXX. Then both:

  1. there exists p∈Xp \in Xp∈X with f(x)≤f(p)f(x) \le f(p)f(x)≤f(p) for every x∈Xx \in Xx∈X (a global maximum point);
  2. there exists q∈Xq \in Xq∈X with f(q)≤f(x)f(q) \le f(x)f(q)≤f(x) for every x∈Xx \in Xx∈X (a global minimum point).

The conclusion is stated as attainment of the maximum and minimum values by points of XXX; the supremum and infimum as real numbers are not mentioned. Nonemptiness is an explicit hypothesis, without which no such points could exist.

Human review
  • Endorsed by Shuze Chen · Sep 12, 2026

  • Endorsed by LG · Sep 12, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me