At the Lean FRO, Kim Morrison, a Senior Research Software Engineer, recently ran an experiment that went well beyond our expectations. An AI agent converted zlib, a widely used C compression library embedded in countless systems, to Lean, with minimal human guidance. No special tooling was built. It was Claude, a general-purpose AI, with no special training for theorem proving, out of the box. The workflow had four steps. First, the AI produced a clean, readable Lean implementation of the zlib compression format, including the DEFLATE algorithm at its core. Second, the Lean version passed the library’s existing test suite, confirming behavioral equivalence. Third, key properties were stated and proved, not as tests, but as mathematical theorems. The capstone theorem:
A Riemannian metric on a smooth manifold \(M\) is a family of inner products \[g_p : T_pM \times T_pM \;\longrightarrow\; \mathbb{R}, \qquad p \in M,\] varying smoothly in \(p\), such that each \(g_p\) is symmetric and positive-definite. In local coordinates the metric is completely determined by its values on basis tangent vectors: \[g_{ij}(p) \;:=\; g_p\!\left(\frac{\partial}{\partial x^i}\bigg|_p,\; \frac{\partial}{\partial x^j}\bigg|_p\right), \qquad g_{ij} = g_{ji},\] with the matrix \((g_{ij}(p))\) positive-definite at every point. The length of a tangent vector \(v = \sum_i v^i \frac{\partial}{\partial x^i}\in T_pM\) is then \(\|v\|_g = \sqrt{\sum_{i,j} g_{ij}(p)\, v^i v^j}\).
。关于这个话题,WPS下载最新地址提供了深入分析
external dependencies
- .claude/commands/fd-explore.md — Project exploration