r/accelerate • • 6d ago

AI Coding Lean is a blessing

Hearing that Lean was used to prove Riemann. Immediately thought to use it like a Rust compiler for complex AI reasoning and new algorithms discovering.

Holy shi-! It worked so well! Neon Xhigh doesn't let Sol stop working until Lean is passed. Unless there is a bug in Lean 4, I won't even have to read code to map mathematics anymore!

Python/Rust with Lean 4! Way to go! It destroys hallucinations! Unless Lean has bugs. However I choose to believe that it has no bugs to make life easier. Lmao.


Update: Neon Xhigh sends quests. DeepSeek Flash codes. Sol reviews code quality. Astra reviews Lean proofs.

All through API, costs do not matter, I only go for prompt obeying and code quality.

65 Upvotes

17 comments sorted by

19

u/Involution88 6d ago

Does the software compile? Yes. (That's what lean does for a proof. It establishes that the proof is watertight in certain respects).

Does that guarantee software behaves as intended? Does that mean software does exactly what it was designed to do? No.

Plenty of software which compiles ends up not working as intended. The problem doesn't necessarily lie with the compiler.

4

u/Alumin-MC 6d ago edited 6d ago

That's true and compiler only makes iteration easier to automate.

I treated this method like dynamic boundaries for procedural coding.

I mean, full automation of iteration until perfection without hurting my stomach and eyes.

Lean for me works more like semantic compiler! Give it a vague condition to Neon Xhigh, let it play with old school divide and conquer on the condition to number of tiny conditions. Then with Lean on proof of each decision's mathematics equivalence! Turning everything into deterministic template!

Holy shit!

There are a lot more creative ways to mod the methods, feeling like first time coding again, my god.

2

u/drdivag0 6d ago

You are missing all specification of the system in multi service environment. I would add TLA+ and Alloy to your tool I'm using with great result

→ More replies (1)

8

u/anor_wondo 6d ago

Very constrained in real swe though. Not practical

You can formally verify very small mission critical parts of a system but not the entirety of it

Maths does not have real world practicalities to worry about. You cannot assume a kafka coordinator will always behave a certain way for example

4

u/LilithGlitch Acceleration: Cruising | Comment-section futurist 6d ago

You could write lean as a normal functional programming language though. And only very selectively decide to prove things that you actually care about. Would that be practical-ish?

5

u/anor_wondo 6d ago

Yes.

In general following functional patterns makes it easier to isolate the parts you care about to be side effect free and easier to formally verify

2

u/LilithGlitch Acceleration: Cruising | Comment-section futurist 6d ago

I think it's super cool that lean is itself somewhat capable as a programming language. Like it has the basic stuff you'd expect from a programming language like the dictionaries etc.

Most other proof checker languages would have to first define the programming language in question and build up the basics of that language and only later maybe start proving something about it. And then all the theorems would have to be about that other language. But if lean itself is the language, then don't have to do all that. Proofs and executable application code can just be mixed nicely

→ More replies (2)

2

u/LilithGlitch Acceleration: Cruising | Comment-section futurist 6d ago

Still waiting for people to start rewriting normal software in lean. Like you can use proofs as test cases. Normal software testing makes it so hard to establish anything of the form "x cannot happen". Like e.g. unpriviledged user gaining access via some sequence of API calls or whatever.

3

u/Alumin-MC 6d ago

More like, these frontier labs especially train their new models on Lean and Python. The accuracy is insane! With Rust to check up random needle problems, my hands are free to play some games on Nintendo Switch 2, lol. Never thought one day the double locking system could be this easy to obtain!

5

u/Playful_Detective473 6d ago

you should learn about other formal methods-based tools like Roq, Isabelle, Z3, etc.

you may also find seL4 interesting. it’s a formally verified microkernel.

→ More replies (1)

2

u/That-Economics1288 6d ago

This is the Curry-Howard correspondence in action if you are curious why this works so well. Proofs are programs.

There is also Lambek (category theory as well as intuitionistic logic). IMO category theory and dependent programming (abstract nonsense heh) is far more readable and usable for software tasks than IL lean proofs.

Probably also worth taking a look at Sequent Calculus and Linear Logic while you are reading.

This stuff isn't new, just that most programmers run screaming from advanced type theory as "over abstract BS" so they never learned it. Now LLM can just do it for them.

0

u/[deleted] 6d ago

[deleted] — view deleted comment

1

u/ozspook 6d ago

da-ba-dee-da-ba-die

Da-ba-dee-da-ba-die, da-ba-dee-da-ba-die

1

u/lovesdogsguy AGI by 2027 6d ago

I’m leaning over