Skip to main content

Build a continously updating database of sorry statments in public Lean4 repositories

Project description

Lean4 SorryDB

The SorryDB project aims to help bridge the gap between automated (formal) theorem proving "in the lab" and adoption by mathematicians. It provides tools and infrastructure to facilitate developing, testing, and ultimately using AI proof agents against "real world" mathematical propositions in Lean.

At its core, it provides a continuously updating dataset of sorry statements in public Lean 4 repositories. It also provides template agents that attempt to prove such statements, and a verifier that checks the correctness of proposed proofs.

Eventually, we hope to host a continuously running sorry-filling competition, with a public leaderboard. For a detailed explanation of the project's motivation, philosophy, and long-term goals, see ABOUT.md.

Components

The nightly SorryDB dataset

The main instance of a SorryDB database is hosted at sorrydb-data. It is updated nightly, by crawling Lean 4 repositories listed on Reservoir for sorried (Prop-valued) statements.

For each such statement, it contains all information needed to locally reproduce it. This includes repository information (remote url, branch, commit hash), the Lean 4 version used, and coordinates of the sorry within the repository (path, line, column).

See DATABASE.md for more detailed information on the database format.

The sorry crawler

The dataset is updated nightly using a crawler which uses git and lake build to clone and build the repository locally, and then uses the Lean REPL to locate and analyze sorries in the repository.

The sorry-proving agents

We treat each entry of the database as a theorem-proving challenge, where the precise task is to replace the "sorry" string with a string of tactics that fills the proof. The input to an agent is an item of the dataset, and the agent is asked to clone and build the repository, and attempt to find a proof of the given sorry.

We provide two sample agents:

  1. rfl_agent which checks if the tactic rfl completes the sorried proof
  2. llm_agent which polls an LLM to make a one-shot attempt at filling the proof.

These are deliberately primitive (and hence weak), and not meant for consumption. Rather, we hope they are helpful as templates on which one can base stronger sorry-proving agents.

See AGENTS.md for the specification of input and output of an agent, and more information on the sample agents.

Getting started

SorryDB uses Poetry for dependency management and packaging. To get started

  1. Install Poetry if you haven't already

  2. Clone the repository and install dependencies:

    git clone https://github.com/SorryDB/SorryDB.git
    cd SorryDB
    poetry install
    
  3. Activate the virtual environment:

    eval $(poetry env activate)
    

The command line scripts in sorrydb/cli can now be run from poetry's virtual environment by running:

poetry run <script name> <options>.

See the documents in doc/ for more information on the various scripts provided.

Setting up your own database

We provide various tools to create and manage your own database. See DATABASE-SCRIPTS.md for instructions in setting up your own database (e.g. to scrape your own repository).

Contributing

See CONTRIBUTING.md for contribution guidelines.

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

sorrydb-0.1.0.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

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

sorrydb-0.1.0-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file sorrydb-0.1.0.tar.gz.

File metadata

  • Download URL: sorrydb-0.1.0.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Linux/6.14.4-arch1-2

File hashes

Hashes for sorrydb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5098c94af68e367421e5cce12e35d03d4fd3446bd002877d431f32561dd3695b
MD5 b2ec15fc25d1e76e4e6fed5327cf070d
BLAKE2b-256 bec0b925be2be4072621f4e1ea0d1cb153d26c6feeb507b5417faf6ea84b5077

See more details on using hashes here.

File details

Details for the file sorrydb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sorrydb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Linux/6.14.4-arch1-2

File hashes

Hashes for sorrydb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab01b0ef5bc5a967165dffbe690b49dd002c291be066f4c682316ce2afcffea6
MD5 d48d65fe5be7acb157da504fb72789a5
BLAKE2b-256 c19edde0952d5351f4ccc5f1fc6236b9f25b403625609a96a7565321a5ec48c4

See more details on using hashes here.

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