Directory macros/latex/contrib/leanify
leanify — a LaTeX article checked by Lean
Version 0.3, 2026-11-06.
Leanify compiles an ordinary mathematical article, written in LaTeX, to the Lean proof assistant: every definition and theorem becomes a Lean statement checked by the kernel, and the proofs are checked sentence by sentence against the results they cite. The same source is typeset as the paper you submit.
The LaTeX package leanify.sty is the typesetting side:
- it loads the notation the Leanify grammar reads (
mathtools,amssymb); - with shell escape, inside a Lean project, it runs
lake exe leanify checkon every compile and reports the findings as LaTeX warnings at their lines; - with the option
status, it marks every labelled result in the margin with its verification status (checked, derived, partly checked, compiled, false); - without options and without shell escape, it changes nothing in the typeset article, so the article compiles anywhere, e.g. on arXiv.
\usepackage{leanify} % check as you compile \usepackage[status]{leanify} % and show the verification status \usepackage[certify]{leanify} % and build the certificate first
The package needs LaTeX 2022-06-01 or newer. Checking needs the Lean toolchain (lake on the PATH) and the Leanify Lean package; typesetting does not.
Documentation: leanify-doc.pdf, and the full documentation, tutorial and demo at https://corrram.github.io/leanify/. Source and issues: https://github.com/Corrram/leanify.
Licence
Copyright (C) 2026 Marcus Rockel. Released under the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0).
Download the contents of this package in one zip archive (277.9k).
Leanify – A LaTeX article checked by the Lean proof assistant
This package connects mathematical articles written in LaTeX with the Leanify proof checker and the Lean proof assistant. It translates mathematical definitions, statements, and proofs supported by its grammar into Lean for formal verification. The same LaTeX source is used to typeset the article.
The leanify package provides the LaTeX integration. It loads
the required mathematical notation packages and, when shell escape is
enabled within a configured Lean project, invokes the checker during
compilation. Diagnostic messages are reported as LaTeX warnings at
the corresponding source lines. The status option displays
the verification status of labelled results in the margins.
Without shell escape, no external checker is invoked. Without options, the package leaves the typeset article unchanged. Thus, articles can also be compiled without the Lean toolchain, for example on arXiv. Formal verification requires the Lean toolchain and the separate Leanify checker.
| Package | Leanify |
| Home page | |
| Bug tracker | |
| Repository | |
| Version | 0.3 |
| Licenses | Apache License, version 2.0 |
| Copyright | 2026 Markus Rockel |
| Maintainer | Markus Rockel |
| Topics | Callback Maths Debug support Proof |