<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: permute</title><link>https://news.ycombinator.com/user?id=permute</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Mon, 15 Jun 2026 16:37:51 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=permute" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>There are two things here: The proof and how you would represent that in a program that you actually can run.<p>From the math side, I am confident that the construction and proof can be extended to the real numbers and that can be formalized in lean with minimal changes in the existing proof. (Mathematically speaking, we can replace the rationals with any ordered field and the proof should run through.)<p>I chose to model the problem with rational numbers because the intersections of polygons with rational coordinates have rational coordinates and rational numbers can easily be represented in the computer.<p>To have a computable implementation with real numbers, you have to make some choice about which part of the real numbers you want to be able to represent in the computer.
For example if sqrt(2) and sqrt(3) is important to you, I think you can have a program that can represent them if they occur in any input coordinates and can represent any resulting coordinates exactly symbolically besides the rational numbers (I think this requires minimal changes in the code, the required lean machinery to work with such numbers can be separated from the geometrical code), but a program can’t be able to represent all real numbers exactly since there are too many of them.<p>Another interesting direction to take this would be to allow spline segments instead of line segments, since intersections of splines with rational coordinates can have non rational coordinates, but I think can still be represented exactly in the computer. This would require a bigger change and would be interesting geometrically.</p>
]]></description><pubDate>Sun, 07 Jun 2026 10:06:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=48433386</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48433386</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48433386</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>Yes, it runs significantly longer.<p>Opus 4.8 ran autonomously for about 8 hours to provide program and proof of correctness, given the formal specification. And in previous experiments, Opus 4.7 failed and I was only able to do it using that model when I cut the work for the agents in smaller steps.<p>Much of the work the agent is to provide the proof of correctness. The upside is that less time is needed for human review and we can guarantee the absence of bugs that might be expensive when they come up in production.<p>Historically formal verification was only worth it for very critical software. In the readme I reference related work from NASA, that implemented and verified a different algorithm concerned with polygons, with the intended application to compute keep out zones for autonomous vehicles. This was 2021 before capable LLMs and in the paper they mention that they manually wrote 700 lemmas to produce such a formal proof manually.
I hope that as it gets cheaper now, formal verification is used more widely.</p>
]]></description><pubDate>Sun, 07 Jun 2026 08:47:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=48433046</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48433046</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48433046</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>Sure, what the program does is not interesting by itself, neither is that you can use AI to create programs to do polygon intersection.<p>The main feature, that I hope is interesting in this submission, is that the program is formally verified and how I used formal verification together with AI to create it.<p>Formal verification means that a mathematical proof is provided that the program satisfies a specification. And that proof is checked automatically by a deterministic system, the lean checker, which we can trust, in constrast to error prone LLMs.<p>I gave the agent a formal specification m1.interior ∩ m2.interior = result.interior and it produced an implementation together with such a formal proof. With this approach we can treat much of the work of the agent as a black box, which we don't have to review to judge correctness.<p>I think the project shows that as AI agents get more capable, an approach like this is starting to get practical for certain problems like polygon intersection for which there is a concise way to specify the problem.</p>
]]></description><pubDate>Sat, 06 Jun 2026 14:14:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=48425333</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48425333</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48425333</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>Yes</p>
]]></description><pubDate>Fri, 05 Jun 2026 16:55:45 +0000</pubDate><link>https://news.ycombinator.com/item?id=48415222</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48415222</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48415222</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>Thanks! Yes, I hope AI and Lean will enable formally verified practical software.</p>
]]></description><pubDate>Fri, 05 Jun 2026 09:04:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=48409911</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48409911</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48409911</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>Thanks for the pointer, I will look into it.<p>I think to do efficient formally verified geometry with floating point we would also need something like Shewchuk robust predicates. (I worked with them in the past to write robust software that is not formally verified. Did not read up, if there is a formally verified library for them.) Shewchuk robust predicates give certain consistency guarantees that are nice to have when implementing computational geometry with floating points and I think can be formalized.</p>
]]></description><pubDate>Fri, 05 Jun 2026 08:57:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=48409863</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48409863</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48409863</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>Thanks! I am currently working on a follow up project for 3D polyhedrons for which the case handling really starts to get tedious. It's nice when AI can handle it without humans having to read the code and many unit tests to trust it.</p>
]]></description><pubDate>Fri, 05 Jun 2026 08:37:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=48409710</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48409710</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48409710</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>Yes, the webassembly is compiled from lean. The JS UI that calls the webassembly is not built from lean and not formally verified. So a human reviewer that does not trust the code, needs to review the formal spec and the UI code. But the geometry with rare special cases that we want to treat correctly happens in the verified core.</p>
]]></description><pubDate>Fri, 05 Jun 2026 08:32:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=48409665</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48409665</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48409665</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed"]]></title><description><![CDATA[
<p>Yes, the core supports exact rationals. This is easier to deal with in formal verification than floating point.<p>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.</p>
]]></description><pubDate>Fri, 05 Jun 2026 08:18:03 +0000</pubDate><link>https://news.ycombinator.com/item?id=48409539</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48409539</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48409539</guid></item><item><title><![CDATA[Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed]]></title><description><![CDATA[
<p>To my knowledge, this is the first formally verified implementation of an intersection algorithm for polygons.<p>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.<p>Trust in the correctness comes entirely from the Lean checker and human review of a small specification, not from the LLM.<p>Also check out the web demo built around the verified core linked in the readme: <a href="https://schildep.github.io/verified-polygon-intersection/" rel="nofollow">https://schildep.github.io/verified-polygon-intersection/</a>. It supports multipolygons including holes, self intersections, and overlapping edges.</p>
<hr>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=48405264">https://news.ycombinator.com/item?id=48405264</a></p>
<p>Points: 93</p>
<p># Comments: 21</p>
]]></description><pubDate>Thu, 04 Jun 2026 22:06:18 +0000</pubDate><link>https://github.com/schildep/verified-polygon-intersection</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48405264</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48405264</guid></item><item><title><![CDATA[New comment by permute in "Claude Opus 4.8"]]></title><description><![CDATA[
<p>I am using Claude Code for formal verification with Lean. In my personal experience both Opus 4.7 and now what I see from first experiments with Opus 4.8 were big improvements. I was able to delegate proofs of larger theorems that their predecessors could not handle.</p>
]]></description><pubDate>Fri, 29 May 2026 06:15:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=48319669</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48319669</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48319669</guid></item><item><title><![CDATA[New comment by permute in "Show HN: Geomatic – A command-driven geometry studio enabled with autodiff"]]></title><description><![CDATA[
<p>It’s fun to play around with this! It could be helpful to add support for parentheses and chaining of commands. For example: \add (\area-circle circ0) (\area-circle circ1). Intermediate nodes could be anonymous or automatically named.</p>
]]></description><pubDate>Wed, 27 May 2026 16:51:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=48296963</link><dc:creator>permute</dc:creator><comments>https://news.ycombinator.com/item?id=48296963</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48296963</guid></item></channel></rss>