Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The Riemann–Stieltjes integral ∫abf dα\int_a^b f\,d\alpha∫ab​fdα

Definition
Rudin_ch06_stieltjes

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

analysisintegration

Rudin's Definitions 6.1–6.3, formalized. A partition of [a,b][a,b][a,b] is a finite increasing list a=x0≤x1≤⋯≤xn=ba = x_0 \le x_1 \le \dots \le x_n = ba=x0​≤x1​≤⋯≤xn​=b; for a bounded fff and a monotonically increasing integrator α\alphaα the upper and lower sums are U(P,f,α)=∑iMiΔαiU(P,f,\alpha) = \sum_i M_i \Delta\alpha_iU(P,f,α)=∑i​Mi​Δαi​ and L(P,f,α)=∑imiΔαiL(P,f,\alpha) = \sum_i m_i \Delta\alpha_iL(P,f,α)=∑i​mi​Δαi​, with MiM_iMi​ and mim_imi​ the supremum and infimum of fff on the iii-th subinterval and Δαi=α(xi)−α(xi−1)\Delta\alpha_i = \alpha(x_i) - \alpha(x_{i-1})Δαi​=α(xi​)−α(xi−1​). The upper and lower integrals are the infimum of UUU and the supremum of LLL over all partitions; fff is integrable with respect to α\alphaα when they coincide, and ∫abf dα\int_a^b f\,d\alpha∫ab​fdα is the common value. The case α(x)=x\alpha(x) = xα(x)=x is the Riemann integral. Mathlib has no Riemann–Stieltjes integral, so this construction is new; the suprema and infima are the usual real ones, which return 000 on unbounded sets, so the theorems below state Rudin's boundedness hypotheses explicitly.

Definition code
import Mathlib

/-!
# Rudin, Chapter 6 — the Riemann–Stieltjes integral

Definitions transcribed from Walter Rudin, *Principles of Mathematical Analysis*, 3rd edition,
Chapter 6 (Definitions 6.1, 6.2, 6.3).

Mathlib has the Bochner and interval integrals, but no Riemann–Stieltjes integral
`∫ f dα` for a monotonically increasing integrator `α`, which is the object Chapter 6 is about;
it is therefore built here from Rudin's definitions: partitions, upper and lower sums, upper and
lower integrals, and integrability as their equality.  Taking `α x = x` recovers the Riemann
integral, as Rudin notes, and `Rudin.RiemannIntegrable` is that special case.

All suprema and infima are Mathlib's `sSup`/`sInf` on `ℝ`, which return `0` for sets that are
empty or unbounded; every statement about these notions therefore carries the boundedness
hypotheses Rudin states.
-/

namespace Rudin

/-- Rudin, Definition 6.1: a **partition** of `[a, b]` is a finite set of points
`a = x₀ ≤ x₁ ≤ ⋯ ≤ xₙ = b`, recorded here as the number `n` of subintervals together with the
(monotone) placement function `x`. -/
structure Partition (a b : ℝ) where
  /-- The number of subintervals of the partition. -/
  n : ℕ
  /-- The division points; only the values at `0, 1, …, n` matter. -/
  x : ℕ → ℝ
  /-- The partition starts at `a`. -/
  first : x 0 = a
  /-- The partition ends at `b`. -/
  last : x n = b
  /-- The division points increase. -/
  mono : ∀ i < n, x i ≤ x (i + 1)

/-- Rudin, Definition 6.3: `P'` is a **refinement** of `P` if every division point of `P` is
also a division point of `P'`. -/
def Refines {a b : ℝ} (P' P : Partition a b) : Prop :=
  ∀ i ≤ P.n, ∃ j ≤ P'.n, P'.x j = P.x i

/-- Rudin, Definition 6.2: the upper sum `U(P, f, α) = ∑ Mᵢ Δαᵢ`, where `Mᵢ` is the supremum of
`f` on the `i`-th subinterval. -/
noncomputable def upperSum {a b : ℝ} (f α : ℝ → ℝ) (P : Partition a b) : ℝ :=
  ∑ i ∈ Finset.range P.n,
    sSup (f '' Set.Icc (P.x i) (P.x (i + 1))) * (α (P.x (i + 1)) - α (P.x i))

/-- Rudin, Definition 6.2: the lower sum `L(P, f, α) = ∑ mᵢ Δαᵢ`, where `mᵢ` is the infimum of
`f` on the `i`-th subinterval. -/
noncomputable def lowerSum {a b : ℝ} (f α : ℝ → ℝ) (P : Partition a b) : ℝ :=
  ∑ i ∈ Finset.range P.n,
    sInf (f '' Set.Icc (P.x i) (P.x (i + 1))) * (α (P.x (i + 1)) - α (P.x i))

/-- Rudin, Definition 6.2, equation (5): the **upper integral** `inf_P U(P, f, α)`. -/
noncomputable def upperIntegral (a b : ℝ) (f α : ℝ → ℝ) : ℝ :=
  sInf {y : ℝ | ∃ P : Partition a b, y = upperSum f α P}

/-- Rudin, Definition 6.2, equation (6): the **lower integral** `sup_P L(P, f, α)`. -/
noncomputable def lowerIntegral (a b : ℝ) (f α : ℝ → ℝ) : ℝ :=
  sSup {y : ℝ | ∃ P : Partition a b, y = lowerSum f α P}

/-- Rudin, Definition 6.2: `f ∈ ℛ(α)` on `[a, b]`, i.e. the upper and lower integrals agree. -/
def RSIntegrable (a b : ℝ) (f α : ℝ → ℝ) : Prop :=
  upperIntegral a b f α = lowerIntegral a b f α

/-- Rudin, Definition 6.2, equation (7): the Riemann–Stieltjes integral `∫ₐᵇ f dα`, defined as
the common value of the upper and lower integrals when `f ∈ ℛ(α)` (and as the upper integral
otherwise). -/
noncomputable def RSIntegral (a b : ℝ) (f α : ℝ → ℝ) : ℝ :=
  upperIntegral a b f α

/-- Rudin, Definition 6.1: `f ∈ ℛ` on `[a, b]`, the Riemann-integrable case `α x = x`. -/
def RiemannIntegrable (a b : ℝ) (f : ℝ → ℝ) : Prop :=
  RSIntegrable a b f id

/-- The Riemann integral `∫ₐᵇ f dx`, the case `α x = x` of `Rudin.RSIntegral`. -/
noncomputable def RiemannIntegral (a b : ℝ) (f : ℝ → ℝ) : ℝ :=
  RSIntegral a b f id

end Rudin
Source
Walter Rudin, Principles of Mathematical Analysis, 3rd edition, McGraw-Hill, 1976, Chapter 6, pp. 120-122, Definitions 6.1, 6.2, 6.3
Read-back

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

A bundle of definitions building an integral of a function f:R→Rf : \mathbb{R}\to\mathbb{R}f:R→R against an integrator α:R→R\alpha : \mathbb{R}\to\mathbb{R}α:R→R over [a,b][a,b][a,b].

Partition. For reals a,ba,ba,b, a partition of [a,b][a,b][a,b] is a record consisting of: a natural number nnn; a function x:N→Rx : \mathbb{N} \to \mathbb{R}x:N→R; proofs that x0=ax_0 = ax0​=a, that xn=bx_n = bxn​=b, and that xi≤xi+1x_i \le x_{i+1}xi​≤xi+1​ for every i<ni < ni<n. Only the values x0,…,xnx_0,\dots,x_nx0​,…,xn​ are constrained; xix_ixi​ for i>ni > ni>n is unconstrained data. The increase is non-strict, so repeated points are allowed. The case n=0n = 0n=0 is permitted and forces a=ba = ba=b; conversely, if a>ba > ba>b no partition exists at all.

Refinement. P′P'P′ refines PPP (both partitions of the same [a,b][a,b][a,b]) means: for every i≤P.ni \le P.ni≤P.n there is j≤P′.nj \le P'.nj≤P′.n with xj′=xix'_j = x_ixj′​=xi​ — every division point of PPP occurs among the division points of P′P'P′, as a value. Nothing requires P′P'P′ to have more points or the indices to be related.

Upper and lower sums. For a partition PPP with nnn subintervals,

U(P,f,α)=∑i=0n−1(sup⁡f([xi,xi+1]))(α(xi+1)−α(xi)),L(P,f,α)=∑i=0n−1(inf⁡f([xi,xi+1]))(α(xi+1)−α(xi)),U(P,f,\alpha) = \sum_{i=0}^{n-1} \Bigl(\sup f\bigl([x_i,x_{i+1}]\bigr)\Bigr)\bigl(\alpha(x_{i+1}) - \alpha(x_i)\bigr), \qquad L(P,f,\alpha) = \sum_{i=0}^{n-1} \Bigl(\inf f\bigl([x_i,x_{i+1}]\bigr)\Bigr)\bigl(\alpha(x_{i+1}) - \alpha(x_i)\bigr),U(P,f,α)=i=0∑n−1​(supf([xi​,xi+1​]))(α(xi+1​)−α(xi​)),L(P,f,α)=i=0∑n−1​(inff([xi​,xi+1​]))(α(xi+1​)−α(xi​)),

the supremum and infimum being the real ones, which by convention return 000 when the set of values is empty or unbounded in the relevant direction. The subintervals are the closed intervals [xi,xi+1][x_i, x_{i+1}][xi​,xi+1​].

Upper and lower integrals. ∫ab‾f dα=inf⁡{ U(P,f,α):P a partition of [a,b] }\overline{\int_a^b} f\,d\alpha = \inf\{\, U(P,f,\alpha) : P \text{ a partition of } [a,b] \,\}∫ab​​fdα=inf{U(P,f,α):P a partition of [a,b]} and ∫ab‾f dα=sup⁡{ L(P,f,α):P }\underline{\int_a^b} f\,d\alpha = \sup\{\, L(P,f,\alpha) : P \,\}∫ab​​fdα=sup{L(P,f,α):P}, again with the convention that an empty or unbounded set of values yields 000.

Integrability and the integral. fff is Riemann–Stieltjes integrable with respect to α\alphaα on [a,b][a,b][a,b] exactly when these two numbers are equal. The value ∫abf dα\int_a^b f\,d\alpha∫ab​fdα is defined to be the upper integral, unconditionally — for non-integrable fff it therefore still denotes the upper integral rather than being undefined.

Riemann case. fff is Riemann integrable on [a,b][a,b][a,b] means it is Riemann–Stieltjes integrable with integrator the identity function α(x)=x\alpha(x) = xα(x)=x, and the Riemann integral is the corresponding value, i.e. again the upper integral with α=id\alpha = \mathrm{id}α=id.

These are definitions only; nothing is asserted about them here.

Human review
  • Endorsed by Community (Bot) · Sep 14, 2026

  • Endorsed by LG · Sep 14, 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