Formalizing the US Tax Code to Identify Loopholes
Researchers are using formal verification techniques to analyze the US Internal Revenue Code, identifying drafting mistakes and potential loopholes in the tax law.

Researchers are employing the Lean programming language to formalize the entire Internal Revenue Code, aiming to identify drafting mistakes and unknown loopholes. By translating each section of the law into Lean and testing it against the IRS’s official examples, they have uncovered 138 real faults in the tax law’s text, including references to provisions that have been repealed or rewritten. These findings are verified using AI agents and are based on the official XML data published by the Office of the Law Revision Counsel. Each fault is documented with a certificate that traces the error back to the specific law that introduced it. [1]
Section 1 of Title 26 of the US Code outlines the tax rates for various categories of taxpayers, including married individuals filing joint returns, heads of households, and unmarried individuals. The tax rates are structured in a table format, specifying different brackets and corresponding tax rates. These rates are subject to annual adjustments based on the cost-of-living adjustment, ensuring that the tax tables remain relevant to inflation. However, the formal verification process has identified potential drafting errors in these sections, such as incorrect references to other parts of the code. [2]
Section 168 of Title 26 outlines the accelerated cost recovery system, which governs the depreciation of tangible property. The section details the applicable depreciation methods, recovery periods, and conventions. Formal verification has identified potential errors in the references within this section, including typos and incorrect subdivisions. For example, a typo in a citation to a subsection has been flagged, which could lead to misinterpretation of the depreciation rules. These errors may affect how taxpayers calculate their deductions and could potentially create unintended loopholes. [3]
Section 1400Z-2 of Title 26 outlines the treatment of gains from the sale of property held by the taxpayer, including provisions for deferring gain invested in opportunity zone property. The section includes specific rules for the inclusion of deferred gain in gross income and adjustments to the taxpayer’s basis in the investment. Formal verification has identified issues with the structure of this section, including parentheses that do not close properly, which could lead to ambiguities in the interpretation of the rules. These issues highlight the need for careful review and correction of the tax code to ensure clarity and accuracy. [4]
Advertisement
Researchers are using the Lean programming language to formalize the entire Internal Revenue Code, aiming to identify drafting mistakes and unknown loopholes. Section 1 of Title 26 of the U.S. Code outlines the tax rates for various categories of taxpayers, including married individuals filing joint returns, heads of households, and unmarried individuals. According to evidence from a blog post, the formalization process revealed 138 drafting mistakes in the tax law. These mistakes include references to provisions that have been repealed, moved, or rewritten, as well as typographical errors and incorrect subdivisions (source ID: 1). [1]
The formalization process involves parsing each section of the law into Lean, ensuring that cross-references are verified and consistent. For instance, Section 168 of Title 26 outlines the accelerated cost recovery system, which governs the depreciation of tangible property. The Lean type checker confirms that each referenced provision exists and is still in force, as verified by the versioned history of the law. This process highlights discrepancies such as incorrect citations and missing parentheses (source ID: 3). [3]
Another area of focus is Section 1400Z-2 of Title 26, which outlines the treatment of gains from the sale of property held by the taxpayer, including provisions for deferring gain invested in opportunity zone property. The formalization effort also checks for consistency with the IRS’s published examples and tax tables. The use of Lean ensures that each part of the law is tested against figures published by the IRS and checked against independent tax programs, reinforcing the accuracy of the formalized code (source ID: 4). [4]
Sources
Prepared with AI assistance from the cited sources.
The Cali Reporter newsletter
The stories worth your time.
California, the country, and what comes next. Join our free newsletter for reporting that keeps you informed.
More in Technology
- Modern Web Guidance 1.0 and Browser Compatibility
Modern Web Guidance 1.0, announced by Chrome for Developers on November 10, introduces browser compatibility data to assist coding agents in building web features. The initiative emphasizes the importance of fallback…
- Apache mod_http2 Vulnerability Detection with Nmap
A new Nmap scripting module has been developed to detect the Apache mod_http2 vulnerability (CVE-2026-119618), addressing the challenges of identifying affected systems accurately.
- Securing Remote Vendor Access in Industrial Networks
Best practices for managing remote vendor access in operational technology (OT) networks emphasize controlled access points, multifactor authentication, and time-bound sessions to reduce cybersecurity risks.
