Formalizing US Tax Code (Using Lean)

Efforts to formalize the U.S. tax code in the Lean proof assistant are highlighting both technical possibilities and political sensitivities around “loopholes.” Commenters focus on a newly identified quirk in the SALT deduction that can penalize some high-earning married couples who file jointly, raising questions about fairness, intentionality, and the impact on different income brackets and states. More broadly, they debate whether law can or should be made logically consistent, given its reliance on ambiguity, precedent, and judicial interpretation, and what formalization could realistically achieve for taxpayers and policymakers.

SALT cap and joint vs separate filing quirk

  • Discussion centers on a reported quirk from the “Big Beautiful Bill”: married couples around $300k each ($600k total) may deduct more SALT by filing separately than jointly.
  • Example cited: two $300k earners can allegedly deduct up to $25k combined when filing separately vs $10k jointly, due to how the SALT cap shrinks with income and is halved only after the shrink when filing separately.
  • Some see this as a non-trivial penalty for certain dual‑income couples, especially in high‑tax states, and predict refund claims and more separate filings.

Who is affected and fairness debates

  • One side argues the affected group (dual $300k+ earners) is tiny and firmly “rich,” so the issue is minor.
  • Others counter that this income level is common in very high cost‑of‑living cities and that cost of living should matter when judging “rich.”
  • There is disagreement over whether such households “have plenty of money” vs whether a “livable” income should imply comfort, not mere survival.

Politics of SALT and interstate transfers

  • Several comments frame SALT limits as deliberately targeting high‑tax, “blue” states and wealthy urban professionals.
  • Others argue SALT is a flawed subsidy letting high‑tax states offload costs to the federal government.
  • Counter‑arguments highlight data (Massachusetts vs Florida) suggesting some low‑tax states rely more heavily on federal funds for health care and education.

What Lean might add

  • Supporters see value in:
    • Proving invariants (e.g., you can’t owe more tax than income).
    • Automatically finding inconsistencies, edge cases, and loopholes.
    • Simulating policy changes and ensuring new legislation doesn’t contradict existing rules.
    • Verifying that AI‑generated tax plans actually comply with statute.

Limits of formalizing law

  • Multiple comments stress that tax law and broader law are often inconsistent, politically shaped, and sometimes intentionally vague.
  • Judges, precedent, and “spirit of the law” play a large role; you can comply textually and still lose in court.
  • Some see this as inherently favoring those with money, influence, and top CPAs.

Loopholes: intentional vs accidental

  • Disagreement over whether loopholes are “bugs” or intended features.
  • Some emphasize deliberate micro‑changes in statutes to benefit specific interests.
  • Others note many so‑called loopholes are just disliked but intentional provisions.

Project reception and related tools

  • Several commenters praise the project as a promising, democratizing use of formal methods, potentially a step toward “CPA‑grade advice via API.”
  • Skeptics call it another short‑lived, “vibecoded” formalization effort and question Lean’s fit with inherently non‑logical, precedent‑driven law.
  • Catala is cited as an existing domain‑specific language for legal formalization already used in at least one French government service.