Formalizing US Tax Code (Using Lean)
First reported by Lexifina ·
The IRS Tax Table is now proven to differ from the statutory formula by up to $6 for incomes under $100,000.
Lexifina has formalized the entire US Internal Revenue Code (Title 26 of the US Code) into the Lean programming language, a system used for checking mathematical proofs. This process involved translating each section of the law and verifying its cross-references against official records. The initiative identified 138 drafting mistakes within the current tax code, including references to repealed or moved provisions, typos, incorrect references, and structural inconsistencies. Furthermore, Lexifina built a computational model of the 2025 federal income tax calculation, including adjustments, deductions, alternative minimum tax, and credits, which was then tested against IRS publications and three independent tax software programs. This computational model revealed discrepancies between the tax law's text and its practical application, highlighting issues with effective dates of legislation, rounding inconsistencies in deductions, and sharp cutoffs for benefits like the Earned Income Tax Credit (EITC).
Formalizing the US tax code in Lean allows for rigorous verification, identifying not only known loopholes but also unknown ones by treating the law as executable code. This approach reveals mechanical errors in statutes and unintended consequences of legislative drafting. By comparing the formal model against IRS publications and independent tax software, Lexifina has uncovered specific flaws, such as incorrect EITC calculations and missing deductions in other tools, demonstrating the value of automated, proof-checked legal analysis.
The initiative highlights the potential for AI and formal methods to improve the accuracy and clarity of legal and financial regulations. The identification of 138 drafting mistakes and discrepancies between tax law text and its application suggests a broader need for such formalization efforts. Future work could involve extending this methodology to other complex legal domains, potentially reducing errors and increasing public trust in the fairness and precision of codified law.
AI-written summary. May contain errors.