Alphabeta Math
Session-authored (Fable 5 assisted)
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.

21 results · all verified · 0 also independently AI-judged
Every result on this page is machine-checked by a proof checker and read in full and owner-audited; the judge is an additional, independent cross-model AI review of the proofs. The 21 not AI-judged were verified by owner audit (typically over a confirmed judge false positive), not failures.

Trees, Forests and Spanning Trees

1 · Prerequisites

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 V=E+c|V|=|E|+c, 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

DefinitionDefinition: Literature-sourcedProof: Not applicableaudited 2026-08-01Open item page →

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.

vleafT1T2isolatedforestF:componentsT1,T2,K1

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.
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

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 FF with V(F)V(F)\ne\varnothing.

[L1]

A forest contains no cycle (Trees, forests, leaves and isolated vertices).

[L2]

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).

Proof

technique · contradiction
1.1

Suppose every vertex of FF has degree greater than one.

assume-contra
2.1

Since degrees are natural numbers, FF has minimum degree at least two.

step 1.1F1
3.1

Hence FF contains a cycle.

step 2.1L2
4.1

This contradicts that FF is a forest, so some vertex has degree at most one.

step 3.1L1discharge-contradiction
TheoremStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

For every forest, V=E+c|V|=|E|+c, where cc is the number of connected components

Statement

If FF is a forest, let C(F)\mathscr C(F) be the family of vertex sets of its connected components and put c(F):=C(F)c(F):=|\mathscr C(F)|. Then

V(F)=E(F)+c(F).|V(F)|=|E(F)|+c(F).

For the null forest, c(F)=0c(F)=0.

Facts & Assumptions

Given: A finite forest FF.

[L1]

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).

[L3]

Induction is valid on V(F)|V(F)| (The principle of mathematical induction).

Proof

technique · induction on $|V(F)|$
1.1

If V(F)=0|V(F)|=0, then E(F)=0|E(F)|=0 and c(F)=0c(F)=0, so the identity holds.

base
1.2

Let V(F)>0|V(F)|>0, assume the identity for forests with fewer vertices, and choose a vertex vv of degree at most one.

ihL1L3
2.1

Put F:=FvF':=F-v. It remains a forest, and V(F)V(F) is the disjoint union of V(F)V(F') and {v}\{v\}, so V(F)=V(F)+1|V(F)|=|V(F')|+1.

step 1.2L1F1F2
3.1

If vv is isolated, then E(F)=E(F)E(F)=E(F'), while the component family of FF is the disjoint union of the component family of FF' and {{v}}\{\{v\}\}. Hence E(F)=E(F)|E(F)|=|E(F')| and c(F)=c(F)+1c(F)=c(F')+1.

step 2.1F1L2F2
3.2

If vv has degree one, deleting it removes its unique incident edge, so E(F)=E(F)+1|E(F)|=|E(F')|+1. It does not change the number of components: vv cannot be an internal vertex of a path between remaining vertices, and its neighbour remains in the same nonempty component after deletion. Thus c(F)=c(F)c(F)=c(F').

step 2.1F1L2F2
4.1

In the isolated case, the induction hypothesis gives V(F)=V(F)+1=(E(F)+c(F))+1=E(F)+c(F)|V(F)|=|V(F')|+1=(|E(F')|+c(F'))+1=|E(F)|+c(F).

step 1.2step 2.1step 3.1F2
4.2

In the degree-one case, the induction hypothesis gives V(F)=V(F)+1=(E(F)+c(F))+1=(E(F)+1)+c(F)=E(F)+c(F)|V(F)|=|V(F')|+1=(|E(F')|+c(F'))+1=(|E(F')|+1)+c(F')=|E(F)|+c(F).

step 1.2step 2.1step 3.2F2
5.1

The two possible degrees of vv have both been handled, so the identity holds for every forest.

step 4.1step 4.2discharge-induction
CorollaryStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

A tree on n1n\ge1 vertices has n1n-1 edges

Statement

A tree with n1n\ge1 vertices has exactly n1n-1 edges.

Facts & Assumptions

Given: A tree TT with V(T)=n|V(T)|=n.

[L1]
[F1]

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

technique · direct
1.1

Apply the forest identity to TT: n=E(T)+1n=|E(T)|+1.

L1F1
2.1

Therefore E(T)=n1|E(T)|=n-1.

step 1.1
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

Deleting any edge of a tree separates it into exactly two tree components

Statement

If TT is a tree and e=uvE(T)e=uv\in E(T), then TeT-e has exactly two connected components, each of which is a tree.

Facts & Assumptions

Given: A tree TT and an edge e=uve=uv.

[F1]

A tree is connected and has no cycle (Trees, forests, leaves and isolated vertices).

[F2]

TeT-e has the same vertices and all edges of TT except ee (Vertex and edge deletion, edge contraction, graph minors, subdivisions and topological minors).

Proof

technique · direct
1.1

The vertices uu and vv lie in distinct components of TeT-e: otherwise a uu-vv path in TeT-e together with ee would be a cycle in TT.

F1F2F3
1.2

Every vertex xx lies in the component of uu or the component of vv. Indeed, take an xx-uu path in TT; if it avoids ee it joins xx to uu in TeT-e, and if it uses ee then its segment from xx to vv avoids ee.

F1F2F3
2.1

Thus TeT-e has exactly two components.

step 1.1step 1.2
3.1

Each component is connected by definition and contains no cycle because it is a subgraph of the acyclic graph TT. Hence each component is a tree.

F1F3
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passverified 2026-08-04 (gpt-5.6-sol-codex-subscription)Open item page →

Adding an edge between two nonadjacent vertices of a tree creates exactly one cycle

Statement

Let TT be a tree and let u,vu,v be nonadjacent vertices. Adding the edge uvuv creates exactly one cycle.

Facts & Assumptions

Given: A tree TT and nonadjacent vertices u,vV(T)u,v\in V(T).

[F1]

A tree is connected and acyclic (Trees, forests, leaves and isolated vertices).

Proof

technique · direct
1.1

There is a uu-vv path PP in TT, and it is unique: if two distinct such paths existed, their first divergence and next reunion would yield a cycle.

F1F2
1.2

Every cycle in T+uvT+uv must contain uvuv, since TT itself is acyclic. Removing uvuv from such a cycle leaves a uu-vv path in TT.

F1F2
2.1

The path PP together with the new edge uvuv is a cycle in T+uvT+uv.

step 1.1F2
3.1

By uniqueness in step 1.1, the path obtained in step 1.2 is PP. Hence the cycle in step 2.1 is the only cycle.

step 1.1step 1.2
TheoremStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-08-01Open item page →

Equivalent characterisations of a nonempty tree by unique paths, edge count, minimal connectivity and maximal acyclicity

Statement

For a finite nonempty graph GG, the following are equivalent:

  1. GG is a tree.
  2. Every two vertices are joined by a unique path.
  3. GG is connected and E(G)=V(G)1|E(G)|=|V(G)|-1.
  4. GG is acyclic and E(G)=V(G)1|E(G)|=|V(G)|-1.
  5. GG is minimally connected: it is connected, but deleting any edge disconnects it.
  6. GG is maximally acyclic: it is acyclic, but adding any missing edge creates a cycle.

Facts & Assumptions

Given: A finite nonempty graph GG.

[L1]

Forests satisfy V=E+c|V|=|E|+c, and trees satisfy E=V1|E|=|V|-1 (For every forest, V=E+c|V|=|E|+c, where cc is the number of connected components, A tree on n1n\ge1 vertices has n1n-1 edges).

[L2]
[F1]

A tree is connected and acyclic (Trees, forests, leaves and isolated vertices).

Proof

technique · direct cycle of implications
1.1

If GG 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.

F1F2
1.2

Under condition 2, GG is connected. Deleting any edge uvuv leaves no uu-vv path, because such a path together with uvuv would give a second path in GG. Thus condition 2 implies condition 5.

F2
1.3

Suppose condition 5 holds. If GG contained a cycle, deleting one edge of that cycle would leave its endpoints joined around the rest of the cycle and would not disconnect GG. Hence GG is acyclic and therefore is a tree. Thus condition 5 implies condition 1.

F2F1
1.4

Condition 1 implies condition 3 by the tree edge count.

L1
1.5

Under condition 3, suppose GG 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 TT. At least one edge was deleted, so E(T)<V(G)1|E(T)|<|V(G)|-1, while the forest identity with one component gives E(T)=V(G)1|E(T)|=|V(G)|-1, a contradiction. Hence condition 3 implies condition 1.

L1F2
1.6

Under condition 4, the forest identity gives V=(V1)+c|V|=(|V|-1)+c, so c=1c=1 and GG is a tree. Conversely condition 1 implies condition 4 by definition and the tree edge count.

L1F1
1.7

Condition 1 implies condition 6 by edge addition.

L2
1.8

Under condition 6, if GG were disconnected, vertices in different components would be nonadjacent and adding an edge between them could create no cycle. Hence GG is connected, and its assumed acyclicity makes it a tree.

F1F2
2.1

All six conditions are therefore equivalent.

step 1.1step 1.2step 1.3step 1.4step 1.5step 1.6step 1.7step 1.8
CorollaryStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

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.

Proof

technique · direct
1.1

Choose a path P=v0v1vkP=v_0v_1\cdots v_k of maximum length. Since TT has at least two vertices and is connected, k1k\ge1.

F2L1
2.1

If v0v_0 had a neighbour other than v1v_1, that neighbour could not already lie on PP, since that would form a cycle; adjoining it would therefore lengthen the maximum-length path PP. Thus v0v_0 has degree one.

step 1.1L1
2.2

The same argument shows that vkv_k has degree one.

step 1.1L1
3.1

Since v0vkv_0\ne v_k, these are two distinct leaves.

step 1.1step 2.1step 2.2F1
DefinitionDefinition: AI-adaptedProof: Not applicableaudited 2026-08-01Open item page →

Rooted trees, ancestors, descendants, depth, height, parents and children

Definition

A rooted tree is a pair (T,r)(T,r) consisting of a tree TT and a distinguished vertex rr, the root (Trees, forests, leaves and isolated vertices). The unique rr-vv path is the root path of vv (Equivalent characterisations of a nonempty tree by unique paths, edge count, minimal connectivity and maximal acyclicity).

The depth of vv is dT(r,v)d_T(r,v), and the height of (T,r)(T,r) is the maximum vertex depth (Graph distance within a component, eccentricity, diameter and girth, including the acyclic convention). A vertex uu is an ancestor of vv, and vv a descendant of uu, when uu lies on the root path of vv. If vrv\ne r, the neighbour of vv immediately preceding it on its root path is its parent; the vertices having parent vv are the children of vv.

The vertices of depth kk form level kk. The root has depth zero and is its own ancestor, but it has no parent.

level0level1level2ruwvxyrootuisparentofv
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

Every nonroot vertex has a unique parent, and adjacent vertices have depths differing by one

Statement

In a rooted tree (T,r)(T,r), every vertex other than rr has exactly one parent. If uvE(T)uv\in E(T), then the depths of uu and vv differ by exactly one.

Facts & Assumptions

Proof

technique · direct
1.1

For vrv\ne r, its unique root path has positive length and therefore has one vertex immediately before vv. This vertex is the unique parent of vv.

L1F1
1.2

Let uvuv be an edge. The root paths of uu and vv cannot diverge before their endpoints, since the two divergent tails together with uvuv would form a cycle. Hence one root path is obtained from the other by appending uvuv.

L1
2.1

Their lengths, and therefore their depths, differ by exactly one.

step 1.2F1
DefinitionDefinition: Literature-sourcedProof: Not applicableaudited 2026-08-01Open item page →

Spanning trees of a graph

Definition

Let GG be a graph. A spanning tree of GG is a spanning subgraph TT of GG that is a tree (Subgraphs, induced subgraphs and spanning subgraphs, Trees, forests, leaves and isolated vertices). Equivalently,

V(T)=V(G),E(T)E(G),V(T)=V(G),\qquad E(T)\subseteq E(G),

and TT is connected and acyclic.

The null graph has no spanning tree under the library convention that a tree is nonempty and connected.

LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

A maximal acyclic spanning subgraph of a connected graph is a spanning tree

Statement

Let GG be a finite connected graph. If FF is an acyclic spanning subgraph of GG maximal under edge inclusion among such subgraphs, then FF is a spanning tree of GG.

Facts & Assumptions

Given: A connected graph GG and an edge-maximal acyclic spanning subgraph FF.

[F2]

A spanning tree is a connected acyclic spanning subgraph (Spanning trees of a graph, Trees, forests, leaves and isolated vertices).

Proof

technique · contradiction
1.1

Suppose FF is disconnected, and choose vertices u,vu,v in distinct components of FF.

assume-contraF1
1.2

A uu-vv path in GG has a first edge xyxy whose endpoints lie in distinct components of FF.

F3F1
2.1

Adding xyxy to FF cannot create a cycle, because a cycle through xyxy would contain an xx-yy path already in FF, contrary to the choice of distinct components.

step 1.2
3.1

Thus F+xyF+xy is a strictly larger acyclic spanning subgraph, contradicting maximality.

step 2.1
4.1

Hence FF is connected, and therefore it is a spanning tree.

F2discharge-contradiction
TheoremStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

A finite graph is connected if and only if it has a spanning tree

Statement

A finite graph GG is connected if and only if it has a spanning tree.

Facts & Assumptions

Given: A finite graph GG.

[L1]

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).

[F1]

A spanning tree is a connected spanning subgraph (Spanning trees of a graph).

[F2]

A finite graph has only finitely many edge subsets, so the family of acyclic spanning subgraphs has a maximal member.

[F3]

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

technique · direct
1.1

If GG is connected, choose a maximal acyclic spanning subgraph FF; the edgeless spanning subgraph shows that the choice family is nonempty.

F2
2.1

By L1, FF is a spanning tree of GG.

step 1.1L1
3.1

Conversely, if GG has a spanning tree TT, every two vertices are joined by a path in TT, hence by a path in GG. Thus GG is connected.

F1F3
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

Every edge outside a spanning tree determines a unique fundamental cycle

Statement

If TT is a spanning tree of GG and e=uvE(G)E(T)e=uv\in E(G)\setminus E(T), then T+eT+e has a unique cycle, namely ee together with the unique uu-vv path in TT. This is the fundamental cycle of ee with respect to TT.

Facts & Assumptions

Given: A spanning tree TT of GG and e=uvE(T)e=uv\notin E(T).

[L2]

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).

[F1]

TT contains every vertex of GG (Spanning trees of a graph).

Proof

technique · direct
1.1

The endpoints u,vu,v belong to TT and are nonadjacent there.

GivenF1
2.1

Let PP be the unique uu-vv path in TT. By edge addition, P+eP+e is the unique cycle in T+eT+e.

step 1.1L1L2
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passverified 2026-08-04 (gpt-5.6-sol-codex-subscription)Open item page →

Every edge of a spanning tree determines a fundamental cut, and every edge crossing it restores a spanning tree

Statement

Let TT be a spanning tree of GG and eE(T)e\in E(T). The two components A,BA,B of TeT-e determine the fundamental cut

δT(e):={xyE(G):xA, yB}.\delta_T(e):=\{xy\in E(G):x\in A,\ y\in B\}.

For every fδT(e)f\in\delta_T(e), the graph Te+fT-e+f is a spanning tree of GG.

Facts & Assumptions

Given: A spanning tree TT of GG and eE(T)e\in E(T).

[L1]

TeT-e has exactly two tree components (Deleting any edge of a tree separates it into exactly two tree components).

[F2]

A spanning tree contains every vertex of GG (Spanning trees of a graph).

Proof

technique · direct
1.1

Let A,BA,B be the vertex sets of the two components of TeT-e. They partition V(G)V(G).

L1F2
2.1

If f=xyf=xy crosses from AA to BB, then Te+fT-e+f is connected: paths inside AA and BB, together with ff, join every pair of vertices.

step 1.1L1
2.2

It is acyclic: each side is acyclic, and a cycle using ff would require a second edge between the two sides, but Te+fT-e+f has only ff.

step 1.1L1
3.1

It is spanning by construction, so it is a spanning tree of GG.

step 2.1step 2.2F2
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-08-01Open item page →

The set of spanning trees of a finite graph is finite

Statement

Every finite graph has only finitely many spanning trees.

Facts & Assumptions

Proof

technique · direct
1.1

The map sending a spanning tree to its edge set embeds the set of spanning trees into P(E(G))\mathcal P(E(G)).

F1
2.1

The latter power set is finite, so its subset consisting of spanning-tree edge sets is finite.

F2L1
DefinitionDefinition: Literature-sourcedProof: Not applicableaudited 2026-08-01Open item page →

The spanning-tree number τ(G)\tau(G)

Definition

For a finite graph GG, its spanning-tree number is

τ(G):={T:T is a spanning tree of G}.\tau(G):=|\{T:T\text{ is a spanning tree of }G\}|.

This is a natural number because the displayed set is finite (The set of spanning trees of a finite graph is finite, The cardinality A\lvert A\rvert of a finite set). In particular, τ(G)=0\tau(G)=0 exactly when GG has no spanning tree.

DefinitionDefinition: AI-adaptedProof: Not applicableaudited 2026-08-01Open item page →

The Prüfer code of a tree on a finite set of natural labels

Definition

Let SNS\subseteq\mathbb N be finite with S=n2|S|=n\ge2, and let TT be a tree whose vertex set is SS. Here n2n-2 denotes the unique natural number mm satisfying m+2=nm+2=n. The Prüfer code is the word of length n2n-2 on SS obtained by repeating the following operation until two vertices remain:

  1. choose the least labelled leaf vv;
  2. record the unique neighbour of vv;
  3. delete vv 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 n2n-2 symbols are recorded.

The usual formulation has S=n={0,1,,n1}S=n=\{0,1,\ldots,n-1\}, using natural numbers as their von Neumann initial segments (The natural numbers N\mathbb{N} (von Neumann), The cardinality A\lvert A\rvert 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.

LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-08-01Open item page →

The Prüfer decoding procedure is well defined and produces a labelled tree

Statement

Let SNS\subseteq\mathbb N be finite with S=n2|S|=n\ge2, and let (ai)i<n2(a_i)_{i<n-2} be a word on the label set SS. The following procedure is well defined and produces a tree on SS:

At stage ii, choose the least unused label absent from the remaining word aian3a_i\cdots a_{n-3}, join it to aia_i, and mark it used. After all symbols are processed, join the two unused labels.

Facts & Assumptions

Given: A word (ai)i<n2(a_i)_{i<n-2} on a finite set SNS\subseteq\mathbb N of cardinality n2n\ge2 (The cardinality A\lvert A\rvert of a finite set).

[L1]

A word with rr positions cannot contain more than rr distinct labels. Thus among r+2r+2 available labels at least two are absent; every nonempty set of natural labels has a least element (The pigeonhole principle on N\mathbb{N}, The well-ordering principle).

[F1]

A tree is a connected acyclic graph (Trees, forests, leaves and isolated vertices).

[L2]

Induction applies to the decoding stages (The principle of mathematical induction).

Proof

technique · induction on the stage number
1.1

Before any word entry is processed, the graph has nn singleton components indexed by SS, each containing exactly one unused label.

base
1.2

Assume that after ii stages the built edges form a forest and every component contains exactly one unused label.

ih
2.1

There are nin-i unused labels and n2in-2-i entries in the remaining word. Hence at least two unused labels are absent from that word, so the least such label vv exists. Every label used at an earlier stage was absent from the then-remaining word and hence from its current suffix, so aia_i is unused; because aia_i occurs in the remaining word, vaiv\ne a_i.

step 1.2L1
3.1

The label aia_i lies in a component different from the component containing vv: by the induction hypothesis each component contains exactly one unused label, and aiva_i\ne v. Adding vaiva_i and marking vv used joins those components without a cycle and leaves exactly one unused label in the new component. Thus the invariant holds after stage i+1i+1.

step 1.2step 2.1
4.1

Induction gives the invariant after all n2n-2 word stages. Exactly two unused labels and two components remain; joining those labels makes the graph connected without creating a cycle.

step 3.1L2
5.1

The output uses all labels in SS and is connected and acyclic, hence is a labelled tree on SS.

step 4.1F1discharge-induction
TheoremStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-08-01Open item page →

Prüfer encoding and decoding are inverse bijections between labelled trees on n2n\ge2 vertices and words of length n2n-2 on their labels

Statement

For every natural n2n\ge2, Prüfer encoding is a bijection from the set of trees with vertex set nn to the set of words of length n2n-2 on nn. 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 n2n\ge2.

[F1]

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).

[L1]

Decoding is well defined and produces a labelled tree (The Prüfer decoding procedure is well defined and produces a labelled tree).

[F2]

Two maps are inverse bijections when both composites are identity maps (Injection, surjection, bijection).

[L2]

Induction is valid on the word length (The principle of mathematical induction).

[F3]

Decoding chooses the least unused label absent from the remaining word, attaches it to the first remaining symbol, and then deletes that symbol.

Proof

technique · induction on the size of the label set. We prove the stronger statement for every finite set of natural labels with its inherited order
1.1

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.

baseF1L1
1.2

Assume that encoding and decoding are inverse on every finite natural-label set of size n1n-1.

ih
1.3

Let w=a0an3w=a_0\cdots a_{n-3} and let vv be the least label absent from ww. Decoding first attaches vv to a0a_0 and never uses vv again.

chooseF3L1
1.4

Conversely, let TT be a labelled tree, let its first encoding operation delete the least leaf uu, and let it record the neighbour bb.

chooseF1
2.1

In the decoded tree, vv is a leaf. Every label smaller than vv occurs in ww, 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 vv and records a0a_0.

step 1.3F1
2.2

The label uu 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 uu is the least label absent from the code, and decoding first restores the edge ubub.

step 1.4F3
3.1

After removing vv and the first word entry, both procedures operate on the same ordered label set of size n1n-1 and the suffix word. The induction hypothesis shows that the remaining operations are inverse. Thus encoding the decoded tree returns ww.

step 1.2step 2.1L2
3.2

After deleting uu and the first code entry, the induction hypothesis restores the remaining tree on its ordered label set of size n1n-1. Therefore decoding the code of TT returns TT.

step 1.2step 2.2L2
4.1

Both composites are identities, so encoding and decoding are inverse bijections on the ordered label set of size nn. Applying this to the natural order on nn proves the theorem.

step 3.1step 3.2F2discharge-induction
TheoremStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-08-01Open item page →

Cayley's formula: τ(Kn)=nn2\tau(K_n)=n^{n-2} for n2n\ge2, with τ(K1)=1\tau(K_1)=1 and τ(K0)=0\tau(K_0)=0

Statement

For n2n\ge2, the complete graph KnK_n has

τ(Kn)=nn2\tau(K_n)=n^{n-2}

spanning trees. Moreover, τ(K1)=1\tau(K_1)=1 and τ(K0)=0\tau(K_0)=0.

Facts & Assumptions

Proof

technique · direct
1.1

For n2n\ge2, spanning trees of KnK_n are exactly the trees on its fixed label set.

F1
2.1

By the Prüfer bijection, they correspond to functions from an (n2)(n-2)-element position set to nn, of which there are nn2n^{n-2}.

step 1.1L1L2
3.1

The sole spanning tree of K1K_1 is K1K_1 itself, so τ(K1)=1\tau(K_1)=1. The null graph K0K_0 is not a tree and has no spanning tree, so τ(K0)=0\tau(K_0)=0.

F1
DefinitionDefinition: AI-adaptedProof: Not applicableaudited 2026-08-01Open item page →

Real edge-weighted graphs, total tree weight and minimum spanning trees

Definition

A real edge-weighted graph is a pair (G,w)(G,w), where GG is a finite graph and w:E(G)Rw:E(G)\to\mathbb R. For a spanning tree TT of GG, its total weight is

w(T):=eE(T)w(e)w(T):=\sum_{e\in E(T)}w(e)

(Spanning trees of a graph, The sum iSai\sum_{i \in S} a_i 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 TT satisfying w(T)w(S)w(T)\le w(S) for every spanning tree SS of GG.

If GG 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 GG is disconnected, it has no spanning tree and hence no MST.

LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-08-01Open item page →

The spanning-tree exchange lemma

Statement

Let TT be a spanning tree of GG.

  1. If eE(G)E(T)e\in E(G)\setminus E(T) and ff is any edge other than ee on the fundamental cycle of ee, then Tf+eT-f+e is a spanning tree.
  2. If fE(T)f\in E(T) and ee crosses the fundamental cut of ff, then Tf+eT-f+e is a spanning tree.

Facts & Assumptions

Given: A graph GG and a spanning tree TT.

[L1]

T+eT+e has one fundamental cycle for every eTe\notin T (Every edge outside a spanning tree determines a unique fundamental cycle).

[L2]

Removing fTf\in T 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).

[F1]

A spanning tree is a connected acyclic spanning subgraph (Spanning trees of a graph).

Proof

technique · constructive
1.1

Construct T:=Tf+eT':=T-f+e, where eE(T)e\notin E(T) and fef\ne e lies on the fundamental cycle of ee. Removing ff breaks that cycle but leaves the graph connected, because the rest of the cycle replaces every use of ff.

constructL1
2.1

No other cycle exists in T+eT+e, so Tf+eT-f+e is connected, acyclic and spanning, hence a spanning tree.

step 1.1L1F1
3.1

The second assertion is exactly the restoration clause for the fundamental cut of ff.

L2discharge-construct
TheoremStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-08-01Open item page →

Cut and cycle properties for minimum spanning trees

Statement

Let (G,w)(G,w) be a connected real edge-weighted graph.

  1. A minimum-weight edge crossing any nontrivial cut belongs to some MST.
  2. A uniquely minimum-weight edge crossing a cut belongs to every MST.
  3. A maximum-weight edge on any cycle is omitted by some MST.
  4. A uniquely maximum-weight edge on a cycle belongs to no MST.

Facts & Assumptions

Given: A connected weighted graph (G,w)(G,w).

[F1]

An MST minimizes the sum of its edge weights (Real edge-weighted graphs, total tree weight and minimum spanning trees).

[L1]

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

technique · direct exchange arguments
1.1

Let ee be a minimum edge crossing a cut and choose an MST TT. If eTe\in T, this MST already proves assertion 1. If eTe\notin T, the fundamental cycle of ee contains a tree edge ff crossing the same cut.

chooseL1
1.2

Let gg be a maximum edge on a cycle and choose an MST SS. If gSg\notin S, this MST already proves assertion 3. If gSg\in S, deleting gg gives a fundamental cut, and the remainder of the cycle contains an edge hh crossing that cut.

chooseL1
2.1

In the second case of step 1.1, w(e)w(f)w(e)\le w(f), so Tf+eT-f+e is an MST containing ee. Together with the first case, this proves assertion 1.

step 1.1L1F1
2.2

If ee is uniquely minimum across the cut and an MST omitted it, the same exchange would have w(e)<w(f)w(e)<w(f) and strictly decrease total weight. Thus every MST contains ee.

step 1.1F1
2.3

In the second case of step 1.2, w(h)w(g)w(h)\le w(g), so Sg+hS-g+h is an MST omitting gg. Together with the first case, this proves assertion 3.

step 1.2L1F1
3.1

If gg is uniquely maximum on the cycle, then w(h)<w(g)w(h)<w(g) in step 1.2, so no MST can contain gg.

step 1.2step 2.3F1
CorollaryStatement: AI-adaptedProof: AI-adaptedprecheck passverified 2026-08-04 (gpt-5.6-sol-codex-subscription)Open item page →

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 (G,w)(G,w) whose edge weights are pairwise distinct.

[L2]

Exchanging an outside edge for an edge on its fundamental cycle preserves the spanning-tree property (The spanning-tree exchange lemma).

[L3]

Adding an edge outside a spanning tree creates its unique fundamental cycle (Every edge outside a spanning tree determines a unique fundamental cycle).

[F2]

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

technique · contradiction
1.1

Suppose TT and TT' are distinct MSTs. Choose the least-weight edge ee in the symmetric difference E(T)E(T)E(T)\mathbin\triangle E(T'), and assume after swapping names that eE(T)E(T)e\in E(T)\setminus E(T').

assume-contraF2
1.2

By [L3], T+eT'+e has a fundamental cycle. Apart from ee, that cycle cannot consist entirely of edges of TT, since then it would be a cycle in TT. Hence it contains an edge fE(T)E(T)f\in E(T')\setminus E(T).

chooseL3
2.1

The choice of ee and distinct weights gives w(e)<w(f)w(e)<w(f).

step 1.1step 1.2
3.1

The exchange Tf+eT'-f+e is a spanning tree of weight w(T)w(f)+w(e)<w(T)w(T')-w(f)+w(e)<w(T'), contradicting the minimality of TT'.

step 1.2step 2.1L2F1
4.1

Hence the MST is unique.

step 3.1F1discharge-contradiction
TheoremStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-08-01Open item page →

Kruskal's greedy edge procedure produces a minimum spanning tree

Statement

Let (G,w)(G,w) 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 (G,w)(G,w).

[L2]

Spanning-tree exchanges preserve spanning trees (The spanning-tree exchange lemma).

[L4]

Adding an edge outside a spanning tree creates a unique fundamental cycle (Every edge outside a spanning tree determines a unique fundamental cycle).

[F1]

GG is connected, and a connected acyclic spanning subgraph is a spanning tree.

[F2]

Kruskal chooses a least-weight edge among the currently eligible edges.

Proof

technique · induction on the number of chosen edges
1.1

Maintain the invariant that the current forest FF is contained in some MST. It holds initially by L1.

baseL1
1.2

Suppose FTF\subseteq T for an MST TT, and Kruskal chooses ee. If eTe\in T, the invariant persists.

ih
2.1

If eTe\notin T, let CC be its fundamental cycle in T+eT+e. Some edge fE(C){e}f\in E(C)\setminus\{e\} is not in FF; otherwise the TT-path CeC-e would lie in FF and adding ee to FF would create a cycle. Since F+fF+f is a subgraph of the acyclic tree TT, the edge ff is eligible for Kruskal.

step 1.2L4
3.1

At the moment ee is chosen, ff is eligible, so w(e)w(f)w(e)\le w(f). The exchange Tf+eT-f+e is a spanning tree of no greater weight, hence an MST containing F+eF+e.

step 2.1L2F2
4.1

Thus the invariant holds after every choice.

step 1.2step 3.1L3
5.1

On termination, FF must be connected: otherwise a path of GG between two components of FF would contain a first edge joining distinct components, and that edge would still be eligible. Thus FF is a spanning tree. The invariant then forces FF itself to be an MST.

step 4.1F1L1
6.1

Therefore every tie-breaking execution returns a minimum spanning tree.

step 5.1discharge-induction
TheoremStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-08-01Open item page →

Prim's growing-tree procedure produces a minimum spanning tree

Statement

Let (G,w)(G,w) 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 (G,w)(G,w) and a start vertex rr.

[L2]

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).

[F1]

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.

[F2]

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

technique · induction on the number of reached vertices
1.1

Maintain the invariant that the chosen edges FF are contained in some MST. It holds for F=F=\varnothing by L1.

baseL1
1.2

Assume the invariant for the current reached set SS. If SS is not all of V(G)V(G), connectedness gives an edge crossing (S,V(G)S)(S,V(G)\setminus S), so a minimum-weight crossing edge ee exists.

ihF1
2.1

Choose an MST TT containing FF. If eTe\notin T, the TT-path between the endpoints of ee contains an edge ff crossing (S,V(G)S)(S,V(G)\setminus S). No edge of FF crosses this cut, and w(e)w(f)w(e)\le w(f), so Tf+eT-f+e is an MST containing F+eF+e. Thus in either case some MST contains F+eF+e.

step 1.2L2
3.1

Hence the invariant persists, and adding ee reaches one new vertex without creating a cycle.

step 2.1L3
4.1

After all vertices are reached, FF is connected and acyclic with all vertices, so it is a spanning tree. Since an MST contains all its edges, it equals FF.

step 3.1F2
5.1

Thus Prim's procedure returns an MST for every permitted tie-breaking.

step 4.1discharge-induction

5 · Examples, counterexamples and false statements

None yet.

Sources