← All papers
First page of Stochastic order symbols form a ring that Lean verifies

Stochastic order symbols form a ring that Lean verifies

Carlos García Meixide

math.ST Nov 30, 2026 · v1
Formalizes in Lean 4/Mathlib the ring and ideal structure of stochastic order symbols and asymptotic linearity of M-estimators, about 1,700 lines with no sorry.
The calculus of stochastic order symbols is used on nearly every page of asymptotic statistics, yet it is invariably presented as a list of conveniences. We observe that it is the closure structure of an algebraic object: the stochastically bounded sequences form a commutative ring, the sequences vanishing in probability form an ideal of that ring, and every asymptotic equality between stochastically bounded sequences is an equality in the quotient ring. We then report what happened when this observation, and a standard application, asymptotic linearity of M-estimators as proved in a set of lecture notes on empirical process theory, were verified in the proof assistant Lean 4. We further show that risk bounds for finite samples are statements of membership in rate classes, which for positive rates are principal ideals, so that arguments composing such bounds, including the product rate condition of double machine learning, reduce to ideal arithmetic. In the formal development the closure rules are proved once, and the asymptotic arguments become chains of these rules. The complete development (approximately 1,700 lines, no unproved assertions) is publicly available.

The calculus of stochastic order symbols O_P(1) and o_P(1) is used throughout asymptotic statistics but is usually presented as a list of separate rules. A standard lecture-note proof of asymptotic linearity of M-estimators also omits a step that establishes the sqrt(n) rate.

Stochastically bounded sequences are shown to form a commutative ring, with sequences vanishing in probability as a proper ideal, so asymptotic equalities become equalities in the quotient ring. In Lean 4 on Mathlib, these are defined as a Subring and an Ideal of the ring of sequences of random variables, and all closure rules are derived from a single union-bound lemma. An auxiliary lemma supplies the omitted rate step without dividing by a possibly vanishing quantity. Finite-sample risk bounds are treated as membership in rate classes (principal ideals), including the product-rate condition of double machine learning.

About 1,700 lines of Lean with no sorry, depending only on Lean's three standard axioms, verify the ring and ideal structure, asymptotic linearity of M-estimators under van de Geer's score conditions, and the DML product-rate proposition. The ring, the ideal and the M-estimator theorem need no measurability hypotheses, because Mathlib measures are outer measures.