As part of my doctoral dissertation, I developed a formal proof, in the Mizar system, of Euler's polyhedron formula. That's the result in mathematics (combinatorial topology) which says that, for a polyhedron , we have
where , , and are, respectively, the numbers of vertices, edges, and faces of .
To get a feel for that fact, take a look at the platonic solids (tetrahedron, cube, octahedron, dodecahedron, and icosahedron). But that's just the beginning; the formula is true of all convex polyhedra, and some more too. There are some extensions of the theorem for non-convex polyhedra, and it can be generalized to arbitrary finite dimensions. (The 2-dimensional version of the theorem says that for a polygon. Neat!)
Lean currently doesn't have a proof of Euler's polyhedron formula. It's one of the few theorems in Freek Wiedijk's 100 Theorems that's still outstanding in Lean.
So I decided to give it a go.
With some assistance from Claude Code, Loogle, Leansearch, and just bread-and-butter digging around in Mathlib, I was able to whip together a proof of Euler's polyhedron formula for combinatorial polyhedra, which are just a finite sequence of incidence relations: we postulate finite sets of vertices, edges, etc. and say which vertices are incident with which edges, which edges with which faces, etc. Following the standard approach in algebraic topology, we define a boundary operator (essentially, which are the edges that go around a single face, which are the two vertices of a single edge). The notion of boundary gets generalized a bit to map sets of faces (or edges) to a set of edges (or vertices). Mathematically, what's going s that we're working over finite-dimensional vector spaces over generated by the faces, edges, and vertices; the boundary operators are linear transformations from these spaces. The connection from the (abstract, combinatorial) geometry to the alternating sum comes from using the rank-nullity theorem. in linear algebra.
Although I've been following Lean for a couple years now, I've generally been nothing more than a tourist visiting a friendly place I want to learn more about. I'm a big fan; I even organize a conference dedicated to it! I've been wanting to dip my toes in—or, rather,
After getting something that worked, I opened a PR against Mathlib and posted a request for review on the Lean Zulip.
I quickly found out that my newbie PR needed work. I ended up factoring out one of the core algebraic topological results, the Euler-Poincaré formula, into its own PR. Also, reflecting on the feedback that my purely combinatorial formalization of polyhedra doesn't relate to Euclidean space or real numbers at all, I decided to close my PR and go back to the drawing board. I'm currently working on a variety of topics centered around Euler's polyhedron formula. I'm ultimately working on a version of Euler's polyhedron formula for convex polyhedra (which connected with real numbers). The plan there is to develop a theory of convex polytopes to the point where we can associate a chain complex with one, show that they're homology spheres, and then apply the Euler-Poincaré formula.
I'll also keep pushing in this area. It's a delight to use Claude Code and allied tools to help do these formalizations. The wonderful Lean LSP MCP collection (dare I call it a theorem prover
?) is a real power tool. I'd like to have a version of Euler's polyhedron formula based on combinatorial maps and perhaps CW complexes.