Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

BEST theorem — Euler tours =L τ(D)∏v(deg⁡−(v)−1)!=L\,\tau(D)\prod_v(\deg^-(v)-1)!=Lτ(D)∏v​(deg−(v)−1)!

Proved
HararySachs.Hyper.best_theorem

by milia · Nov 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

arborescencebest-theoremeuleriangraph-theory

This is the BEST theorem (de Bruijn–van Aardenne-Ehrenfest–Smith–Tutte, Theorem 5 of the paper), counted as Euler tours with a distinguished first arc.

Let DDD be a directed multigraph on [n][n][n] with arc multiplicities m(u,v)m(u,v)m(u,v) (loops allowed) and L>0L>0L>0 arcs in total, where parallel arcs are distinguishable. Suppose DDD is Eulerian: its set V(D)V(D)V(D) of vertices of positive degree is nonempty, deg⁡+(v)=deg⁡−(v)\deg^+(v)=\deg^-(v)deg+(v)=deg−(v) for every vvv, and V(D)V(D)V(D) is weakly connected. Let τ(D)\tau(D)τ(D) be the number of spanning arborescences of V(D)V(D)V(D) oriented toward the least vertex of V(D)V(D)V(D), with parallel arcs distinguished. Then the number of Euler tours of DDD, i.e. closed trails using every arc exactly once with a distinguished first position, is

L⋅τ(D)∏v∈V(D)(deg⁡−(v)−1)!.L\cdot\tau(D)\prod_{v\in V(D)}\bigl(\deg^-(v)-1\bigr)!.L⋅τ(D)v∈V(D)∏​(deg−(v)−1)!.

Equivalently, since each Euler circuit gives LLL tours, ∣E(D)∣=τ(D)∏v∈V(D)(deg⁡−(v)−1)!|\mathfrak E(D)|=\tau(D)\prod_{v\in V(D)}(\deg^-(v)-1)!∣E(D)∣=τ(D)∏v∈V(D)​(deg−(v)−1)!, which is the BEST theorem. Combined with Lemma 4, it yields Corollary 6, the closed form f^tr⁡(Ad(k−1))=d(k−1) τ(f)∏v(deg⁡−(v)−1)!\hat f\operatorname{tr}(A^{d(k-1)})=d(k-1)\,\tau(f)\prod_v(\deg^-(v)-1)!f^​tr(Ad(k−1))=d(k−1)τ(f)∏v​(deg−(v)−1)! used in the proof of Lemma 13.

Formalization Note Tours are the mission's numTours: bijections σ\sigmaσ from positions Fin L onto the labeled arcs Arcs m, such that the head of each arc is the tail of the next, cyclically. The arborescence count is numArb, which encodes trees by parent maps weighted by the product of arc multiplicities. In-degree is used in the factorials, as in the mission's associated coefficient; in an Eulerian digraph it equals out-degree.

Preamble
import Mathlib
import Definitions.Def_HararySachs_Hyper_Operators
Formal statement
namespace HararySachs.Hyper

theorem best_theorem {n L : ℕ} (hL : 0 < L) (m : ArcMult n)
    (hm : (∑ u : Fin n, ∑ v : Fin n, m u v) = L) (hEu : IsEulerian m) :
    numTours m hL =
      L * numArb m * ∏ v ∈ active m, Nat.factorial (inDeg m v - 1) := by sorry

end HararySachs.Hyper
Source
Clark and Cooper, A Harary-Sachs theorem for hypergraphs, arXiv:1812.00468v2, p. 6, Theorem 5 (BEST theorem) and Corollary 6, with the count |E(D)||𝔈(D)| of Euler tours from the proof of Lemma 4; original: van Aardenne-Ehrenfest and de Bruijn (1951), Smith and Tutte (1941)

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me