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

Two South African Home Affairs Officials Suspended Over AI Hallucinations in Policy Paper
Two officials were suspended after AI hallucinations were found in the reference list of a revised white paper on citizenship, immigration, and refugee protection. The department will implement AI checks and review all policy documents back to Nov 2022.

AI Eats the World (Spring 2026) – A Comprehensive Market Analysis
An in-depth PDF report on AI industry trends, market sizes, and adoption metrics for Spring 2026, covering key technologies, players, and forecasts.

Claude Code Telegram Plugin Bug: MCP Notifications Silently Dropped — Workaround via File Polling and tmux Injection
A Telegram plugin for Claude Code works correctly but inbound messages are silently dropped because Claude Code discards MCP notifications on stdio transport. A workaround uses file polling and tmux send-keys with ~5-9s latency.

Claude Shannon's 1950 Chess Paper Predicted GenAI's Core Problem: Guessing vs. Knowing
Shannon's 1950 chess paper framed the core challenge of AI: making 'tolerably good' decisions under uncertainty—exactly the problem generative AI faces today when it produces polished but wrong answers.