Formalizing US Tax Code (Using Lean) lexifina.com · 56 points · 20 comments · HN...

@best

Formalizing US Tax Code (Using Lean) lexifina.com · 56 points · 20 comments · HN thread

TL;DR Lexifina reports formalizing the 2025 US federal individual income tax and the full Title 26 text in Lean, a proof checker. Their checks found 138 drafting faults in the Code, a model that matches two of three independent tax tools on 4,993 of 5,000 households, and several loopholes such as filing separately to reduce tax on Social Security benefits.

  • Lean checks every cross-reference in Title 26 against the official XML and flagged 257 findings; after AI triage 138 were real faults, each with a Lean certificate, e.g. 67 dead references to repealed or moved provisions.
  • The model of the 2025 income tax agreed with PolicyEngine-US on 4,993 of 5,000 sample households; the other seven differed by at most $11, all in the EITC. Tax-Calculator and UsTaxes had bugs, including UsTaxes never attaching Schedule C.
  • The published Code mixes 2025 and 2026 law in six places, and rounding in the new deductions runs in opposite directions.
  • A separate-filing search found that couples can pay less on Social Security benefits by filing separately (an example saves $1,482), and a 3.8% tax split across returns saves $1,621 in one example.
  • Schedule 8812 refunds more child credit than the statute allows in the phase-out range (example: $700 on the form versus $200 under the statute).
  • Many large multi-year strategies the search found (business owner filing separately under §199A, Roth conversions in gap years) were already described in practitioner literature; the authors say the novel finds are narrower.
  • Stated limits: the model excludes kiddie tax on single-year returns, most AMT preferences and foreign income, and nothing was reviewed by a lawyer or CPA.

Discussion The thread is short and split between a policy argument and a skeptical look at the project. The most-discussed thread concerns whether tax loopholes are deliberate and whether law can be made precise; jedberg argues they are left in on purpose for the wealthy and for judicial wiggle room, and rendaw pushes back that laws are meant to reduce vagueness. A second thread picks up rancar2's reading of the SALT cap change and its effect on married couples in high-tax states, which another commenter downplays as affecting few households. Others discuss whether formal, compilable law is feasible and what Lean would add, and one commenter calls the project a vibecoded formalization likely to be abandoned. The mood is skeptical and wry, with little engagement with the technical findings.

  • Loopholes are deliberate and aimed at the wealthy (some): jedberg argues that loopholes persist so that people who can afford CPAs can use them, and that vagueness leaves room for interpretation before judges.
  • Laws should be precise, not vague (some): rendaw says the purpose of law and its formal structure is to reduce vagueness, with case law filling remaining gaps, and that claims of deliberate vagueness need citations.
  • SALT change unfairly penalizes married couples (some): rancar2 summarizes the article's SALT example and expects refund appeals and more separate filing, while AnthonyMouse says the code has long penalized dual-income couples.
  • Impact is too narrow to matter (a few): jghn argues that couples each earning $300K are a very small share of households, so the SALT issue is not a major concern, though jedberg counters it matters in high-cost metros.
  • Formalizing tax law is useful for analysis and loophole search (a few): squirrel suggests proving invariants such as tax never exceeding income, with counterexamples as loopholes; claw-el floats using it for congressional impact analysis.
  • Project is likely to be abandoned (a few): rappatic says this is one of many vibecoded legal formalizations posted to HN that get dropped within months.

Links from the comments

#tax #lean #formalMethods #lawAsCode #USTaxCode #policy