HyperCactus0 commited on
Commit
8e549a6
·
verified ·
1 Parent(s): 18b2d63

Docs: explain LeanTransitionCorpus for ATP training

Browse files
Files changed (1) hide show
  1. README.md +71 -4
README.md CHANGED
@@ -13,10 +13,55 @@ configs:
13
 
14
  # LeanTransitionCorpus
15
 
16
- Incrementally published archival Lean proof transitions. **Partial extraction;
17
- not the complete planned corpus.** Original source and environment provenance are
18
- retained per row. The existing repository license metadata is preserved; source
19
- corpus licenses and restrictions still apply and are not replaced by this card.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  ## Format
22
 
@@ -37,6 +82,28 @@ Null stays null; an empty object stays the JSON string `{}`.
37
  identity of the provenance-based proof key plus `step_index`, prefixed by
38
  `ltc-v2:`. The earlier colliding source IDs are not retained in another column.
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  Each shard is round-trip compared against every original JSON row before upload.
41
  Remote bytes are streamed back and checked for SHA-256 and size at a pinned commit.
42
  `manifests/batches/` records verified shard hashes/revisions, original batch
 
13
 
14
  # LeanTransitionCorpus
15
 
16
+ > **Status: incremental upload in progress.** This repository is useful now, but
17
+ > it is not the complete planned corpus. Counts, source coverage, and shard
18
+ > inventory will grow as verified batches are added.
19
+
20
+ LeanTransitionCorpus is a dataset for training and studying automated theorem
21
+ proving systems in Lean. Its unit of data is one tactic transition: the proof state
22
+ before a tactic, the tactic that was executed, and the resulting state. This makes
23
+ it suitable for tactic prediction, proof-state representation learning, premise
24
+ selection, retrieval, verification, and trajectory-level training.
25
+
26
+ Many Lean datasets expose a theorem, tactic, and pretty-printed goal strings. This
27
+ corpus retains those human-readable views, but also preserves richer information
28
+ from Lean's elaborator: the tactic `Syntax` tree, resolved identifiers, recursive
29
+ Lean `Expr` trees, local context, metavariables, universe metavariables, source
30
+ ranges, and premise/context information. The extra representations make it
31
+ possible to investigate models that use Lean's internal structure rather than
32
+ recovering it from printed text.
33
+
34
+ Original source and environment provenance are retained per row. The repository's
35
+ MIT metadata applies to this packaging; source corpus licenses and restrictions
36
+ remain applicable and are not replaced by this card.
37
+
38
+ ## Source datasets
39
+
40
+ The extraction pipeline draws from pinned snapshots of the following Lean sources.
41
+ Rows identify their origin in `source_dataset`, `source_url`, `repo_commit`, and
42
+ toolchain columns. Coverage is incremental: a source listed here may have less
43
+ published coverage than another at any point in time.
44
+
45
+ | Source | Role in the corpus |
46
+ |---|---|
47
+ | NuminaMath-CoT | Lean formalizations from the Numina mathematical reasoning corpus. This is the source of the initial uploaded seed. |
48
+ | DeepSeek-Prover | Lean proof data used to broaden theorem and tactic coverage. |
49
+ | Goedel Lean Workbook | Lean workbook proofs, retained as a separately attributable source. |
50
+ | Mathlib | The pinned Mathlib snapshot supplies the theorem-proving environment and contributes directly extracted Mathlib theorems. |
51
+
52
+ ## How the data is produced
53
+
54
+ For each selected theorem, the extractor runs the matching pinned Lean and Mathlib
55
+ environment, records the sequence of tactic-state transitions, and canonicalizes
56
+ the result into one row per transition. It validates internal-state structure and
57
+ continuity between adjacent transitions, assigns deterministic splits, and keeps
58
+ provenance needed to trace a row back to its source theorem and environment.
59
+
60
+ Rows are written as Parquet shards. Before publication, every shard is checked
61
+ against its source rows; uploaded bytes are read back and verified at an immutable
62
+ Hugging Face revision. Batch manifests record shard hashes, source-batch identity,
63
+ and extraction evidence. A `replay_status` value records whether an additional
64
+ replay check was performed; publication alone does not mean replay certification.
65
 
66
  ## Format
67
 
 
82
  identity of the provenance-based proof key plus `step_index`, prefixed by
83
  `ltc-v2:`. The earlier colliding source IDs are not retained in another column.
84
 
85
+ ## Schema in plain language
86
+
87
+ Each row is a single ordered step within a proof. The fields fall into these groups:
88
+
89
+ | Fields | Meaning |
90
+ |---|---|
91
+ | `example_id`, `proof_id`, `step_index`, `split`, `schema_version` | Stable identity, position in the proof, dataset split, and format version. `example_id` is globally unique; `proof_id` alone may not be. |
92
+ | `source_dataset`, `source_url`, `repo_commit`, `file_path`, `lean_version`, `mathlib_version`, `extractor_version`, `pantograph_version`, `provenance` | Where the theorem came from and the exact environment and extraction provenance needed to reproduce or audit it. |
93
+ | `theorem_name`, `theorem_statement_raw`, `theorem_source_raw`, `namespace`, `imports` | The theorem and its surrounding Lean source context. |
94
+ | `state_before_raw`, `tactic_raw`, `state_after_raw` | The familiar human-readable goal display and tactic text for the transition. |
95
+ | `state_before_structured`, `state_after_structured` | Parsed versions of the displayed proof states. |
96
+ | `state_before_internal`, `state_after_internal` | Lean's detailed elaborator state: active goals, local declarations, targets, metavariables, universe metavariables, and recursive expressions. |
97
+ | `atomic_tactics`, `tactic_internal` | The tactic's atomic view and its full Lean `Syntax` representation, including identifier resolution, premise references, and nested tactic structure when available. |
98
+ | `used_premises`, `available_context`, `source_start`, `source_end` | Referenced declarations, candidate context, and the tactic's source span. |
99
+ | `terminal`, `terminal_marker`, `terminal_raw` | Whether this step closes the proof and the source/display marker associated with closure. |
100
+ | `theorem_fingerprint`, `state_fingerprint`, `transition_fingerprint` | Deterministic hashes useful for deduplication, grouping, and integrity checks. |
101
+ | `replay_status`, `replay_error` | Result of optional replay validation; `not_run` means no independent replay was attempted. |
102
+
103
+ The recursive structures are stored as lossless JSON strings in Parquet. Parse them
104
+ with `json.loads` when you need their tree structure; leave them as strings for
105
+ text-only training baselines.
106
+
107
  Each shard is round-trip compared against every original JSON row before upload.
108
  Remote bytes are streamed back and checked for SHA-256 and size at a pinned commit.
109
  `manifests/batches/` records verified shard hashes/revisions, original batch