AI NewsProductivityAnnouncement

Lexifina used AI to find 138 drafting errors in US tax code

Lexifina translated the US Internal Revenue Code into Lean. AI agents checked every section. The run flagged 138 real faults the official text does not record.

AI News

Editorial2 min read

LinkedInX
Lexifina dependency map showing 2,159 Lean definitions and theorems across drafting checks, the 2025 income tax, and loophole searches

Why it mattersA translator agent, an adversarial reviewer and a proof checker turn any long, cross-referenced body of text into an audit.

A single wrong cross-reference in a tax rule can make a form compute the wrong refund. The people who draft tax law do not have a tool that catches those mistakes before the code is published. The rule book has bugs in it that nobody has counted.

Lexifina says it has counted them. Alan Yahya reports that the company translated the 2025 US Internal Revenue Code into Lean. Lean is a language whose type checker also checks mathematical proofs. AI agents did the translation. A second agent reviewed each part. The result is 2,159 definitions and theorems tied back to the official text. The post reached 152 points on Hacker News.

What the agents did

Lexifina used one AI agent to turn each statute section into Lean code. "This is the lossy step, therefore we reinforce it with the following measures," Yahya writes. A second agent, which did not write that part, "reviews it adversarially, looking for errors and for cheating". The translated code is tested against figures the IRS publishes.

The adversarial reviewer guards against a model that writes code to pass tests. The goal is code that matches the law. Lexifina does not name which models it used.

138 real faults

The checks found 257 potential issues. The team marked 138 as real faults. 67 were references to provisions that had been repealed or moved. 30 were unclosed parentheses. 24 were typos or wrong subdivision numbers. 9 were duplicate section numbers. 8 called a subsection a paragraph.

Yahya gives examples. §1(f)(7)(A) cites a rewritten provision. §1202(b)(4) appears twice. §165(h)(1) leaves a parenthesis open. The company links each finding back to the public law that caused it. An edit by the people who draft the code would be one lookup away.

What it matched

Lexifina ran its Lean version of the 2025 income tax against 5,000 synthetic households. 2,000 were ordinary and 3,000 were deliberately complex. It compared the answers with three open-source tax calculators. The three are PolicyEngine-US, Tax-Calculator by the Policy Simulation Library and UsTaxes.

Its model and PolicyEngine-US agreed on every figure for 4,993 of the 5,000 households. Seven differed by at most $11 on the earned income tax credit. Yahya says the team found 14 bugs in UsTaxes. One Tax-Calculator case gave credits to spouses filing separately without checking they lived apart.

Yahya states one caveat on the face of the post: "Agreement is not truth. Where all four calculators agree they may share a misreading."

What it means

The pattern is a translator agent, an adversarial reviewer, a real reference corpus and a proof checker. The proof checker stops a single lossy step from carrying the whole result. The ingredients are not new. That is the point. A team can run the same loop on any structured text that pays for a proof of its own consistency. A set of insurance policies. A build system configuration. A product's API across three releases. The audit becomes a command that fails on a fault the last run did not have.

Source

SourceLexifina

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project