Skip to content

About

Finite-state continuous-time Markov processes in Lean: normalized history laws, Sanov and path large deviations, and quantitative bounds.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Finite Markov Processes

Lean verification

Finite-state jump processes and large deviations in Lean 4, built on Mathlib.

The library develops finite-horizon history laws from generators and connects their explicit densities with normalized generative constructions. Its upper layers formalize finite-alphabet Sanov bounds, density/flux path large deviations, zero-action evolution, and quantitative particle confidence.

The local Lean 4.35 qualification records 302 source files, all 16 source linters per file, and 3,631 named transitive axiom audits. It binds candidate-relative source and verifier hashes to the exact public dependency pins. Hosted verification is recorded separately.

The historical qualification evidence records 297 source files, all 16 source linters per file, and 3,606 named transitive axiom audits on the pinned toolchain, including the concrete path-LDP and trajectory-Fisher examples. It identifies the exact checked source hashes, compiler, dependency pins, and build, lint, and axiom stages on Lean 4.34.1. The supported toolchain and sources have since changed. The earlier hosted verification and historical evidence cover the library before those examples were added. The earlier CTMC v0.1.0 qualification covers its original 69 files and 964 named declarations.

Continuous-time jump processes

import FiniteMarkovProcesses.CTMC

The core includes:

  • Conversion between signed rate matrices and physical jump rates, including absorbing rows.
  • Finite-horizon Gillespie histories, with absorbing states handled explicitly.
  • Equality of the stopped generative law and its counting/Lebesgue density, including a proof of normalization for every nonnegative finite horizon.
  • Uniformization and exact deletion of virtual self-events, with a bounded measurable time-dependent extension.
  • Common-support likelihood-ratio, integral fluctuation, and expected-KL identities.
  • Stationary path-KL rates and complete-trajectory Fisher response for explicitly identified affine generator charts.

The hypotheses are part of the API: common support, integrability, stationarity, and chart identification are retained where needed. See the CTMC guide and checked examples. The signed-generator example derives a finite-particle bound under the physical history law and computes a sufficient count of 4,480 independent particles for its one-second experiment.

Large deviations and effective evolution

Focused entry points keep the mathematical layers explicit:

Import Results and important premises
FiniteMarkovProcesses.Sanov Finite-alphabet closed upper/open lower bounds and a good KL rate; the reference density is strictly positive, while empirical targets may lie on the boundary.
FiniteMarkovProcesses.ProbabilityVectorInterop Coordinate-preserving equivalence and homeomorphism with the public probability-vector API, including equality of canonical PMFs.
FiniteMarkovProcesses.PathLargeDeviations Renger density/flux path bounds for specified initial regimes; the general initial-law theorem assumes an initial LDP and boundary continuity.
FiniteMarkovProcesses.EffectiveEvolution Complete-rate zeros are exactly Markov mean evolutions from the supplied initial zero set; all-N strong-L1 particle bounds remain separate probabilistic results.
FiniteMarkovProcesses.QuantitativeBounds Dynamic-rate stability with explicit initial-density error, rate-gap coercivity, eventual LDP concentration, and executable rational budgets for supplied finite-sample envelopes.

General initial mixtures have independent jump dynamics conditional on the initial configuration. The invariant-IID corollary uses actual IID initialized histories. The supplied initial cost determines the zero family; uniqueness of its initial zero is an additional condition.

The all-N Chernoff estimate controls density and cumulative-flow paths in strong L1 distance from their actual unconditional mean, using a supplied admissible tilt. The deterministic stability estimates retain the initial-density error; an arbitrary initial cost does not control that error automatically.

See the theorem and premise map, the path large-deviation guide, the Sanov guide, and probability-vector interoperability.

Dependencies and verification

The supported pair is Lean 4.35.0 and Mathlib 56a005855ea17e0b0958f73ec801ae140b0a1679. Public dependencies use exact commit pins. The finite-simplex interface composes with finite-markov-kernels, and product-measure transport uses measure-discrimination.

MATHLIB_NO_CACHE_ON_UPDATE=1 python3 scripts/fetch_mathlib_cache.py
python3 -m unittest discover -s scripts -p 'test_*.py'
python3 scripts/verify.py

The verifier inventories every authored Lean file, clears its compiled artifacts before the initial build, runs all 16 source linters, and audits each explicit named public top-level declaration's transitive axioms. It admits only propext, Classical.choice, and Quot.sound. It does not claim to enumerate every anonymous or generated declaration independently.

Long verification runs can resume with --resume --evidence-dir DIR. Completed stages are reusable only with matching source, dependency, compiler, configuration, and verifier identities and intact logs. Ordinary overlong lines are rejected; any inherited indivisible long identifier requires an exact line hash and reason.

Attribution and scope

These are formalizations of classical mathematics. Mathematical references and original author notices remain in the individual modules. The path large-deviation development follows Renger's density/flux results; the finite Sanov development uses the method of types. No mathematical priority claim is made.

The package contains generic mathematics. It does not assert empirical validity for a physical model. The source inventory records public source paths, dependency origins, and documented signature adaptations. Apache-2.0; see NOTICE.

Releases and related libraries

Start with the v0.3.0 release for the supported toolchain and verification run.

Browse the Lean library index.

About

Finite-state continuous-time Markov processes in Lean: normalized history laws, Sanov and path large deviations, and quantitative bounds.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages