Lexifina formalizes US tax code in Lean, finds 138 drafting faults
Lexifina says it translated the US Internal Revenue Code into Lean and found 138 drafting faults, using certificates tied to official XML. It also formalized 2025 federal income tax calculations and tested them against IRS tables and independent programs. The work shows legal text can be checked mechanically, but AI translation remains a weak point that tests must catch.
Lexifina said it translated the Internal Revenue Code, Title 26 of the US Code, into the Lean programming language, using a versioned record of the law and checking cross-references against the official text. The work is part of the global-law repository, which publishes legislation and case law under a CC0 license. The team used a release the post describes as current to November 3, 2026, and reported 257 findings from automated cross-reference checks.
The Lean checker reported 138 real drafting faults, after classifying 98 findings as intended historical or not-yet-effective provisions and 21 as false alarms from editors' hyperlinks. Each fault has a short Lean certificate carrying evidence from the official XML, and the suite rechecks all 138 in about two and a half minutes. The team also translated the 2025 federal income tax calculation for one household, including One Big Beautiful Bill Act changes, and tested it against IRS tables and three independent tax programs on 5,000 households.
The method treats statutory text as a machine-readable object rather than prose alone. By encoding definitions, deductions, credits, alternative minimum tax and cross-references, the system can ask whether a provision exists, whether a reference still points to live law, and whether a calculation follows from definitions. The approach extends prior work using Lean to find known tax loopholes and points to a broader pattern of applying formal verification to legal texts, where AI translation remains lossy but can be bounded by tests and proof certificates.
The findings affect taxpayers, tax preparers, software vendors and Congress because they identify mechanical errors in the law that can change compliance, interpretation and enforcement. A repeatable checker could name the public law that introduced a fault and flag new drafting problems when the Code is updated. For tax software, a formal specification tied to IRS examples and independent programs offers a way to test calculations more directly than natural-language rules alone.
Taxpayers, preparers and software vendors are affected because machine-checked cross-references and calculations can expose drafting errors and test tax software against statutory rules. Congress and the IRS also have a repeatable way to flag new mechanical faults when the Code changes.
Sources (1)
- [1]Formalizing US Tax Code (Using Lean)(https://lexifina.com/blog/formalizing-the-us-tax-code)