Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

A reduced incidence submatrix has determinant ±1 on a spanning tree and 0 otherwise

Proved
ClassicalGaps.orientedIncMatrix_submatrix_det_eq_spanningTree_indicator

by Rizwan G Mir · Sep 24, 2026 · Mathlib c5ea003 (Lean v4.30.0)

determinantsgraph-theorymatrix-tree-theoremspanning-trees

Let GGG be a finite simple graph on vertex set VVV with oriented incidence matrix BBB (ClassicalGaps.orientedIncMatrix), fix a base vertex v0v_0v0​, let FFF be a set of ∣V∣−1|V|-1∣V∣−1 edges of GGG, and fix any bijection eee between V∖{v0}V\setminus\{v_0\}V∖{v0​} and FFF. Form the square matrix Ma,b=Ba,e(b)M_{a,b} = B_{a, e(b)}Ma,b​=Ba,e(b)​ indexed by V∖{v0}V \setminus \{v_0\}V∖{v0​} (deleting the row for v0v_0v0​ and reindexing the columns from FFF through eee). Then det⁡(M)2\det(M)^2det(M)2 is 111 if the edges in FFF form a spanning tree of GGG (the subgraph they induce is connected), and 000 otherwise. Squaring makes the statement independent of the choice of eee and of sign conventions.

This is the key combinatorial fact in Kirchhoff's matrix-tree theorem: combined with the Cauchy-Binet formula (ClassicalGaps.cauchy_binet_det) applied to ClassicalGaps.lapMatrix_eq_orientedIncMatrix_mul_transpose, it turns the sum of squared minors into exactly the count of spanning trees. The classical proof is by induction on ∣F∣|F|∣F∣: if FFF contains a cycle the columns are linearly dependent (determinant 000); if FFF is a spanning tree, expanding along a leaf vertex's row gives ±1\pm 1±1 times the determinant for the smaller tree with that leaf removed.

Formalization Note: child lemma of ClassicalGaps.kirchhoff_matrix_tree.

Preamble
import Mathlib
import Definitions.Def_ClassicalGaps_orientedIncMatrix
open Classical Matrix
Formal statement
namespace ClassicalGaps

theorem orientedIncMatrix_submatrix_det_eq_spanningTree_indicator
    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj]
    (v₀ : V) (F : Finset (Sym2 V)) (hF : F ⊆ G.edgeFinset) (hcard : F.card + 1 = Fintype.card V)
    (e : {x : V // x ≠ v₀} ≃ {x // x ∈ F}) :
    (Matrix.of (fun a b : {x : V // x ≠ v₀} => orientedIncMatrix G a.1 ((e b : Sym2 V)))).det ^ 2 =
      (if (SimpleGraph.fromEdgeSet (↑F : Set (Sym2 V))).Connected then (1:ℝ) else 0) := 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