frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Provepy – A Python decorator that proves your code using Lean and LLMs

2•spaccy05•1h ago
Hi all,

I have recently been playing around with AI and formal methods and built Provepy. It's an experiment to see if we can use frontier LLMs to bridge the gap between everyday Python code and formal verification in Lean.

The idea is to make formal methods more accessible by burying the complex Lean syntax behind a standard Python decorator. You add @provable to your function, give it a plain English claim, and run your code.

  from provepy import provable

  @provable(claim="This function returns the sum of its inputs")
  def add(a: int, b: int) -> int:
    return a + b
Under the hood, when the script runs, Provepy grabs the function and your claim, and passes them to an LLM (defaults to Gemma, but supports OpenRouter or any custom OpenAI-compatible endpoint). The LLM attempts to translate the claim into a Lean 4 theorem and generate the proof. Using Frontier models is recommended for best results.

Generation of the theorem, code and proof is done separately to avoid the LLM proving the wrong claim or function just to succeed in the proof.

If Lean compiles and accepts the proof, your Python function executes normally. If the proof fails, your program halts with a VerificationError.

You can also pass context to the decorator if your function relies on other Python functions in your codebase. I also added a fallback mechanism—you can configure a smaller, cheaper model to try first, and if it fails to generate a valid proof, it automatically retries with a heavier model.

To be clear: this is very experimental alpha software.

It currently only works reliably on simple functions.

There's a lot left to do, like improving how context is pulled from the AST and resolving name clashes with Lean's mathlib.

Contributions are most welcome!

I'd love to hear your thoughts.

Github: https://github.com/genie16/provepy

Pizza Tycoon Deluxe Bundle

https://store.steampowered.com/bundle/6361/Pizza_Connection__Deluxe/
1•doener•14m ago•0 comments

Scoop: Microsoft Is Pausing Carbon Removal Purchases

https://heatmap.news/carbon-removal/microsoft-carbon-removal-pause
1•doener•15m ago•0 comments

Claude API Error: 529

2•anujbans•15m ago•1 comments

Tomato – Visual DAG editor for NixOS configurations

https://github.com/thatsme/Tomato
2•alessio66•16m ago•0 comments

The hottest Apple product isn't what you think

https://www.cnn.com/2026/04/10/tech/apple-mac-mini-ai-openclaw
1•abe94•17m ago•0 comments

Build a viral website, win $1000

https://launchyard.dev/contest
1•hackmaxim•21m ago•1 comments

My AI workflow evolved from prompts to a near-autonomous workflow

3•hoangnnguyen•22m ago•1 comments

Parakeet Streaming ASR on Apple Silicon via CoreML – and Swift Demo App

https://old.reddit.com/r/iOSProgramming/comments/1sickii/streaming_asr_on_apple_silicon_via_corem...
2•ipotapov•22m ago•0 comments

News is bad for you (2013)

https://www.theguardian.com/media/2013/apr/12/news-is-bad-rolf-dobelli
3•downbad_•28m ago•2 comments

Hello, Liquid Fox (A Nice macOS Firefox Theme)

https://miloszfalinski.com/hello-liquid-fox-a-nice-macos-firefox-theme/
1•alin23•30m ago•0 comments

The Apple Museum Officially Opens April 2 – Update – Stichting the Apple Museum

https://applemuseum.nl/updates/the-apple-museum-officially-opens-april-2/
1•janandonly•40m ago•0 comments

Jolgbs

1•google_play_hn•47m ago•0 comments

CoLaptop – Personal Laptop Colocation Service

https://www.colaptop.com/
2•pabs3•48m ago•0 comments

Dancer with MND performs on stage again through digital avatar

https://www.bbc.co.uk/news/articles/cgqkz5lzvnwo
1•ColinEberhardt•50m ago•0 comments

Falco's Convergence: Bitcoin-Core Reform Agenda (Via Information-Reveal) [pdf]

https://cppalliance.org/tools/bitcoin-core-reform-agenda.pdf
1•vinniefalco•50m ago•0 comments

ThinkPad X1 Carbon 14: Light on Weight, Heavy on Intelligence

https://www.lenovo.com/us/en/p/coming-soon/lenovo-thinkpad-x1-carbon-gen-14-aura-edition-14-inch-...
2•seekdeep•50m ago•0 comments

Ask HN: Best books on building a programming language

2•ezzato•52m ago•1 comments

Runtime augmentation of Hugging Face without modifying source – CMPSBL Demo

https://github.com/SweetKenneth/transformers-ascended-verified
2•promptfluid•53m ago•1 comments

How to Solve SBoM Sprawl: From Static Files to Vex and Automation

https://anchore.com/blog/sbom-sprawl-paradox/
1•Tomte•53m ago•0 comments

Gigi – Geometric Intrinsic Global Index – A new approach to database queries

https://www.davisgeometric.com/gigi#home
1•thunderbong•53m ago•0 comments

MLSharp Single-View High-Quality AI Reconstruction Pipeline

https://suto.bex.jp/mac/mlsharp/index.html
1•mvdwoord•53m ago•1 comments

AI is the boss at this retail store. What could go wrong?

https://www.nbcnews.com/tech/innovation/ai-store-sf-san-francisco-bay-area-andon-labs-market-boss...
2•divbzero•56m ago•0 comments

IPFS Bot AI Agent Content

https://ipfs.bot/
1•sucid•57m ago•0 comments

Relics of the Heroic Age of Manned Space Flight

http://heroicrelics.org/index.html
1•zdgeier•57m ago•0 comments

Securing ECC Cryptocurrencies Against Quantum Vulnerabilities

https://arxiv.org/abs/2603.28846
1•u1hcw9nx•1h ago•1 comments

Premium: The Hater's Guide to OpenAI

https://www.wheresyoured.at/hatersguide-openai/
2•mc-serious•1h ago•0 comments

Being-as-Appearing Under Articulation

https://jimiwen.substack.com/p/a4
1•jimiwen•1h ago•0 comments

The Gombe Chimpanzee War

https://en.wikipedia.org/wiki/Gombe_Chimpanzee_War
3•creamyhorror•1h ago•1 comments

Abundance for All – Not Just the Few

https://github.com/dileeppandey/abundance-manifesto
1•ai_psychosis•1h ago•0 comments

Session-roam – Resume Claude Code conversations from any machine via Syncthing

https://github.com/VirelNode/session-roam
3•JDaily•1h ago•1 comments