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

Deterministic vs Probabilistic Code Generation: Why Bun's Vibe-Coded Rust Conversion Raises Red Flags
Noah Hall argues vibe-coded 1M-line repo changes (like Bun's Zig-to-Rust) are dangerous. Contrasts deterministic transpilers vs. probabilistic LLM output. Tests aren't enough.

Yann LeCun's AMI raises $1B for AI world models, challenges LLM approach
Yann LeCun's startup AMI raised over $1 billion to develop AI world models that understand the physical world, arguing LLMs alone won't achieve human-level intelligence. The company will build systems with persistent memory, reasoning, and planning capabilities for manufacturing, biomedical, and robotics applications.

Pentagon Pledges No More Single AI Provider After Anthropic Fallout, Signs Deals with AWS, Google, Microsoft, NVIDIA, OpenAI, Oracle, SpaceX
Defense Under Secretary Emil Michael says the Pentagon will 'never again' rely on a single AI model provider, citing integration complexity and the recent dispute with Anthropic. New agreements with eight AI companies aim to diversify the tech stack.

AI Agents Need Rollback Primitives, Not Just Autonomy
A developer argues agent frameworks must adopt database concepts like ACID, sagas, and compensating actions to handle partial failures, rather than relying on LLMs to "figure it out."