Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

§2, pp. 199–200 — the recurrence S(m,D)=min⁡k(dmk+Sk(D))S(m,D) = \min_k (d_{mk} + S_k(D))S(m,D)=mink​(dmk​+Sk​(D))

Proved
DreyfusWagner.Steiner.steinerLength_recurrence

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

dynamic-programminggraph-theoryp2o-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, let dmk=D(m,k)d_{mk} = D(m,k)dmk​=D(m,k) be the shortest-path length from mmm to kkk, and let St⁡(X)\operatorname{St}(X)St(X) be the Steiner length of a node set XXX. Let D⊆ND \subseteq ND⊆N have at least two nodes and let m∈Nm \in Nm∈N be any node. For k∈Nk \in Nk∈N put

Sk(D)=min⁡{St⁡({k}∪E)+St⁡({k}∪(D−E)):∅≠E⊊D},S_k(D) = \min\big\{\operatorname{St}(\{k\} \cup E) + \operatorname{St}(\{k\} \cup (D - E)) : \emptyset \ne E \subsetneq D\big\},Sk​(D)=min{St({k}∪E)+St({k}∪(D−E)):∅=E⊊D},

the best way of joining the two parts of a splitting of DDD into nonempty disjoint sets EEE, F=D−EF = D - EF=D−E at the node kkk. Then

St⁡({m}∪D)=min⁡k∈N(dmk+Sk(D)).\operatorname{St}(\{m\} \cup D) = \min_{k \in N}\big(d_{mk} + S_k(D)\big).St({m}∪D)=k∈Nmin​(dmk​+Sk​(D)).

This is the dynamic-programming recurrence of Dreyfus and Wagner: the Steiner length for a terminal set of size j+1j+1j+1 is obtained from shortest-path lengths and Steiner lengths of terminal sets of size at most jjj. The node mmm may belong to DDD.

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

/-- Dreyfus–Wagner 1971, §2, pp. 199–200: for a set `D` of at least two nodes and any node `m`,
the Steiner length of `{m} ∪ D` is `min_k (d_mk + S_k(D))`, where
`S_k(D)` is the minimum, over all splittings of `D` into two nonempty disjoint parts `E` and
`F = D − E`, of the Steiner lengths of `{k} ∪ E` and `{k} ∪ F` added together. -/
theorem steinerLength_recurrence {V : Type*} [Fintype V] [DecidableEq V]
    (G : SimpleGraph V) [DecidableRel G.Adj] (ℓ : Sym2 V → ℝ)
    (hpos : ∀ e ∈ G.edgeSet, 0 < ℓ e) (hconn : G.Connected)
    (D : Finset V) (hD : 2 ≤ D.card) (m : V) :
    steinerLength G ℓ (insert m D) =
      Finset.univ.inf fun k => pathDist G ℓ m k +
        (D.powerset.filter fun E => E.Nonempty ∧ E ≠ D).inf fun E =>
          steinerLength G ℓ (insert k E) + steinerLength G ℓ (insert k (D \ E)) := by sorry

end DreyfusWagner.Steiner
Source
Dreyfus, Wagner, The Steiner Problem in Graphs, Networks 1 (1971), pp. 199–200, §2, last paragraph of p. 199 continued on p. 200 (definition of S_k(D), d_mk and S(m,D))
Read-back

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

Let VVV be a finite node type with decidable equality, 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. Here St(X)∈R∪{∞}\mathrm{St}(X) \in \mathbb{R} \cup \{\infty\}St(X)∈R∪{∞} is the minimum total length ∑e∈Sℓ(e)\sum_{e \in S} \ell(e)∑e∈S​ℓ(e) over arc sets S⊆AS \subseteq AS⊆A that join every two nodes of XXX using only arcs of SSS. DG,ℓ(m,k)D_{G,\ell}(m,k)DG,ℓ​(m,k) is the minimum total length of a path in GGG from mmm to kkk that repeats no node. The statement says that for every node set DDD with ∣D∣≥2|D| \ge 2∣D∣≥2 and every node mmm (which may or may not belong to DDD):

St({m}∪D)=min⁡k∈V(DG,ℓ(m,k)+min⁡E⊆DE≠∅, E≠D(St({k}∪E)+St({k}∪(D∖E)))).\mathrm{St}(\{m\} \cup D) = \min_{k \in V}\Big( D_{G,\ell}(m,k) + \min_{\substack{E \subseteq D \\ E \neq \emptyset,\ E \neq D}} \big( \mathrm{St}(\{k\} \cup E) + \mathrm{St}(\{k\} \cup (D \setminus E)) \big) \Big).St({m}∪D)=k∈Vmin​(DG,ℓ​(m,k)+E⊆DE=∅, E=D​min​(St({k}∪E)+St({k}∪(D∖E)))).

The inner minimum ranges over all nonempty proper subsets EEE of DDD, so each unordered split appears twice, once as EEE and once as D∖ED \setminus ED∖E. The outer minimum ranges over all nodes kkk of VVV, including mmm and the nodes of DDD.

Degenerate cases. Because ∣D∣≥2|D| \ge 2∣D∣≥2, the inner index set is nonempty. Because GGG is connected, all quantities involved are finite. The case m∈Dm \in Dm∈D is included, and there the left side is St(D)\mathrm{St}(D)St(D).

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