GenLimitLib: A Formal Library for Language Generation in the Limit and AI-Assisted Mathematical Research
Organizations: Yale University · Rutgers University
Abstract
We present GenLimitLib, a source-aligned Lean 4 library for language generation in the limit. Introduced by Kleinberg and Mullainathan at NeurIPS 2024, language generation in the limit studies a theoretical question motivated by LLMs: how to generate valid new strings from observed examples. This young and rapidly evolving field offers a natural testbed for studying large-scale formalization. GenLimitLib contains formal developments for 30 papers. It extracts shared definitions and reusable proof components while preserving paper-specific assumptions and statements, and records relationships across papers. In this way, GenLimitLib provides a concrete and structured view of the literature. We show through mathematical case studies and LLM experiments how our library can support both human mathematical research and AI-assisted research. Our Library: https://github.com/pengzhang91/generation-in-the-limit-lib.
Figures & tables
| Condition | Resources |
|---|---|
| P | Minimal Lean vocabulary |
| PML | Full research sub-library |
| PML-Oracle | Oracle-selected library subset |
| Success | ||||
|---|---|---|---|---|
| Condition | Success H/M P | PML | PML- Oracle | Overall |
| Proof / H | 15/25 | 22/25 | 25/25 | 62/75 |
| No proof / H | 14/25 | 22/25 | 24/25 | 60/75 |
| Proof / M | 10/25 | 17/25 | 16/25 | 43/75 |
| No proof / M | 9/25 | 18/25 | 16/25 | 43/75 |
| Overall | 48/100 | 79/100 | 81/100 | 208/300 |
| Condition | Valid proofs | API cost / valid proof |
|---|---|---|
| P | 48/100 | $2.76 |
| PML | 79/100 | $1.95 |
| PML-Oracle | 81/100 | $1.78 |
| Information supplied | Accuracy (%) |
|---|---|
| Question only | 41.20 |
| Paper excerpts | 70.09 |
| Paper + unrelated Lean | 71.12 |
| Paper + Lean in file order | 73.45 |
| Paper + relevant Lean | 78.55 |
| Map supplied | Accuracy (%) |
|---|---|
| No map | 60.26 |
| Relevant map | 70.61 |
| Sham map | 60.51 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Finding | Proof | Lean scope |
|---|---|---|
| Section 4.1 : local invariant repair | Appendix A.2 | Counterexample, corrected score bound, and the repaired generation guarantee, including repeated observations. |
| Theorem 1 : finite proper replay | Appendix A.3 | Three-language impossibility, both directions of the characterization, and finite-state consequences. |
| Theorem 2 : exact staircase frontier | Appendix A.4 | Exact guarantees, lower bounds for arbitrary deterministic generators, and Pareto optimality. |
| Task | Vocabulary files | PML-Oracle files |
|---|---|---|
| Case 002 | 6 | 4 |
| Case 017 | 8 | 10 |
| Case 024 | 6 | 13 |
| Case 025 | 8 | 44 |
| Case 019 | 8 | 59 |
| Setting | P | PML | PML-Oracle |
| Case 002 | |||
| Proof / High | 5 | 4 | 5 |
| No proof / High | 4 | 5 | 5 |
| Proof / Medium | 2 | 2 | 2 |
| No proof / Medium | 2 | 4 | 3 |
| Case 017 | |||
| P | PML | PML-Oracle | |
| Panel A: By theorem task | |||
| Case 002 | $2.28 | $2.06 | $1.91 |
| Case 017 | $1.56 | $1.13 | $0.99 |
| Case 024 | $2.05 | $0.89 | $0.95 |
| Case 025 | – | $1.43 | $1.34 |
| Case 019 | – | $11.10 | $5.90 |
| Condition | Valid proofs | API calls per run | Input tokens per run | Cache-write tokens per run | Reasoning tokens per run | Author time per run |
|---|---|---|---|---|---|---|
| P | 48/100 | 55.6 | 3.122M | 166.6K | 11.3K | 19.3 min |
| PML | 79/100 | 51.9 | 3.121M | 253.8K | 9.33K | 15.7 min |
| PML-Oracle | 81/100 | 53.6 | 3.184M | 210.2K | 9.94K | 17.6 min |