Skip to main content

Reinforcement learning for Lean theorem proving

Project description

LeanReinforcement

Repository for LeanReinforcement (LR), a Monte Carlo Tree Search (MCTS) agent building on the ReProver system.

Gym-like

This repository builds on the gym-like LeanDojo interface for interacting with Lean. See the LeanDojo documentation for more information on how to use it.

Monte Carlo Tree Search

Relevant sources will be added here as the project progresses.

TODO

  • Import ReProver weights to Snellius
  • Set up premise retrieval code
  • Create gym environment with LeanDojo and OpenAI Gym
  • Decide PPO vs MCTS => MCTS on top of ReProver
  • Update Snellius environment
  • Import LeanDojo benchmark to Snellius
  • Look into LeanDojo step time, value functions, etc.
  • Implement runner script to run MCTS agent on LeanDojo environment
  • Implement appropriate DataLoader training and evaluation
  • Implement training loop
  • Run experiments on Snellius
  • Finish in-comment ToDo's
    • Checkpoint saving and loading
    • Subtree reusage
    • Reimplement tactic generator fine-tuning
  • Implement ValueHead Dataset creation
  • Set up wandb/tensorboard equivalent logging
  • Write README.md
  • Write paper
  • Fix parallelization memory issues

License

LeanReinforcement: An MCTS RL agent for Automatic Theorem Proving in Lean. Copyright (C) 2025 Gerben Koopman

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lean_reinforcement-0.3.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lean_reinforcement-0.3.0-cp313-cp313-musllinux_1_2_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

lean_reinforcement-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

lean_reinforcement-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

lean_reinforcement-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

lean_reinforcement-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

lean_reinforcement-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

lean_reinforcement-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

lean_reinforcement-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file lean_reinforcement-0.3.0.tar.gz.

File metadata

  • Download URL: lean_reinforcement-0.3.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lean_reinforcement-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e6cf69aeb630fbc1d819e71a6d1053652cbb0b4bacaf3d9a4e176ce621ba8119
MD5 5b0ba02feaf09bf53f64fe0244ce5159
BLAKE2b-256 1c9edc7349533e10e7dbf0652816b01441eeb159dfca57baee2aac02fa3a3c12

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0.tar.gz:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lean_reinforcement-0.3.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for lean_reinforcement-0.3.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0c4830b8c88f9da1bd59ed32c097daa5ba60d92ea87ed80b97807c77ff7b8f3d
MD5 6c955a4821f75b102bfebe956ee66f58
BLAKE2b-256 5ca6715f59951569cc01762e6312d9a4ecf388deb05ee83214e295dd4305832b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lean_reinforcement-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lean_reinforcement-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec16bc63c3ea62951c3bff9383e53ad67faaed074b1d0bd3140cb349dec99914
MD5 250a85c19d51ce288a6faf4605c6eab0
BLAKE2b-256 94c95404bb14ad4fa465af92c5779546fb564f9c6f83cfb3d10a9d0b2eaad72b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lean_reinforcement-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for lean_reinforcement-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5660b2342ea969bd587e12d465d7463f8b0b4089fa08cf1a50354db50dabd735
MD5 c05ab6892089496258ed5a1d64a14212
BLAKE2b-256 7c243adb80e7e0c23eb3de526bce52dc0d1b078efa65a086769b65ee93b0b33f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lean_reinforcement-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lean_reinforcement-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa358db825a787d87ba41f32b123c730718a3fa4af3703fcaa8f8e1930ffafe2
MD5 9237872f2beaa22d0987cca3f49c2c64
BLAKE2b-256 a9e4f423298f3c06f8ee27ce436ae08e78cfa75e3ff0f1e30eaa71d6d80828a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lean_reinforcement-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for lean_reinforcement-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5890ea8bd700d588a016c4756e237215e8f290fde112c337651014ae6899673f
MD5 8259f292b72c33fa1dfc085610c05e55
BLAKE2b-256 98b21cf98ad6a2b0517205e8c2669d04f92a58f4dbaae59abb1480461598d447

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lean_reinforcement-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lean_reinforcement-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2ed7118f52f0f9b3b1f0357f5fb55b1dcef520b58d87e5aff81b8a356314d23e
MD5 81e500b4fa6f7eef16a4d70a6fe92b50
BLAKE2b-256 a298ed4b2c3493d961872f8476828e6a1eba3a7daf1310988dafce2bc7a855d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lean_reinforcement-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for lean_reinforcement-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 47e039796806f628483ced8c08beb44a6784bb2878172c672f5b51ec2335ab07
MD5 bdd19ea8eacb428a807a18d0722c9bb4
BLAKE2b-256 962b0e16d145a9a51de81b875883f618a7d8f3f8c26f65e67957d2e6e6721870

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lean_reinforcement-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lean_reinforcement-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 560ea6147aa3b7f33bd49d5fc5795901e289fa5393c116ce29306538ce454990
MD5 14df00b5e9c9c732b35192063173630c
BLAKE2b-256 0df305ab6bb46cbac6627b45ffdcf2adff1b32f6e9ec059819019c24d4c85abf

See more details on using hashes here.

Provenance

The following attestation bundles were made for lean_reinforcement-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on GerbenKoopman/LeanReinforcement

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page