Mathlib theorem · Existing formal mathematics

Existing in Mathlib · Analysis and topology

Stone–Weierstrass Theorem

On a compact space, a real algebra of continuous functions that can distinguish every pair of points can approximate every continuous real-valued target as closely as desired in uniform distance.

Exact theorem

Exact Mathlib statement

theorem ContinuousMap.subalgebra_topologicalClosure_eq_top_of_separatesPoints {X : Type*} [TopologicalSpace X] [CompactSpace X] (A : Subalgebra ℝ C(X, ℝ)) (w : A.SeparatesPoints) : A.topologicalClosure = ⊤

The theorem at a glance

Stone–Weierstrass Theorem at a glance

A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.

A point-separating real subalgebra is uniformly dense in the continuous real-valued functions on a compact space. Explanatory diagram.
Detailed visual description

The poster presents the exact compact real-valued theorem and the four checked movements from absolute-value closure through finite lattice patching to uniform approximation, without claiming a rate or complex version.

Statement structure

Statement and scope

Statement map for Stone–Weierstrass TheoremA point-separating real subalgebra of continuous functions on a compact space is dense in the entire continuous-function algebra. Claim boundary: This target indexes Mathlib's real compact-space subalgebra theorem: a subalgebra of continuous real-valued functions that separates points has topological closure equal to the whole function algebra. It does not state the complex version or approximation rates. The pinned upstream declaration is ContinuousMap.subalgebra_topologicalClosure_eq_top_of_separatesPoints. The complete formal statement is available in the Exact Mathlib statement section.Mathematical readingA point-separating realsubalgebra of continuousfunctions on a compactspace is dense in theentirecontinuous-functionalgebra.Claim boundaryThis target indexesMathlib's realcompact-space subalgebratheorem: a subalgebra ofcontinuous real-valuedfunctions that separatespoints has topologicalclosure equal to thewhole function algebra.It does not state thecomplex version orapproximation rates.Pinned declarationmathlib ·ContinuousMap.subalgebra_topologicalClosure_eq_top_of_separatesPointsStatement map for Stone–Weierstrass TheoremA point-separating real subalgebra of continuous functions on a compact space is dense in the entire continuous-function algebra. Claim boundary: This target indexes Mathlib's real compact-space subalgebra theorem: a subalgebra of continuous real-valued functions that separates points has topological closure equal to the whole function algebra. It does not state the complex version or approximation rates. The pinned upstream declaration is ContinuousMap.subalgebra_topologicalClosure_eq_top_of_separatesPoints. The complete formal statement is available in the Exact Mathlib statement section.Mathematical readingA point-separating realsubalgebra of continuousfunctions on a compactspace is dense in theentirecontinuous-functionalgebra.Claim boundaryThis target indexesMathlib's realcompact-space subalgebratheorem: a subalgebra ofcontinuous real-valuedfunctions that separatespoints has topologicalclosure equal to thewhole function algebra.It does not state thecomplex version orapproximation rates.Pinned declarationmathlib ·ContinuousMap.subalgebra_topologicalClosure_eq_top_of_separatesPoints

Read the exact Mathlib declaration

This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.

Point separation, lattice closure, and compact finite patching produce uniform approximation of every real continuous target. Explanatory scientific diagram.
Detailed visual description

A fixed compact domain carries a target curve and a point-separating algebra. Absolute-value and finite lattice operations convert local approximants selected by compactness into a final curve that remains uniformly close to the target.

Why it matters

A mathematical landmark

Stone–Weierstrass turns a local ability to separate points into a global density theorem. It is a central bridge among algebra, topology, compactness, and approximation theory.

Proof architecture

From point separation to uniform approximation

4 curated stages

Mathlib's real Stone–Weierstrass route first places absolute values in the closure, uses them to obtain a function lattice, turns point separation into finitely many local approximants by compactness, and combines those patches into a uniform approximation of every continuous target.

These source-anchored stages explain the retained Mathlib proof route. They are generated explanations, not proof evidence or an extracted Lean proof-term dependency graph.

  1. Absolute value enters the topological closure

    Uniform polynomial approximation on the bounded range of a continuous function brings its pointwise absolute value into the closure.

    f ∈ A → |f| ∈ A.topologicalClosure

    For f in the subalgebra, compactness bounds its range. Weierstrass approximation on the resulting real interval approximates the absolute-value function by polynomials; evaluating those polynomials at f shows |f| belongs to A.topologicalClosure.

  2. The closure is stable under pointwise maxima and minima

    Combining addition, subtraction, and absolute value turns the closed subalgebra into a sublattice of continuous functions.

    f,g ∈ closure(A) → f ⊔ g, f ⊓ g ∈ closure(A)

    The checked route uses the familiar identities expressing pointwise supremum and infimum through sums, differences, and absolute values. Because the topological closure is a subalgebra containing these absolute values, it contains both lattice operations.

  3. Pairwise interpolants become finite global envelopes

    Point separation creates functions matching a target at chosen points; compactness reduces their neighborhoods to finite covers.

    finite suprema and infima from compact subcovers

    For points x and y, strong point separation supplies a function agreeing with the target at both points. Continuity keeps it close on neighborhoods. Compactness selects finitely many such patches. Finite suprema produce functions above the target minus the error while still anchored at a chosen point; a second finite cover prepares the final infimum.

  4. A finite infimum closes the uniform error band

    The final finite infimum stays between the target minus and plus the chosen error everywhere, so every continuous function lies in the closure.

    A.topologicalClosure = ⊤

    The source verifies the two pointwise inequalities for the finite infimum k, obtaining uniform distance below the prescribed positive error. Applying this density result to L = A.topologicalClosure, which is nonempty, lattice-closed, and point-separating, proves that the closure is the entire real continuous-function algebra.

ProofAtlas record

What has been checked

Upstream indexedPinned source bytes verified locally
Locally reproducedExact upstream declaration replayed
Reviewed pageCurrent public presentation reviewed
Accepted Atlas resultNot recorded for the preferred artifact

Mathlib is the source of the theorem; the local Lean replay and page review are separate.

Claim boundary

No new theorem is claimed

This target indexes Mathlib's real compact-space subalgebra theorem: a subalgebra of continuous real-valued functions that separates points has topological closure equal to the whole function algebra. It does not state the complex version or approximation rates.

Source and local evidence

Where the theorem comes from

Existing declaration
ContinuousMap.subalgebra_topologicalClosure_eq_top_of_separatesPoints in mathlib
Relationship
The checked artifact is the upstream declaration itself
Local Lean evidence
artifact.library.mathlib.stone-weierstrass-theorem.v001
Source
Open the pinned upstream reference