HeadlinesBriefing favicon HeadlinesBriefing.com

Sostactic Brings Sum‑of‑Squares Proofs to Lean4

Hacker News •
×

Lean4 developers now have a new toolbox that turns polynomial inequalities into formal proofs. The Lean4 package, called Sostactic, plugs into the Lean ecosystem and uses a Python backend to generate sum‑of‑squares certificates. It outperforms existing tactics like nlinarith and positivity by handling cases that were previously intractable.

The core idea relies on a classic theorem: a polynomial that can be written as a sum of squares is nonnegative everywhere. Sostactic translates that theorem into a semidefinite programming problem, solved with cvxpy. The solver’s numeric output is then rationalized and checked inside Lean, giving an exact, machine‑verified certificate.

Users can invoke the tactics directly in Lean or call the same logic from Python via a command‑line interface. Example scripts prove classical inequalities—AM‑GM, Motzkin’s polynomial, and emptiness of overlapping disks—without resorting to manual algebra. The package also offers guidance on troubleshooting when exactification fails, suggesting higher degrees or custom denominators.

Sostactic’s design bridges formal verification and numerical optimization, filling a gap in Lean’s support for nonlinear reasoning. By automating sum‑of‑squares proofs, the tool lets researchers and educators tackle a broader class of algebraic problems within a proof assistant. The result is a more expressive theorem‑proving environment that remains grounded in rigorous computation.