Skip to content

Add formalized lean implementation with WIP browser build#29

Merged
pimlu merged 29 commits intomasterfrom
sgeipel/vibe-proved-lean
Apr 27, 2026
Merged

Add formalized lean implementation with WIP browser build#29
pimlu merged 29 commits intomasterfrom
sgeipel/vibe-proved-lean

Conversation

@pimlu
Copy link
Copy Markdown
Owner

@pimlu pimlu commented Apr 27, 2026

So issue #3 has haunted me for a long time and I couldn't help but wonder if my interpreter had a bug in it. As a result, a long time goal of mine has been to formalize this interpreter in Lean which guarantees it's bug free. Turns out it was bugs in the FRACTRAN programs themselves and not my interpreter, after all.

This has been a long-term quest of mine, which all of a sudden I was able to prove from scratch in just one weekend vibe-coding with Claude Opus. It almost feels surreal. Anyway, here it is. I'm still working on getting the browser build up to standards but it's working right now.

The trick with the browser build is that Lean compiles to C code, so by linking together that C code with the Lean runtime and requisite C libraries like GMP, I can compile it for the browser without too much fuss. And of course, Opus handled all the fuss with grace.

I'm still working on benchmarking performance but it seems pretty good, similar to the Haskell interpreter. Once I have it stable and the web UI looking nice, I will switch over the browser build to that.

Are the proofs elegant? No, look at the size of leap_correct lmao. I'm going to try to clean up these proofs later.

@pimlu pimlu merged commit 78efc60 into master Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant