Formally verified 3D CSG mesh intersection: trust 93 lines of spec, not AI code

A new project, verified-3d-mesh-intersection, implements a formally verified 3D constructive solid geometry (CSG) mesh intersection in Lean 4. The key idea: trust only 93 lines of formal specification, not the 1000+ lines of AI-written implementation code. The AI automatically wrote over 60,000 lines of Lean proofs, which never need human review — the Lean checker guarantees correctness at compile time.
How it works
The specification pins down the exact surface of the resulting mesh and guarantees well-formedness conditions on the triangulation. The core identity:
solid (meshIntersect M1 M2) = solid M1 ∩ solid M2where solid represents the infinite set of points inside a mesh. Lean can reason about these infinite sets and prove the equality exactly.
Key details
- Language: Lean 4, compiled to WebAssembly via
emcc-wasm.sh. - Performance: 24 seconds to intersect two 70k-triangle Stanford bunny meshes. Slow but prioritizes verification over speed.
- Web demo: Runs the verified kernel in-browser at schildep.github.io/verified-3d-mesh-intersection. Supports STL import. No data sent to server.
- Human review: Only the 93-line spec needs reading. The 1000+ lines of AI implementation and 60k+ lines of AI proofs are treated as black boxes.
- Well-formedness: If inputs are not well-formed (e.g., non-closed or self-intersecting), the algorithm must detect and report correctly — formalized in the spec.
Who it's for
Developers working with 3D geometry, CSG operations, or formal verification, especially those skeptical of trusting AI-generated code without guarantees.
Architecture
The repository contains the Lean kernel (CSG/), a C wrapper (wrapper.c), and web glue code (web/). Build commands are provided via lakefile.lean, emcc-wasm.sh, and build_web_demo.sh. The UI and glue code are not formally verified.
📖 Read the full source: HN LLM Tools
👀 See Also

Testing OpenClaw on UmbrelOS: What to Know
OpenClaw's integration with UmbrelOS is being explored, potentially offering a new environment for AI-enhanced coding tools.

Exploring the Dynamic World of Moving Machines
Discover how AI-powered coding agents transform the industry in the latest discussion from the tech community. Engage with insights from OpenClawRadar as we highlight key aspects of this evolving technology.

Tennessee Woman Jailed for Six Months Due to AI Facial Recognition Error
Angela Lipps, a 50-year-old Tennessee grandmother, spent nearly six months in jail after Fargo police used facial recognition software to incorrectly identify her as a suspect in a North Dakota bank fraud case. She was released on Christmas Eve after bank records proved she was 1,200 miles away at the time of the crimes.

The First Step to AGI: Bridging the Gap with ClawDBot
Explore how ClawDBot advances us towards AGI by enhancing AI coding agents, showcasing a pivotal step in AI evolution.