Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 5.2, p. 112 — the next-node algorithm's lists satisfy Theorem 5.1 (i), (ii) and (iii)

Proved
ChinesePostman.NextNode.theorem_5_2

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithmarborescenceeuler-tournext-node-listp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let GGG be an even, connected, finite loopless multigraph, rrr a node and e0e_0e0​ an edge meeting rrr. Run the next-node algorithm of §5.2 from rrr, starting with the edge e0e_0e0​:

  • Step 0. n0=n=rn_0 = n = rn0​=n=r, e=e0e = e_0e=e0​, all lists empty, all edges unused.
  • Step 1. Let mmm be the node other than nnn meeting eee; append nnn to the end of LmL_mLm​; eee is now used. If mmm meets an unused edge, go to Step 2; otherwise go to Step 3.
  • Step 2. Change nnn to mmm and let eee be any unused edge meeting mmm; go to Step 1.
  • Step 3. Let n0n_0n0​ be any node meeting a used edge and an unused edge eee; change nnn to n0n_0n0​ and go to Step 1. If no such n0n_0n0​ exists, terminate.

Then for every choice made along the way, the lists LLL at termination satisfy

(i)  2kn=deg⁡(n) ∀n,(ii)  #(n,m)=∣{i:Lm(i)=n}∣+∣{i:Ln(i)=m}∣ ∀n,m,(iii)  n↦Ln(1), n≠r, is an arborescence with root r.\text{(i)}\ \ 2k_n = \deg(n)\ \forall n, \qquad \text{(ii)}\ \ \#(n,m) = |\{i: L_m(i) = n\}| + |\{i : L_n(i) = m\}|\ \forall n,m, \qquad \text{(iii)}\ \ n \mapsto L_n(1),\ n \ne r, \text{ is an arborescence with root } r .(i)  2kn​=deg(n) ∀n,(ii)  #(n,m)=∣{i:Lm​(i)=n}∣+∣{i:Ln​(i)=m}∣ ∀n,m,(iii)  n↦Ln​(1), n=r, is an arborescence with root r.

Combined with Theorem 5.1, the lists produced by the algorithm describe an Euler tour.

Formalization Note Step 0 needs an edge meeting rrr, which is the added hypothesis r∈e0r \in e_0r∈e0​; for a graph with no edges the algorithm cannot start and the statement is vacuous. "Produced by the algorithm" means: a terminated state is reachable from the Step 0 state by the steps above, each nondeterministic choice ("any unused edge", "any node n0n_0n0​") being a branch. Condition (iii) is stated for Ln(1)L_n(1)Ln​(1), as in Theorem 5.1 and in the paper's proof of Theorem 5.2.

Preamble
import Mathlib
import Definitions.Def_ChinesePostman_NextNode_Setting
Formal statement
namespace ChinesePostman.NextNode

/-- Theorem 5.2, p. 112: the next-node lists created by any complete run of the next-node algorithm
(§5.2, p. 111) on an even, connected graph, started at `r` with an edge `e₀` meeting `r`, satisfy
Theorem 5.1 (i), (ii) and (iii). -/
theorem theorem_5_2 {V E : Type} [Fintype V] [DecidableEq V] [Fintype E] [DecidableEq E]
    (G : Graph V E) (hconn : Connected G) (heven : ∀ n, Even (degree G n)) (r : V) (e₀ : E)
    (hr : r ∈ G.ends e₀) (L : V → List V) (hL : AlgProduces G r e₀ L) :
    CondI G L ∧ CondII G L ∧ CondIII G r L := by sorry

end ChinesePostman.NextNode
Source
Edmonds and Johnson, Matching, Euler tours and the Chinese postman, Math. Programming 5 (1973), p. 112, Theorem 5.2, with the next-node algorithm of §5.2, p. 111
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 6, 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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me