Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 110 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@
<a href="https://github.com/chenle02/markovprocess-pilot/actions/workflows/ci.yml"><img alt="Lean CI status" src="https://github.com/chenle02/markovprocess-pilot/actions/workflows/ci.yml/badge.svg"></a>
<a href="https://github.com/scottnarmstrong/MarkovProcess"><img alt="Built on MarkovProcess by Scott Armstrong" src="https://img.shields.io/badge/built%20on-MarkovProcess%20(S.%20Armstrong)-3730a3"></a>
<a href="lean-toolchain"><img alt="Lean version 4.35.0-rc2" src="https://img.shields.io/badge/Lean-v4.35.0--rc2-0f766e"></a>
<a href="https://github.com/leanprover-community/mathlib4/tree/065356127b1dc0016f66b7283ce0ce2c4055aa55"><img alt="Mathlib commit 0653561" src="https://img.shields.io/badge/Mathlib-0653561-0f766e"></a>
<a href="docs/reproducing.md#receipts"><img alt="Evidence: lower-tier and comparator receipts" src="https://img.shields.io/badge/evidence-comparator%20receipts-115e59"></a>
<a href="https://github.com/chenle02/markovprocess-pilot/releases/tag/v0.1.1"><img alt="Release v0.1.1" src="https://img.shields.io/badge/release-v0.1.1-4338ca"></a>
<a href="https://doi.org/10.5281/zenodo.23452512"><img alt="DOI 10.5281/zenodo.23452512" src="https://zenodo.org/badge/DOI/10.5281/zenodo.23452512.svg"></a>
<a href="LICENSE"><img alt="Apache-2.0 license" src="https://img.shields.io/badge/license-Apache--2.0-4338ca"></a>
<a href="https://github.com/sponsors/chenle02"><img alt="Sponsor Le Chen on GitHub" src="https://img.shields.io/badge/sponsor-GitHub-be123c?logo=githubsponsors&amp;logoColor=white"></a>
</p>

<p>
<a href="#the-result"><strong>The result</strong></a>
· <a href="#quick-start">Quick start</a>
<a href="#what-is-proved"><strong>What is proved</strong></a>
· <a href="docs/what-is-proved.md">What is proved (for mathematicians)</a>
· <a href="docs/reproducing.md">Verification and evidence</a>
· <a href="#build-and-verify">Build</a>
· <a href="docs/proof-outline.md">Proof outline</a>
· <a href="docs/reproducing.md">Reproducing and evidence</a>
· <a href="#citing">Citing</a>
· <a href="#citing">Cite</a>
· <a href="llms.txt">LLM index</a>
</p>
</div>
Expand All @@ -46,29 +49,33 @@
> with Armstrong's copyright notice and a statement of the changes. It is a
> pilot, not a general library, and not a new theorem.

## The result
## What is proved

<p align="center">
<img src="docs/assets/exit-time.svg" width="560" alt="Diagram: a Brownian path starts at level x between levels a and b and is stopped at time T, the first time it touches b, which comes before the horizon K. Caption: under the law of Brownian motion started at x, the mean of the path at T is x.">
</p>

**Headline theorem.** Brownian motion started at `x ∈ (a, b)` and stopped at
its exit time from `(a, b)`, truncated at any deterministic horizon `K`, has
mean `x`:
- **Optional stopping at a truncated exit time**
(`MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo`). Let $\mathbb{P}_x$ be
the law of Brownian motion started at $x$ (`MarkovProcess.brownianMotion x`),
and let $\tau_K$ be the exit time of the path from $(a, b)$, truncated at a
deterministic horizon $K \ge 0$ (`exitTimeTrunc (Set.Ioo a b) K`). If
$a < x < b$, then $`\int \omega(\tau_K(\omega))\,\mathbb{P}_x(d\omega) = x`$.

```lean
theorem MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo
(a b x : ℝ) (hax : a < x) (hxb : x < b) (K : ℝ≥0) :
∫ ω, ω (MarkovProcess.ContinuousPath.exitTimeTrunc (Set.Ioo a b) K ω)
∂(MarkovProcess.brownianMotion x) = x
```
```lean
theorem MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo
(a b x : ℝ) (hax : a < x) (hxb : x < b) (K : ℝ≥0) :
∫ ω, ω (MarkovProcess.ContinuousPath.exitTimeTrunc (Set.Ioo a b) K ω)
∂(MarkovProcess.brownianMotion x) = x
```

**Bridge to Mathlib.** `MarkovProcessPilot.isBrownianReal_iff` shows that
`MarkovProcess.IsBrownianReal X P ↔ ProbabilityTheory.IsBrownianReal X P` for
every process `X` and measure `P`, so the library's Brownian motion is a
Brownian motion in Mathlib's sense once recentred at its starting point
(`isBrownianReal_brownianMotion`), and
Mathlib's Brownian API applies to it.
- **Bridge to Mathlib** (`MarkovProcessPilot.isBrownianReal_iff`).
`MarkovProcess.IsBrownianReal X P ↔ ProbabilityTheory.IsBrownianReal X P` for
every process $X$ and measure $P$, so the library's Brownian motion is a
Brownian motion in Mathlib's sense once recentred at its starting point:
under $\mathbb{P}_x$, the process $t \mapsto \omega(t) - x$ is
`IsBrownianReal` (`MarkovProcessPilot.isBrownianReal_brownianMotion`), and
Mathlib's Brownian API applies to it.

**Mathlib-only statement check.** `lake comparator` confirms that the theorem
`exit_mean` in [`Audit/Exit/Challenge.lean`](Audit/Exit/Challenge.lean),
Expand All @@ -83,23 +90,40 @@ statement cannot name the library's kernel, so the Solution proves this with
`MarkovProcess.brownianMotion` as the witness. `claims.yaml` names the
Challenge theorem that judges each claim (`judged_as`).

The page [docs/what-is-proved.md](docs/what-is-proved.md) puts each result in mathematical
notation beside its Lean statement, with the boundary. The proof route is in [docs/proof-outline.md](docs/proof-outline.md); pins,
axioms and receipts are in [docs/reproducing.md](docs/reproducing.md).

> [!IMPORTANT]
> **Scope.** The exit time is **truncated at `K`**. Untruncated exit times,
> **Not proved here.** The exit time is **truncated at `K`**. Untruncated exit times,
> and the exit probability `P_x(exit at b) = (x - a)/(b - a)`, are out of scope
> and not claimed. The mathematics is classical; what this repository
> contributes is a machine-checked consumer of MarkovProcess, not a new
> theorem.

| Check | Status |
|---|---|
| Build | `lake build` green at Lean `v4.35.0-rc2`, Mathlib `065356127b1d` |
| Placeholders | no `sorry`, `admit`, custom `axiom` or `native_decide` in `MarkovProcessPilot/` |
| Axioms | `propext`, `Classical.choice`, `Quot.sound` only ([`logs/axioms.txt`](logs/axioms.txt)) |
| Comparator | `pass`, toolchain mechanism; con-ron, NanoDa and Lean kernels |
| Receipts | [`.lean-receipts/`](.lean-receipts/), bound to commit [`1548828e63c8`](https://github.com/chenle02/markovprocess-pilot/tree/1548828e63c86f2c3f360ac46ab91ec78ba45276) |
| Index | listed in the lean-pkg package index at that pin, trust level `comparator` |
## Paper and references

Standalone library; there is no accompanying paper. It is based on:

- Scott Armstrong. *MarkovProcess: sub-Markov kernel semigroups and
continuous-path Markov processes in Lean 4.* Software, Apache-2.0.
<https://github.com/scottnarmstrong/MarkovProcess>, used at commit
[`666cda029098`](https://github.com/scottnarmstrong/MarkovProcess/tree/666cda029098a1106914fc9fa7abd1727573284a).
It supplies the Brownian motion, exit times, the heat generator, optional
stopping and Dynkin's formula.
- [Mathlib](https://github.com/leanprover-community/mathlib4), for the
Brownian-motion API (`ProbabilityTheory.IsBrownianReal`) used by the bridge.

If you use this work, cite MarkovProcess, the preferred citation; see
[Citing](#citing).

## Build and verify

## Quick start
Toolchain Lean `v4.35.0-rc2` ([`lean-toolchain`](lean-toolchain), a prerelease
inherited from MarkovProcess); MarkovProcess
`666cda029098a1106914fc9fa7abd1727573284a` and, through it, Mathlib
`065356127b1dc0016f66b7283ce0ce2c4055aa55`
([`lake-manifest.json`](lake-manifest.json)).

```bash
git clone https://github.com/chenle02/markovprocess-pilot.git
Expand All @@ -115,6 +139,62 @@ build: about 3.5 minutes on 4 cores and 1.5 GB peak memory per process
([measured](docs/reproducing.md#build-cost-measured-on-a-laptop-2026-10-05)).
`lake build Audit` builds the comparator challenge and solution.

To use the pilot from another Lake project:

```toml
[[require]]
name = "MarkovProcessPilot"
git = "https://github.com/chenle02/markovprocess-pilot.git"
rev = "v0.1.1"
```

then `import MarkovProcessPilot`. This also brings in MarkovProcess at the
pinned commit; the consuming project must use the same Lean toolchain,
`leanprover/lean4:v4.35.0-rc2`.

## Trust and axioms

| Check | Status |
|---|---|
| Build | `lake build` green at Lean `v4.35.0-rc2`, Mathlib `065356127b1d` |
| Placeholders | no `sorry`, `admit`, custom `axiom` or `native_decide` in `MarkovProcessPilot/` |
| Axioms | `propext`, `Classical.choice`, `Quot.sound` only ([`logs/axioms.txt`](logs/axioms.txt)) |
| Comparator | `pass`, toolchain mechanism; con-ron, NanoDa and Lean kernels |
| Receipts | [`.lean-receipts/`](.lean-receipts/), bound to commit [`1548828e63c8`](https://github.com/chenle02/markovprocess-pilot/tree/1548828e63c86f2c3f360ac46ab91ec78ba45276) |
| Index | listed in the lean-pkg package index at that pin, trust level `comparator` |

The comparator receipt covers three configurations in
[`comparator/`](comparator/): `exit_mean`, `exists_unique_brownian_kernel` and
a toolchain smoke test (`two_mul_le`, in [`Audit/Smoke/`](Audit/Smoke/)), each
with permitted axioms `propext`, `Quot.sound` and `Classical.choice`. The
`sorry` in each `Audit/*/Challenge.lean` is intentional: those files hold the
statements only, and the comparator checks each against its `Solution.lean`.
Details: [Axioms and placeholders](docs/reproducing.md#axioms-and-placeholders)
and [Receipts](docs/reproducing.md#receipts).

## Built with lean-pkg

Developed and verified with [lean-pkg](https://github.com/lean-pkg/lean-pkg) ([doi:10.5281/zenodo.23272098](https://doi.org/10.5281/zenodo.23272098)).
The receipts were made with lean-pkg 0.14.0
([doi:10.5281/zenodo.23445755](https://doi.org/10.5281/zenodo.23445755)); the
build receipt and the comparator receipt under
[`.lean-receipts/`](.lean-receipts/) bind the checks above to source commit
`1548828e63c8`.

## Authors and AI disclosure

Le Chen, Associate Professor,
Department of Mathematics and Statistics, Auburn University.

The mathematics formalised here, and nearly all of the Lean, come from Scott
Armstrong's [MarkovProcess](https://github.com/scottnarmstrong/MarkovProcess);
the pilot depends on it and on Mathlib, both Apache-2.0, and adapts one lemma
from MarkovProcess with Armstrong's notice.

Developed with AI assistance (Anthropic Claude) under Le Chen's direction.
Lean compilation, the axiom check and the comparator check the stated theorems
only; AI assistance is not human mathematical review.

## Find your way

| You want to | Go to |
Expand Down
110 changes: 110 additions & 0 deletions docs/what-is-proved.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# What is proved

A page for mathematicians: each result in mathematical language, beside the Lean
statement that was checked, and the boundary of what is **not** claimed.

Lean checks every step of the proofs below. It cannot check that a Lean statement says
what the words on this page say: that comparison is the reader's. For each result, read
the mathematics beside the Lean statement and check that the hypotheses match.

All results build on Scott Armstrong's
[MarkovProcess](https://github.com/scottnarmstrong/MarkovProcess) library (pinned at
`666cda029098`), which supplies the Brownian motion, exit times, optional stopping and
Dynkin's formula. Checked at commit `1548828e63c8` with Lean `v4.35.0-rc2`; axioms
`propext`, `Classical.choice`, `Quot.sound` only.

## 1. Mean of Brownian motion stopped at a truncated exit time

**Status: proved; the Mathlib-only form was also confirmed by the comparator.**

**In words.** Let $a<x<b$ and $K\ge 0$. Let $\mathbb{P}_x$ be the law of Brownian motion
started at $x$ on the path space $C([0,\infty),\mathbb{R})$, and let

```math
\tau_K(\omega)=\inf\{t\in[0,K]:\ \omega(t)\notin(a,b)\}\wedge K
```

be the exit time from $(a,b)$ truncated at the horizon $K$. Then

```math
\int \omega\bigl(\tau_K(\omega)\bigr)\,\mathbb{P}_x(d\omega)=x .
```

**In Lean (library form).** [`MarkovProcessPilot/BrownianExit.lean`](../MarkovProcessPilot/BrownianExit.lean),
with the library's Brownian motion and its truncated exit time:

```lean
theorem MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo
(a b x : ℝ) (hax : a < x) (hxb : x < b) (K : ℝ≥0) :
∫ ω, ω (MarkovProcess.ContinuousPath.exitTimeTrunc (Set.Ioo a b) K ω)
∂(MarkovProcess.brownianMotion x) = x
```

**In Lean (Mathlib-only form, compared).** [`Audit/Exit/Challenge.lean`](../Audit/Exit/Challenge.lean):
for *any* probability measure $P$ on $C(\mathbb{R}_{\ge0},\mathbb{R})$ under which
$t\mapsto\omega(t)-x$ is a real Brownian motion (Mathlib's `IsBrownianReal`), with Mathlib's
`hittingBtwn` as the stopping time, the stopped position is integrable and has mean $x$:

```lean
theorem exit_mean (P : Measure C(ℝ≥0, ℝ)) [IsProbabilityMeasure P] (a b x : ℝ)
(hax : a < x) (hxb : x < b) (hP : IsBrownianReal (fun t ω ↦ ω t - x) P) (K : ℝ≥0) :
Integrable (fun ω : C(ℝ≥0, ℝ) ↦ ω (hittingBtwn (fun t ω ↦ ω t) (Ioo a b)ᶜ 0 K ω)) P ∧
∫ ω, ω (hittingBtwn (fun t (ω : C(ℝ≥0, ℝ)) ↦ ω t) (Ioo a b)ᶜ 0 K ω) ∂P = x
```

**Hypotheses.** Exactly those shown: $a<x<b$, a deterministic horizon $K$, and (for the
compared form) that $P$ is a law of Brownian motion started at $x$.

## 2. The library's Brownian motion is Brownian motion in Mathlib's sense

**Status: proved; a stronger Mathlib-only form was confirmed by the comparator.**

**In words.** For every $x\in\mathbb{R}$, under the library's law $\mathbb{P}_x$ the
recentred coordinate process $t\mapsto\omega(t)-x$ is a real Brownian motion in Mathlib's
sense. More generally, the library's notion `MarkovProcess.IsBrownianReal X P` and Mathlib's
`ProbabilityTheory.IsBrownianReal X P` are equivalent for every process $X$ and measure $P$
(`MarkovProcessPilot.isBrownianReal_iff`).

**In Lean.** [`MarkovProcessPilot/BrownianExit.lean`](../MarkovProcessPilot/BrownianExit.lean):

```lean
theorem isBrownianReal_brownianMotion (x : ℝ) :
ProbabilityTheory.IsBrownianReal
(fun (t : ℝ≥0) (ω : MarkovProcess.ContinuousPath ℝ) ↦ ω t - x)
(MarkovProcess.brownianMotion x)
```

**Compared form.** [`Audit/BrownianKernel/Challenge.lean`](../Audit/BrownianKernel/Challenge.lean)
states, in Mathlib's vocabulary only, that there is exactly one Markov kernel
$\kappa:\mathbb{R}\to C(\mathbb{R}_{\ge0},\mathbb{R})$ such that $t\mapsto\omega(t)-x$ is a
real Brownian motion under $\kappa(x)$ for every $x$:

```lean
theorem exists_unique_brownian_kernel :
∃! κ : Kernel ℝ C(ℝ≥0, ℝ),
IsMarkovKernel κ ∧ ∀ x : ℝ, IsBrownianReal (fun t ω ↦ ω t - x) (κ x)
```

A Mathlib-only statement cannot name the library's kernel, so this form is stronger than
the library theorem: its proof uses `MarkovProcess.brownianMotion` as the witness together
with the library's uniqueness theorem.

## Not proved here

- Untruncated exit times: $`\tau=\inf\{t\ge0:\omega(t)\notin(a,b)\}`$ without the horizon $K$.
- The exit probability $\mathbb{P}_x(\text{exit at } b)=(x-a)/(b-a)$.
- Anything about Brownian motion that MarkovProcess or Mathlib does not already provide;
this is a thin consumer pilot, and the mathematics is classical. No new theorem is claimed.

## How this was checked

- `lake build` with no `sorry`, `admit`, custom `axiom` or `native_decide` in
`MarkovProcessPilot/`; axioms recorded in [`logs/axioms.txt`](../logs/axioms.txt).
- The comparator checked each Challenge statement above against its `Solution.lean`
(Lean kernel plus the independent kernels con-ron and NanoDa).
- Receipts: [`.lean-receipts/`](../.lean-receipts/), bound to commit `1548828e63c8`;
reproduction steps in [reproducing.md](reproducing.md).

This page is written by hand. The page lean-pkg generates from `coverage.yaml` is not yet
available for this package: its recorded comparator receipt includes a toolchain smoke test
that no result names.
2 changes: 1 addition & 1 deletion llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Essential

- [README](https://raw.githubusercontent.com/chenle02/markovprocess-pilot/main/README.md): Result, scope, status and quick start.
- [README](https://raw.githubusercontent.com/chenle02/markovprocess-pilot/main/README.md): What is proved, scope, build, trust and axioms, and how to cite.
- [Repository contract](https://raw.githubusercontent.com/chenle02/markovprocess-pilot/main/AGENTS.md): Which files are bound to receipts, and the rules for changes.
- [Machine-readable claims](https://raw.githubusercontent.com/chenle02/markovprocess-pilot/main/claims.yaml): The two claimed theorems (schema claims/1).
- [Proof outline](https://raw.githubusercontent.com/chenle02/markovprocess-pilot/main/docs/proof-outline.md): Dynkin's formula route, the comparator statement, and what came from MarkovProcess.
Expand Down
Loading