Live data from Hacker News

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

github.com

1–10 of 26 posts

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

#1
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.

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

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

#4
post #2

Does this use integer coordinates or floating point coordinates?

It uses exact rational coordinates, not floating-point coordinates in the verified core. See: https://github.com/schildep/verified-polygon-intersection/bl...

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

#8
post #2

Does this use integer coordinates or floating point coordinates?

It uses exact rational coordinates, not floating-point coordinates in the verified core. See: https://github.com/schildep/verified-polygon-intersection/bl...

I am eager for a lean equivalent of flocq in rocq. When I did some lean verification of numerical algorithms I did the same thing with rationals or the reals from mathlib. The big gap between that and the actual code is the lack of a solid theory library to pull in that would give me IEEE floats that is at the same level of quality as Flocq. I’m eager for that to come along (unless it has and I just haven’t found it yet).

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

#10
post #2

Does this use integer coordinates or floating point coordinates?

It uses exact rational coordinates, not floating-point coordinates in the verified core. See: https://github.com/schildep/verified-polygon-intersection/bl...

Yes, the core supports exact rationals. This is easier to deal with in formal verification than floating point.

I made the UI snap to a fixed precision, such that its easy to reproduce special cases with overlapping edges, coinciding vertices etc. that make up much of the complexity of the algorithm.

Post reply on HN