A template for blueprint-driven formalization projects in Lean.
Python
116
209 commits
updated Aug 28, 2026
This repository contains a template for blueprint-driven formalization projects in Lean 4.
Ensure that you have a functioning Lean 4 installation. If you do not, please follow the Lean installation guide.
To create a new repository using this template, ensure you are on the correct repository page (LeanProject) and then follow these steps:
To clone this repository to your local machine, please refer to the relevant section of the GitHub documentation here.
To tailor this template to your specific project, follow these steps:
python3 --version
pip3 --version
cd path/to/your/project
scripts/customize_template.py NewProject
where NewProject must 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.
To set up GitHub Pages for your repository, follow these steps:
GitHub Actions.The workflow deploy-pages.yml builds the Jekyll site in
website, runs the
upstreaming-dashboard-action,
and deploys the result to GitHub Pages.
The template repository is organized as follows (listing the main folders and files):
.github contains GitHub-specific configuration files and workflows.
workflows contains GitHub Actions workflow files.
build-project.yml defines 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.deploy-pages.yml defines the workflow for building
and deploying the GitHub Pages site, including generation of the upstreaming dashboard.create-release.yml: defines the workflow for creating a new Git tag and GitHub release when the lean-toolchain file is updated in the main branch. 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.yml is the dependency
update workflow to be triggered manually by default. [It's not documented yet, but it will be soon.]dependabot.yml is the configuration file to automate CI dependency updates..vscode contains Visual Studio Code configuration files
extensions.json recommends VS Code extensions for the project.settings.json defines the project-specific settings for VS Code.Project should contain the Lean code files.
Mathlib should contain .lean files with declarations missing from the
current version of Mathlib.Example.lean is a sample Lean file.scripts contains scripts to update Mathlib ensuring that the latest version is
fetched and integrated into the development environment.website contains the Jekyll files for the GitHub Pages homepage that displays the
upstreaming dashboard..gitignore specifies files and folders to be ignored by Git.
and environment.CODE_OF_CONDUCT.md should contain the code of conduct for the project.CONTRIBUTING.md should provide the guidelines for contributing to the
project.lakefile.toml is the configuration file for the Lake build system used in
Lean projects.lean-toolchain specifies the Lean version and toolchain used for the project.For more examples of completed and ongoing Lean projects and libraries, please see the Lean Reservoir.
To install the necessary dependencies, follow the instructions in the PyGraphViz installation guide.
Assuming you have a properly configured Python environment, install LeanBlueprint by running:
pip install leanblueprint
If you have an existing installation of LeanBlueprint, you can upgrade to the latest version by running:
pip install -U leanblueprint
To set up the blueprint for your project, run:
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:
Proceed with blueprint creation? [y/n]
Respond affirmatively with y to the following prompt:
Modify lakefile and lake-manifest to allow checking declarations exist? [y/n] (y)
Respond negatively with n to the following prompt:
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:
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:
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.
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:
Python
87.2%
Shell
12.1%
A template for blueprint-driven formalization projects in Lean.
Python
116
209 commits
updated Aug 28, 2026
This repository contains a template for blueprint-driven formalization projects in Lean 4.
Ensure that you have a functioning Lean 4 installation. If you do not, please follow the Lean installation guide.
To create a new repository using this template, ensure you are on the correct repository page (LeanProject) and then follow these steps:
To clone this repository to your local machine, please refer to the relevant section of the GitHub documentation here.
To tailor this template to your specific project, follow these steps:
python3 --version
pip3 --version
cd path/to/your/project
scripts/customize_template.py NewProject
where NewProject must 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.
To set up GitHub Pages for your repository, follow these steps:
GitHub Actions.The workflow deploy-pages.yml builds the Jekyll site in
website, runs the
upstreaming-dashboard-action,
and deploys the result to GitHub Pages.
The template repository is organized as follows (listing the main folders and files):
.github contains GitHub-specific configuration files and workflows.
workflows contains GitHub Actions workflow files.
build-project.yml defines 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.deploy-pages.yml defines the workflow for building
and deploying the GitHub Pages site, including generation of the upstreaming dashboard.create-release.yml: defines the workflow for creating a new Git tag and GitHub release when the lean-toolchain file is updated in the main branch. 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.yml is the dependency
update workflow to be triggered manually by default. [It's not documented yet, but it will be soon.]dependabot.yml is the configuration file to automate CI dependency updates..vscode contains Visual Studio Code configuration files
extensions.json recommends VS Code extensions for the project.settings.json defines the project-specific settings for VS Code.Project should contain the Lean code files.
Mathlib should contain .lean files with declarations missing from the
current version of Mathlib.Example.lean is a sample Lean file.scripts contains scripts to update Mathlib ensuring that the latest version is
fetched and integrated into the development environment.website contains the Jekyll files for the GitHub Pages homepage that displays the
upstreaming dashboard..gitignore specifies files and folders to be ignored by Git.
and environment.CODE_OF_CONDUCT.md should contain the code of conduct for the project.CONTRIBUTING.md should provide the guidelines for contributing to the
project.lakefile.toml is the configuration file for the Lake build system used in
Lean projects.lean-toolchain specifies the Lean version and toolchain used for the project.For more examples of completed and ongoing Lean projects and libraries, please see the Lean Reservoir.
To install the necessary dependencies, follow the instructions in the PyGraphViz installation guide.
Assuming you have a properly configured Python environment, install LeanBlueprint by running:
pip install leanblueprint
If you have an existing installation of LeanBlueprint, you can upgrade to the latest version by running:
pip install -U leanblueprint
To set up the blueprint for your project, run:
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:
Proceed with blueprint creation? [y/n]
Respond affirmatively with y to the following prompt:
Modify lakefile and lake-manifest to allow checking declarations exist? [y/n] (y)
Respond negatively with n to the following prompt:
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:
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:
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.
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:
Python
87.2%
Shell
12.1%