Mathematical formalization in Lean 4 - #6
Open
LeonardoSanBenitez wants to merge 2 commits into
Open
Conversation
Machine-checked (Lean 4 + Mathlib) proofs of the five self-contained results of Appendix C: the log-sum inequality engine, Lemma 1 (readout DPI), Proposition 1 (information bound), Proposition 2 (local forgetting bound), Proposition 3 (optimal quadratic scrubbing), and Proposition 4 (robust isotropic scrubbing). Every result builds with zero sorry and depends only on the standard classical axioms (propext, Classical.choice, Quot.sound). See lean_proofs/README.md and lean_proofs/catalog.json. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, first of all, thank you for work, it's a really nice paper.
I wanted to contribute something I hope is useful to you: I went through the self-contained mathematical results in the paper (the four propositions and the lemma proved in Appendix C, "Proofs") and formalized all of them in Lean 4, using the Mathlib library.
For anyone less familiar with this: Lean is a proof assistant, a language where you write mathematical definitions, theorem statements, and proofs, and a computer mechanically checks that every logical step actually follows, with no room for a hidden gap or an unnoticed mistake. Machine-checked proofs are increasingly used alongside papers precisely because they build a stronger kind of trust than "we checked it by hand and it looks right"; a proof that a computer has verified line by line can't have a mistake that everyone just missed. It's also a solid foundation for anyone, including yourselves, who wants to build on these results later, since it makes completely explicit exactly what has been established and what is still being assumed.
In the
lean_proofs/folder of this PR you'll find Lean formalizations of the paper's mathematical content, one Lean file per result (with a short explanation at the top of each connecting the Lean statement back to your equations):The folder has its own README with the full list and instructions for building everything yourself if you'd like to check it independently, and a
catalog.jsonrecording, for each result, the paper statement, your own proof, and how the Lean version maps to it. Everything builds with zero unproven steps (sorryis Lean's keyword for an unproven placeholder, and there are none left anywhere), and every result depends only on the standard logical axioms.One important comment: I relied heavily on Claude Code (Anthropic's AI coding assistant) for this, especially for finding the right building blocks in Lean's math library and writing the proof code. I did go through and check that the statements capture the actual meaning of your results, but since this is your paper and your notation, I'd really appreciate it if you could take a look yourselves and double-check that the Lean statements genuinely capture what you meant, especially for Propositions 3 and 4.
Speaking of which, a few small things came up in Appendix C that look like typos. None of them change any result, but I'd appreciate it if you could confirm them:
On the assumptions: a few steps are taken as given rather than derived, and each is marked in the corresponding Lean file. In Proposition 1 the Data Processing Inequality is a hypothesis, as noted above. Proposition 3 formalizes the algebraic identity relating the two flows, taking their closed forms as the paper states them; the$t \to \infty$ Newton update (Eq. (7)) is a limit taken informally in the paper and is not formalized. Proposition 4 formalizes the exact optimization of your own second-order (Gaussian/quadratic) approximate objective — the approximation is assumed, exactly as in the paper — in the isotropic case, and there the symmetric square roots of the positive-definite matrices are taken as hypotheses (they exist by the spectral theorem). Everything else is derived in full.
Once again, thank you for developing this method, I hope these machine-checked proofs are useful to you :)