hn.today

Formalizing US Tax Code (Using Lean)

lexifina.com152 points104 comments
Screenshot of Formalizing US Tax Code (Using Lean)

The project translates the US Internal Revenue Code into Lean, a language whose type checker can verify proofs, with the goal of detecting drafting errors and uncovering rules’ unintended effects. Applied to Title 26’s official text, the system checked statutory cross-references and found 138 confirmed faults, including references to repealed or altered provisions, incorrect citations, duplicate numbering and unclosed parentheses. Each finding has a Lean certificate tied to the official text, and the versioned legislative record helps identify which law introduced it. The team also modeled the main steps in calculating a household’s 2025 federal income tax, using AI to translate statutes and checking the result against IRS examples, tax tables and independent review.

Testing the model against three tax programs on 5,000 households exposed errors in both the new model and existing software. It also surfaced consequential quirks in the law: separate returns can let a married couple claim a larger state-and-local-tax deduction; IRS tax-table figures differ slightly from the statutory formula; and a one-dollar income change can eliminate thousands of dollars in benefits. The model matched PolicyEngine-US on 4,993 households, while comparisons identified 14 bugs in USTaxes and eligibility errors in Tax-Calculator. After correcting two mistakes in their own model, the researchers used automated searches across nearly 196,000 returns and long-term family plans to find tax-planning opportunities, including strategies already known to advisers. The larger aim is to make systematic, repeatable checks possible as the law changes.

Read on lexifina.com104 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Aristotle Expands into Rust

Aristotle has expanded its formal verification platform to Rust, allowing developers to prove code meets specifications and contains no undefined behavior, including in unsafe blocks. It can also verify that Rust rewrites behave like their original C code, targeting critical software such as smart contracts and infrastructure. (harmonic.fun)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.