From 09e96824fbe1601959eedd96f31d607391b28eb1 Mon Sep 17 00:00:00 2001 From: chenle02 Date: Thu, 8 Oct 2026 20:46:45 -0400 Subject: [PATCH 1/2] docs: landing-page README, proof and reproduction pages, agent entry, community files Presentation only. No Lean source, build file, comparator config, claims.yaml, receipt or log changes; the receipts for 05d99d75df82 still cover the source. - README: logo, badges, a prominent credit note for Scott Armstrong's MarkovProcess, the headline theorem and its truncation boundary in the first screen, quick start, routing table, repository map, citing, support. - docs/proof-outline.md and docs/reproducing.md: the long-form material from the old README (proof route, what MarkovProcess supplied, pins, build cost, axioms, receipts), plus the comparator statement exit_mean. - llms.txt and AGENTS.md: curated machine entry and modification contract. - CITATION.cff with MarkovProcess as the preferred citation. - Issue forms, PR template, FUNDING.yml (verified GitHub Sponsors listing). - Lean CI: placeholder scan, build, lake build Audit, axioms diff against logs/axioms.txt; actions pinned to commit SHAs, read-only permissions. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011u9cmGVrmPi5G9fC65oymz --- .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/build-problem.yml | 34 +++ .github/ISSUE_TEMPLATE/config.yml | 5 + .github/ISSUE_TEMPLATE/documentation.yml | 30 +++ .github/pull_request_template.md | 23 ++ .github/workflows/ci.yml | 48 ++++ AGENTS.md | 55 ++++ CITATION.cff | 38 +++ README.md | 322 ++++++++++------------- docs/assets/exit-time.svg | 28 ++ docs/assets/logo.svg | 20 ++ docs/proof-outline.md | 179 +++++++++++++ docs/reproducing.md | 108 ++++++++ llms.txt | 27 ++ 14 files changed, 728 insertions(+), 190 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/build-problem.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/ci.yml create mode 100644 AGENTS.md create mode 100644 CITATION.cff create mode 100644 docs/assets/exit-time.svg create mode 100644 docs/assets/logo.svg create mode 100644 docs/proof-outline.md create mode 100644 docs/reproducing.md create mode 100644 llms.txt diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..3661a62 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [chenle02] diff --git a/.github/ISSUE_TEMPLATE/build-problem.yml b/.github/ISSUE_TEMPLATE/build-problem.yml new file mode 100644 index 0000000..2384d15 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/build-problem.yml @@ -0,0 +1,34 @@ +name: Build or proof problem +description: Report a build failure, a wrong axiom list, or a mismatch between the Lean source and what the documentation claims. +title: "[Build]: " +body: + - type: textarea + id: what + attributes: + label: What happened + description: Paste the command you ran and the relevant output. + render: text + validations: + required: true + - type: input + id: commit + attributes: + label: Commit + description: Output of `git rev-parse HEAD`. + validations: + required: true + - type: textarea + id: environment + attributes: + label: Environment + description: Output of `lean --version` and `lake --version`, operating system, and whether `lake exe cache get` succeeded. + render: text + validations: + required: true + - type: checkboxes + id: scope + attributes: + label: Scope check + options: + - label: I checked that the problem is in this pilot, not in MarkovProcess or Mathlib (those have their own trackers). + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..6fc29b7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: MarkovProcess library (Scott Armstrong) + url: https://github.com/scottnarmstrong/MarkovProcess/issues + about: Problems in the underlying MarkovProcess library belong in its own tracker. diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 0000000..c80eaa2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,30 @@ +name: Documentation problem +description: Report unclear, stale, inaccessible, or overstated documentation. +title: "[Docs]: " +body: + - type: input + id: location + attributes: + label: Page or file + description: Link the file and heading. + placeholder: "README.md#the-result" + validations: + required: true + - type: textarea + id: problem + attributes: + label: What is wrong or hard to use? + validations: + required: true + - type: textarea + id: correction + attributes: + label: Proposed correction + description: If it concerns mathematics, cite the Lean declaration it should match. + - type: checkboxes + id: scope + attributes: + label: Scope check + options: + - label: My correction does not claim more than the Lean source proves (for example, untruncated exit times). + required: true diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..6e313ed --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ +## Summary + + + +## Scope + +- [ ] Presentation only (README, `docs/`, images, `.github/`, metadata): no new receipts needed. +- [ ] Touches receipt-bound files (Lean source, `Audit/`, `scripts/*.lean`, `lakefile.toml`, + `lake-manifest.json`, `lean-toolchain`, `comparator/`, `claims.yaml`): fresh build, + comparator run and receipts are included. +- [ ] No theorem-boundary change, or the change is stated here and mirrored in `README.md`, + `docs/`, `claims.yaml` and `llms.txt`. +- [ ] Credit to Scott Armstrong's MarkovProcess is unchanged or more prominent. + +## Validation + + + +- [ ] `lake build` and `lake build Audit` +- [ ] `lake env lean scripts/Axioms.lean` shows only `propext`, `Classical.choice`, `Quot.sound` +- [ ] no `sorry`, `admit`, `axiom` or `native_decide` in `MarkovProcessPilot/` +- [ ] `git diff --check` +- [ ] links checked, when documentation changed diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..038f150 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: Lean CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: lean-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build, audit and axioms + runs-on: ubuntu-latest + timeout-minutes: 90 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Reject placeholders in production modules + # Audit/*/Challenge.lean contain `sorry` by design (comparator challenges). + shell: bash + run: | + if grep -rnE 'sorry|admit|axiom |native_decide' MarkovProcessPilot.lean MarkovProcessPilot/; then + echo "placeholder or custom axiom found" >&2 + exit 1 + fi + + - uses: leanprover/lean-action@f061402b660e0c34644504b324e830f2991d4865 # v1.6.1 + with: + build: true + use-mathlib-cache: true + + - name: Build the comparator audit + run: lake build Audit + + - name: Axioms match the recorded log + shell: bash + run: | + lake env lean scripts/Axioms.lean | tee axioms-ci.txt + diff -u logs/axioms.txt axioms-ci.txt diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..1ca0920 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,55 @@ +# Repository contract + +Rules for people and coding agents changing this repository. + +## What this repository is + +A small Lean 4 pilot built on Scott Armstrong's +[MarkovProcess](https://github.com/scottnarmstrong/MarkovProcess). It is not a +general library. Keep the credit to MarkovProcess at least as prominent as it +is in `README.md`, and keep Armstrong's notice in +`MarkovProcessPilot/BrownianExit.lean`. + +## Authority order + +1. The Lean source (`MarkovProcessPilot/`, `Audit/`) at commit + `05d99d75df8235e79902220f0fe13e07e81867ca`, and its receipts in + `.lean-receipts/`. +2. `claims.yaml`. +3. `README.md`, `docs/`, `llms.txt`: presentation; they must agree with 1 and 2. + +## Files bound to receipts + +The receipts cover the source at `05d99d75df82`. Changing any of these +requires a fresh build, a fresh comparator run and new receipts in the same +pull request: + +- `MarkovProcessPilot.lean`, `MarkovProcessPilot/`, `Audit/`, `scripts/*.lean` +- `lakefile.toml`, `lake-manifest.json`, `lean-toolchain` +- `comparator/`, `claims.yaml` + +Never edit `.lean-receipts/` or `logs/` by hand. + +Documentation, images, `.github/` and other metadata may change without new +receipts. + +## Claim boundary + +- Headline: `MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo`, exit time + **truncated at `K`**. Do not describe it as a result about untruncated exit + times or exit probabilities. +- Bridge: `MarkovProcessPilot.isBrownianReal_iff`. +- Kernel checking, a green build, comparator acceptance and novelty are + different claims. The mathematics is classical; do not claim novelty. + +## Checks before a pull request + +```bash +lake build && lake build Audit +lake env lean scripts/Axioms.lean # expect propext, Classical.choice, Quot.sound only +grep -rnE 'sorry|admit|axiom |native_decide' MarkovProcessPilot.lean MarkovProcessPilot/ # expect nothing +git diff --check +``` + +`sorry` in `Audit/*/Challenge.lean` is intentional: those files are +comparator challenges. diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..98714f5 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,38 @@ +cff-version: 1.2.0 +message: >- + This pilot is a thin layer over Scott Armstrong's MarkovProcess library, + which did the hard part. If you use it, please cite MarkovProcess (the + preferred citation below). To refer to the pilot itself, cite this + repository at commit 05d99d75df8235e79902220f0fe13e07e81867ca, the commit + its receipts cover; there is no tagged release. +type: software +title: "MarkovProcess consumer pilot: optional stopping for Brownian motion at a truncated exit time" +abstract: >- + A small Lean 4 project built on Scott Armstrong's MarkovProcess library. It + proves that Brownian motion started at x in (a, b), stopped at its exit time + from (a, b) truncated at a deterministic horizon K, has mean x, and that + MarkovProcess.IsBrownianReal is equivalent to Mathlib's + ProbabilityTheory.IsBrownianReal. +authors: + - family-names: Chen + given-names: Le + affiliation: "Department of Mathematics and Statistics, Auburn University" +repository-code: "https://github.com/chenle02/markovprocess-pilot" +license: Apache-2.0 +commit: 05d99d75df8235e79902220f0fe13e07e81867ca +keywords: + - Lean + - mathlib + - formal verification + - Brownian motion + - optional stopping + - exit time +preferred-citation: + type: software + title: "MarkovProcess: sub-Markov kernel semigroups and continuous-path Markov processes in Lean 4" + authors: + - family-names: Armstrong + given-names: Scott + repository-code: "https://github.com/scottnarmstrong/MarkovProcess" + url: "https://github.com/scottnarmstrong/MarkovProcess" + license: Apache-2.0 diff --git a/README.md b/README.md index 030a5b5..d6d2782 100644 --- a/README.md +++ b/README.md @@ -1,210 +1,152 @@ -# MarkovProcess consumer pilot - -The smallest Lake project that depends on Scott Armstrong's -[MarkovProcess](https://github.com/scottnarmstrong/MarkovProcess) Lean library and proves a -theorem the lab needs, compiled for real. Approved by the Chair (Le Chen) on 2026-10-05. -Design comes from a private study of Armstrong's Lean portfolio (2026-10-05), -section 5. - -Status: **builds green, no `sorry`, axioms in {propext, Classical.choice, Quot.sound}.** -Both targets closed: (a) the bridge to Mathlib's Brownian motion and (b) optional stopping at -the truncated exit time of an interval. - -## Dependencies and pins - -| Item | Pin | -|---|---| -| Lean toolchain | `leanprover/lean4:v4.35.0-rc2` (prerelease, inherited from MarkovProcess) | -| MarkovProcess | `https://github.com/scottnarmstrong/MarkovProcess.git` @ `666cda029098a1106914fc9fa7abd1727573284a` | -| Mathlib (transitive, via MarkovProcess's `v4.35.0-rc2` tag) | `065356127b1dc0016f66b7283ce0ce2c4055aa55` | -| batteries / aesop / Qq / proofwidgets / plausible / LeanSearchClient / importGraph / Cli | transitive, see `lake-manifest.json` | - -There is a single `require` (MarkovProcess). Lake did not ask for a second Mathlib -requirement. The project uses the Lean module system (`module`, `public import`, -`@[expose] public section`), as MarkovProcess's own files do. - -## What it proves - -All in `MarkovProcessPilot/BrownianExit.lean`, namespace `MarkovProcessPilot`. - -### Part (a): the bridge to Mathlib's Brownian motion +
+ MarkovProcess pilot logo: a random path between two barriers, stopped where it first touches the upper barrier +

MarkovProcess consumer pilot

+

A small Lean 4 project that uses Scott Armstrong's + MarkovProcess + library to prove optional stopping for Brownian motion at a truncated exit time.

+ +

+ Lean CI status + Built on MarkovProcess by Scott Armstrong + Lean version 4.35.0-rc2 + Evidence: lower-tier and comparator receipts + Apache-2.0 license + Sponsor Le Chen on GitHub +

+ +

+ The result + · Quick start + · Proof outline + · Reproducing and evidence + · Citing + · LLM index +

+
+ +> [!NOTE] +> **Credit.** This pilot is a thin consumer of Scott Armstrong's +> [MarkovProcess](https://github.com/scottnarmstrong/MarkovProcess), which did +> the heavy lifting: the canonical Brownian motion, exit times, the heat +> generator, Feller regularity, continuous-time optional stopping and +> Dynkin's formula. This repository adds about 250 lines on top (a bridge to +> Mathlib's Brownian motion, a test function and the final assembly), and one +> helper lemma is adapted from MarkovProcess with Armstrong's copyright notice. +> It is a pilot, not a general library. If you use it, please +> [cite MarkovProcess](#citing). + +## The result + +

+ 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. +

+ +**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`: ```lean -theorem hasIndepIncrements_iff {T Ω E : Type*} [Preorder T] [MeasurableSpace Ω] - [MeasurableSpace E] [Sub E] (X : T → Ω → E) (P : Measure Ω) : - MarkovProcess.HasIndepIncrements X P ↔ ProbabilityTheory.HasIndepIncrements X P := - Iff.rfl - -theorem isBrownianReal_iff {Ω : Type*} [MeasurableSpace Ω] (X : ℝ≥0 → Ω → ℝ) - (P : Measure Ω) : - MarkovProcess.IsBrownianReal X P ↔ ProbabilityTheory.IsBrownianReal X P - -theorem isBrownianReal_brownianMotion (x : ℝ) : - ProbabilityTheory.IsBrownianReal - (fun (t : ℝ≥0) (ω : MarkovProcess.ContinuousPath ℝ) ↦ ω t - x) - (MarkovProcess.brownianMotion x) - --- a first use of Mathlib's Brownian API through the bridge -theorem integral_eval_brownianMotion (x : ℝ) (t : ℝ≥0) : - ∫ ω, ω t ∂(MarkovProcess.brownianMotion x) = x +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 ``` -The bridge is an exact `Iff` for every process and measure, not only for the canonical one. -`MarkovProcess.HasIndepIncrements` is definitionally Mathlib's (`Iff.rfl` closes it). -The forward direction of `isBrownianReal_iff` is Mathlib's -`HasIndepIncrements.isPreBrownianReal_of_hasLaw`. The reverse direction uses Mathlib's -`IsPreBrownianReal.hasLaw_eval` and `IsPreBrownianReal.hasIndepIncrements`. - -Note: the docstring of `MarkovProcess/Examples/BrownianMotion.lean` says Mathlib's -`HasIndepIncrements` and `IsBrownianReal` are "not available at the pinned revision". That is -**not true at the Mathlib this library actually resolves to** (`065356127b1d`): both exist, -and this file compiles against them. +**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. + +**Mathlib-only statement check.** `lake comparator` confirms that the theorem +`exit_mean` in [`Audit/Exit/Challenge.lean`](Audit/Exit/Challenge.lean), +stated in Mathlib's vocabulary only (any law on `C(ℝ≥0, ℝ)` that is Brownian +started at `x`, with Mathlib's `hittingBtwn` as the stopping time), is +exactly what [`Audit/Exit/Solution.lean`](Audit/Exit/Solution.lean) proves. + +> [!IMPORTANT] +> **Scope.** 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 [`05d99d75df82`](https://github.com/chenle02/markovprocess-pilot/tree/05d99d75df8235e79902220f0fe13e07e81867ca) | +| Index | listed in the lean-pkg package index at that pin, trust level `comparator` | -### Part (b): optional stopping at a truncated exit time +## Quick start -```lean -theorem 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 +```bash +git clone https://github.com/chenle02/markovprocess-pilot.git +cd markovprocess-pilot +lake update # once; fetches packages and the Mathlib cache +lake exe cache get # Mathlib oleans (no-op if already fetched) +lake build # builds MarkovProcess from source, then the pilot +lake env lean scripts/Axioms.lean # prints the axioms of the main declarations ``` -This is exactly the target statement of the study (section 5), with no extra hypothesis. In -words: 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`. - -The study suggested building a clamped stopped martingale and calling -`integral_stoppedValue_eq_of_locallyBounded`. That route is circular, because showing the -stopped process is a martingale is itself optional stopping. The library offers a better -route: **Dynkin's formula at a bounded stopping time**, which it has already derived from -optional stopping. - -1. `cutId y = y * φ(y)`, where `φ` is a Mathlib `ContDiffBump` equal to 1 on `[a-1, b+1]`. - `cutId` is smooth and compactly supported, so it and its second derivative are `C₀` - functions. -2. `MarkovProcess.mem_generatorDomain_heatSemigroup` and `generator_heatSemigroup` put - `cutId` in the generator domain, with generator `cutId'' / 2`. That is 0 on `(a-1, b+1)`. -3. `IsFellerKernelSemigroup.integral_eval_stoppingTime_sub_eq_integral_integral_generator` - is applied with the heat semigroup's `isConservative_heatSemigroup` and - `kolmogorovRegular_heatSemigroup`, at the stopping time `exitTimeTrunc (Ioo a b) K` - (`isStoppingTime_exitTimeTrunc`, `exitTimeTrunc_le`). It gives - `E_x cutId(ω_T) - cutId x = E_x ∫_0^T (cutId''/2)(ω_s) ds`. The inner integral vanishes, - because `ω_s ∈ (a, b)` for `s < T`. -4. Almost surely `ω 0 = x`, because `brownianMotion_map_eval 0 x` gives - `gaussianReal x 0 = dirac x`. Then `ω_T ∈ [a, b]` by continuity of the path, where - `cutId = id`. So `E_x ω_T = cutId x = x`. - -Helper results, all proved: `contDiff_cutId`, `hasCompactSupport_cutId`, `cutId_eq_self`, -`iteratedDeriv_two_cutId_eq_zero`, `mem_of_lt_exitTimeTrunc`, `eval_exitTimeTrunc_mem_Icc` -and `ae_eval_zero_eq`. `mem_of_lt_exitTimeTrunc` is adapted, specialised to `ℝ` and made public, from Scott -Armstrong's `private` lemma in `MarkovProcess/Trajectory/DynkinStopping.lean`. - -## Axioms - -`lake env lean scripts/Axioms.lean` (full output in `logs/axioms.txt`): +MarkovProcess ships no olean cache, so its 250 modules compile on the first +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. -```text -'MarkovProcessPilot.hasIndepIncrements_iff' depends on axioms: [propext, Classical.choice, Quot.sound] -'MarkovProcessPilot.isBrownianReal_iff' depends on axioms: [propext, Classical.choice, Quot.sound] -'MarkovProcessPilot.isBrownianReal_brownianMotion' depends on axioms: [propext, Classical.choice, Quot.sound] -'MarkovProcessPilot.integral_eval_brownianMotion' depends on axioms: [propext, Classical.choice, Quot.sound] -'MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo' depends on axioms: [propext, Classical.choice, Quot.sound] -'MarkovProcessPilot.eval_exitTimeTrunc_mem_Icc' depends on axioms: [propext, Classical.choice, Quot.sound] -'MarkovProcessPilot.ae_eval_zero_eq' depends on axioms: [propext, Classical.choice, Quot.sound] -'MarkovProcessPilot.iteratedDeriv_two_cutId_eq_zero' depends on axioms: [propext, Classical.choice, Quot.sound] -``` +## Find your way -A grep of `MarkovProcessPilot.lean` and `MarkovProcessPilot/` for -`sorry|admit|axiom |native_decide` finds nothing. +| You want to | Go to | +|---|---| +| Understand the proof and what came from MarkovProcess | [docs/proof-outline.md](docs/proof-outline.md) | +| Rebuild, check pins, axioms and receipts | [docs/reproducing.md](docs/reproducing.md) | +| Read the Lean source | [`MarkovProcessPilot/BrownianExit.lean`](MarkovProcessPilot/BrownianExit.lean) | +| Machine-readable claims | [`claims.yaml`](claims.yaml) | +| Point a coding agent at the repository | [`llms.txt`](llms.txt) and [`AGENTS.md`](AGENTS.md) | +| Report a problem | [open an issue](https://github.com/chenle02/markovprocess-pilot/issues/new/choose) | -## How to build +## Repository map -```bash -lake update # once; also runs Mathlib's cache fetch via the post-update hook -lake exe cache get # Mathlib oleans (no-op if already fetched) -lake build # builds the needed MarkovProcess modules from source, then the pilot -lake env lean scripts/Axioms.lean +```text +MarkovProcessPilot/BrownianExit.lean the bridge and the exit-time theorem (namespace MarkovProcessPilot) +MarkovProcessPilot.lean umbrella import +Audit/Exit/{Challenge,Solution}.lean comparator statement (Mathlib only) and its proof +Audit/Smoke/ comparator smoke test on a trivial statement +comparator/ comparator configurations +scripts/Axioms.lean #print axioms for the main declarations +.lean-receipts/ lower-tier and comparator receipts, bound to source commits +claims.yaml machine-readable claims (schema claims/1) +logs/ build, cache and axiom logs +docs/ proof outline, reproduction notes, images ``` -MarkovProcess ships no olean cache, so its modules compile from source on first build. - -## Build cost (measured on a lab laptop, 2026-10-05) - -Host: a lab laptop, Intel i5-11500H (12 threads), 38 GB RAM. The build was pinned to 4 -cores with `taskset -c 0-3 nice -n 10` because another Lean build was running on the same host. -`lake build` at this toolchain has no `-j` flag (`error: unknown short option '-j'`), so -`taskset` was used to cap the cores. Times and memory come from `/usr/bin/time -v`. Peak RSS -is the largest single process (getrusage), not the sum across workers. - -| Step | Wall time | Peak RSS | -|---|---|---| -| `lake update` (clones 10 packages + Mathlib cache fetch of 8,915 files) | 1:50.6 | 0.95 GB | -| `lake exe cache get` (second call, already cached) | 0:05.9 | 0.80 GB | -| `lake build MarkovProcess` (all 250 MarkovProcess modules from source; 3,514 jobs; 0 warnings) | **3:32.8** (524.7 s user, 351% CPU) | **1.54 GB** | -| `lake build` of the pilot after `rm -rf .lake/build` (MarkovProcess already built) | **0:07.4** (`BrownianExit` 3.2 s) | 1.54 GB | -| `lake env lean scripts/Axioms.lean` | 0:10.6 | n/a | - -The study expected "tens of minutes" for MarkovProcess. The real cost is about 3.5 minutes on -4 cores. Logs are in `logs/`. - -## What MarkovProcess gave us for free vs what we had to write - -**For free (used directly, unmodified):** -- The canonical Brownian motion `brownianMotion : Kernel ℝ (ContinuousPath ℝ)`, its - identification `isBrownianReal_brownianMotion`, and the one-point law - `brownianMotion_map_eval`. -- The exit-time API: `exitTimeTrunc`, `isStoppingTime_exitTimeTrunc`, `exitTimeTrunc_le`, - `coe_exitTimeTrunc`, `mem_of_lt_exitTime`. -- The heat generator: `mem_generatorDomain_heatSemigroup` and `generator_heatSemigroup`, so - `C²` `C₀` functions with `C₀` second derivative are in the domain, with `L = ½ d²`. -- Feller and Kolmogorov regularity of the heat semigroup: `isFellerKernelSemigroup_heatSemigroup`, - `isConservative_heatSemigroup` and `kolmogorovRegular_heatSemigroup`. -- **Dynkin's formula at a bounded stopping time** - (`integral_eval_stoppingTime_sub_eq_integral_integral_generator`). Underneath it sit - continuous-time optional stopping (`integral_stoppedValue_eq_of_locallyBounded`) and the - martingale property of the Dynkin process. This was the expensive part, and none of it had - to be written. - -**What we wrote (about 250 lines including docs):** -- The two-way bridge `isBrownianReal_iff` (about 15 lines). The heavy direction is Mathlib's - `isPreBrownianReal_of_hasLaw`. -- A test function: the identity cut off by a `ContDiffBump`, its `C₀` packaging, and the fact - that its second derivative vanishes near `[a, b]`. -- The pathwise facts: before `T` the path is in `(a, b)`, and at `T` it is in `[a, b]`. -- `ω 0 = x` almost surely, from the dirac law at time 0. -- The final assembly: the inner integral vanishes almost everywhere, then `integral_congr_ae`. - -**Friction points:** -- `Main` does not import `Examples/*`. The pilot imports - `MarkovProcess.Examples.{BrownianMotion,HeatGenerator}` and - `MarkovProcess.Trajectory.DynkinStopping` directly. -- The "path is inside `U` before the truncated exit time" lemma is `private` in the library, so - the pilot had to copy it. -- The library's docstring claim that Mathlib lacks `IsBrownianReal` is stale for its own - Mathlib pin. - -## Not done / out of scope - -- Untruncated exit times. The library has `Trajectory/ExpectedExitTime.lean` - (`ae_exitTime_lt_top`); with dominated convergence it would remove `K` and give the exit - probability `P_x(exit at b) = (x - a)/(b - a)`. Not attempted. - -## Evidence - -`.lean-receipts/` holds a lower-tier receipt (build, placeholder scan, `#print axioms`) and a -comparator receipt for the commit that last changed the source: `lake comparator` checks that -the Mathlib-only statement in `Audit/Exit/Challenge.lean` is exactly what -`Audit/Exit/Solution.lean` proves, and replays the proof in the con-ron, NanoDa and Lean -kernels. The package is listed in the [lean-pkg](https://github.com/lean-pkg/lean-pkg) index. - ## Citing -This pilot is a thin layer over Scott Armstrong's MarkovProcess, which did the hard part -(see above). If you use it, please cite MarkovProcess as its +This pilot is a thin layer over Scott Armstrong's MarkovProcess, which did the +hard part. If you use it, please cite **MarkovProcess** as its [`CITATION.cff`](https://github.com/scottnarmstrong/MarkovProcess/blob/main/CITATION.cff) -asks. +asks. This repository's [`CITATION.cff`](CITATION.cff) names MarkovProcess as +the preferred citation, so GitHub's "Cite this repository" button shows it. +To refer to the pilot itself, cite the repository URL together with commit +`05d99d75df82`, the commit its receipts cover; there is no tagged release. + +## Support + +If this work is useful to you, you can +[sponsor Le Chen on GitHub](https://github.com/sponsors/chenle02). +Sponsorship does not change what is claimed here or how it is checked. To +support MarkovProcess, star and cite +[Armstrong's repository](https://github.com/scottnarmstrong/MarkovProcess). ## License -Apache-2.0, see `LICENSE`. MarkovProcess (Apache-2.0, Scott Armstrong) and Mathlib -(Apache-2.0) are dependencies, not vendored, except one lemma adapted from MarkovProcess -(`mem_of_lt_exitTimeTrunc`; its notice is in `MarkovProcessPilot/BrownianExit.lean`). +Apache-2.0, see [`LICENSE`](LICENSE). MarkovProcess (Apache-2.0, Scott +Armstrong) and Mathlib (Apache-2.0) are dependencies, not vendored, except one +lemma adapted from MarkovProcess (`mem_of_lt_exitTimeTrunc`; its notice is in +[`MarkovProcessPilot/BrownianExit.lean`](MarkovProcessPilot/BrownianExit.lean)). + +Maintained by [Le Chen](https://webhome.auburn.edu/~lzc0090/), Department of +Mathematics and Statistics, Auburn University. diff --git a/docs/assets/exit-time.svg b/docs/assets/exit-time.svg new file mode 100644 index 0000000..53116b0 --- /dev/null +++ b/docs/assets/exit-time.svg @@ -0,0 +1,28 @@ + + Brownian path stopped at its truncated exit time + Time runs to the right. Two horizontal lines mark the levels a (bottom) and b (top). A jagged path starts at level x between them at time 0 and is stopped at time T, the first time it touches level b, which comes before the dashed vertical line at the horizon K. T equals the exit time from the open interval (a, b), capped at K. The theorem says the expected stopped position equals x. + + + + + + time + + + + b + a + x + + + K + + + + + + + T + stopped at T = min(exit time from (a, b), K) + Under the law of Brownian motion started at x, the mean of the path at T is x. + diff --git a/docs/assets/logo.svg b/docs/assets/logo.svg new file mode 100644 index 0000000..4415b21 --- /dev/null +++ b/docs/assets/logo.svg @@ -0,0 +1,20 @@ + + MarkovProcess pilot logo + A jagged random path starts between two horizontal barriers and stops at the point where it first touches the upper barrier, before a dashed vertical time horizon. + + + + + + + + + + + + + + + + + diff --git a/docs/proof-outline.md b/docs/proof-outline.md new file mode 100644 index 0000000..13c7396 --- /dev/null +++ b/docs/proof-outline.md @@ -0,0 +1,179 @@ +# Proof outline + +[Back to README](../README.md) · [Reproducing and evidence](reproducing.md) + +Everything below is in +[`MarkovProcessPilot/BrownianExit.lean`](../MarkovProcessPilot/BrownianExit.lean), +namespace `MarkovProcessPilot`. Almost all of the mathematics comes from Scott +Armstrong's [MarkovProcess](https://github.com/scottnarmstrong/MarkovProcess) +library; the last section lists exactly what came from the library and what +this pilot had to write. + +

+ 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. +

+ +## Part (a): the bridge to Mathlib's Brownian motion + +```lean +theorem hasIndepIncrements_iff {T Ω E : Type*} [Preorder T] [MeasurableSpace Ω] + [MeasurableSpace E] [Sub E] (X : T → Ω → E) (P : Measure Ω) : + MarkovProcess.HasIndepIncrements X P ↔ ProbabilityTheory.HasIndepIncrements X P := + Iff.rfl + +theorem isBrownianReal_iff {Ω : Type*} [MeasurableSpace Ω] (X : ℝ≥0 → Ω → ℝ) + (P : Measure Ω) : + MarkovProcess.IsBrownianReal X P ↔ ProbabilityTheory.IsBrownianReal X P + +theorem isBrownianReal_brownianMotion (x : ℝ) : + ProbabilityTheory.IsBrownianReal + (fun (t : ℝ≥0) (ω : MarkovProcess.ContinuousPath ℝ) ↦ ω t - x) + (MarkovProcess.brownianMotion x) + +-- a first use of Mathlib's Brownian API through the bridge +theorem integral_eval_brownianMotion (x : ℝ) (t : ℝ≥0) : + ∫ ω, ω t ∂(MarkovProcess.brownianMotion x) = x +``` + +- The bridge is an exact `Iff` for every process and measure, not only for the + canonical one. +- `MarkovProcess.HasIndepIncrements` is definitionally Mathlib's (`Iff.rfl` + closes it). +- The forward direction of `isBrownianReal_iff` is Mathlib's + `HasIndepIncrements.isPreBrownianReal_of_hasLaw`. The reverse direction uses + Mathlib's `IsPreBrownianReal.hasLaw_eval` and + `IsPreBrownianReal.hasIndepIncrements`. + +A note on the library at its pinned revision: the docstring of +`MarkovProcess/Examples/BrownianMotion.lean` says Mathlib's +`HasIndepIncrements` and `IsBrownianReal` are "not available at the pinned +revision". At the Mathlib commit the library actually resolves to +(`065356127b1d`) both exist, and this file compiles against them. The +docstring is simply older than the Mathlib pin. + +## Part (b): optional stopping at a truncated exit time + +```lean +theorem 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 +``` + +There is no hypothesis beyond `a < x < b`. In words: 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`. + +### Why not a stopped martingale + +One natural plan is to build a clamped stopped martingale and call +`integral_stoppedValue_eq_of_locallyBounded`. That route is circular: showing +the stopped process is a martingale is itself optional stopping. The library +offers a better route, **Dynkin's formula at a bounded stopping time**, which +it has already derived from optional stopping. + +### The route through Dynkin's formula + +1. `cutId y = y * φ(y)`, where `φ` is a Mathlib `ContDiffBump` equal to 1 on + `[a-1, b+1]`. `cutId` is smooth and compactly supported, so it and its + second derivative are `C₀` functions. +2. `MarkovProcess.mem_generatorDomain_heatSemigroup` and + `generator_heatSemigroup` put `cutId` in the generator domain, with + generator `cutId'' / 2`. That is 0 on `(a-1, b+1)`. +3. `IsFellerKernelSemigroup.integral_eval_stoppingTime_sub_eq_integral_integral_generator` + is applied with the heat semigroup's `isConservative_heatSemigroup` and + `kolmogorovRegular_heatSemigroup`, at the stopping time + `exitTimeTrunc (Ioo a b) K` (`isStoppingTime_exitTimeTrunc`, + `exitTimeTrunc_le`). It gives + `E_x cutId(ω_T) - cutId x = E_x ∫_0^T (cutId''/2)(ω_s) ds`. The inner + integral vanishes, because `ω_s ∈ (a, b)` for `s < T`. +4. Almost surely `ω 0 = x`, because `brownianMotion_map_eval 0 x` gives + `gaussianReal x 0 = dirac x`. Then `ω_T ∈ [a, b]` by continuity of the + path, where `cutId = id`. So `E_x ω_T = cutId x = x`. + +Helper results, all proved: `contDiff_cutId`, `hasCompactSupport_cutId`, +`cutId_eq_self`, `iteratedDeriv_two_cutId_eq_zero`, `mem_of_lt_exitTimeTrunc`, +`eval_exitTimeTrunc_mem_Icc` and `ae_eval_zero_eq`. +`mem_of_lt_exitTimeTrunc` is adapted, specialised to `ℝ` and made public, from +Scott Armstrong's `private` lemma in +`MarkovProcess/Trajectory/DynkinStopping.lean`; his copyright notice is at the +top of `BrownianExit.lean`. + +## The comparator statement (Mathlib vocabulary only) + +The headline theorem is also judged by `lake comparator` against a statement +that uses nothing but Mathlib: +[`Audit/Exit/Challenge.lean`](../Audit/Exit/Challenge.lean), theorem +`exit_mean`. + +```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 +``` + +It quantifies over any probability law `P` on `C(ℝ≥0, ℝ)` under which the +recentred coordinate process is Brownian in Mathlib's sense, uses Mathlib's +`hittingBtwn` of `(Ioo a b)ᶜ` on `[0, K]` as the stopping time, and also states +integrability. [`Audit/Exit/Solution.lean`](../Audit/Exit/Solution.lean) +proves it from the pilot theorem in two pieces: + +1. `hittingBtwn_eq_exitTimeTrunc`: path by path, Mathlib's `hittingBtwn` of + `Uᶜ` on `[0, K]` is the library's `exitTimeTrunc U K`. +2. `eq_brownianMotion_of_isBrownianReal`: such a law `P` is + `MarkovProcess.brownianMotion x`, by the library's uniqueness theorem + `MarkovProcess.eq_brownianMotion_of_map_finsetEvaluation`. + +## What MarkovProcess gave us for free, and what we wrote + +**From MarkovProcess (used directly, unmodified):** + +- The canonical Brownian motion + `brownianMotion : Kernel ℝ (ContinuousPath ℝ)`, its identification + `isBrownianReal_brownianMotion`, and the one-point law + `brownianMotion_map_eval`. +- The exit-time API: `exitTimeTrunc`, `isStoppingTime_exitTimeTrunc`, + `exitTimeTrunc_le`, `coe_exitTimeTrunc`, `mem_of_lt_exitTime`. +- The heat generator: `mem_generatorDomain_heatSemigroup` and + `generator_heatSemigroup`, so `C²` `C₀` functions with `C₀` second + derivative are in the domain, with `L = ½ d²`. +- Feller and Kolmogorov regularity of the heat semigroup: + `isFellerKernelSemigroup_heatSemigroup`, `isConservative_heatSemigroup` and + `kolmogorovRegular_heatSemigroup`. +- **Dynkin's formula at a bounded stopping time** + (`integral_eval_stoppingTime_sub_eq_integral_integral_generator`). + Underneath it sit continuous-time optional stopping + (`integral_stoppedValue_eq_of_locallyBounded`) and the martingale property + of the Dynkin process. This was the expensive part, and none of it had to be + written. +- For the comparator solution, the uniqueness theorem + `eq_brownianMotion_of_map_finsetEvaluation`. + +**What this pilot wrote (about 250 lines including docs):** + +- The two-way bridge `isBrownianReal_iff` (about 15 lines). The heavy + direction is Mathlib's `isPreBrownianReal_of_hasLaw`. +- A test function: the identity cut off by a `ContDiffBump`, its `C₀` + packaging, and the fact that its second derivative vanishes near `[a, b]`. +- The pathwise facts: before `T` the path is in `(a, b)`, and at `T` it is in + `[a, b]`. +- `ω 0 = x` almost surely, from the dirac law at time 0. +- The final assembly: the inner integral vanishes almost everywhere, then + `integral_congr_ae`. + +**Friction points met while consuming the library:** + +- `Main` does not import `Examples/*`. The pilot imports + `MarkovProcess.Examples.{BrownianMotion,HeatGenerator}` and + `MarkovProcess.Trajectory.DynkinStopping` directly. +- The "path is inside `U` before the truncated exit time" lemma is `private` + in the library, so the pilot had to copy it (with attribution). +- The library's docstring claim that Mathlib lacks `IsBrownianReal` is stale + for its own Mathlib pin. + +## Out of scope + +- **Untruncated exit times.** The library has + `Trajectory/ExpectedExitTime.lean` (`ae_exitTime_lt_top`); with dominated + convergence it would remove `K` and give the exit probability + `P_x(exit at b) = (x - a)/(b - a)`. Not attempted, and not claimed here. diff --git a/docs/reproducing.md b/docs/reproducing.md new file mode 100644 index 0000000..194d5f9 --- /dev/null +++ b/docs/reproducing.md @@ -0,0 +1,108 @@ +# Reproducing and evidence + +[Back to README](../README.md) · [Proof outline](proof-outline.md) + +## Dependencies and pins + +| Item | Pin | +|---|---| +| Lean toolchain | `leanprover/lean4:v4.35.0-rc2` (prerelease, inherited from MarkovProcess) | +| MarkovProcess | `https://github.com/scottnarmstrong/MarkovProcess.git` @ [`666cda029098a1106914fc9fa7abd1727573284a`](https://github.com/scottnarmstrong/MarkovProcess/tree/666cda029098a1106914fc9fa7abd1727573284a) | +| Mathlib (transitive, via MarkovProcess's `v4.35.0-rc2` tag) | `065356127b1dc0016f66b7283ce0ce2c4055aa55` | +| batteries / aesop / Qq / proofwidgets / plausible / LeanSearchClient / importGraph / Cli | transitive, see [`lake-manifest.json`](../lake-manifest.json) | + +There is a single `require` (MarkovProcess) in +[`lakefile.toml`](../lakefile.toml); Lake did not ask for a second Mathlib +requirement. The project uses the Lean module system (`module`, +`public import`, `@[expose] public section`), as MarkovProcess's own files do. + +## How to build + +```bash +lake update # once; also runs Mathlib's cache fetch via the post-update hook +lake exe cache get # Mathlib oleans (no-op if already fetched) +lake build # builds the needed MarkovProcess modules from source, then the pilot +lake env lean scripts/Axioms.lean +``` + +MarkovProcess ships no olean cache, so its modules compile from source on the +first build. To build the comparator audit modules as well, run +`lake build Audit`. + +## Build cost (measured on a laptop, 2026-10-05) + +Host: an Intel i5-11500H laptop (12 threads), 38 GB RAM. The build was pinned +to 4 cores with `taskset -c 0-3 nice -n 10` because another Lean build was +running on the same host. `lake build` at this toolchain has no `-j` flag +(`error: unknown short option '-j'`), so `taskset` was used to cap the cores. +Times and memory come from `/usr/bin/time -v`. Peak RSS is the largest single +process (getrusage), not the sum across workers. + +| Step | Wall time | Peak RSS | +|---|---|---| +| `lake update` (clones 10 packages + Mathlib cache fetch of 8,915 files) | 1:50.6 | 0.95 GB | +| `lake exe cache get` (second call, already cached) | 0:05.9 | 0.80 GB | +| `lake build MarkovProcess` (all 250 MarkovProcess modules from source; 3,514 jobs; 0 warnings) | **3:32.8** (524.7 s user, 351% CPU) | **1.54 GB** | +| `lake build` of the pilot after `rm -rf .lake/build` (MarkovProcess already built) | **0:07.4** (`BrownianExit` 3.2 s) | 1.54 GB | +| `lake env lean scripts/Axioms.lean` | 0:10.6 | n/a | + +So MarkovProcess costs about 3.5 minutes on 4 cores, not the tens of minutes +one might expect for 250 modules. Logs are in [`logs/`](../logs/). + +## Axioms and placeholders + +`lake env lean scripts/Axioms.lean` (full output in +[`logs/axioms.txt`](../logs/axioms.txt)): + +```text +'MarkovProcessPilot.hasIndepIncrements_iff' depends on axioms: [propext, Classical.choice, Quot.sound] +'MarkovProcessPilot.isBrownianReal_iff' depends on axioms: [propext, Classical.choice, Quot.sound] +'MarkovProcessPilot.isBrownianReal_brownianMotion' depends on axioms: [propext, Classical.choice, Quot.sound] +'MarkovProcessPilot.integral_eval_brownianMotion' depends on axioms: [propext, Classical.choice, Quot.sound] +'MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo' depends on axioms: [propext, Classical.choice, Quot.sound] +'MarkovProcessPilot.eval_exitTimeTrunc_mem_Icc' depends on axioms: [propext, Classical.choice, Quot.sound] +'MarkovProcessPilot.ae_eval_zero_eq' depends on axioms: [propext, Classical.choice, Quot.sound] +'MarkovProcessPilot.iteratedDeriv_two_cutId_eq_zero' depends on axioms: [propext, Classical.choice, Quot.sound] +``` + +A grep of `MarkovProcessPilot.lean` and `MarkovProcessPilot/` for +`sorry|admit|axiom |native_decide` finds nothing. (The `sorry` in +`Audit/*/Challenge.lean` is intentional: a comparator challenge is a statement +with a placeholder proof, and the matching `Solution.lean` proves it.) + +## Receipts + +[`.lean-receipts/`](../.lean-receipts/) holds two kinds of receipt for commit +[`05d99d75df82`](https://github.com/chenle02/markovprocess-pilot/tree/05d99d75df8235e79902220f0fe13e07e81867ca), +the commit that last changed the Lean source: + +- **Lower tier** (`05d99d75df82-*-pilot.json` and its `-lower-report.txt`): + `lake build`, `lake build Audit`, a placeholder scan and `#print axioms`, at + Lean `v4.35.0-rc2` and Mathlib `065356127b1d`. Result: 0 `sorry`, axioms + `propext`, `Classical.choice`, `Quot.sound`. +- **Comparator** (`05d99d75df82-comparator.json` and its two logs): + `lake comparator`, toolchain mechanism, Lean `v4.35.0-rc2`. For + [`comparator/config-exit.json`](../comparator/config-exit.json) it checks + that the Mathlib-only statement `exit_mean` in + [`Audit/Exit/Challenge.lean`](../Audit/Exit/Challenge.lean) is exactly what + [`Audit/Exit/Solution.lean`](../Audit/Exit/Solution.lean) proves, with only + the permitted axioms, and replays the proof in the con-ron, NanoDa and Lean + kernels. [`comparator/config-smoke.json`](../comparator/config-smoke.json) + is a smoke test of the same machinery on a trivial statement + (`two_mul_le`). Both results: `pass`. + +The receipts are bound to that commit. Later commits that touch only +documentation, images or repository metadata do not change what was checked; +any change to the Lean source, `lakefile.toml`, `lake-manifest.json` or +`lean-toolchain` would need fresh receipts. + +The older `9bb873e7aa31-*` receipts cover the previous source commit, which +differed only in attribution comments in `BrownianExit.lean` (the file header +and one docstring). + +## Index listing + +The package is listed in the lean-pkg package index at the pin +`05d99d75df82`, with trust level `comparator` and headline +`MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo`. The index repository may +not be publicly readable; the receipts in this repository are self-contained. diff --git a/llms.txt b/llms.txt new file mode 100644 index 0000000..cbac2ce --- /dev/null +++ b/llms.txt @@ -0,0 +1,27 @@ +# MarkovProcess consumer pilot + +> A small Lean 4 project built on Scott Armstrong's MarkovProcess library (https://github.com/scottnarmstrong/MarkovProcess), which supplies the Brownian motion, exit times, heat generator, optional stopping and Dynkin's formula. The pilot adds about 250 lines. Headline theorem `MarkovProcessPilot.integral_eval_exitTimeTrunc_Ioo`: for `a < x < b` and every `K : ℝ≥0`, the integral of `ω (exitTimeTrunc (Set.Ioo a b) K ω)` against `MarkovProcess.brownianMotion x` equals `x`. Bridge `MarkovProcessPilot.isBrownianReal_iff`: `MarkovProcess.IsBrownianReal X P ↔ ProbabilityTheory.IsBrownianReal X P` for every `X` and `P`. The exit time is truncated at `K`; untruncated exit times and the exit probability are not proved. Lean `v4.35.0-rc2`, Mathlib `065356127b1d`, MarkovProcess `666cda029098`. Lower-tier and comparator receipts (toolchain mechanism; con-ron, NanoDa and Lean kernels) are bound to commit `05d99d75df8235e79902220f0fe13e07e81867ca`. This is a pilot, not a general library; credit MarkovProcess for the underlying theory. + +## Essential + +- [README](https://raw.githubusercontent.com/chenle02/markovprocess-pilot/main/README.md): Result, scope, status and quick start. +- [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. + +## Source at the receipted commit + +- [BrownianExit.lean](https://github.com/chenle02/markovprocess-pilot/blob/05d99d75df8235e79902220f0fe13e07e81867ca/MarkovProcessPilot/BrownianExit.lean): The bridge, the test function and the exit-time theorem. +- [Comparator challenge](https://github.com/chenle02/markovprocess-pilot/blob/05d99d75df8235e79902220f0fe13e07e81867ca/Audit/Exit/Challenge.lean): Theorem `exit_mean`, stated with Mathlib only. +- [Comparator solution](https://github.com/chenle02/markovprocess-pilot/blob/05d99d75df8235e79902220f0fe13e07e81867ca/Audit/Exit/Solution.lean): Proves `exit_mean` from the pilot theorem. +- [lakefile.toml](https://github.com/chenle02/markovprocess-pilot/blob/05d99d75df8235e79902220f0fe13e07e81867ca/lakefile.toml): Single `require` on MarkovProcess at a pinned commit. + +## Verification + +- [Reproducing and evidence](https://raw.githubusercontent.com/chenle02/markovprocess-pilot/main/docs/reproducing.md): Pins, build commands, build cost, axioms and receipts. +- [Comparator receipt](https://github.com/chenle02/markovprocess-pilot/blob/main/.lean-receipts/05d99d75df82-comparator.json): Result `pass` for `exit_mean` and the smoke test. + +## Optional + +- [MarkovProcess](https://github.com/scottnarmstrong/MarkovProcess): The library this pilot depends on, by Scott Armstrong. +- [MarkovProcess citation](https://github.com/scottnarmstrong/MarkovProcess/blob/main/CITATION.cff): How to cite the library. From 7d6681d9e145d633d54bdf5b12075d1478553910 Mon Sep 17 00:00:00 2001 From: chenle02 Date: Thu, 8 Oct 2026 20:48:23 -0400 Subject: [PATCH 2/2] docs: repository map as a table so it wraps on narrow screens Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011u9cmGVrmPi5G9fC65oymz --- README.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d6d2782..451f2ad 100644 --- a/README.md +++ b/README.md @@ -110,18 +110,17 @@ build: about 3.5 minutes on 4 cores and 1.5 GB peak memory per process ## Repository map -```text -MarkovProcessPilot/BrownianExit.lean the bridge and the exit-time theorem (namespace MarkovProcessPilot) -MarkovProcessPilot.lean umbrella import -Audit/Exit/{Challenge,Solution}.lean comparator statement (Mathlib only) and its proof -Audit/Smoke/ comparator smoke test on a trivial statement -comparator/ comparator configurations -scripts/Axioms.lean #print axioms for the main declarations -.lean-receipts/ lower-tier and comparator receipts, bound to source commits -claims.yaml machine-readable claims (schema claims/1) -logs/ build, cache and axiom logs -docs/ proof outline, reproduction notes, images -``` +| Path | Contents | +|---|---| +| [`MarkovProcessPilot/BrownianExit.lean`](MarkovProcessPilot/BrownianExit.lean) | the bridge and the exit-time theorem | +| [`MarkovProcessPilot.lean`](MarkovProcessPilot.lean) | umbrella import | +| [`Audit/Exit/`](Audit/Exit/) | comparator statement (Mathlib only) and its proof | +| [`Audit/Smoke/`](Audit/Smoke/), [`comparator/`](comparator/) | comparator smoke test and configurations | +| [`scripts/Axioms.lean`](scripts/Axioms.lean) | `#print axioms` for the main declarations | +| [`.lean-receipts/`](.lean-receipts/) | lower-tier and comparator receipts, bound to source commits | +| [`claims.yaml`](claims.yaml) | machine-readable claims (schema `claims/1`) | +| [`logs/`](logs/) | build, cache and axiom logs | +| [`docs/`](docs/) | proof outline, reproduction notes, images | ## Citing