Oleksandr Kuzmenko, EditorPublished 8 min readAI-assisted · editor-reviewed
TL;DR
- global-law uncovered 138 confirmed drafting defects in US tax law using automated Lean type-checking.
- Formal mathematical proofs eliminate sampling blind spots and verify edge cases across infinite possible inputs.
- Adversarial LLM review coupled with open-source tax simulators prevents shortcut coding during legislative formalization.
Key facts
- Verified Statutory Faults
- 138 defects
- Lean Suite Runtime
- ~2.5 minutes
- Synthetic Validation Cohort
- 5,000 households
- Tested Independent Engines
- PolicyEngine-US, Tax-Calculator, UsTaxes
Source: Key facts — Verified Statutory Faults, Synthetic Validation Cohort
Source: Key facts. Verified Statutory Faults: 138 defects. Synthetic Validation Cohort: 5,000 households. Each figure is copied from the story.
- Verified Statutory Faults138 defects
- Synthetic Validation Cohort5,000 households
Compiling Law into Exhaustive Proofs
The global-law project parsed the structured XML of Title 26 (current to 3 November 2026) published by the Office of the Law Revision Counsel. Using a parser coupled with the Lean type checker, the system traversed every statutory cross-reference, mapping it across a public Git commit history of public laws dating back to 1994. The automated test suite flagged 257 findings. After filtering out 98 intended transitional rules and 21 faulty editorial hyperlinks, the authors confirmed 138 real statutory defects: 67 references to repealed or moved provisions, 24 citation typos, 8 hierarchy misnomers, 9 duplicated provision identifiers, and 30 unclosed parentheses.
Each defect carries a Lean certificate that can re-verify all 138 faults in approximately 2.5 minutes, establishing a continuous integration pipeline for legislative text.
Multi-Agent Translation with Adversarial Review
To model 2025 federal income taxes under Form 1040 and the July 2025 One Big Beautiful Bill Act, global-law established a robust multi-agent synthesis loop:
1. An initial LLM translated statute text into Lean definitions across income, deductions, taxes, and credits. 2. A second adversarial agent reviewed the resulting code specifically to catch test-passing cheats and logical shortcuts. 3. The formalized model was benchmarked against 5,000 synthetic households across three independent open-source packages: PolicyEngine-US, Tax-Calculator, and UsTaxes.
Exposing Hidden Software Bugs and Regulatory Cliffs
Lean's exhaustive verification uncovered bugs in independent software that traditional testing missed. UsTaxes was found to drop Schedule C self-employment income from 2025 returns, while Tax-Calculator granted the Earned Income Tax Credit (EITC) to separate filers without checking cohabitation requirements.
Furthermore, Lean mathematically proved sharp economic threshold anomalies: a single dollar of investment income over $11,950 completely eliminates up to $8,046 of EITC benefits, and exceeding $47,500 by $1 slashes the saver's retirement credit from $2,000 down to $800.
When to use
- Use for automated CI/CD checks of statutory amendments and exhaustively verifying tax calculation software.
When NOT to use
- Do not use when statutes contain deliberate judicial ambiguities that require human interpretive discretion.
What to do today
- Explore the global-law CC0 repository to study formalization patterns for statutory text.
- Integrate formal theorem-proving tools like Lean into legal tech and compliance pipelines.
Step names are taken from What to do today.
Step names are taken from What to do today. Explore the global-law CC0 repository to study formalization patterns for statutory text.. Integrate formal theorem-proving tools like Lean into legal tech and compliance pipelines.
- Explore the global-law CC0 repository to study formalization patterns for statutory text.
- Integrate formal theorem-proving tools like Lean into legal tech and compliance pipelines.
