Chain law from an initial distribution, sample averages, and the CLT property
DefinitionMarkovChainPathMeasureThree notions used throughout the mission, for a transition kernel on a state space .
(i) The law of the chain: for an initial distribution , the probability measure on the path space under which the coordinate at time has law and transitions are governed by (the Ionescu–Tulcea construction).
(ii) The sample average of a function along the first steps of a path:
the initial state not included, matching the source.
(iii) The central limit theorem property of the chain and functional : there exists an asymptotic variance such that for every initial distribution ,
The CLT property is the shared conclusion of the drift-condition theorems, the five corollaries, and the goal theorem of the mission.
Formalization Note The chain law is built by composing the platform's existing Markov-chain trajectory kernel (from the Gittins mission's Ionescu–Tulcea infrastructure) with the initial distribution. Convergence in distribution is weak convergence of laws; is read as the point mass at . In the CLT property the existential quantifier over comes first, so one variance is shared by all initial distributions.
import Definitions.Def_MarkovChainKernel
import Mathlib.Probability.Kernel.Composition.MeasureComp
import Mathlib.MeasureTheory.Function.ConvergenceInDistribution
import Mathlib.Probability.Distributions.Gaussian.Real
/-!
The law of a time-homogeneous Markov chain started from an initial
distribution, sample averages of a functional along the chain, and the Markov
chain central limit theorem property.
Source: Galin L. Jones, *On the Markov Chain Central Limit Theorem*,
Probability Surveys 1 (2004) 299-320 (arXiv math/0409112v2), §1: the sample
average `f̄_n` (Section 1) and the CLT of eq. (1).
Builds on the platform's Ionescu-Tulcea infrastructure
(`BanditAlgorithm.markovChainKernel`, itself built on
`BanditAlgorithm.markovChainStep` and `ProbabilityTheory.Kernel.traj`).
-/
open MeasureTheory ProbabilityTheory Filter
open scoped NNReal
namespace MarkovChainCLT
/-- The law of the trajectory `(X₀, X₁, X₂, …)` of the time-homogeneous Markov chain
with transition kernel `P` and **initial distribution** `lam` (coordinate `0` has law
`lam`), as a measure on the path space `ℕ → X`. Built from the platform's
Ionescu-Tulcea infrastructure: `BanditAlgorithm.markovChainKernel P` is the kernel
sending a starting point to the law of the trajectory from that point. -/
noncomputable def chainMeasure {X : Type*} [MeasurableSpace X] (P : Kernel X X)
[IsMarkovKernel P] (lam : Measure X) : Measure (ℕ → X) :=
(BanditAlgorithm.markovChainKernel P) ∘ₘ lam
instance chainMeasure.instIsProbabilityMeasure {X : Type*} [MeasurableSpace X]
(P : Kernel X X) [IsMarkovKernel P] (lam : Measure X) [IsProbabilityMeasure lam] :
IsProbabilityMeasure (chainMeasure P lam) :=
inferInstanceAs (IsProbabilityMeasure ((BanditAlgorithm.markovChainKernel P) ∘ₘ lam))
/-- The sample average `f̄_n = n⁻¹ ∑_{i=1}^n f(X_i)` of a functional `f` along the
first `n` steps of a trajectory `ω` (the initial point `ω 0` is not included,
matching Jones 2004, Section 1). -/
noncomputable def sampleAvg {X : Type*} (f : X → ℝ) (n : ℕ) (ω : ℕ → X) : ℝ :=
(n : ℝ)⁻¹ * ∑ i ∈ Finset.range n, f (ω (i + 1))
/-- `SatisfiesCLT P π f` says: there is an asymptotic variance `v ≥ 0` such that for
**every** initial distribution `lam`, under the chain law started from `lam`,
`√n (f̄_n - E_π f)` converges in distribution to `N(0, v)` (Jones 2004 eq. (1); the
degenerate case `v = 0` means convergence to the point mass at `0`). -/
def SatisfiesCLT {X : Type*} [MeasurableSpace X] (P : Kernel X X) [IsMarkovKernel P]
(π : Measure X) (f : X → ℝ) : Prop :=
∃ v : ℝ≥0, ∀ (lam : Measure X) [IsProbabilityMeasure lam],
TendstoInDistribution
(fun (n : ℕ) (ω : ℕ → X) => Real.sqrt n * (sampleAvg f n ω - ∫ x, f x ∂π))
atTop (id : ℝ → ℝ) (fun _ => chainMeasure P lam) (gaussianReal 0 v)
end MarkovChainCLT
Read-back
What the Lean code literally says, in plain math · claude-fable-5
chainMeasure — For a measurable type , a kernel from to assumed (typeclass) to be a Markov kernel (each a probability measure), and an arbitrary measure on (not assumed to be a probability measure in this definition), is the measure on the sequence space obtained by composing the kernel with : the measure . Unfolding the imported declaration: is the Ionescu–Tulcea trajectory kernel built from the step kernels which map a finite history (a function on ) to the measure — the next state depends only on the last coordinate, through — precomposed with the map sending to the one-point time- history with value ; an accompanying lemma identifies with the trajectory measure started from . Concretely, is the probability measure on under which coordinate equals almost surely and, for each , the conditional law of coordinate given coordinates is . So is this path law with the initial state integrated against .
chainMeasure.instIsProbabilityMeasure — Under the same hypotheses ( measurable, a Markov kernel), with the additional typeclass hypothesis that is a probability measure, the declaration provides the fact that (the composition of the trajectory kernel with , as unfolded above) is a probability measure on .
sampleAvg — For an arbitrary type (no σ-algebra needed here), an arbitrary function (no measurability assumed), , and a sequence : , i.e., . Coordinate is never used — the average runs over coordinates through . For the sum is empty and the real inverse of is by convention, so the value is .
SatisfiesCLT — For a measurable type , a kernel on assumed (typeclass) to be a Markov kernel, a measure on (completely arbitrary: not assumed to be a probability measure, finite, or invariant for ), and a function (no measurability or integrability assumed): the proposition that there exists (a nonnegative real; is allowed) such that for every measure on that is a probability measure, the sequence of functions on path space — where (value at ) and is the real square root — converges in distribution as , each taken under the single fixed measure (the path law of the chain with one-step kernel and initial law , as unfolded above), to the identity map on under the real Gaussian measure with mean and variance — i.e., the image laws of the converge weakly to that Gaussian measure ( gives the Dirac mass at ). Points to note: the quantifier order makes one single work uniformly for all initial probability laws ; the centering constant is the Bochner integral , which equals by convention when is not -integrable; and since carries no measurability hypothesis, the need not be almost-everywhere measurable, in which case their image laws are the zero measure by the pushforward convention.
Confirmed by the mission captain (proposal self-audit).