{"id":23405,"date":"2026-10-07T22:04:49","date_gmt":"2026-10-07T20:04:49","guid":{"rendered":"https:\/\/djalil.chafai.net\/blog\/?p=23405"},"modified":"2026-10-07T22:31:38","modified_gmt":"2026-10-07T20:31:38","slug":"automatic-formalization-of-a-full-paper-in-lean","status":"publish","type":"post","link":"https:\/\/djalil.chafai.net\/blog\/2026\/10\/07\/automatic-formalization-of-a-full-paper-in-lean\/","title":{"rendered":"Automatic formalization of a full paper in Lean"},"content":{"rendered":"<figure id=\"attachment_23201\" aria-describedby=\"caption-attachment-23201\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/theorem_1_9_dependencies.png\"><img loading=\"lazy\" class=\"size-medium wp-image-23201\" src=\"http:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/theorem_1_9_dependencies-300x196.png\" alt=\"Lean formal dependency graph\" width=\"300\" height=\"196\" srcset=\"https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/theorem_1_9_dependencies-300x196.png 300w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/theorem_1_9_dependencies-1030x673.png 1030w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/theorem_1_9_dependencies-768x502.png 768w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/theorem_1_9_dependencies.png 1500w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-23201\" class=\"wp-caption-text\">Lean formal dependency graph<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">I have just conducted the automatic formalization in Lean of all my Ginibre Poincar\u00e9 paper <a href=\"http:\/\/arxiv.org\/abs\/2608.19358v2\">arXiv:2608.19358v2<\/a> using Codex CLI. Coverage concerns the asserted mathematical results, on the domains specified in the mathematical paper. It does not include certification of the numerical experiments or a separate formalization of every alternative proof. It took hours and the Lean code is relatively big in total because the paper involves functional analysis, stochastic calculus, and complex analysis, among other things. In particular, the formalization encompasses complex Hermite polynomials as well as the optimal Gaussian logarithmic Sobolev inequality, proved from the two-point space by tensorization and the binomial central limit theorem. Most of the formalization was done with Codex CLI, but I have also played successfully with Leanstral. What is really important is to ask Codex explicitly to use agents for the full formalization, and to use the standards of Palomar. The full development passes the project build and axiom audits. Theorem 1.1, including its equality classification, additionally passes Comparator and the three configured kernels. Palomar registration is a separate step.<\/p>\n<table>\n<tr>\n<th>Source scope<\/th>\n<th>Files\/modules<\/th>\n<th>Physical lines<\/th>\n<\/tr>\n<tr>\n<td>Active project Lean sources, including roots and generated facades<\/td>\n<td>1,315<\/td>\n<td>142,364<\/td>\n<\/tr>\n<tr>\n<td>Transitively imported Mathlib<\/td>\n<td>3,794<\/td>\n<td>1,251,826<\/td>\n<\/tr>\n<tr>\n<td>Project plus imported Mathlib<\/td>\n<td>5,109<\/td>\n<td>1,394,190<\/td>\n<\/tr>\n<\/table>\n<p style=\"text-align: justify;\">Counts include comments and blank lines. Imported Mathlib modules are counted once in full, these are source-module counts, not the size of a minimal proof-dependency closure.<\/p>\n<p style=\"text-align: justify;\"><strong>Note.<\/strong> A large automatic Lean formalization is the one of the Fermat Last Theorem : about 13 million lines, more than 5 times the size of Mathlib. It seems that the automatic formalization of the $\\theta(p_c)=0$ conjecture for bond percolation on $\\mathbb{Z}^d$, $d\\geq2$, takes \"only\" about 100,000 lines.<\/p>\n<p><a href=\"http:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/Lean_logo2.svg_.webp\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-23166\" src=\"http:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/Lean_logo2.svg_-300x94.webp\" alt=\"Lean Logo\" width=\"300\" height=\"94\" srcset=\"https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/Lean_logo2.svg_-300x94.webp 300w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/Lean_logo2.svg_-1030x321.webp 1030w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/Lean_logo2.svg_-768x240.webp 768w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/Lean_logo2.svg_-1536x479.webp 1536w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2026\/09\/Lean_logo2.svg_.webp 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p text-align:justify;\"><strong>Further reading.<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/djalilchafai\/ginibre-poincare\/blob\/main\/REPORT.md\">Ginibre Poincar\u00e9 formalization report on GitHub<\/a><\/li>\n<li><a href=\"https:\/\/djalil.chafai.net\/blog\/2026\/09\/04\/lean-formalization-with-ai\/\">First attempt: automatic formalization of Theorem 1.9<\/a><\/li>\n<li><a href=\"http:\/\/arxiv.org\/abs\/2608.19358v2\">Ginibre Poincar\u00e9 paper on arXiv<\/a><\/li>\n<li><a href=\"https:\/\/palomar-registry.org\/\">Palomar : Registry of Lean-verified mathematics<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I have just conducted the automatic formalization in Lean of all my Ginibre Poincar&eacute; paper arXiv:2608.19358v2 using Codex CLI. Coverage concerns the asserted mathematical results,&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/djalil.chafai.net\/blog\/2026\/10\/07\/automatic-formalization-of-a-full-paper-in-lean\/\">Continue reading<span class=\"screen-reader-text\">Automatic formalization of a full paper in Lean<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/posts\/23405"}],"collection":[{"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/comments?post=23405"}],"version-history":[{"count":28,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/posts\/23405\/revisions"}],"predecessor-version":[{"id":23433,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/posts\/23405\/revisions\/23433"}],"wp:attachment":[{"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/media?parent=23405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/categories?post=23405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/tags?post=23405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}