Lemma 2.2 — a spanning connected subgraph is a spanning tree iff it has edges (corrected: nonempty node set)
ProvedCombOpt.SpanningTree.isSpanningTree_iff_cardcombinatoricsgraph-theorylinear-optimizationminimum-spanning-treep2o-correctedp2o-gran-per-chapterp2o-plan-bookp2o-v1
Let be a graph with nodes and let be such that the spanning subgraph is connected. Then is a spanning tree if and only if
This is the counting characterization of spanning trees used throughout the chapter, e.g. in showing that the characteristic vector of a spanning tree satisfies .
Formalization Note The count is compared in the integers. The hypothesis is added: for the graph with no nodes and no edges, the empty subgraph is connected and has no circuit, so it is a spanning tree, yet it has edges.
Differences from the source:
- correction: any graph G (n = |V| ≥ 0) → [Nonempty V] (n ≥ 1); reason: for V = E = ∅ the empty subgraph is a spanning connected subgraph and a spanning tree with 0 ≠ −1 = n − 1 edges, so the printed statement fails
- encoding: n − 1 → (Fintype.card V : ℤ) − 1, compared with (F.card : ℤ); reason: integer arithmetic avoids truncated natural subtraction; with n ≥ 1 it is the same number
Preamble
import Mathlib import Definitions.Def_CombOpt_SpanningTree_Graph_IsSpanningTree
Formal statement
namespace CombOpt.SpanningTree
/-- **Lemma 2.2: a spanning connected subgraph is a spanning tree iff it has n − 1 edges.**
Cook, Cunningham, Pulleyblank & Schrijver, *Combinatorial Optimization* (Wiley, 1998), Lemma 2.2, p. 11 (PDF p. 20): "A spanning connected subgraph of G is a spanning tree if and
only if it has exactly n − 1 edges", where n = |V| (p. 10).
For a graph with a nonempty finite node set and an edge set `F` such that the spanning subgraph
`(V, F)` is connected: `(V, F)` is a spanning tree if and only if `|F| = |V| − 1`.
**Formalization Note.** The count is compared in `ℤ`. The node set is assumed nonempty: with
`V = E = ∅` the empty subgraph is connected and has no circuit, hence is a spanning tree, but has
`0 ≠ −1 = n − 1` edges (see the differences list). -/
theorem isSpanningTree_iff_card {V E : Type*} [Fintype V] [Nonempty V] [Fintype E]
(G : Graph V E) (F : Finset E) (hF : G.SpanConnected F) :
G.IsSpanningTree F ↔ (F.card : ℤ) = Fintype.card V - 1 := by sorry
end CombOpt.SpanningTree
Source
Cook, Cunningham, Pulleyblank & Schrijver, Combinatorial Optimization (Wiley, 1998), Lemma 2.2, p. 11 (PDF p. 20)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.