Alan Yahya describes translating US tax rules into Lean, a programming language that also checks mathematical proofs. Lexifina combines those proofs with IRS worked examples and comparisons against three independent tax programs. Each check catches a different kind of failure.
The engineering details carry beyond tax software:
- Version the specification. The project tracks legislation in Git. Its text checks can trace a broken cross-reference to the law that introduced it.
- Prove bounded properties. Lean checks claims such as a deduction never increasing as income rises, across every input covered by the model.
- Compare independent implementations. Testing 5,000 households against other calculators caught two mistakes in Lexifina’s own model, including a deduction choice that changed one household’s tax by $2,070.
- Exercise awkward cases. Of those households, 3,000 target complicated filing situations. Effective dates, rounding rules and benefit cutoffs matter as much as arithmetic.
- Keep competing specifications visible. The IRS Tax Table differs slightly from the statutory formula. Agreement depends on which rule an implementation follows.
Proofs establish consequences of the encoded rules. Checking that those rules faithfully represent the source remains separate work. The project uses AI for translation and review; Yahya explicitly says a lawyer or CPA has not checked those reviews.
A reliable workflow pairs broad proofs with concrete examples and independent implementations. When they disagree, investigate the specification and the input mappings alongside the code.