Cayley’s formula for labeled trees
ProvedProofsInTheBook.Chapter31.chapter31book-chapter-33combinatoricslean4proofs-from-the-book
For every natural number , let be the set of simple graphs on that are trees. Then
The labels are the fixed vertex indices, so isomorphic graphs with different labelings are counted separately. This is the full labeled-tree count for the stated range.
Preamble
import Mathlib import Definitions.Def_ProofsInTheBook_Chapter31 set_option autoImplicit true open ProofsInTheBook.Chapter31 open SimpleGraph
Formal statement
theorem ProofsInTheBook.Chapter31.chapter31 (n : ℕ) (hn : 2 ≤ n) :
Fintype.card (LabeledTree n) = n ^ (n - 2) := by sorrySource
Martin Aigner and Günter M. Ziegler, Proofs from THE BOOK, 6th edition, Springer, 2018, Chapter 33, “Cayley’s formula for the number of trees”, pp. 235–240 (https://doi.org/10.1007/978-3-662-57265-8_33). Formalization: https://github.com/xiangyazi24/proof_in_the_book/blob/88d88d141768cded75e782c525ef1bf04b8fe220/ProofsInTheBook/Chapter31.lean#L2673. The chapter reference identifies the topic; it does not claim the Lean development reproduces every argument of that chapter.