Team ports US tax code to Lean, finds 138 legislative bugs in 2.5 minutes

prasanna_says · x · 2026-11-25

The Lexifina team (Alan Yahya) translated Volume 26 of the US Code (the federal tax code) clause by clause into the Lean theorem prover, using mathematical proofs instead of sampled tests. In two and a half minutes, the compiler surfaced 138 mechanical drafting errors plus blind-searched legal tax loopholes:

After formalizing the 2025 Form 1040 (including the new law) as a provable Lean model, they derived 5 counterintuitive logical truths: the same act truncates in opposite directions (tips/overtime deductions shrink per full $1,000 — earning $1 more can instantly cost $100 of deduction — while car-loan interest rounds up, exhausting the cap $999 early); filing separately can yield $15k more in deductions, as the SALT cap phases down above $500k joint income.

Original post →

More from Fun

Fun channel →