Theorem 3.7.5 — Cayley's Tree Formula
ProvedGYGraphTheory.cayley_tree_formulaTheorem 3.7.5 [Cayley's Tree Formula] (Gross–Yellen, p. 162). For every , the number of distinct labeled trees on the vertex set is . Two labeled trees are considered distinct exactly when their edge sets differ. The source derives this immediately from Proposition 3.7.4: since Prüfer encoding and decoding are mutually inverse bijections between labeled trees on vertices and Prüfer sequences of length over an -element label alphabet, and there are such sequences by the rule of product, the two sets have equal cardinality.
import Definitions.Def_GYGraphTheory import Mathlib
namespace GYGraphTheory
theorem cayley_tree_formula (n : ℕ) (hn : 2 ≤ n) :
Nat.card {T : SimpleGraph (Fin n) // T.IsTree} = n ^ (n - 2) := by sorry
end GYGraphTheoryRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
For every natural number satisfying , the statement asserts that the number of simple graphs on the vertex set (i.e. ) that are trees — meaning, per Mathlib's SimpleGraph.IsTree, that the graph is both connected and acyclic (contains no cycles) — equals . Concretely, the quantity on the left is applied to the subtype , i.e. the cardinality of the set of all such tree-graphs on this fixed -element vertex set (where a "simple graph" here is an irreflexive symmetric relation on , so no loops and no multi-edges, and two such graphs are counted as distinct objects whenever their edge relations differ, i.e. this counts labeled trees on distinguishable vertices , not trees up to isomorphism). Since is a finite type for every , this subtype is finite as well, so here denotes the ordinary (finite) cardinality of this set of graphs, not the degenerate value that assigns to infinite types. The hypothesis restricts the claim to , so the potentially degenerate cases (empty vertex set) and (single vertex, where would require care as a natural-number subtraction) are excluded from what is being asserted; note also that is natural-number subtraction, which for evaluates to , giving right-hand side . The proof of this equality is not supplied — the body is sorry, so the statement is asserted but unproved.
Confirmed by the mission captain (proposal self-audit).