How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced — the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted — a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated — a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Trees, Forests and Spanning Trees
1 · Prerequisites
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Countability and Uncountability
- Finite Counting, Factorials and Binomial Coefficients
- Foundations of the Real Numbers for Analysis
- Graphs, Walks and Connectivity
- Relations, Functions, and Quotients
- Roots, Rational Powers, and Classical Inequalities
- Suprema and Infima
- The ZFC Axioms and the Basic Set Constructions
2 · Summary
Published finite-simple-graph conventions, path and cycle definitions, connected components, vertex degrees, graph deletion, and finite-cardinality results supply the structural setting. Forest component counting gives , while deleting a tree edge or adding a missing edge relates acyclicity, connectivity, unique paths, and the tree edge count.
Those structural equivalences lead to rooted-tree levels, spanning trees, fundamental cycles and cuts, and the finite spanning-tree number. Prüfer encoding and decoding then biject labelled trees with words and yield Cayley's formula. For real edge weights, spanning-tree exchange proves cut and cycle rules, uniqueness under distinct weights, and correctness of Kruskal's and Prim's finite greedy procedures.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Trees, forests, leaves and isolated vertices
Definition
All graphs here are finite, simple and undirected (A finite simple graph is a finite vertex set together with a set of two-element vertex subsets). A forest is a graph containing no cycle, and a tree is a connected forest (Walks, closed walks, trails, paths and cycles, with length equal to the number of traversed edges, Connected graphs and connected components defined by the existence of vertex paths).
A vertex of degree one is a leaf. A vertex of degree zero is isolated (Adjacency, incidence, open and closed neighbourhoods, vertex degree, minimum degree and maximum degree). Thus the one-vertex tree has an isolated vertex and no leaf under this convention. A nontrivial tree means a tree with at least two vertices.
Remarks
- The null graph is a forest but not a tree, because it is not connected under the library convention.
- Every connected component of a nonnull forest is a tree.
Every nonempty forest has a vertex of degree at most one
Statement
Every forest with at least one vertex has a vertex of degree at most one.
Facts & Assumptions
Given: A forest with .
A forest contains no cycle (Trees, forests, leaves and isolated vertices).
Every finite graph of minimum degree at least two contains a cycle (Every finite simple graph of minimum degree at least two contains a cycle).
Vertex degrees are natural numbers (Adjacency, incidence, open and closed neighbourhoods, vertex degree, minimum degree and maximum degree).
Proof
Suppose every vertex of has degree greater than one.
Since degrees are natural numbers, has minimum degree at least two.
Hence contains a cycle.
This contradicts that is a forest, so some vertex has degree at most one.
For every forest, , where is the number of connected components
Statement
If is a forest, let be the family of vertex sets of its connected components and put . Then
For the null forest, .
Facts & Assumptions
Given: A finite forest .
A forest contains no cycle, and a nonempty forest has a vertex of degree zero or one (Trees, forests, leaves and isolated vertices, Every nonempty forest has a vertex of degree at most one).
Connected components partition the vertex set. Their vertex sets form a subset of the finite power set , so is finite and is defined (The connected components of a graph partition its vertex set and are its maximal connected subgraphs, for finite , A subset of a finite set is finite, with , and equality holds if and only if , The cardinality of a finite set).
Deleting a vertex deletes exactly its incident edges (Vertex and edge deletion, edge contraction, graph minors, subdivisions and topological minors).
Finite disjoint unions obey the sum rule, and natural addition is associative and commutative (The cardinality of a finite set, The sum rule: a finite disjoint union is finite with and , and a sum over a finite index set splits along a partition, Addition is associative, Addition is commutative).
Induction is valid on (The principle of mathematical induction).
Proof
If , then and , so the identity holds.
Let , assume the identity for forests with fewer vertices, and choose a vertex of degree at most one.
Put . It remains a forest, and is the disjoint union of and , so .
If is isolated, then , while the component family of is the disjoint union of the component family of and . Hence and .
If has degree one, deleting it removes its unique incident edge, so . It does not change the number of components: cannot be an internal vertex of a path between remaining vertices, and its neighbour remains in the same nonempty component after deletion. Thus .
In the isolated case, the induction hypothesis gives .
In the degree-one case, the induction hypothesis gives .
The two possible degrees of have both been handled, so the identity holds for every forest.
A tree on vertices has edges
Statement
A tree with vertices has exactly edges.
Facts & Assumptions
Given: A tree with .
Every forest satisfies (For every forest, , where is the number of connected components).
A tree is connected and acyclic, so it is a forest with exactly one connected component (Trees, forests, leaves and isolated vertices, Connected graphs and connected components defined by the existence of vertex paths).
Proof
Apply the forest identity to : .
Therefore .
Deleting any edge of a tree separates it into exactly two tree components
Statement
If is a tree and , then has exactly two connected components, each of which is a tree.
Facts & Assumptions
Given: A tree and an edge .
A tree is connected and has no cycle (Trees, forests, leaves and isolated vertices).
has the same vertices and all edges of except (Vertex and edge deletion, edge contraction, graph minors, subdivisions and topological minors).
Connectedness is equivalently the existence of a path between every two vertices (Connected graphs and connected components defined by the existence of vertex paths, Walks, closed walks, trails, paths and cycles, with length equal to the number of traversed edges).
Proof
The vertices and lie in distinct components of : otherwise a - path in together with would be a cycle in .
Every vertex lies in the component of or the component of . Indeed, take an - path in ; if it avoids it joins to in , and if it uses then its segment from to avoids .
Thus has exactly two components.
Each component is connected by definition and contains no cycle because it is a subgraph of the acyclic graph . Hence each component is a tree.
Adding an edge between two nonadjacent vertices of a tree creates exactly one cycle
Statement
Let be a tree and let be nonadjacent vertices. Adding the edge creates exactly one cycle.
Facts & Assumptions
Given: A tree and nonadjacent vertices .
A tree is connected and acyclic (Trees, forests, leaves and isolated vertices).
Paths and cycles have their usual vertex-simple meanings (Walks, closed walks, trails, paths and cycles, with length equal to the number of traversed edges).
Proof
There is a - path in , and it is unique: if two distinct such paths existed, their first divergence and next reunion would yield a cycle.
Every cycle in must contain , since itself is acyclic. Removing from such a cycle leaves a - path in .
The path together with the new edge is a cycle in .
By uniqueness in step 1.1, the path obtained in step 1.2 is . Hence the cycle in step 2.1 is the only cycle.
Equivalent characterisations of a nonempty tree by unique paths, edge count, minimal connectivity and maximal acyclicity
Statement
For a finite nonempty graph , the following are equivalent:
- is a tree.
- Every two vertices are joined by a unique path.
- is connected and .
- is acyclic and .
- is minimally connected: it is connected, but deleting any edge disconnects it.
- is maximally acyclic: it is acyclic, but adding any missing edge creates a cycle.
Facts & Assumptions
Given: A finite nonempty graph .
Forests satisfy , and trees satisfy (For every forest, , where is the number of connected components, A tree on vertices has edges).
Deleting a tree edge disconnects the tree, and adding a missing edge to a tree creates one cycle (Deleting any edge of a tree separates it into exactly two tree components, Adding an edge between two nonadjacent vertices of a tree creates exactly one cycle).
A tree is connected and acyclic (Trees, forests, leaves and isolated vertices).
Connectedness and paths use the standard graph meanings (Connected graphs and connected components defined by the existence of vertex paths, Walks, closed walks, trails, paths and cycles, with length equal to the number of traversed edges).
Proof
If is a tree, connectedness supplies a path between each two vertices, and two distinct paths would contain a cycle. Thus condition 1 implies condition 2.
Under condition 2, is connected. Deleting any edge leaves no - path, because such a path together with would give a second path in . Thus condition 2 implies condition 5.
Suppose condition 5 holds. If contained a cycle, deleting one edge of that cycle would leave its endpoints joined around the rest of the cycle and would not disconnect . Hence is acyclic and therefore is a tree. Thus condition 5 implies condition 1.
Condition 1 implies condition 3 by the tree edge count.
Under condition 3, suppose had a cycle. Repeatedly delete an edge from a cycle; each deletion preserves connectedness, and finiteness makes the process stop at a connected acyclic spanning graph . At least one edge was deleted, so , while the forest identity with one component gives , a contradiction. Hence condition 3 implies condition 1.
Under condition 4, the forest identity gives , so and is a tree. Conversely condition 1 implies condition 4 by definition and the tree edge count.
Condition 1 implies condition 6 by edge addition.
Under condition 6, if were disconnected, vertices in different components would be nonadjacent and adding an edge between them could create no cycle. Hence is connected, and its assumed acyclicity makes it a tree.
All six conditions are therefore equivalent.
Every tree with at least two vertices has at least two leaves
Statement
Every tree with at least two vertices has at least two distinct leaves.
Facts & Assumptions
Given: A tree with at least two vertices.
Every two vertices of a tree are joined by a unique path (Equivalent characterisations of a nonempty tree by unique paths, edge count, minimal connectivity and maximal acyclicity).
Because is finite, its set of paths has a maximum-length member (Walks, closed walks, trails, paths and cycles, with length equal to the number of traversed edges).
Proof
Choose a path of maximum length. Since has at least two vertices and is connected, .
If had a neighbour other than , that neighbour could not already lie on , since that would form a cycle; adjoining it would therefore lengthen the maximum-length path . Thus has degree one.
The same argument shows that has degree one.
Since , these are two distinct leaves.
Rooted trees, ancestors, descendants, depth, height, parents and children
Definition
A rooted tree is a pair consisting of a tree and a distinguished vertex , the root (Trees, forests, leaves and isolated vertices). The unique - path is the root path of (Equivalent characterisations of a nonempty tree by unique paths, edge count, minimal connectivity and maximal acyclicity).
The depth of is , and the height of is the maximum vertex depth (Graph distance within a component, eccentricity, diameter and girth, including the acyclic convention). A vertex is an ancestor of , and a descendant of , when lies on the root path of . If , the neighbour of immediately preceding it on its root path is its parent; the vertices having parent are the children of .
The vertices of depth form level . The root has depth zero and is its own ancestor, but it has no parent.
Every nonroot vertex has a unique parent, and adjacent vertices have depths differing by one
Statement
In a rooted tree , every vertex other than has exactly one parent. If , then the depths of and differ by exactly one.
Facts & Assumptions
Given: A rooted tree .
There is a unique path from to each vertex (Equivalent characterisations of a nonempty tree by unique paths, edge count, minimal connectivity and maximal acyclicity).
Depth is distance from , and parent means the preceding vertex on the root path (Rooted trees, ancestors, descendants, depth, height, parents and children, Graph distance within a component, eccentricity, diameter and girth, including the acyclic convention).
Proof
For , its unique root path has positive length and therefore has one vertex immediately before . This vertex is the unique parent of .
Let be an edge. The root paths of and cannot diverge before their endpoints, since the two divergent tails together with would form a cycle. Hence one root path is obtained from the other by appending .
Their lengths, and therefore their depths, differ by exactly one.
Spanning trees of a graph
Definition
Let be a graph. A spanning tree of is a spanning subgraph of that is a tree (Subgraphs, induced subgraphs and spanning subgraphs, Trees, forests, leaves and isolated vertices). Equivalently,
and is connected and acyclic.
The null graph has no spanning tree under the library convention that a tree is nonempty and connected.
A maximal acyclic spanning subgraph of a connected graph is a spanning tree
Statement
Let be a finite connected graph. If is an acyclic spanning subgraph of maximal under edge inclusion among such subgraphs, then is a spanning tree of .
Facts & Assumptions
Given: A connected graph and an edge-maximal acyclic spanning subgraph .
The connected components of partition (The connected components of a graph partition its vertex set and are its maximal connected subgraphs).
A spanning tree is a connected acyclic spanning subgraph (Spanning trees of a graph, Trees, forests, leaves and isolated vertices).
Connectedness supplies a path between vertices (Connected graphs and connected components defined by the existence of vertex paths).
Proof
Suppose is disconnected, and choose vertices in distinct components of .
A - path in has a first edge whose endpoints lie in distinct components of .
Adding to cannot create a cycle, because a cycle through would contain an - path already in , contrary to the choice of distinct components.
Thus is a strictly larger acyclic spanning subgraph, contradicting maximality.
Hence is connected, and therefore it is a spanning tree.
A finite graph is connected if and only if it has a spanning tree
Statement
A finite graph is connected if and only if it has a spanning tree.
Facts & Assumptions
Given: A finite graph .
Every maximal acyclic spanning subgraph of a connected graph is a spanning tree (A maximal acyclic spanning subgraph of a connected graph is a spanning tree).
A spanning tree is a connected spanning subgraph (Spanning trees of a graph).
A finite graph has only finitely many edge subsets, so the family of acyclic spanning subgraphs has a maximal member.
A graph is connected when every two vertices are joined by a path (Connected graphs and connected components defined by the existence of vertex paths).
Proof
If is connected, choose a maximal acyclic spanning subgraph ; the edgeless spanning subgraph shows that the choice family is nonempty.
By L1, is a spanning tree of .
Conversely, if has a spanning tree , every two vertices are joined by a path in , hence by a path in . Thus is connected.
Every edge outside a spanning tree determines a unique fundamental cycle
Statement
If is a spanning tree of and , then has a unique cycle, namely together with the unique - path in . This is the fundamental cycle of with respect to .
Facts & Assumptions
Given: A spanning tree of and .
A tree has a unique path between each two vertices (Equivalent characterisations of a nonempty tree by unique paths, edge count, minimal connectivity and maximal acyclicity).
Adding an edge between nonadjacent vertices of a tree creates exactly one cycle (Adding an edge between two nonadjacent vertices of a tree creates exactly one cycle).
contains every vertex of (Spanning trees of a graph).
Proof
The endpoints belong to and are nonadjacent there.
Let be the unique - path in . By edge addition, is the unique cycle in .
Every edge of a spanning tree determines a fundamental cut, and every edge crossing it restores a spanning tree
Statement
Let be a spanning tree of and . The two components of determine the fundamental cut
For every , the graph is a spanning tree of .
Facts & Assumptions
Given: A spanning tree of and .
has exactly two tree components (Deleting any edge of a tree separates it into exactly two tree components).
A spanning tree contains every vertex of (Spanning trees of a graph).
Proof
Let be the vertex sets of the two components of . They partition .
If crosses from to , then is connected: paths inside and , together with , join every pair of vertices.
It is acyclic: each side is acyclic, and a cycle using would require a second edge between the two sides, but has only .
It is spanning by construction, so it is a spanning tree of .
The set of spanning trees of a finite graph is finite
Statement
Every finite graph has only finitely many spanning trees.
Facts & Assumptions
Given: A finite graph .
A spanning tree of is determined by its edge set, which is a subset of (Spanning trees of a graph).
The power set of a finite set is finite, and every subset of a finite set is finite ( for finite , A subset of a finite set is finite, with , and equality holds if and only if ).
Proof
The map sending a spanning tree to its edge set embeds the set of spanning trees into .
The latter power set is finite, so its subset consisting of spanning-tree edge sets is finite.
The spanning-tree number
Definition
For a finite graph , its spanning-tree number is
This is a natural number because the displayed set is finite (The set of spanning trees of a finite graph is finite, The cardinality of a finite set). In particular, exactly when has no spanning tree.
The Prüfer code of a tree on a finite set of natural labels
Definition
Let be finite with , and let be a tree whose vertex set is . Here denotes the unique natural number satisfying . The Prüfer code is the word of length on obtained by repeating the following operation until two vertices remain:
- choose the least labelled leaf ;
- record the unique neighbour of ;
- delete and its incident edge.
A nontrivial tree has a leaf, so the least one exists (Every tree with at least two vertices has at least two leaves, The well-ordering principle). Deleting a leaf from a tree with at least three vertices leaves a tree: paths between the remaining vertices never need the deleted leaf, and no cycle is introduced. Thus every stage is defined. Each stage removes one vertex, so precisely symbols are recorded.
The usual formulation has , using natural numbers as their von Neumann initial segments (The natural numbers (von Neumann), The cardinality of a finite set). Allowing an arbitrary finite subset of natural labels is essential because every intermediate label set produced by deletion is again such a subset.
The Prüfer decoding procedure is well defined and produces a labelled tree
Statement
Let be finite with , and let be a word on the label set . The following procedure is well defined and produces a tree on :
At stage , choose the least unused label absent from the remaining word , join it to , and mark it used. After all symbols are processed, join the two unused labels.
Facts & Assumptions
Given: A word on a finite set of cardinality (The cardinality of a finite set).
A word with positions cannot contain more than distinct labels. Thus among available labels at least two are absent; every nonempty set of natural labels has a least element (The pigeonhole principle on , The well-ordering principle).
A tree is a connected acyclic graph (Trees, forests, leaves and isolated vertices).
Induction applies to the decoding stages (The principle of mathematical induction).
Proof
Before any word entry is processed, the graph has singleton components indexed by , each containing exactly one unused label.
Assume that after stages the built edges form a forest and every component contains exactly one unused label.
There are unused labels and entries in the remaining word. Hence at least two unused labels are absent from that word, so the least such label exists. Every label used at an earlier stage was absent from the then-remaining word and hence from its current suffix, so is unused; because occurs in the remaining word, .
The label lies in a component different from the component containing : by the induction hypothesis each component contains exactly one unused label, and . Adding and marking used joins those components without a cycle and leaves exactly one unused label in the new component. Thus the invariant holds after stage .
Induction gives the invariant after all word stages. Exactly two unused labels and two components remain; joining those labels makes the graph connected without creating a cycle.
The output uses all labels in and is connected and acyclic, hence is a labelled tree on .
Prüfer encoding and decoding are inverse bijections between labelled trees on vertices and words of length on their labels
Statement
For every natural , Prüfer encoding is a bijection from the set of trees with vertex set to the set of words of length on . Its inverse is the decoding procedure of The Prüfer decoding procedure is well defined and produces a labelled tree.
Facts & Assumptions
Given: A natural number .
Encoding repeatedly removes the least labelled leaf and records its neighbour (The Prüfer code of a tree on a finite set of natural labels).
Decoding is well defined and produces a labelled tree (The Prüfer decoding procedure is well defined and produces a labelled tree).
Two maps are inverse bijections when both composites are identity maps (Injection, surjection, bijection).
Induction is valid on the word length (The principle of mathematical induction).
Decoding chooses the least unused label absent from the remaining word, attaches it to the first remaining symbol, and then deletes that symbol.
Proof
On a two-element natural-label set, the only word is empty and the only tree is the edge joining the labels, so encoding and decoding agree.
Assume that encoding and decoding are inverse on every finite natural-label set of size .
Let and let be the least label absent from . Decoding first attaches to and never uses again.
Conversely, let be a labelled tree, let its first encoding operation delete the least leaf , and let it record the neighbour .
In the decoded tree, is a leaf. Every label smaller than occurs in , so while it is unused it receives an edge as a recorded neighbour and later receives its deletion edge or the final edge. Hence no smaller label is initially a leaf, and encoding first deletes and records .
The label is absent from the full code. Every smaller label is not initially a leaf, so before it can be deleted, deletion of an incident leaf records it at least once. Thus is the least label absent from the code, and decoding first restores the edge .
After removing and the first word entry, both procedures operate on the same ordered label set of size and the suffix word. The induction hypothesis shows that the remaining operations are inverse. Thus encoding the decoded tree returns .
After deleting and the first code entry, the induction hypothesis restores the remaining tree on its ordered label set of size . Therefore decoding the code of returns .
Both composites are identities, so encoding and decoding are inverse bijections on the ordered label set of size . Applying this to the natural order on proves the theorem.
Cayley's formula: for , with and
Statement
For , the complete graph has
spanning trees. Moreover, and .
Facts & Assumptions
Given: A natural number .
Trees on the fixed label set are in bijection with words of length on when (Prüfer encoding and decoding are inverse bijections between labelled trees on vertices and words of length on their labels).
The set of functions from an -element set to an -element set has cardinality (The set of functions between finite sets is finite, with , Exponentiation of natural numbers, , and its agreement with the integer power in ).
Every labelled tree on is a spanning subgraph of (Empty and complete graphs, complete bipartite graphs, and the convention that and have vertices, The spanning-tree number ).
Proof
For , spanning trees of are exactly the trees on its fixed label set.
By the Prüfer bijection, they correspond to functions from an -element position set to , of which there are .
The sole spanning tree of is itself, so . The null graph is not a tree and has no spanning tree, so .
Real edge-weighted graphs, total tree weight and minimum spanning trees
Definition
A real edge-weighted graph is a pair , where is a finite graph and . For a spanning tree of , its total weight is
(Spanning trees of a graph, The sum over a finite index set, and its product form, The reals form a totally ordered field). A minimum spanning tree, or MST, is a spanning tree satisfying for every spanning tree of .
If is connected, an MST exists: connectedness supplies a spanning tree, and the set of spanning trees is finite, so the finite nonempty set of their real weights has a least element. This is the order-dual form of the finite-set maximum principle (A finite graph is connected if and only if it has a spanning tree, The set of spanning trees of a finite graph is finite, Every nonempty finite set of reals has a maximum and a minimum). If is disconnected, it has no spanning tree and hence no MST.
The spanning-tree exchange lemma
Statement
Let be a spanning tree of .
- If and is any edge other than on the fundamental cycle of , then is a spanning tree.
- If and crosses the fundamental cut of , then is a spanning tree.
Facts & Assumptions
Given: A graph and a spanning tree .
has one fundamental cycle for every (Every edge outside a spanning tree determines a unique fundamental cycle).
Removing gives a fundamental cut, and adding any crossing edge restores a spanning tree (Every edge of a spanning tree determines a fundamental cut, and every edge crossing it restores a spanning tree).
A spanning tree is a connected acyclic spanning subgraph (Spanning trees of a graph).
Proof
Construct , where and lies on the fundamental cycle of . Removing breaks that cycle but leaves the graph connected, because the rest of the cycle replaces every use of .
No other cycle exists in , so is connected, acyclic and spanning, hence a spanning tree.
The second assertion is exactly the restoration clause for the fundamental cut of .
Cut and cycle properties for minimum spanning trees
Statement
Let be a connected real edge-weighted graph.
- A minimum-weight edge crossing any nontrivial cut belongs to some MST.
- A uniquely minimum-weight edge crossing a cut belongs to every MST.
- A maximum-weight edge on any cycle is omitted by some MST.
- A uniquely maximum-weight edge on a cycle belongs to no MST.
Facts & Assumptions
Given: A connected weighted graph .
An MST minimizes the sum of its edge weights (Real edge-weighted graphs, total tree weight and minimum spanning trees).
Exchanging an outside edge with a suitable tree edge on its fundamental cycle, or a tree edge with a crossing edge of its fundamental cut, preserves the spanning-tree property (The spanning-tree exchange lemma, Every edge outside a spanning tree determines a unique fundamental cycle, Every edge of a spanning tree determines a fundamental cut, and every edge crossing it restores a spanning tree).
Proof
Let be a minimum edge crossing a cut and choose an MST . If , this MST already proves assertion 1. If , the fundamental cycle of contains a tree edge crossing the same cut.
Let be a maximum edge on a cycle and choose an MST . If , this MST already proves assertion 3. If , deleting gives a fundamental cut, and the remainder of the cycle contains an edge crossing that cut.
In the second case of step 1.1, , so is an MST containing . Together with the first case, this proves assertion 1.
If is uniquely minimum across the cut and an MST omitted it, the same exchange would have and strictly decrease total weight. Thus every MST contains .
In the second case of step 1.2, , so is an MST omitting . Together with the first case, this proves assertion 3.
If is uniquely maximum on the cycle, then in step 1.2, so no MST can contain .
A connected graph with pairwise distinct edge weights has a unique minimum spanning tree
Statement
If a connected graph has pairwise distinct real edge weights, then it has exactly one minimum spanning tree.
Facts & Assumptions
Given: A connected weighted graph whose edge weights are pairwise distinct.
At least one MST exists (Real edge-weighted graphs, total tree weight and minimum spanning trees).
Exchanging an outside edge for an edge on its fundamental cycle preserves the spanning-tree property (The spanning-tree exchange lemma).
Adding an edge outside a spanning tree creates its unique fundamental cycle (Every edge outside a spanning tree determines a unique fundamental cycle).
Every finite nonempty set of edge weights has a least member, by order duality from Every nonempty finite set of reals has a maximum and a minimum.
Proof
Suppose and are distinct MSTs. Choose the least-weight edge in the symmetric difference , and assume after swapping names that .
By [L3], has a fundamental cycle. Apart from , that cycle cannot consist entirely of edges of , since then it would be a cycle in . Hence it contains an edge .
The choice of and distinct weights gives .
The exchange is a spanning tree of weight , contradicting the minimality of .
Hence the MST is unique.
Kruskal's greedy edge procedure produces a minimum spanning tree
Statement
Let be a connected real edge-weighted graph. Start with the edgeless spanning forest, repeatedly add a minimum-weight edge whose addition creates no cycle, and stop when no such edge remains. With ties broken arbitrarily, the output is a minimum spanning tree.
Facts & Assumptions
Given: A connected finite weighted graph .
has a spanning tree, and hence an MST (A finite graph is connected if and only if it has a spanning tree, Real edge-weighted graphs, total tree weight and minimum spanning trees).
Spanning-tree exchanges preserve spanning trees (The spanning-tree exchange lemma).
Induction is valid over the finitely many chosen edges (The cardinality of a finite set, The principle of mathematical induction).
Adding an edge outside a spanning tree creates a unique fundamental cycle (Every edge outside a spanning tree determines a unique fundamental cycle).
is connected, and a connected acyclic spanning subgraph is a spanning tree.
Kruskal chooses a least-weight edge among the currently eligible edges.
Proof
Maintain the invariant that the current forest is contained in some MST. It holds initially by L1.
Suppose for an MST , and Kruskal chooses . If , the invariant persists.
If , let be its fundamental cycle in . Some edge is not in ; otherwise the -path would lie in and adding to would create a cycle. Since is a subgraph of the acyclic tree , the edge is eligible for Kruskal.
At the moment is chosen, is eligible, so . The exchange is a spanning tree of no greater weight, hence an MST containing .
Thus the invariant holds after every choice.
On termination, must be connected: otherwise a path of between two components of would contain a first edge joining distinct components, and that edge would still be eligible. Thus is a spanning tree. The invariant then forces itself to be an MST.
Therefore every tie-breaking execution returns a minimum spanning tree.
Prim's growing-tree procedure produces a minimum spanning tree
Statement
Let be a connected real edge-weighted graph and choose a start vertex. Repeatedly add a minimum-weight edge with exactly one endpoint in the vertices reached so far. With ties broken arbitrarily, after all vertices are reached the chosen edges form a minimum spanning tree.
Facts & Assumptions
Given: A connected finite weighted graph and a start vertex .
A minimum edge crossing a cut belongs to some MST, and exchanging an outside edge for an edge of its fundamental cycle preserves a spanning tree (Cut and cycle properties for minimum spanning trees, The spanning-tree exchange lemma).
A finite nonempty set of crossing-edge weights has a least member, by order duality from Every nonempty finite set of reals has a maximum and a minimum.
Induction applies to the finite reached set (The cardinality of a finite set, The principle of mathematical induction).
A connected acyclic spanning subgraph is a spanning tree, and an MST is a spanning tree of minimum weight (Spanning trees of a graph, Real edge-weighted graphs, total tree weight and minimum spanning trees).
Proof
Maintain the invariant that the chosen edges are contained in some MST. It holds for by L1.
Assume the invariant for the current reached set . If is not all of , connectedness gives an edge crossing , so a minimum-weight crossing edge exists.
Choose an MST containing . If , the -path between the endpoints of contains an edge crossing . No edge of crosses this cut, and , so is an MST containing . Thus in either case some MST contains .
Hence the invariant persists, and adding reaches one new vertex without creating a cycle.
After all vertices are reached, is connected and acyclic with all vertices, so it is a spanning tree. Since an MST contains all its edges, it equals .
Thus Prim's procedure returns an MST for every permitted tie-breaking.
5 · Examples, counterexamples and false statements
None yet.
Sources
Standard references
Recommended treatments; not extraction sources.