Show HN: Sostactic – polynomial inequalities using sums-of-squares in Lean

New ‘prove my inequality’ button for Lean sparks cheers and side‑eye

TLDR: Sostactic brings push‑button inequality proofs to Lean using a Python solver and then checks an exact certificate. The crowd is split between excitement over power and simplicity, and skepticism about numerical steps, setup pains, and reproducibility—making it a flashy but debated leap in automated math proofs.

Show HN: Sostactic drops a shiny ‘prove my inequality’ button for Lean, and the threads lit up. The tool auto‑proves that certain algebra expressions never go negative by breaking them into sums of squares (think: squares can’t be negative), all powered by a Python solver. Fans cheered the one‑line demos—AM‑GM in a blink, a notorious “Motzkin” example tamed, and even a proof that two circles can’t overlap under certain rules. One commenter called it a math cheat code, another joked they’d retire their algebra notes.

Then the drama: Sostactic leans on a numerical optimizer via CVXPY, then converts the result into an exact certificate that Lean verifies. Supporters say the final check is iron‑clad; skeptics worry about the messy middle—“what if the exact step fails?”—and grumble about Python virtual envs and pinning the right Mathlib version. Memes flew about Lean calling Python calling CVXPY calling vibes, while old‑schoolers reminded everyone that not every non‑negative polynomial is a simple sum of squares—but this thing can handle some of those too with clever tricks. Meanwhile, performance hawks grilled solver choices and reproducibility, and practical folks just begged for a one‑click setup. The vibe? Half hype, half side‑eye, and 100% entertained. Check the repo here.

Key Points

  • Sostactic provides Lean 4 tactics and a Python backend to prove polynomial inequalities via sums-of-squares and SDP.
  • It can prove global nonnegativity, constrained nonnegativity over semialgebraic sets, and emptiness (infeasibility) of systems of polynomial inequalities.
  • Examples include proving AM-GM, nonnegativity of the Motzkin polynomial, constrained nonnegativity on [0,1], and disjointness of two unit disks.
  • The Lean tactics call a Python CLI that uses cvxpy to solve an SDP; numerical solutions are rationalized to exact certificates verified in Lean.
  • Setup requires elan and Python 3.10+, addition via Lake, alignment with Mathlib v4.29.0-rc8, and a project-local Python virtual environment.

Hottest takes

"It’s basically pip‑installing a theorem" — algebra_goblin
"Numerical floats in my proofs? Hard pass" — exactness_warrior
"Lean → Python → CVXPY → solver → vibes" — shell_scripter
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.