Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§II — a complete construction (N − 1 applications) is a spanning subtree

Proved
ShortestConnection.Principles.complete_construction_isSpanningSubtree

by mikedeng1 · Sep 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

graph-theoryp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1spanning-trees

Let GGG be a connected simple graph on a finite set VVV of NNN terminals with real edge lengths www. If e0,…,eN−2e_0,\dots,e_{N-2}e0​,…,eN−2​ is a complete construction by P1 and P2 (exactly N−1N-1N−1 applications), then its links form a spanning subtree of GGG:

{e0,…,eN−2}⊆E(G)andH({e0,…,eN−2}) is a tree on V.\{e_0,\dots,e_{N-2}\} \subseteq E(G) \quad\text{and}\quad H(\{e_0,\dots,e_{N-2}\}) \text{ is a tree on } V.{e0​,…,eN−2​}⊆E(G)andH({e0​,…,eN−2​}) is a tree on V.

This is Prim's "an NNN-terminal network is connected by N−1N-1N−1 applications": the output of a complete construction is a connection network.

Formalization Note The connectivity of GGG is an implicit hypothesis of the paper, stated explicitly here; it guarantees V≠∅V \ne \emptysetV=∅, so N−1N-1N−1 is ordinary subtraction.

Preamble
import Mathlib
import Definitions.Def_ShortestConnection_Principles_SpanningSubtree
import Definitions.Def_ShortestConnection_Principles_Construction
Formal statement
namespace ShortestConnection.Principles

/-- Prim 1957, §II, p. 1392 ("an N-terminal network is connected by N-1 applications"): the
links of a complete construction by P1 and P2 (one with `N - 1` links, `N = card V`) form a
spanning subtree of the labelled graph `G`.
Implicit hypothesis made explicit: `G` is connected (in particular `V` is nonempty, so
`card V - 1` is ordinary subtraction). -/
theorem complete_construction_isSpanningSubtree {V : Type*} [Fintype V] [DecidableEq V]
    (G : SimpleGraph V) (hG : G.Connected) (w : Sym2 V → ℝ) (l : List (Sym2 V))
    (hl : IsCompleteConstruction G w l) :
    IsSpanningSubtree G l.toFinset := by sorry

end ShortestConnection.Principles
Source
Prim, Shortest Connection Networks And Some Generalizations, Bell System Tech. J. 36 (1957), p. 1392, §II
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Let VVV be a finite type with decidable equality and N=∣V∣N = |V|N=∣V∣ elements. Let GGG be a simple graph on VVV, assumed connected, which includes that VVV is nonempty. Let www be any real-valued length on unordered pairs. Let lll be a complete construction for GGG and www, meaning both of the following:

  • each entry lil_ili​ is an application of P1 or P2 relative to the set {l0,…,li−1}\{l_0,\dots,l_{i-1}\}{l0​,…,li−1​} of earlier entries. P1 attaches a terminal with no earlier link to a GGG-neighbour at minimal www among its GGG-edges. P2 joins a terminal uuu that has an earlier link to a terminal nnn not reachable from uuu, by a GGG-edge {u,n}\{u,n\}{u,n} whose www is at most that of every GGG-edge leaving uuu's earlier-link component;
  • the list has exactly N−1N-1N−1 entries.

The theorem asserts that the set FFF of entries of lll is a spanning subtree of GGG:

  • every element of FFF is an edge of GGG;
  • the graph on all of VVV whose edges are the pairs in FFF is connected and has no cycles.

Degenerate cases. Connectedness of GGG rules out empty VVV, so N−1N-1N−1 is ordinary subtraction here. If ∣V∣=1|V|=1∣V∣=1, the only complete construction is the empty list. The claim is then that ∅\varnothing∅ is a spanning subtree, meaning the one-vertex edgeless graph is a tree. No condition is placed on www: ties and negative lengths are allowed.

Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

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