Algorithm A computes the length of the Steiner tree connecting
ProvedDreyfusWagner.Steiner.algorithmA_eq_steinerLengthLet be a finite connected undirected graph whose arcs have positive lengths, with the node set linearly ordered in any way. Let contain at least three nodes and let . Then the value returned by Algorithm A of Dreyfus and Wagner (with and the shortest-path lengths of as input) is the length of the Steiner tree connecting :
This is the main result of the paper: the Dreyfus–Wagner dynamic program solves the Steiner problem in graphs exactly, in time exponential only in the number of terminals.
Formalization Note The hypothesis is the paper's own (Appendix A, p. 205). For Algorithm A as printed returns (line (18) admits no set ), and the two-node case is covered by the shortest path instead. The order on is arbitrary: the conclusion holds for every choice of . Values are in WithTop ℝ; under the hypotheses both sides are finite.
import Mathlib import Definitions.Def_DreyfusWagner_Steiner_SteinerProblem import Definitions.Def_DreyfusWagner_Steiner_AlgorithmA
namespace DreyfusWagner.Steiner
/-- Dreyfus–Wagner 1971, §4, Algorithm A, p. 203: for a finite connected undirected graph with
positive arc lengths, a set `Y` of at least three nodes and any `q ∈ Y`, Algorithm A returns
the length of the Steiner tree connecting `Y`, whatever the order of the nodes. -/
theorem algorithmA_eq_steinerLength {V : Type*} [Fintype V] [LinearOrder V]
(G : SimpleGraph V) [DecidableRel G.Adj] (ℓ : Sym2 V → ℝ)
(hpos : ∀ e ∈ G.edgeSet, 0 < ℓ e) (hconn : G.Connected)
(Y : Finset V) (hY : 3 ≤ Y.card) (q : V) (hq : q ∈ Y) :
algorithmA G ℓ Y q = steinerLength G ℓ Y := by sorry
end DreyfusWagner.Steiner
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be any finite type of vertices with any linear order on it. The statement holds for every such order, so neither side is claimed to depend on which order is chosen. Let be a simple graph on : undirected, with no loops and no multiple edges, and with decidable adjacency. Let
be a real-valued length function. It is defined on all unordered pairs, including non-adjacent pairs and "diagonal" pairs , not only on the edges of .
The hypotheses are:
- (positivity) for every edge of . No condition is placed on at pairs that are not edges, so there it may be zero, negative or anything else.
- (connectivity) is connected. In particular is non-empty, and any two vertices are joined by a path in .
- (terminals) is a finite set of vertices with .
- (root) is a vertex with .
The conclusion is the equation
Here is a function of the graph, the length function, the terminal set and the chosen terminal . is a function of the graph, the length function and the terminal set only. Both are defined in the imported files Def_DreyfusWagner_Steiner_AlgorithmA and Def_DreyfusWagner_Steiner_SteinerProblem. Their definitions are not part of the code I was given, so I cannot spell out what they compute or what type of value they return. The documentation comment calls them "Algorithm A" of Dreyfus–Wagner and "the length of the Steiner tree connecting ", but that is only a comment, not something the code asserts. Because the equation holds for every , it also implies that the left-hand side has the same value for every choice of terminal .
Degenerate cases:
- Size of and : Since , has at least three elements. The empty type, a one-element type and a two-element type are therefore excluded, and so are terminal sets with 0, 1 or 2 elements; the statement says nothing about them.
- Vacuity: The hypotheses can all be satisfied, so the statement is not vacuous. For example, take a triangle with all three edge lengths equal to , equal to all three vertices, and any .
- Lengths off the edges: The values of on non-edges and on diagonal pairs are completely unconstrained. Those pairs are never edges of a simple graph. The equation is claimed for every such choice of those values. Whether either side actually reads them depends on the definitions I cannot see.
- Default values: Any default or "junk" value those definitions might produce is also outside what I can see. Examples are a minimum or infimum over an empty family, or a sum over no terms. Whatever such values are, the statement asserts the two sides agree under the hypotheses above.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.