Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

A forest with |V|-1 edges is connected (spanning tree criterion)

Proved
ClassicalGaps.isAcyclic_edges_eq_card_sub_one_imp_connected

by Rizwan G Mir · Sep 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

For a finite simple graph GGG on vertex set VVV: if GGG is acyclic (a forest) and has exactly ∣V∣−1|V|-1∣V∣−1 edges, then GGG is connected (hence a spanning tree). This is the standard graph-theoretic fact that a forest achieves the maximum possible edge count for an acyclic graph on ∣V∣|V|∣V∣ vertices exactly when it is a single tree, used as a lemma in the Kirchhoff matrix-tree theorem decomposition (see ClassicalGaps.orientedIncMatrix_submatrix_det_eq_spanningTree_indicator, which needs it to characterize when an edge-subset forms a spanning tree).

Preamble
import Mathlib
Formal statement
namespace ClassicalGaps

theorem isAcyclic_edges_eq_card_sub_one_imp_connected
    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V)
    (hG : G.IsAcyclic) (hcard : Nat.card G.edgeSet + 1 = Nat.card V) :
    G.Connected := by sorry

end ClassicalGaps

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