§II — each application of P1 or P2 joins two components: no loops, N − k components
ProvedShortestConnection.Principles.construction_acyclic_card_componentsLet be a simple graph on a finite set of terminals with real edge lengths , and let be a construction by P1 and P2. Then the links contain no closed loop, and the number of connected components of the link graph (isolated terminals and isolated fragments together) is
This is Prim's observation that each application of either principle reduces the number of isolated terminals and fragments by one; it is the counting step behind "an -terminal network is connected by applications".
Formalization Note The component count is Nat.card of the connected components of the link graph; is natural-number subtraction. No connectivity of is needed.
import Mathlib import Definitions.Def_ShortestConnection_Principles_SpanningSubtree import Definitions.Def_ShortestConnection_Principles_Construction
namespace ShortestConnection.Principles
/-- Prim 1957, §II, p. 1392 ("each application of either P1 or P2 reduces the total number of
isolated terminals and fragments by one"): after the links of any construction by P1 and P2 have
been made, the links form no closed loop, and the number of connected components (isolated
terminals and isolated fragments) is the number of terminals minus the number of links made.
No hypothesis on `G` or on the lengths is needed. -/
theorem construction_acyclic_card_components {V : Type*} [Fintype V] [DecidableEq V]
(G : SimpleGraph V) (w : Sym2 V → ℝ) (l : List (Sym2 V)) (hl : IsConstruction G w l) :
(linkGraph l.toFinset).IsAcyclic ∧
Nat.card (linkGraph l.toFinset).ConnectedComponent = Fintype.card V - l.length := by sorry
end ShortestConnection.Principles
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be a finite type with decidable equality and elements. Let be any simple graph on , and let be any real-valued length on unordered pairs. Let be a list of unordered pairs that is a construction for and .
A construction is a list in which each entry is either:
- a P1 step relative to : a pair with touched by no earlier non-degenerate link, , and minimal among the -edges at ; or
- a P2 step: a pair with having an earlier link, not reachable from by earlier links, , and at most the length of every -edge from the earlier-link component of to its complement.
Let be the graph on whose edges are the non-degenerate entries of . The theorem asserts two things:
- has no cycles;
- the number of connected components of equals , where is the number of list entries (repeats counted) and the subtraction is natural-number subtraction:
There are no hypotheses on (it may be disconnected) or on (ties and negative values are allowed).
Degenerate cases. If is empty, only the empty list is a construction, since a step needs a terminal. The claim is then that the empty graph is acyclic and has components. If is empty, the claim is that the edgeless graph has components. Because the subtraction is truncated, the equation read literally allows with components. The theorem asserts the stated equality for every construction.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.