The US tax code formalised in Lean to check IRS figures
A developer used Claude Code to parse the US tax code, compile its relationships into Lean and search for mistakes in values the IRS reports.
Credits
- Reddit poster SnooPeripherals5313 Source ↗
Earliest dated source:
The full story
A team used Claude Code to turn the US tax code into a formal model in the Lean theorem prover. They took the code as XML, wrote a parser to extract the relationships between sections, versioned them, and had Claude compile them into a Lean script, borrowing the approach used to formalise CPython. Claude also managed subagents watching the long-running searches.
They then wrote each line of IRS worksheets in Lean from the worksheets' own text and proved it against the statute for every possible input. The write-up lists eight places where IRS forms differ from the law and who is affected, and also checks open-source tax calculators against the model.
How it was done
Tools
Themes
Loading themes…
Sources
From a short post by the maker, so the details are as they tell them.
- Reddit: Vibe checking the IRS with LeanReddit poster: SnooPeripherals5313Posted
The developer's post in r/ClaudeCode summarising the method.
- The project: lexifina.com
The team's blog post with the IRS discrepancies and calculator checks.