logoalt Hacker News

Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed

35 pointsby permuteyesterday at 10:06 PM5 commentsview on HN

To my knowledge, this is the first formally verified implementation of an intersection algorithm for polygons.

The experience of working with AI agents on this project changed a lot with recent model releases, as I describe in the readme. Opus 4.8 is able to provide algorithm implementation with formal proof in one shot, whereas previous models required me to provide proof strategies in multiple steps.

Trust in the correctness comes entirely from the Lean checker and human review of a small specification, not from the LLM.

Also check out the web demo built around the verified core linked in the readme: https://schildep.github.io/verified-polygon-intersection/. It supports multipolygons including holes, self intersections, and overlapping edges.


Comments

prewettyesterday at 11:30 PM

This is a great use for AI! Calculating intersections is tedious and there are an surprising number of edge cases that are tedious to track down and fix.

CyLithyesterday at 10:17 PM

Does this use integer coordinates or floating point coordinates?

show 2 replies
olaird25yesterday at 10:58 PM

Is the web demo compiled from the lean?

huflungdungyesterday at 10:41 PM

[dead]