https://github.com/mrigankpawagi/simpleafier
Command line tool to help improve the quality of Lean code by converting any "simp" to "simp only".
https://github.com/mrigankpawagi/simpleafier
code-quality lean4 python-module
Last synced: about 1 month ago
JSON representation
Command line tool to help improve the quality of Lean code by converting any "simp" to "simp only".
- Host: GitHub
- URL: https://github.com/mrigankpawagi/simpleafier
- Owner: mrigankpawagi
- License: mit
- Created: 2025-04-18T13:16:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-18T16:52:34.000Z (about 1 year ago)
- Last Synced: 2025-08-26T00:59:23.471Z (9 months ago)
- Topics: code-quality, lean4, python-module
- Language: Python
- Homepage: https://pypi.org/project/Simpleafier
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Simpleafier
Simpleafier is a command line tool to help improve the quality of Lean code by converting any `simp` to `simp only`. This can help make Lean proofs more robust and maintainable by restricting the set of lemmas used by `simp`.
## Requirements
- Python 3.6+
- Lean 4
- `lake` must be installed and available in your PATH.
## Installation
Simpleafier is available on PyPI and can be installed using `pip`.
```bash
python -m pip install Simpleafier
```
## Usage
To convert all `simp` calls in a Lean file to `simp only`:
```bash
python -m simpleafier path/to/your/file.lean --simponly --fast
```
`simpleafier` must be invoked from the root of your lake project. The lean file provided must be compilable without any errors. `simpleafier` will create a temporary file in the same directory as the original file for processing. At the end of the process, the temporary file will be deleted and the original file will be replaced with the modified version.
The `--fast` flag provides significantly faster processing, but may result in less accurate results that may need more manual fixes. However it is currently the **recommended mode** for using `simpleafier` as it is more stable and gives reasonably good results.
> [!WARNING]
> This tool is still under development and does not guarantee perfect results. You may have to manually fix the output in some cases.
> [!NOTE]
> At the end of this processing, your code might contain some `simp only` or `simp only at ...` statements that may not be necessary. These are currently not automatically removed.
## License
This project is licensed under the MIT License.
## Contributing
Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request on GitHub.