Cut Property (Blue Rule) and Minimum Spanning Tree Uniqueness on SimpleGraph #
This module formalizes minimum-weight spanning trees (SimpleGraph.IsMST), outgoing cut edges
(SimpleGraph.IsOutgoingEdge, SimpleGraph.outgoingEdges), minimum-weight outgoing edges
(SimpleGraph.IsMOE), the cycle-exchange cut property, and distinct-weight MST uniqueness on
Mathlib's SimpleGraph V, following Section 2 (Properties 1 and 2, p. 68) of
[GHS83] and bridging both sequential Kruskal
(CslibFrontier.Algorithms.Lean.Kruskal.SimpleGraph) and the distributed GHS protocol
(CslibFrontier.Computability.Distributed.MinimumSpanningTree.GHS).
Main definitions #
SimpleGraph.IsSpanningTree: spanning treeT ≤ G ∧ T.IsTreeof a simple graphG.SimpleGraph.edgeWeightSum: total edge weight∑ᶠ e ∈ H.edgeSet, w eof a simple graphH.SimpleGraph.IsMST: minimum-weight spanning tree of(G, w).SimpleGraph.IsOutgoingEdge: undirected edge ofGwith one endpoint inS : Finset Vand one outsideS.SimpleGraph.crossesCut,SimpleGraph.outgoingEdges: computable Boolean cut test and outgoing edgeFinsetfor finite decidable graphs.SimpleGraph.IsMOE: minimum-weight outgoing edge of a vertex subsetS : Finset Vin(G, w).
Main results #
SimpleGraph.IsSpanningTree.swap_edge: adding a non-tree edges(u, v)(u ∈ S,v ∉ S) to a spanning treeTand deleting a boundary edgee'on theu–vtree path yields another spanning tree preserving any subgraph internal toS.SimpleGraph.IsMST.exists_sup_edge_of_isMOE: GHS Property 1 ([GHS83], §2, p. 68) — extending a fragmentH ≤ Tof an MSTTby any minimum-weight outgoing edge of its vertex set yields a subgraph of an MSTT'.SimpleGraph.IsMOE.mem_edgeSet_of_isMST_of_injOn: Distinct-weight cut / blue-rule theorem — whenwis injective onG.edgeSet, every minimum-weight outgoing edge across any cut belongs to every MST ofG.SimpleGraph.exists_isMOE,SimpleGraph.existsUnique_isMOE_of_injOn: existence (and uniqueness under injective edge weights) of the minimum-weight outgoing edge of any nonempty proper vertex subsetSin a finite connected graph.SimpleGraph.exists_isMST: every finite connected graph admits a minimum-weight spanning tree.SimpleGraph.IsMST.eq_of_injOn,SimpleGraph.existsUnique_isMST_of_injOn: GHS Property 2 ([GHS83], §2, p. 68) — whenwis injective onG.edgeSet, the minimum spanning tree of a finite connected graph is unique.SimpleGraph.le_of_forall_isMOE_of_isMST_of_injOn,SimpleGraph.isAcyclic_of_forall_isMOE_of_injOn,SimpleGraph.isMST_of_forall_isMOE_of_connected_of_injOn: any subgraph whose edges are all cut-MOEs is contained in the unique MST, hence acyclic, and equals the unique MST once connected.
References #
- R. G. Gallager, P. A. Humblet, and P. M. Spira, A Distributed Algorithm for Minimum-Weight Spanning Trees, Section 2 (Properties 1–2, p. 68).
Spanning trees, edge-weight sums, and minimum spanning trees #
T is a spanning tree of G when T is a spanning subgraph (T ≤ G) that is a tree
(T.IsTree).
Total weight ∑ᶠ e ∈ H.edgeSet, w e of the undirected edges of H : SimpleGraph V.
Using finsum avoids carrying [DecidableRel H.Adj] or [Fintype H.edgeSet] in quantified
optimality statements while simplifying to ∑ e ∈ H.edgeFinset, w e whenever [Fintype H.edgeSet]
is available.
T is a minimum-weight spanning tree (MST) of G with respect to edge weights w if T is a
spanning tree of G whose total edge weight is less than or equal to that of every spanning tree
of G.
Outgoing cut edges and minimum-weight outgoing edges (MOEs) #
Symmetry-preserving computable Boolean check testing whether e : Sym2 V has one endpoint in
S and one outside S.
Computable Finset of outgoing edges of S in G.
e is a minimum-weight outgoing edge (MOE) of S in (G, w) if e is an outgoing edge of
S and its weight is at most that of every outgoing edge of S.
Instances For
Computable check for IsMOE on a finite decidable graph.
Every nonempty proper subset S of a finite connected graph has at least one outgoing edge.
Every nonempty proper subset S of a finite connected graph has a minimum-weight outgoing
edge.
Under injective edge weights on G.edgeSet, every nonempty proper subset S of a finite
connected graph has a unique minimum-weight outgoing edge.
Fundamental cycle-exchange lemma on spanning trees #
Cycle-exchange lemma across a cut: if T is a spanning tree of G on [Finite V] and
G.Adj u v crosses (S, Sᶜ) (u ∈ S, v ∉ S) with s(u, v) ∉ T.edgeSet, there is an edge
e' ∈ T.edgeSet crossing (S, Sᶜ) in T such that (T ⊔ edge u v).deleteEdges {e'} is a
spanning tree of G with the exact swapped weight sum.
Cut optimality (GHS Property 1) and distinct-weight blue rule #
GHS Property 1 ([GHS83], §2, p. 68): given a minimum-weight spanning
tree T of G, any subgraph H ≤ T whose edges lie inside S : Finset V (in particular, a
connected fragment of T on vertex set S), and any minimum-weight outgoing edge s(u, v) of S,
there exists a minimum-weight spanning tree T' of G containing both H and s(u, v).
Distinct-weight cut / blue-rule theorem: when w is injective on G.edgeSet, the
minimum-weight outgoing edge across any cut S : Finset V belongs to every minimum-weight
spanning tree of G.
Existence and distinct-weight uniqueness of the MST (GHS Property 2) #
Every finite connected graph admits a minimum-weight spanning tree.
GHS Property 2 ([GHS83], §2, p. 68): when w is injective on
G.edgeSet, any two minimum-weight spanning trees of G are equal.
On a finite connected graph with edge weights injective on G.edgeSet, there exists a unique
minimum-weight spanning tree.
Cut-MOE subgraphs and acyclicity #
Any subgraph H whose edges are all cut-MOEs of (G, w) is contained in every MST of (G, w)
when w is injective on G.edgeSet.
On a finite connected graph with injective edge weights, any subgraph whose edges are all cut-MOEs is acyclic (since it is a subgraph of the unique MST).
On a finite connected graph with injective edge weights, any connected graph H whose edges are
all cut-MOEs of (G, w) is the unique minimum-weight spanning tree of (G, w).