lanyonai/advectiondiffusion — explained in plain English
Analysis updated 2026-05-18
Study a worked example of formally verified numerical simulation code.
Compare machine generated C solvers against hand written ones for advection-diffusion problems.
Learn how Lean 4 proofs can back correctness claims for scientific computing code.
| lanyonai/advectiondiffusion | freertos/freertos-smp-demos | xiaojianbang8888/xiaojianbang-stealth-hook | |
|---|---|---|---|
| Stars | 65 | 68 | 68 |
| Language | C | C | C |
| Last pushed | — | 2025-02-16 | — |
| Maintenance | — | Stale | — |
| Setup difficulty | hard | moderate | hard |
| Complexity | 5/5 | 3/5 | 5/5 |
| Audience | researcher | developer | researcher |
Figures from each repo's GitHub metadata at analysis time.
No build or usage instructions are given, understanding the code requires PDE and Lean background.
This repository holds a set of solvers for advection and diffusion equations, which are mathematical equations used to describe how a quantity, like heat or a dissolved substance, spreads and moves through space over time. The project covers three versions of the problem: simple linear advection, advection combined with diffusion that behaves the same in every direction, and a fuller version where diffusion can behave differently depending on direction. Each version is solved in one, two, and three dimensions, giving nine solvers in total. What makes this project unusual is that every solver comes with a formal, machine checked proof of correctness. The proofs are written in Lean 4, a programming language built for verifying mathematical statements, and the repository reports close to 9,600 lines of that proof code alongside roughly 8,300 lines of the actual C code that runs the simulations. The README states there are 438 definitions and 282 theorems backing the correctness claims. All of this, both the C solvers and their Lean proofs, was generated by a tool called Lanyon in about 156 seconds total, with individual solvers taking anywhere from about 7 to 31 seconds each. The README includes the general mathematical form of the advection-diffusion equation and links to a separate technical writeup on the Lanyon website that covers the numerical methods and the prompts used to produce the code. It also includes screen captures and images showing example solutions, such as a one dimensional case on a periodic domain and a two dimensional case showing a shape being carried along by a rotating flow. This project will mainly interest people working in scientific computing, numerical methods, or formal verification who want to see machine generated, proven correct simulation code. It assumes familiarity with partial differential equations and is not aimed at general audiences. No license file or explicit usage instructions are mentioned in the README shown here.
Nine formally verified C solvers for advection and diffusion equations, each proven correct with Lean 4 and generated automatically by a tool called Lanyon.
Mainly C. The stack also includes C, Lean 4.
Setup difficulty is rated hard, with roughly 1day+ to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
double-check against the repo, no cap.