leanproject
A template for blueprint-driven formalization projects in Lean.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.6%) to scientific vocabulary
Keywords
Repository
A template for blueprint-driven formalization projects in Lean.
Basic Info
- Host: GitHub
- Owner: pitmonticone
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://pitmonticone.github.io/LeanProject/
- Size: 156 KB
Statistics
- Stars: 70
- Watchers: 4
- Forks: 8
- Open Issues: 1
- Releases: 21
Topics
Metadata Files
README.md
Lean 4 Project Template
This repository contains a template for blueprint-driven formalization projects in Lean 4.
Install Lean 4
Ensure that you have a functioning Lean 4 installation. If you do not, please follow the Lean installation guide.
Use this Template
To create a new repository using this template, ensure you are on the correct repository page (LeanProject) and then follow these steps:
- Click the Use this template button located at the top right of the repository page.
- Click the Create a new repository button.
- Select the account or organization where you want to create it, choose a name for the new repository, and click the Create repository button.
Clone this Repository
To clone this repository to your local machine, please refer to the relevant section of the GitHub documentation here.
Customize this Template
To tailor this template to your specific project, follow these steps:
- If you don't have a Python environment, you can install one by following the instructions in the Python installation guide.
- Verify your Python installation by running:
bash python3 --version - Verify your Pip installation by running:
bash pip3 --version - Ensure your terminal is in the project directory by running the following command:
bash cd path/to/your/project - Execute the customization script by running:
bash scripts/customize_template.py NewProjectwhereNewProjectmust be replaced by the name of your project.
The script customize_template.py will automatically rename the
project folder and update the necessary files and configurations to match the new project name.
Configure GitHub Pages
To set up GitHub Pages for your repository, follow these steps:
- Go to the Settings tab of your repository.
- In the left sidebar, click on the Pages section.
- In the Source dropdown, select
GitHub Actions.
Repository Layout
The template repository is organized as follows (listing the main folders and files):
.githubcontains GitHub-specific configuration files and workflows.workflowscontains GitHub Actions workflow files.build-project.ymldefines the workflow for building the Lean project on pushes, pull requests, and manual triggers. This is a minimalistic build workflow which is not necessary if you decide to generate a blueprint (see instructions below) and can be manually disabled by clicking on the Actions tab, selecting Build Project in the left sidebar, then clicking the horizontal triple dots (⋯) on the right, and choosing Disable workflow.create-release.yml: defines the workflow for creating a new Git tag and GitHub release when thelean-toolchainfile is updated in themainbranch. Ensure the following settings are configured under Settings > Actions > General > Workflow permissions: "Read and write permissions" and "Allow GitHub Actions to create and approve pull requests".update.ymlis the dependency update workflow to be triggered manually by default. [It's not documented yet, but it will be soon.]
dependabot.ymlis the configuration file to automate CI dependency updates.
.vscodecontains Visual Studio Code configuration filesextensions.jsonrecommends VS Code extensions for the project.settings.jsondefines the project-specific settings for VS Code.
Projectshould contain the Lean code files.Mathlibshould contain.leanfiles with declarations missing from the current version of Mathlib.Example.leanis a sample Lean file.
scriptscontains scripts to update Mathlib ensuring that the latest version is fetched and integrated into the development environment..gitignorespecifies files and folders to be ignored by Git. and environment.CODE_OF_CONDUCT.mdshould contain the code of conduct for the project.CONTRIBUTING.mdshould provide the guidelines for contributing to the project.lakefile.tomlis the configuration file for the Lake build system used in Lean projects.lean-toolchainspecifies the Lean version and toolchain used for the project.
Blueprint
0. Selected Collaborative Projects
- Fermat's Last Theorem for Exponent 3 by Riccardo Brasca et al.
- Polynomial Freiman-Ruzsa Conjecture by Terence Tao et al.
- Fermat's Last Theorem by Kevin Buzzard et al.
- Carleson Operators on Doubling Metric Measure Spaces by Floris van Doorn et al.
- Bonn Collaborative Formalization Seminar Series in Analysis by Floris van Doorn et al.
- Prime Number Theorem and More by Alex Kontorovich et al.
- Infinity Cosmos by Emily Riehl et al.
- Analytic Number Theory Exponent Database by Terence Tao et al.
- Groupoid Model of Homotopy Type Theory by Sina Hazratpour et al.
- Equational Theories by Terence Tao et al.
- Sphere Packing in 8 Dimensions by Maryna Viazovska et al.
For more examples of completed and ongoing Lean projects and libraries, please see the Lean Reservoir.
1. Install Dependencies
To install the necessary dependencies, follow the instructions in the PyGraphViz installation guide.
2. Install LeanBlueprint Package
Assuming you have a properly configured Python environment, install LeanBlueprint by running:
bash
pip install leanblueprint
If you have an existing installation of LeanBlueprint, you can upgrade to the latest version by running:
bash
pip install -U leanblueprint
3. Configure Blueprint
To set up the blueprint for your project, run:
bash
leanblueprint new
Then, follow the prompts and answer the questions as you like, except for a few specific questions which should be answered as indicated below to ensure compatibility with this template.
Respond affirmatively with y to the following prompt:
console
Proceed with blueprint creation? [y/n]
Respond affirmatively with y to the following prompt:
console
Modify lakefile and lake-manifest to allow checking declarations exist? [y/n] (y)
Respond affirmatively with y to the following prompt:
console
Modify lakefile and lake-manifest to allow building the documentation? [y/n] (y):
If you want to generate a Jekyll-based home page for the project, respond
affirmatively with y to the following prompt:
console
Do you want to create a home page for the project, with links to the blueprint, the API documentation and the repository? [y/n]:
Respond affirmatively with y to the following prompt:
console
Configure continuous integration to compile blueprint? [y/n] (y):
For more details about the LeanBlueprint package and its commands, please refer to its documentation.
After configuring the blueprint, please wait for the GitHub Action workflow to finish. You can keep track of the progress in the Actions tab of your repository.
Selected Projects Using this Template
If you have used this template to create your own Lean project and would like to share it with the community, please consider opening a PR to add your project to this list:
- Infinity Cosmos by Emily Riehl et al.
- Analytic Number Theory Exponent Database by Terence Tao et al.
- Equational Theories by Terence Tao et al.
- Groupoid Model of Homotopy Type Theory by Sina Hazratpour et al.
- Soundness of FRI by Bolton Bailey et al.
- Weil's Converse Theorem by Chris Birkbeck et al.
- Proofs from THE BOOK by Moritz Firsching et al.
- Automata Theory by Stefan Hetzl et al.
- Dirichlet Nonvanishing by Chris Birkbeck et al.
- Seymour's Decomposition Theorem by Ivan Sergeyev et al.
- Spectral Theorem by Oliver Butterley and Yoh Tanimoto.
- NeuralNetworks by Matteo Cipollina.
- ABC Exceptions by Bhavik Mehta et al.
- Sphere Packing in 8 Dimensions by Maryna Viazovska et al.
Owner
- Name: Pietro Monticone
- Login: pitmonticone
- Kind: user
- Location: Trento, Italy
- Company: University of Trento
- Twitter: PietroMonticone
- Repositories: 699
- Profile: https://github.com/pitmonticone
Informal Mathematics @UniTrento || Formal Mathematics at Harmonic || Formalising in @LeanProver || Developing in @JuliaLang and @Python.
Citation (CITATION.bib)
@software{Monticone_LeanProject_2025,
abstract = {A template for blueprint-driven formalization projects in Lean.},
author = {Monticone, Pietro},
institution = {University of Trento},
keywords = {Lean4, Project Management, Formal Methods, Formal Verification, Theorem Proving, Interactive Theorem Proving, Proof Assistant, Mathematical Formalization, Formal Mathematics, Blueprint, Documentation, Template, Dependency Management, Continuous Integration, Automated Testing, Type Theory, Constructive Mathematics, Computer-Assisted Proof, Mathematical Software, Research Software Engineering},
license = {Apache License 2.0},
title = {LeanProject},
year = {2025}
}
GitHub Events
Total
- Create event: 42
- Issues event: 2
- Release event: 17
- Watch event: 42
- Delete event: 26
- Issue comment event: 14
- Push event: 93
- Pull request review comment event: 2
- Pull request review event: 8
- Pull request event: 65
- Fork event: 8
Last Year
- Create event: 42
- Issues event: 2
- Release event: 17
- Watch event: 42
- Delete event: 26
- Issue comment event: 14
- Push event: 93
- Pull request review comment event: 2
- Pull request review event: 8
- Pull request event: 65
- Fork event: 8
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 3
- Total pull requests: 41
- Average time to close issues: about 13 hours
- Average time to close pull requests: 5 days
- Total issue authors: 3
- Total pull request authors: 7
- Average comments per issue: 1.33
- Average comments per pull request: 0.2
- Merged pull requests: 26
- Bot issues: 1
- Bot pull requests: 30
Past Year
- Issues: 3
- Pull requests: 37
- Average time to close issues: about 13 hours
- Average time to close pull requests: 5 days
- Issue authors: 3
- Pull request authors: 7
- Average comments per issue: 1.33
- Average comments per pull request: 0.22
- Merged pull requests: 22
- Bot issues: 1
- Bot pull requests: 26
Top Authors
Issue Authors
- teorth (1)
- b-mehta (1)
Pull Request Authors
- github-actions[bot] (28)
- dependabot[bot] (9)
- pitmonticone (4)
- grunweg (3)
- Vierkantor (2)
- mo271 (2)
- b-mehta (2)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/cache v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/github-script v7 composite
- actions/checkout v4 composite
- oliver-butterley/lean-update v1-alpha composite