Datasets:
Tasks:
Text Generation
Languages:
English
Size:
1K - 10K
ArXiv:
Tags:
Formal theorem proving
Lean 4
Stochastic processes
Mathematical reasoning
Natural language processing
Autoformalization
License:
Dataset Card
Browse files
README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-sa-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- Formal theorem proving
|
| 9 |
+
- Lean 4
|
| 10 |
+
- Stochastic processes
|
| 11 |
+
- Mathematical reasoning
|
| 12 |
+
- Natural language processing
|
| 13 |
+
- Autoformalization
|
| 14 |
+
pretty_name: StochBench
|
| 15 |
+
size_categories:
|
| 16 |
+
- n<1K
|
| 17 |
+
---
|
| 18 |
+
# StochBench
|
| 19 |
+
|
| 20 |
+
StochBench is a Lean 4 benchmark of **450 graduate stochastic-process problems**, each paired with its natural-language statement. It evaluates proof agents on graduate stochastic processes. Topics include finite and countable Markov chains, martingales, stopping times, renewal processes, random walks, queues, Brownian motion, stochastic calculus, Poisson processes, and weak convergence.
|
| 21 |
+
|
| 22 |
+
The benchmark contains direct and abstracted formalizations, with explicit assumptions for each target. The informal-formal pairs can be used for autoformalization training, and checked proofs can provide supervision for proof generation. Shared definitions support further formalization in Lean.
|
| 23 |
+
|
| 24 |
+
The accompanying paper, *StochBench: A Domain-Specific Benchmark for Stochastic Processes in Lean*, reports **157 clean proofs out of 450 targets (34.9%)** from an Opus 4.8-based agent under a 15-minute per-problem limit, with results reported by topic and representation.
|
| 25 |
+
|
| 26 |
+
**Keywords:** Formal theorem proving, Lean 4, stochastic processes, mathematical reasoning, natural language processing, large language models, autoformalization, domain-specific benchmarks
|
| 27 |
+
|
| 28 |
+
**License:** Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International; see [LICENSE.txt](LICENSE.txt).
|
| 29 |
+
|
| 30 |
+
## Formalization scope
|
| 31 |
+
|
| 32 |
+
The `true_to_source` field distinguishes two representations:
|
| 33 |
+
|
| 34 |
+
- **Direct (`literal`): 114 targets, or 25.3%.** These use Mathlib objects or shared definitions to express the problem.
|
| 35 |
+
- **Abstracted (`abstract`): 336 targets, or 74.7%.** These supply required mathematical properties as explicit hypotheses, particularly where the development environment lacks the necessary infrastructure. The properties may define an object or provide intermediate results from the source problem.
|
| 36 |
+
|
| 37 |
+
For example, a hitting-time target may assume first-step equations for an expected hitting-time function. Proving the resulting target can require substantial mathematics while leaving the connection to pathwise hitting-time random variables outside the formalized task. The paper's Q361 example illustrates this distinction: its proof develops auxiliary results about matrix powers, harmonic functions, and hitting-time inequalities from the supplied equations.
|
| 38 |
+
|
| 39 |
+
The labels describe how a target is represented. They are curator-assigned categories rather than correctness scores or rigorously defined difficulty levels. Lean checks that a completed proof establishes its conclusion under the stated hypotheses; correspondence with the informal problem requires a separate assessment.
|
| 40 |
+
|
| 41 |
+
## Coverage and baseline results
|
| 42 |
+
|
| 43 |
+
The paper evaluates a multi-turn, tool-using Opus 4.8-based agent with `lean4skills` and the Lean LSP MCP server. Each target received one run capped at 15 minutes, with access to compiler feedback, library and shared-definition search, `loogle`, `leansearch`, and proof revision. The same model family assisted with statement construction.
|
| 44 |
+
|
| 45 |
+
A **clean proof** is accepted by Lean without `sorry`, `sorryAx`, or additional admitted facts, with checking performed using Lean comparator. The following results reproduce Table 1 of the paper. Only proofs with recorded proving times of at most 900 seconds are counted.
|
| 46 |
+
|
| 47 |
+
| Topic | Direct targets | Abstracted targets | Total targets | Clean proofs | Proof rate |
|
| 48 |
+
| --- | ---: | ---: | ---: | ---: | ---: |
|
| 49 |
+
| Poisson processes | 5 | 35 | 40 | 7 | 17.5% |
|
| 50 |
+
| Markov chains (finite & countable) | 23 | 73 | 96 | 37 | 38.5% |
|
| 51 |
+
| Renewal processes | 0 | 41 | 41 | 2 | 4.9% |
|
| 52 |
+
| Continuous-time Markov & queues | 1 | 54 | 55 | 23 | 41.8% |
|
| 53 |
+
| Random walks & large deviations | 9 | 53 | 62 | 16 | 25.8% |
|
| 54 |
+
| Martingales & stopping | 67 | 27 | 94 | 58 | 61.7% |
|
| 55 |
+
| Brownian motion & stochastic calculus | 0 | 45 | 45 | 8 | 17.8% |
|
| 56 |
+
| Weak convergence & functional limits | 9 | 8 | 17 | 6 | 35.3% |
|
| 57 |
+
| **Total** | **114** | **336** | **450** | **157** | **34.9%** |
|
| 58 |
+
|
| 59 |
+
The baseline proves 79 of 114 direct targets (69.3%) and 78 of 336 abstracted targets (23.2%). These are descriptive comparisons across different problems and levels of library support. They do not isolate the effect of abstraction. The evaluation covers one agent and one time budget, without repeated runs or a comparison between models.
|
| 60 |
+
|
| 61 |
+
The released `attempted_proof.json` contains **168 stored proofs**, including 11 with recorded times above the baseline cutoff. Thus, 168 is the number of stored proof records, while 157 is the paper's count within the 15-minute budget. Q361 has a recorded lower bound of 1800 seconds and is discussed separately in the paper's appendix.
|
| 62 |
+
|
| 63 |
+
## Dataset files and fields
|
| 64 |
+
|
| 65 |
+
There are 450 distinct problems with IDs 1-450. Join records using `question_id`, since the proof file covers only a subset of the problems. The files are overlapping views of the corpus; no separate training, validation, or test partition is provided.
|
| 66 |
+
|
| 67 |
+
- **`questions.json` (450 records):** English problem statements, names, and topics.
|
| 68 |
+
- **`statements.json` (450 records):** The same metadata, Lean targets, and formalization labels.
|
| 69 |
+
- **`attempted_proof.json` (168 records):** Matching statement metadata, stored proof declarations, and recorded proving times.
|
| 70 |
+
- **`proofs/p_<question_id>.lean` (168 files):** Corresponding Lean proof source files.
|
| 71 |
+
- **`helper_funcs.lean`:** Shared mathematical definitions in the `Auto` namespace.
|
| 72 |
+
|
| 73 |
+
| Field | Type | Present in | Description |
|
| 74 |
+
| --- | --- | --- | --- |
|
| 75 |
+
| `question_id` | integer | All JSON files | Problem identifier shared across files |
|
| 76 |
+
| `problem_name` | string | All JSON files | Descriptive machine-readable problem name |
|
| 77 |
+
| `informal_statement` | string | All JSON files | English mathematical problem, including notation and hypotheses |
|
| 78 |
+
| `topic` | string | All JSON files | One of the eight topic labels above |
|
| 79 |
+
| `lean_statement` | string | Statements and proofs | Lean theorem target with an intentional `sorry` proof placeholder |
|
| 80 |
+
| `true_to_source` | string | Statements and proofs | Representation label: `literal` (direct) or `abstract` (abstracted) |
|
| 81 |
+
| `proof` | string | Proofs | Lean declaration containing the stored proof, including any auxiliary declarations |
|
| 82 |
+
| `time_seconds` | integer | Proofs | Recorded proving time in seconds |
|
| 83 |
+
| `time_seconds_is_lower_bound` | boolean, optional | Proofs | When `true`, the recorded time is only a lower bound; absent from other records |
|
| 84 |
+
|
| 85 |
+
For Q361, `time_seconds` is 1800 and `time_seconds_is_lower_bound` is `true`, reflecting a reported duration of 30+ minutes. Preserve this distinction when analyzing runtimes. Missing optional values may appear as `null` when loaded into a tabular dataset.
|
| 86 |
+
|
| 87 |
+
### Example record
|
| 88 |
+
|
| 89 |
+
The following is a record from `questions.json`:
|
| 90 |
+
|
| 91 |
+
```json
|
| 92 |
+
{
|
| 93 |
+
"question_id": 8,
|
| 94 |
+
"problem_name": "stochastic_processes_martingale_1",
|
| 95 |
+
"informal_statement": "Consider biased gambler’s ruin: at each step, the gambler gains one dollar\n with probability p and losses one dollar with probability (1 − p).\n Let X_n be the money in purse at time n.\n\n Show that if p = 1/2, then (X_n) is a martingale.",
|
| 96 |
+
"topic": "Martingales & stopping"
|
| 97 |
+
}
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
## Loading the data
|
| 101 |
+
|
| 102 |
+
Download the JSON files from Hugging Face and read them directly with Python:
|
| 103 |
+
|
| 104 |
+
```python
|
| 105 |
+
import json
|
| 106 |
+
from pathlib import Path
|
| 107 |
+
from huggingface_hub import hf_hub_download
|
| 108 |
+
|
| 109 |
+
repo_id = "IdanDavidovich/StochBench"
|
| 110 |
+
|
| 111 |
+
def read_records(filename):
|
| 112 |
+
path = hf_hub_download(
|
| 113 |
+
repo_id=repo_id, repo_type="dataset", filename=filename
|
| 114 |
+
)
|
| 115 |
+
return json.loads(Path(path).read_text(encoding="utf-8"))
|
| 116 |
+
|
| 117 |
+
questions = read_records("questions.json")
|
| 118 |
+
statements = read_records("statements.json")
|
| 119 |
+
proofs = read_records("attempted_proof.json")
|
| 120 |
+
|
| 121 |
+
statements_by_id = {row["question_id"]: row for row in statements}
|
| 122 |
+
proofs_by_id = {row["question_id"]: row for row in proofs}
|
| 123 |
+
print(statements_by_id[8]["lean_statement"])
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
For files already downloaded to the current directory, use `json.loads(Path("statements.json").read_text(encoding="utf-8"))`. For reproducible experiments, pass a fixed commit hash as `revision` to `hf_hub_download` and record the Lean and Mathlib versions used.
|
| 127 |
+
|
| 128 |
+
## Attribution
|
| 129 |
+
|
| 130 |
+
**Idan Davidovich · Debargha Ganguly · Vikash Singh · Vipin Chaudhary**
|
| 131 |
+
Case Western Reserve University
|
| 132 |
+
`{idan, debargha, vikash, vipin}@case.edu`
|
| 133 |
+
|
| 134 |
+
Please cite the dataset repository and the revision used in your experiments. A dataset citation is:
|
| 135 |
+
|
| 136 |
+
```bibtex
|
| 137 |
+
@misc{davidovich2026stochbench,
|
| 138 |
+
author = {Davidovich, Idan and Ganguly, Debargha and Singh, Vikash and Chaudhary, Vipin},
|
| 139 |
+
title = {StochBench},
|
| 140 |
+
year = {2026},
|
| 141 |
+
howpublished = {Hugging Face dataset},
|
| 142 |
+
url = {https://huggingface.co/datasets/IdanDavidovich/StochBench}
|
| 143 |
+
}
|
| 144 |
+
```
|
| 145 |
+
|
| 146 |
+
## Sources and construction
|
| 147 |
+
|
| 148 |
+
StochBench combines problems written for the benchmark with exercises, lemmas, theorems, and corollaries selected from:
|
| 149 |
+
|
| 150 |
+
- Kyle Siegrist's *Probability, Mathematical Statistics, and Stochastic Processes* (2022).
|
| 151 |
+
- Hao Wu's MIT course *18.445 Introduction to Stochastic Processes* (Spring 2015).
|
| 152 |
+
- David Gamarnik's MIT course *15.070J Advanced Stochastic Processes* (Fall 2013).
|
| 153 |
+
- Robert Gallager's MIT course *6.262 Discrete Stochastic Processes* (Spring 2011).
|
| 154 |
+
|
| 155 |
+
Problems were selected for their relevance to stochastic processes and expressed as mathematical claims with hypotheses. As described in the paper, all benchmark-specific questions, definitions, and hypotheses are human-written. An Opus 4.8-based formalizer assisted with expressing them as Lean theorem statements, which were revised using Lean feedback until they elaborated in Lean 4.30.0 with a fixed Mathlib version.
|
| 156 |
+
|
| 157 |
+
Shared definitions give related problems a common mathematical representation. These include matrix-based descriptions of Markov chains, first-step equations for hitting and return times, and definitions connecting stochastic-process properties to Mathlib. The definitions and hypotheses were reviewed against the source problems.
|