Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

§2, p. 200 and §4, p. 203 — every table entry S[D,I]S[D,I]S[D,I] of Algorithm A is the Steiner length of {I}∪D\{I\} \cup D{I}∪D

Proved
DreyfusWagner.Steiner.tableA_eq_steinerLength

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithmsdynamic-programmingp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1steiner-tree

Let G=(N,A)G = (N, A)G=(N,A) be a finite connected undirected graph whose arcs have positive lengths, with NNN linearly ordered. Let S[D,I]S[D, I]S[D,I] be the table of Algorithm A built from the shortest-path lengths D(i,j)D(i,j)D(i,j) of GGG. Then for every nonempty node set DDD and every node III,

S[D,I]=St⁡({I}∪D),S[D, I] = \operatorname{St}(\{I\} \cup D),S[D,I]=St({I}∪D),

the length of the Steiner path S(I,D)S(I, D)S(I,D) for the nodes {I}∪D\{I\} \cup D{I}∪D.

This is the invariant that the table of Algorithm A maintains: each entry is the optimal value of the subproblem it stands for. With it, the value returned by the algorithm is the recurrence of §2 evaluated at m=qm = qm=q and D=CD = CD=C.

Formalization Note The statement is made for every nonempty DDD, not only for the proper subsets of C=Y−{q}C = Y - \{q\}C=Y−{q} that the algorithm stores; the table is defined for all node sets by the same recursion.

Preamble
import Mathlib
import Definitions.Def_DreyfusWagner_Steiner_SteinerProblem
import Definitions.Def_DreyfusWagner_Steiner_AlgorithmA
Formal statement
namespace DreyfusWagner.Steiner

/-- Dreyfus–Wagner 1971, §2, p. 200 and §4, p. 203: every entry `S[D, I]` of the table of
Algorithm A, built from the shortest-path lengths `D(i,j)`, is the length `S(I, D)` of the
Steiner path for the nodes `{I} ∪ D`. -/
theorem tableA_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)
    (D : Finset V) (hD : D.Nonempty) (I : V) :
    tableA (pathDist G ℓ) D I = steinerLength G ℓ (insert I D) := by sorry

end DreyfusWagner.Steiner
Source
Dreyfus, Wagner, The Steiner Problem in Graphs, Networks 1 (1971), p. 200, §2 ('Let S(m,D) denote the Steiner path for nodes {m ∪ D}'), and p. 203, §4, Algorithm A, lines (1)–(14); worked values p. 201
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Let VVV be a finite, linearly ordered node type, GGG a connected simple graph on VVV with edge set AAA, and ℓ\ellℓ a length function with ℓ(e)>0\ell(e) > 0ℓ(e)>0 for every e∈Ae \in Ae∈A. Take d=DG,ℓd = D_{G,\ell}d=DG,ℓ​, the shortest node-repeat-free path length in GGG. Let Sd[D,I]S_d[D,I]Sd​[D,I] be the table defined recursively on ∣D∣|D|∣D∣:

  • Sd[{t},I]=d(t,I)S_d[\{t\}, I] = d(t,I)Sd​[{t},I]=d(t,I);
  • Sd[∅,I]=∞S_d[\emptyset, I] = \inftySd​[∅,I]=∞;
  • for ∣D∣≥2|D| \ge 2∣D∣≥2:
Sd[D,I]=min⁡J∈V(d(I,J)+min⁡E(Sd[E,J]+Sd[D∖E,J])),S_d[D,I] = \min_{J \in V}\Big( d(I,J) + \min_{E} \big( S_d[E,J] + S_d[D \setminus E, J] \big) \Big),Sd​[D,I]=J∈Vmin​(d(I,J)+Emin​(Sd​[E,J]+Sd​[D∖E,J])),

where EEE ranges over the subsets of DDD that contain the least element of DDD and differ from DDD.

The statement says that for every nonempty node set DDD and every node III:

Sd[D,I]=St({I}∪D).S_d[D,I] = \mathrm{St}(\{I\} \cup D).Sd​[D,I]=St({I}∪D).

Here St(X)\mathrm{St}(X)St(X) is the minimum total length ∑e∈Sℓ(e)\sum_{e \in S} \ell(e)∑e∈S​ℓ(e) over S⊆AS \subseteq AS⊆A joining every two nodes of XXX using only arcs of SSS.

Degenerate cases. For D={t}D = \{t\}D={t} the claim reads DG,ℓ(t,I)=St({I,t})D_{G,\ell}(t, I) = \mathrm{St}(\{I, t\})DG,ℓ​(t,I)=St({I,t}). For I=tI = tI=t both sides are 000. The node III may belong to DDD. The empty DDD is excluded by hypothesis; for it the table value ∞\infty∞ is not claimed to equal anything.

Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me