Begin with eleven weights and make both cuts

Take the finite state space

\[ \Omega=\{0,1,\ldots,11\} \]

and advance one state cyclically:

\[ T(s)=s+1\pmod {12}. \]

Attach these nonnegative one-step weights:

state \(s\)01234567891011
\(w(s)\)251436271546

Interpret these integers as real weights.

Starting at state \(s\), define the finite process

\[ X_n(s)=\sum_{t=0}^{n-1}w(T^t s). \]

The zero-step sum is empty, so \(X_0(s)=0\). This process is additive:

\[ X_{m+k}(s)=X_m(s)+X_k(T^m s). \]

Every additive process is subadditive because equality implies the required upper bound. We use additivity only to make the example’s arithmetic exact. The project theorem assumes the weaker inequality.

If this finite space is given its uniform probability measure, every displayed finite-horizon function is integrable and the cyclic base preserves the measure. Probability is convenient for this model, not an assumption of the pointwise block theorems.

Choose:

\[ n=11, \qquad b=4. \]

Natural-number division gives:

\[ q=n/b=11/4=2, \qquad r=n\bmod b=11\bmod4=3. \]

The arithmetic identity is

\[ bq+r=4\cdot2+3=11. \]

The eleven observed weights from state zero are

\[ 2,\ 5,\ 1,\ 4,\ 3,\ 6,\ 2,\ 7,\ 1,\ 5,\ 4, \]

and their total is

\[ X_{11}(0)=40. \]

Orientation one: complete blocks first

Cut the horizon as

\[ 11=4+4+3. \]

The first block starts at state \(0\), the second at \(T^4(0)=4\), and the terminal remainder at \(T^8(0)=8\):

\[ \begin{aligned} X_4(0)&=2+5+1+4=12,\\ X_4(T^4 0)&=3+6+2+7=18,\\ X_3(T^8 0)&=1+5+4=10. \end{aligned} \]

Thus

\[ X_{11}(0)=12+18+10=40. \]

For a merely subadditive process, the checked theorem replaces this equality with \(\le\).

Orientation two: remainder first

The same natural number is also

\[ 11=3+4+4. \]

Now the three-step remainder stays at the original state, and the complete blocks begin at \(T^3(0)=3\):

\[ \begin{aligned} X_3(0)&=2+5+1=8,\\ X_4(T^3 0)&=4+3+6+2=15,\\ X_4(T^7 0)&=7+1+5+4=17. \end{aligned} \]

Again,

\[ X_{11}(0)=8+15+17=40. \]

The same eleven times were partitioned differently. The real summands may be written in any arithmetic order, but their starting states cannot be moved freely.

The eleven weights 2, 5, 1, 4, 3, 6, 2, 7, 1, 5, 4 total 40. Blocks first groups them into four-step sums 12 and 18 plus terminal three-step sum 10. Remainder first groups them into initial three-step sum 8 plus shifted four-step sums 15 and 17. Both exact totals are 40.
FigureFinding: quotient \(q=2\) and remainder \(r=3\) determine two valid temporal cuts. Blocks first samples the remainder after eight steps; remainder first begins the block orbit after three steps. Equality holds because this teaching process is additive. The checked general declarations prove upper bounds and contain no infinite-time conclusion.

The wrong shift fails numerically

Suppose we keep the two correct block sums \(12\) and \(18\) but evaluate the three-step terminal remainder back at the original state. That wrong term is \(X_3(0)=8\), not \(X_3(T^8 0)=10\). The proposed bound becomes

\[ 40\le12+18+8=38, \]

which is false.

The analogous wrong remainder-first calculation also fails. If the initial remainder is \(8\) but the two blocks incorrectly restart at states \(0\) and \(4\), the right side is

\[ 8+12+18=38. \]

Moving a remainder from one end of the horizon to the other changes the starting state of every later term. Shifted subadditivity records exactly that temporal information.

Time-zero boundary: subadditive does not mean normalized

Consider the constant process

\[ Y_n(s)=5 \]

for every horizon and state. It is subadditive:

\[ 5\le5+5. \]

On the same finite space with its uniform probability measure, every \(Y_n\) is integrable, so this process also fits the public candidate package.

But \(Y_0(s)=5\), not zero. With zero complete blocks, an exact-block estimate without a normalization premise would say

\[ Y_{b\cdot0}(s)\le \operatorname{birkhoffSum}(T^b,Y_b,0,s), \]

or

\[ 5\le0. \]

That is false. This is why the uniform exact-block theorem takes \(X_0=0\). The two remainder theorems do not need that premise: when the block count is zero, the remainder is the whole horizon and the inequality becomes reflexive.

Zero block length: valid but degenerate

Lean’s natural-number operations are total:

\[ 11/0=0, \qquad 11\bmod0=11. \]

At \(b=0\), the terminal quotient-and-remainder theorem reduces to

\[ X_{11}(s)\le0+X_{11}(s). \]

The statement remains true, but zero is not a useful coarse-graining scale. To claim that \(r=n\bmod b\) is strictly shorter than \(b\), one must add the separate premise \(b\gt0\).

The correct two orientations both give the true upper bound 40 less than or equal to 40. Reusing the original remainder gives only 38 and the false statement 40 less than or equal to 38. A quotient panel shows 11 divided by 4 equals 2 with remainder 3, while division by zero gives quotient 0 and remainder 11. A constant process equal to 5 shows why zero exact blocks require X zero equal to zero.
FigureFinding: three independent checks protect the theorem. Sample points must follow temporal order; positive block length is needed only for a genuinely short remainder; and a zero-count exact-block estimate needs \(X_0=0\). The finite integrability result later adds preservation of \(T^b\), but none of these checks introduces probability, ergodicity, or convergence.

Name the objects before climbing

Fix a measurable space \(\Omega\), a measure \(\mu\), a base map \(T:\Omega\to\Omega\), and a real process

\[ X:\mathbb N\to\Omega\to\mathbb R. \]
ObjectMathematicsLean
Horizon-\(n\) sample value\(X_n(\omega)\)X n ω
\(m\)-step base shift\(T^m\omega\)T^[m] ω
Block map\(T^b\)T^[b]
Block observable\(X_b\)X b
\(q\)-block finite sum\(\sum_{j=0}^{q-1}X_b(T^{bj}\omega)\)birkhoffSum (T^[b]) (X b) q ω
Quotient\(\lfloor n/b\rfloor\)n / b
Remainder\(n\bmod b\)n % b

The inherited structure

IsIntegrableSubadditiveProcessCandidate T μ X

stores exactly:

  1. Integrable (X k) μ for every finite \(k\); and
  2. the shifted subadditive inequality for every \(m,k,\omega\).

It does not store:

  • that \(\mu\) is a probability measure ;
  • that \(T\) preserves \(\mu\);
  • that \(T\) is ergodic ;
  • independence or mixing;
  • uniform control as \(n\) varies; or
  • any pointwise, almost-everywhere, or integrated limit.

The word “integrable” concerns each fixed finite function. It does not turn a finite family into an asymptotic theorem.

Choose a route up

RouteBegin withDestination
Concrete routeThe eleven weightsReproduce both exact block ledgers
Error routeThe wrong shiftSee a false upper bound caused by one misplaced sample
Algebra routeCamp oneFollow the directional split used by every helper
Sum routeCamp twoExpand the powered-map finite sum
Arithmetic routeCamp fourRead both quotient-and-remainder declarations
Boundary routeCamp fiveSeparate \(X_0\ge0\) from \(X_0=0\)
Analysis routeCamp sixIdentify the exact measure-preservation premise
Hands-on routeRun the worksheetExecute all arithmetic with Lean core and Std
Audit routeThe declaration mapMatch every public name to its assumptions

Learning objectives

By the summit, you should be able to:

  1. compute \(11/4=2\) and \(11\bmod4=3\);
  2. reproduce both exact \(40\)-unit ledgers;
  3. explain why their block starting states differ;
  4. reject the false \(40\le38\) unshifted bound;
  5. state shifted subadditivity with the later term at \(T^m\omega\);
  6. expand a finite Birkhoff sum along the powered map \(T^b\);
  7. derive the terminal-remainder inequality by induction on \(q\);
  8. derive the remainder-first inequality by one outer split;
  9. read both quotient-and-remainder identities;
  10. distinguish the valid \(b=0\) statement from a short-remainder claim;
  11. prove that subadditivity forces \(X_0\ge0\);
  12. explain why it does not force \(X_0=0\);
  13. identify which exact-block theorem avoids normalization by requiring \(q\ne0\);
  14. identify which exact-block theorem accepts all \(q\) by assuming \(X_0=0\);
  15. separate pointwise bounds from finite integrability;
  16. explain why the generic integrability theorem asks only that \(T^b\) preserve \(\mu\);
  17. distinguish measure preservation from probability and ergodicity;
  18. run the exact local worksheet;
  19. identify the three cocycle specializations and their assumptions; and
  20. list every asymptotic conclusion still absent.

Camp one: read shifted subadditivity in the correct order

The process package stores:

add_le : ∀ m k ω, X (m + k) ω ≤ X k (T^[m] ω) + X m ω

The early \(m\)-step value is \(X_m(\omega)\). The later \(k\)-step value restarts at \(T^m\omega\).

In Lean: split an early block from a later block

One idea, three languages Read across, then read the syntax map
A human says
Run m steps from omega, then measure the later k-step contribution from the environment reached after those m steps. The combined value is at most their sum.
On paper
\(X_{m+k}(\omega)\le X_k(T^m\omega)+X_m(\omega)\).
In Lean
hX.add_le m k ω
Syntax map
  • hX is evidence that \(X\) is an IsIntegrableSubadditiveProcessCandidate.
  • .add_le selects its shifted pointwise inequality field.
  • m + k is the combined natural horizon.
  • T^[m] is the \(m\)-fold function iterate of the base map.
  • X k (T^[m] ω) is the later value at the shifted sample.
  • X m ω is the early value at the original sample.
  • This field is pointwise algebra. Its type contains no probability, preservation, ergodicity, or limiting quantifier.

The source’s three private helpers read only this field. The public generic theorems are methods on the stronger package for convenience, but their pointwise proofs do not consume its integrable field.

Camp two: a Birkhoff sum is a finite container

Mathlib defines

\[ \operatorname{birkhoffSum}(F,g,q,\omega) =\sum_{j=0}^{q-1}g(F^j\omega). \]

In this chapter,

\[ F=T^b, \qquad g=X_b. \]

Therefore

\[ \begin{aligned} \operatorname{birkhoffSum}(T^b,X_b,q,\omega) &=\sum_{j=0}^{q-1}X_b((T^b)^j\omega)\\ &=\sum_{j=0}^{q-1}X_b(T^{bj}\omega). \end{aligned} \]

The sum is finite. At \(q=0\), its index set is empty and its value is zero.

In Lean: sample one block observable along the powered base

One idea, three languages Read across, then read the syntax map
A human says
Start at omega, advance the base by one whole block between samples, evaluate the b-step process each time, and add exactly q terms.
On paper
\(B_{b,q}(\omega)=\sum_{j=0}^{q-1}X_b(T^{bj}\omega)\).
In Lean
birkhoffSum (T^[b]) (X b) q ω
Syntax map
  • birkhoffSum is Mathlib’s finite-orbit sum.
  • T^[b] is the block map, not the original one-step map.
  • X b is the block observable, a function \(\Omega\to\mathbb R\).
  • q is the number of terms.
  • ω is the starting sample.
  • Iterating T^[b] \(j\) times reaches \(T^{bj}\omega\).
  • Nothing in this expression takes a limit or divides by \(q\).

Mathlib exposes two useful successor recurrences:

\[ \begin{aligned} \operatorname{birkhoffSum}(F,g,q+1,\omega) &=\operatorname{birkhoffSum}(F,g,q,\omega)+g(F^q\omega),\\ \operatorname{birkhoffSum}(F,g,q+1,\omega) &=g(\omega)+\operatorname{birkhoffSum}(F,g,q,F\omega). \end{aligned} \]

The private blocks-first induction uses the second orientation because it peels the first block and recurses from \(T^b\omega\).

Camp three: prove blocks first and leave the remainder last

The central private helper proves:

\[ X_{bq+r}(\omega) \le \operatorname{birkhoffSum}(T^b,X_b,q,\omega) +X_r((T^b)^q\omega). \]

Base case: \(q=0\)

The horizon is \(r\). The Birkhoff sum is empty and \((T^b)^0\omega=\omega\), so the goal reduces to

\[ X_r(\omega)\le0+X_r(\omega). \]

No claim about \(X_0\) is needed.

Successor step

For \(q+1\) blocks, arithmetic rewrites

\[ b(q+1)+r=b+(bq+r). \]

Shifted subadditivity peels the first full block:

\[ X_{b+(bq+r)}(\omega) \le X_{bq+r}(T^b\omega)+X_b(\omega). \]

Apply the induction hypothesis at \(T^b\omega\). Mathlib’s birkhoffSum_succ’ then packages the first block with the recursive sum, and the iterate successor identity moves the terminal remainder to the correct final state.

In Lean: invoke the terminal-remainder theorem

One idea, three languages Read across, then read the syntax map
A human says
Bound q complete b-step blocks from omega, then evaluate the r-step remainder after all q blocks have advanced the environment.
On paper
\(X_{bq+r}(\omega)\le\sum_{j=0}^{q-1}X_b(T^{bj}\omega)+X_r(T^{bq}\omega)\).
In Lean
hX.le_birkhoffSum_blocks_add_remainder b q r ω
Syntax map
  • b q r are arbitrary natural numbers.
  • b * q + r is the blocks-first horizon.
  • The Birkhoff term uses (T^[b]), (X b), and count q.
  • The terminal sample is written ((T^[b])^[q] ω) in the theorem statement.
  • This is \(T^{bq}\omega\), not the original ω.
  • No condition on X 0 occurs.
  • The proof uses shifted subadditivity only, despite the stronger receiver type of hX.

The opening example substitutes \(b=4,q=2,r=3,\omega=0\), producing the exact right side \(12+18+10\).

Camp four: let division choose q and r

For any naturals \(n,b\), the formal theorem states the total identity

\[ b(n/b)+(n\bmod b)=n. \]

Substituting \(q=n/b\) and \(r=n\bmod b\) into the terminal theorem gives:

In Lean: quotient form with the remainder last

One idea, three languages Read across, then read the syntax map
A human says
Let natural-number division choose the number of complete blocks and the leftover length, then use the blocks-first bound.
On paper
\(X_n(\omega)\le\sum_{j=0}^{n/b-1}X_b(T^{bj}\omega)+X_{n\bmod b}(T^{b(n/b)}\omega)\).
In Lean
hX.le_birkhoffSum_div_add_mod b n ω
Syntax map
  • n / b is the natural quotient.
  • n % b is the natural remainder.
  • Nat.div_add_mod supplies \(b(n/b)+(n\bmod b)=n\).
  • The short term is terminal and therefore evaluated after all complete blocks.
  • At b = 0, quotient zero and remainder n make this a reflexive inequality.
  • The strict fact n % b < b needs a positive block-length premise; this theorem does not need it for validity.

Remainder first

Commutativity of natural addition also gives

\[ n=(n\bmod b)+b(n/b). \]

But we cannot merely commute two real terms after proving the terminal formula. We must apply shifted subadditivity with the remainder as the early part. Complete blocks then start from \(T^{n\bmod b}\omega\).

In Lean: quotient form with the remainder first

One idea, three languages Read across, then read the syntax map
A human says
Take the leftover steps first at omega, then begin every complete block from the environment reached after that initial remainder.
On paper
\(X_n(\omega)\le X_{n\bmod b}(\omega)+\sum_{j=0}^{n/b-1}X_b(T^{n\bmod b+bj}\omega)\).
In Lean
hX.le_mod_add_birkhoffSum_div b n ω
Syntax map
  • X (n % b) ω keeps the remainder at the original sample.
  • T^[n % b] ω is the starting sample for the later block orbit.
  • The Birkhoff map remains T^[b].
  • The block count remains n / b.
  • Nat.mod_add_div supplies \((n\bmod b)+b(n/b)=n\).
  • No X 0 = 0 premise occurs, even when the quotient is zero.
  • For \(n=11,b=4\), the right side is \(8+15+17\).

The generic non-quotient declaration le_remainder_add_birkhoffSum_blocks takes explicit \(r,b,q\). The quotient declaration sets those values arithmetically.

Camp five: time zero needs its own ledger

Declaration 1: subadditivity forces nonnegativity

Set \(m=k=0\) in shifted subadditivity:

\[ X_0(\omega)\le X_0(\omega)+X_0(\omega). \]

Subtracting \(X_0(\omega)\) gives

\[ 0\le X_0(\omega). \]

The theorem zero_nonneg records this pointwise fact.

Declaration 2: nonpositive is equivalent to zero

Because subadditivity already gives \(X_0\ge0\),

\[ X_0=0 \quad\Longleftrightarrow\quad \forall\omega,\ X_0(\omega)\le0. \]

This is zero_eq_zero_iff_nonpos. The right-to-left direction combines the stored nonnegativity with the supplied nonpositivity.

Exact blocks with positive count

If \(q\ne0\), write \(q=q'+1\). The source proves

\[ X_{bq}(\omega) \le \operatorname{birkhoffSum}(T^b,X_b,q,\omega) \]

without assuming \(X_0=0\). A positive block count lets the helper represent an exact multiple using actual full blocks instead of an empty sum.

Exact blocks uniformly in \(q\)

To include \(q=0\), the source requires exact time-zero normalization.

In Lean: make the exact-block bound uniform

One idea, three languages Read across, then read the syntax map
A human says
If the zero-horizon process is exactly the zero function, then the complete-block bound is valid for every block count, including the empty count.
On paper
\(X_0=0\Longrightarrow X_{bq}(\omega)\le\sum_{j=0}^{q-1}X_b(T^{bj}\omega)\).
In Lean
hX.le_birkhoffSum_blocks_of_zero hX0 b q ω
Syntax map
  • hX0 : X 0 = 0 is equality of functions, not one sampled equality.
  • At q = 0, it rewrites the left side to zero.
  • The right side is the zero-term Birkhoff sum.
  • At q + 1, the proof uses the private positive-count helper and does not need hX0.
  • The theorem does not require b ≠ 0.
  • The constant-five process shows why hX0 cannot be erased from the uniform statement.

This is a good example of boundary-sensitive theorem design: expose a strong positive-count theorem and a convenient all-count theorem with the exact extra premise, rather than burdening every useful positive case.

Camp six: finite integrability needs the powered map

The pointwise inequalities above do not integrate anything. The generic integrability theorem starts from:

\[ \operatorname{Integrable}(X_b,\mu). \]

The \(j\)-th Birkhoff summand is

\[ X_b\circ(T^b)^j. \]

If \(T^b\) preserves \(\mu\), every iterate \((T^b)^j\) also preserves \(\mu\), so composition transports integrability. A finite sum of integrable functions is integrable.

In Lean: prove one finite block sum is integrable

One idea, three languages Read across, then read the syntax map
A human says
If the b-step base map preserves mu, then composing the integrable b-step observable with each finite block iterate preserves integrability, and their q-term sum is integrable.
On paper
\((T^b)_*\mu=\mu\Longrightarrow\operatorname{Integrable}(\sum_{j=0}^{q-1}X_b\circ(T^b)^j,\mu)\).
In Lean
hX.integrable_birkhoffSum_blocks b q hTb
Syntax map
  • hX.integrable b supplies integrability of the block observable.
  • hTb has type MeasurePreserving (T^[b]) μ μ.
  • hTb.iterate j proves that the \(j\)-fold block map preserves the same measure.
  • .integrable_comp_of_integrable transports the block observable’s integrability through that iterate.
  • integrable_finsetSum closes the finite sum.
  • The theorem does not ask that \(T\) itself preserve \(\mu\), only the map that actually appears in the sum.
  • It also does not ask for probability, ergodicity, or independence.

Preservation, probability, and ergodicity are different

A measure-preserving map satisfies \(F_*\mu=\mu\). It allows integrability to be pulled along its iterates.

A probability measure additionally has total mass one. This normalization is irrelevant to a finite sum’s integrability.

Ergodicity says invariant measurable events are trivial up to null sets. It is an asymptotic rigidity property and is also irrelevant to the finite integrability proof.

Even if \(T\) is ergodic, \(T^b\) need not be ergodic. The source avoids that false inference entirely: it asks only for preservation of \(T^b\), and the cocycle specialization obtains it from preservation of \(T\).

Finite integrability is not uniform integrability

For every fixed \(q\), the \(q\)-term block sum is integrable. This does not give a bound uniform in \(q\), a uniformly integrable family , or permission to pass a limit through an integral.

The matrix-cocycle specialization

Let \(C\) be the project’s one-sided discrete complex matrix cocycle and set

\[ X_n(\omega)= \log^+\lVert C(n,\omega)\rVert_\infty. \]

RMT-15 already proved:

  • the shifted subadditive inequality;
  • \(X_0=0\), including empty matrix dimension; and
  • finite-horizon integrability under the explicit one-step hypothesis HasIntegrableGeneratorLogPlus.

RMT-18 exports three cocycle declarations.

Exact block multiples

C.logPlusNormObservable (b * q) ω ≤
  birkhoffSum (C.base^[b])
    (C.logPlusNormObservable b) q ω

This pointwise inequality is uniform in \(q\), including zero, because the cocycle’s log-positive observable has the checked time-zero identity. It takes the cocycle directly and needs no integrability hypothesis.

Remainder-first quotient bound

C.logPlusNormObservable n ω ≤
  C.logPlusNormObservable (n % b) ω +
    birkhoffSum (C.base^[b])
      (C.logPlusNormObservable b) (n / b)
      (C.base^[n % b] ω)

This is also pointwise and hypothesis-free beyond the cocycle bundle. It uses the correct post-remainder starting sample.

Integrability of the finite block sum

hC.integrable_blockBirkhoffSum b q

Only this third declaration takes hC. It converts the finite log-positive family into the generic integrable subadditive candidate and uses

C.base_preserving.iterate b

to show that the powered block map preserves \(\mu\).

Empty matrix dimension

When the finite matrix index type is empty, every log-positive norm observable is zero. Both pointwise inequalities reduce to \(0\le0\), and the finite block sum is the zero function. No positive-dimension premise appears.

This is a genuine boundary theorem, not evidence about growth in a nonempty space.

Type the eleven-step ledger with Lean and Std

The exact project module uses Mathlib’s measurable spaces, integrability, function iterates, Birkhoff sums, and cocycles. The opening finite arithmetic can be checked without that dependency graph.

The worksheet below imports only Lean’s Std library. It implements the twelve-state base, the additive process, a finite block sum, both correct orientations, the wrong shift, the constant-five time-zero boundary, and Lean’s division-by-zero convention.

This is a bounded standalone tutorial. It is suitable for a normal macOS or Linux host and does not invoke Lake, Mathlib, or a project build.

Save the exact block below as /tmp/SubadditiveFiniteBlocksTutorial.lean:

import Std

namespace SubadditiveFiniteBlocksTutorial

def period : Nat := 12

def base (state : Nat) : Nat :=
  (state + 1) % period

def iterateBase : Nat → Nat → Nat
  | 0, state => state
  | steps + 1, state => iterateBase steps (base state)

def weight (state : Nat) : Nat :=
  match state % period with
  | 0 => 2
  | 1 => 5
  | 2 => 1
  | 3 => 4
  | 4 => 3
  | 5 => 6
  | 6 => 2
  | 7 => 7
  | 8 => 1
  | 9 => 5
  | 10 => 4
  | _ => 6

/-- An additive process, hence a concrete subadditive process. -/
def process : Nat → Nat → Nat
  | 0, _ => 0
  | steps + 1, state => weight state + process steps (base state)

/-- The finite Birkhoff sum of one block observable along the powered base. -/
def blockSum (X : Nat → Nat → Nat) (blockLength : Nat) :
    Nat → Nat → Nat
  | 0, _ => 0
  | blocks + 1, state =>
      X blockLength state +
        blockSum X blockLength blocks (iterateBase blockLength state)

def horizon : Nat := 11
def blockLength : Nat := 4
def blockCount : Nat := horizon / blockLength
def remainderLength : Nat := horizon % blockLength
def start : Nat := 0

def terminalRemainderTotal : Nat :=
  blockSum process blockLength blockCount start +
    process remainderLength
      (iterateBase (blockLength * blockCount) start)

def initialRemainderTotal : Nat :=
  process remainderLength start +
    blockSum process blockLength blockCount
      (iterateBase remainderLength start)

def wrongUnshiftedRemainderTotal : Nat :=
  blockSum process blockLength blockCount start +
    process remainderLength start

def constantProcess (_steps _state : Nat) : Nat := 5

#eval (blockCount, remainderLength,
  blockLength * blockCount + remainderLength)

#eval (List.range horizon).map fun t =>
  weight (iterateBase t start)

#eval [process horizon start,
  process blockLength start,
  process blockLength (iterateBase blockLength start),
  process remainderLength
    (iterateBase (blockLength * blockCount) start)]

#eval [process remainderLength start,
  process blockLength (iterateBase remainderLength start),
  process blockLength
    (iterateBase (remainderLength + blockLength) start)]

#eval [terminalRemainderTotal,
  initialRemainderTotal,
  wrongUnshiftedRemainderTotal]

#eval [decide (process horizon start ≤ terminalRemainderTotal),
  decide (process horizon start ≤ initialRemainderTotal),
  decide (process horizon start ≤ wrongUnshiftedRemainderTotal)]

#eval (process 0 start,
  constantProcess 0 start,
  decide (constantProcess (blockLength * 0) start ≤
    blockSum constantProcess blockLength 0 start))

#eval (horizon / 0, horizon % 0,
  decide (process horizon start ≤
    blockSum process 0 (horizon / 0) start +
      process (horizon % 0)
        (iterateBase (0 * (horizon / 0)) start)))

example : blockCount = 2 := by decide
example : remainderLength = 3 := by decide
example : process horizon start = 40 := by decide
example : terminalRemainderTotal = 40 := by decide
example : initialRemainderTotal = 40 := by decide
example : ¬ process horizon start ≤ wrongUnshiftedRemainderTotal := by decide
example : process 0 start = 0 := by decide
example : ¬ constantProcess (blockLength * 0) start ≤
    blockSum constantProcess blockLength 0 start := by decide

end SubadditiveFiniteBlocksTutorial

Type this command:

source "$HOME/.elan/env"
elan run leanprover/lean4:v4.32.0 lean \
  /tmp/SubadditiveFiniteBlocksTutorial.lean

The exact worksheet above was executed successfully with Lean 4.32.0 while editing this chapter. Its output was:

(2, 3, 11)
[2, 5, 1, 4, 3, 6, 2, 7, 1, 5, 4]
[40, 12, 18, 10]
[8, 15, 17]
[40, 40, 38]
[true, true, false]
(0, 5, false)
(0, 11, true)

Read the lines in order:

  1. quotient \(2\), remainder \(3\), and reconstructed horizon \(11\);
  2. the eleven one-step weights;
  3. total \(40\), two blocks \(12,18\), and terminal remainder \(10\);
  4. initial remainder \(8\) and shifted blocks \(15,17\);
  5. both correct totals \(40\) and the wrong-shift total \(38\);
  6. the two true upper bounds and the false \(40\le38\) proposal;
  7. the normalized additive process has \(X_0=0\), while the constant process has \(Y_0=5\) and fails the zero-count exact-block test; and
  8. at \(b=0\), quotient zero and remainder eleven produce a true reflexive bound.

The silent example declarations are kernel-checked proofs of the same finite facts.

This worksheet is a finite model, not the project theorem. It uses natural weights, one twelve-state cyclic base, hand-written recursion, and decidable concrete inequalities. It proves no result about arbitrary real processes, Mathlib Birkhoff sums, measurable spaces, integrability, preservation, matrix cocycles, or limits.

The complete twelve-declaration map

The module exposes twelve public declarations. Three private helpers support them but are not part of the public API.

#DeclarationMain inputExact role
1zero_nonneghX.add_leProves \(0\le X_0(\omega)\)
2zero_eq_zero_iff_nonposDeclaration 1Characterizes \(X_0=0\) by pointwise nonpositivity
3le_birkhoffSum_blocks_add_remainderShifted subadditivityBlocks first with terminal remainder
4le_birkhoffSum_div_add_modDeclaration 3 and Nat.div_add_modTerminal quotient-and-remainder form
5le_birkhoffSum_blocks_of_ne_zeroShifted subadditivity and \(q\ne0\)Exact blocks without time-zero normalization
6le_birkhoffSum_blocks_of_zeroShifted subadditivity and \(X_0=0\)Exact blocks uniformly including \(q=0\)
7le_remainder_add_birkhoffSum_blocksShifted subadditivityRemainder first with shifted blocks
8le_mod_add_birkhoffSum_divDeclaration 7 and Nat.mod_add_divRemainder-first quotient form
9integrable_birkhoffSum_blocksIntegrability of \(X_b\) and preservation of \(T^b\)Integrability of one fixed finite block sum
10logPlusNormObservable_nat_mul_le_birkhoffSumCocycle subadditivity and zero identityCocycle exact-multiple pointwise bound
11logPlusNormObservable_le_mod_add_blockBirkhoffSumCocycle subadditivityCocycle remainder-first quotient pointwise bound
12HasIntegrableGeneratorLogPlus.integrable_blockBirkhoffSumhC and stored base preservationCocycle finite block-sum integrability

The three private helpers are:

HelperProof job
le_birkhoffSum_blocks_add_remainder_of_add_leInducts on \(q\) for the terminal remainder
le_birkhoffSum_blocks_succ_of_add_leConverts the terminal helper with \(r=b\) into a positive exact-block count
le_remainder_add_birkhoffSum_blocks_of_add_leSplits the initial remainder and applies the positive exact-block helper afterward

Assumption ledger

Theorem familyShifted subadditivity\(X_0=0\)Finite integrability\(T^b\) preserves \(\mu\)ProbabilityErgodicity
Remainder bounds, declarations 3, 4, 7, 8YesNoNot used by proofNoNoNo
Positive-count exact blocks, declaration 5YesNoNot used by proofNoNoNo
All-count exact blocks, declaration 6YesYesNot used by proofNoNoNo
Generic finite-sum integrability, declaration 9Stored in receiver but unusedNoYesYesNoNo
Cocycle pointwise bounds, declarations 10–11From cocycleCocycle zero used only by declaration 10NoNoNoNo
Cocycle finite-sum integrability, declaration 12Packaged by hCNoFrom hCFrom stored base preservationNoNo

The generic pointwise methods have a receiver that stores integrability, but their proof bodies use only add_le. The page states that proof dependency explicitly while retaining the stronger receiver type of the public method.

Common wrong turns

Removing the base shift

The later \(k\)-step value starts at \(T^m\omega\). The opening \(40\le38\) failure shows that replacing it by the original sample can destroy the bound.

Using \(T\) instead of \(T^b\) in the block sum

Successive block observations are \(b\) one-step updates apart. The correct finite sum advances by the powered map.

Reversing function-iterate roles

(T^[b])^[q] means apply the \(b\)-step map \(q\) times. It reaches the same point as \(T^{bq}\), not \(T^{b+q}\).

Treating two orientations as one commutative rewrite

Real addition commutes, but sample points do not move with it. Remainder first requires shifting the block orbit by \(r\).

Requiring \(X_0=0\) for every remainder theorem

At \(q=0\), the remainder is the entire horizon. Both remainder bounds become reflexive without normalization.

Deleting \(X_0=0\) from the all-count exact-block theorem

The constant-five process is a counterexample at \(q=0\).

Saying \(n\bmod b\lt b\) at \(b=0\)

The strict remainder theorem needs \(b\gt0\). The project inequalities are total and valid at zero without claiming strict shortness.

Calling the remainder a uniformly bounded error

It has a shorter time length when \(b\gt0\). The module proves no numerical bound uniform over samples or block scales.

Pulling integrability through an arbitrary map

The composition step uses measure preservation of the powered map. Without a suitable nonsingularity or preservation hypothesis, an integrable observable can become nonintegrable after composition.

Assuming ergodicity passes to powers

Preservation passes from \(T\) to every \(T^b\). Ergodicity need not. The finite theorem asks only for the property it actually uses.

Reading finite integrability as convergence

An integrable sum for every fixed finite \(q\) is not a theorem about \(q\to\infty\), samplewise convergence, or exchange of limit and integral.

Calling log-positive blocking a Lyapunov theorem

The cocycle observable uses \(\log^+\), which erases contraction and singular collapse. Its finite block upper bound is not a signed growth exponent.

Exercises from first cut to theorem design

Trailhead

  1. Recompute the eleven weights from the cyclic base.
  2. Verify the blocks-first sums \(12,18,10\).
  3. Verify the remainder-first sums \(8,15,17\).
  4. Explain why the starting states are \(0,4,8\) in one orientation and \(0,3,7\) in the other.
  5. Reproduce both false \(38\)-unit calculations.
  6. Compute \(23/5\) and \(23\bmod5\), then sketch both temporal cuts.

Mid-mountain

  1. Expand birkhoffSum (T^[4]) (X 4) 2 0 term by term.
  2. Prove \((T^b)^q=T^{bq}\) on paper using function iteration.
  3. Derive the blocks-first helper by induction on \(q\).
  4. Derive the remainder-first helper by splitting \(r+bq\) once.
  5. Show that \(X_0\ge0\) follows from subadditivity.
  6. Give another subadditive process with \(X_0\gt0\).
  7. Explain why positive \(q\) avoids the empty-sum obstruction.
  8. Evaluate both quotient theorems at \(b=0\).

Summit

  1. Rewrite declaration 9 as an explicit finite sum and identify the integrability proof for each summand.
  2. Give a finite example where \(T^b\) preserves a measure even if no premise about \(T\) was supplied to the theorem.
  3. Explain why probability mass one is irrelevant to finite-sum integrability.
  4. Find an ergodic measure-preserving map whose square is not ergodic.
  5. State a uniform-integrability claim that declaration 9 does not prove.
  6. Design a later theorem that averages the block inequality over phases. List every new horizon-counting obligation.
  7. State a candidate almost-everywhere limit theorem and list the probability, preservation, ergodicity, and integrability assumptions separately.
  8. Explain why a signed Lyapunov exponent needs information discarded by \(\log^+\).

Inspect and check the exact project interfaces

Try it in the repository NonlinearDynamics/Random/RandomCocycles/SubadditiveFiniteBlocks.lean

The authoritative source is formalization/NonlinearDynamics/Random/RandomCocycles/SubadditiveFiniteBlocks.lean. For a full project check, install the repository’s pinned dependencies and put the following in a temporary project scratch file:

import NonlinearDynamics.Random.RandomCocycles.SubadditiveFiniteBlocks

open MeasureTheory
open NonlinearDynamics.Random.RandomCocycles

#check IsIntegrableSubadditiveProcessCandidate.zero_nonneg
#check IsIntegrableSubadditiveProcessCandidate.zero_eq_zero_iff_nonpos
#check IsIntegrableSubadditiveProcessCandidate.le_birkhoffSum_blocks_add_remainder
#check IsIntegrableSubadditiveProcessCandidate.le_birkhoffSum_div_add_mod
#check IsIntegrableSubadditiveProcessCandidate.le_birkhoffSum_blocks_of_ne_zero
#check IsIntegrableSubadditiveProcessCandidate.le_birkhoffSum_blocks_of_zero
#check IsIntegrableSubadditiveProcessCandidate.le_remainder_add_birkhoffSum_blocks
#check IsIntegrableSubadditiveProcessCandidate.le_mod_add_birkhoffSum_div
#check IsIntegrableSubadditiveProcessCandidate.integrable_birkhoffSum_blocks
#check DiscreteMatrixCocycle.logPlusNormObservable_nat_mul_le_birkhoffSum
#check DiscreteMatrixCocycle.logPlusNormObservable_le_mod_add_blockBirkhoffSum
#check DiscreteMatrixCocycle.HasIntegrableGeneratorLogPlus.integrable_blockBirkhoffSum

These commands inspect existing declaration types. They do not prove a Birkhoff theorem, Kingman’s theorem, samplewise convergence, or a Lyapunov exponent.

Immediately below this prose, the repository-check panel renders:

cd formalization
lake env lean NonlinearDynamics/Random/RandomCocycles/SubadditiveFiniteBlocks.lean

That exact Mathlib-backed check may require substantial disk space and memory.

Full project check, from the repository root
cd formalization
lake env lean -DwarningAsError=true NonlinearDynamics/Random/RandomCocycles/SubadditiveFiniteBlocks.lean

Resource note: this exact file uses the repository's pinned Lean and Mathlib dependencies. Initial project setup can require substantial disk space and build time. For a lightweight first step on macOS or Linux, use the page's standalone Lean-core or Std tutorial.

Passing either technical gate would not complete the pending human or Pro review.

What is established and what remains outside

TopicStatus in this module
\(X_0\ge0\) from shifted subadditivityProved pointwise
\(X_0=0\) characterized by nonpositivityProved
Blocks first plus terminal remainderProved for all natural parameters
Terminal quotient-and-remainder formProved, including reflexive \(b=0\)
Exact blocks with positive countProved without \(X_0=0\)
Exact blocks with arbitrary countProved under \(X_0=0\)
Remainder first plus shifted blocksProved without \(X_0=0\)
Remainder-first quotient formProved without \(X_0=0\)
Integrability of a fixed finite block sumProved when \(T^b\) preserves \(\mu\)
Cocycle exact-multiple pointwise boundProved without hC
Cocycle remainder-first quotient boundProved without hC
Cocycle finite block-sum integrabilityProved under hC
Probability normalizationNot required
Ergodicity or mixingNot required or proved
IndependenceNot required or proved
Positive block lengthNot required for validity; required for strict remainder shortness
Positive matrix dimensionNot required
Uniform remainder magnitudeNot bounded
Uniform integrability over all countsNot proved
Pointwise or almost-everywhere limitNot proved
Birkhoff or Kingman ergodic theoremNot invoked
Limit-integral interchangeNot attempted
Furstenberg-Kesten conclusionNot invoked
Signed Lyapunov exponent or spectrumNot defined or proved
Oseledets filtration or splittingNot invoked

The exact achievement is finite:

A long shifted-subadditive process value can be upper-bounded by repeated observations at one block scale plus one correctly shifted remainder. With preservation of the powered map, each fixed finite block sum is integrable.

No limit appears in that statement.

Where to continue

The Birkhoff sum glossary entry is the compact definition and powered-orbit reference for the finite sum used here.

Probability Normalization and Ergodic Rigidity Before Kingman is the immediate predecessor. It keeps probability and ergodicity separate from the finite process candidate.

Integrated Log-Positive Cocycle Growth and Its Deterministic Fekete Limit explains a distinct deterministic limit taken only after integrating out the sample variable.

Finite Blocks Before Limits: Birkhoff Bounds for Subadditive Cocycles in Lean is the paired Development Notebook entry.

Orbit-Majorant Centering for Subadditive Processes is the immediate finite successor.

Finite Phase Averaging for Nonpositive Subadditive Processes later combines residue phases into a sliding finite base-orbit sum. That chapter must audit its own horizon and summand counts; the present module does not contain a phase average.

References

Nonlinear Dynamics in Lean. SubadditiveFiniteBlocks.lean. This is the authoritative twelve-declaration source described here.

Mathlib contributors. Birkhoff sums, Mathlib 4 documentation. The pinned source defines the finite sum and its zero, successor, and addition identities.

Mathlib contributors. Function iteration, Mathlib 4 documentation. This official source provides zeroth, successor, added, and multiplied iterate identities.

Lean and Mathlib contributors. Natural-number division, Lean and Mathlib documentation. This is the upstream interface for Nat.div_add_mod, Nat.mod_add_div, and the total zero-divisor conventions.

Mathlib contributors. Measure-preserving maps, Mathlib 4 documentation. This source defines preservation and proves it is stable under natural iteration.

Mathlib contributors. Integrable functions, Mathlib 4 documentation. This source provides composition with a measure-preserving map and closure under finite sums.

J. F. C. Kingman. The ergodic theory of subadditive stochastic processes, Journal of the Royal Statistical Society: Series B 30(3), 499–510, 1968. This primary source supplies the asymptotic context. The current module proves only finite block infrastructure.

J. Michael Steele. Kingman’s subadditive ergodic theorem, Annales de l’Institut Henri Poincaré, Probabilités et Statistiques 25(1), 93–98, 1989. This proof-lineage reference organizes a full argument through finite interval decompositions; it is not an upstream Lean theorem used here.

Harry Furstenberg and Harry Kesten. Products of Random Matrices, The Annals of Mathematical Statistics 31(2), 457–469, 1960. This primary source motivates the random-matrix destination. No samplewise conclusion from that work is claimed here.

The exact upstream Lean revision audited for this chapter is Mathlib commit 81a5d257, the revision pinned by formalization/lake-manifest.json. The project source file audited during this rebuild had SHA-256 07a4e6d99893d26e888d5799d15660cfd2b0c931bfdbabd6879f1d773ada2775.