Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§2, p. 5, proof of the Theorem — UNDIRECTED HAMILTON CIRCUIT ∝ UNDIRECTED RURAL POSTMAN

Proved
RuralPostman.NPC.uhc_polyReducible_urp

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

hamilton-circuitnp-completenessp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1polynomial-reductionrural-postman

UNDIRECTED HAMILTON CIRCUIT is polynomially reducible to UNDIRECTED RURAL POSTMAN:

UNDIRECTED HAMILTON CIRCUIT  ∝  UNDIRECTED RURAL POSTMAN.\text{UNDIRECTED HAMILTON CIRCUIT} \;\propto\; \text{UNDIRECTED RURAL POSTMAN}.UNDIRECTED HAMILTON CIRCUIT∝UNDIRECTED RURAL POSTMAN.

That is, there is a function fff from words to words over the alphabet {0,1,−,#}\{0,1,-,\#\}{0,1,−,#}, computable by a one-tape Turing machine in polynomial time, such that a word xxx is the code of an undirected graph on at least three vertices with a hamilton circuit if and only if f(x)f(x)f(x) is the code of a rural postman instance with an undirected postman's tour of weight at most its threshold.

This is the first of the two reductions displayed in the proof; together with the NP-completeness of UNDIRECTED HAMILTON CIRCUIT it gives the NP-hardness half of the undirected case of the Theorem.

Formalization Note The languages consist of codes: uhcLang holds the codes dhpCode adj of symmetric Boolean matrices on n≥3n\ge3n≥3 nodes with a hamilton circuit, urpLang the codes rpCode I of yes-instances. PolyReducible quantifies over all words, so the reducing function must also send words that code no symmetric matrix on at least three nodes to codes outside urpLang (or to words that are no code).

Differences from the source:

  • reading: "L ∝ M means that any instance of L can be reduced to an instance of M in a polynomial number of steps" → CookPvsNP.PolyReducible L M: a polynomial-time computable f : List BSym → List BSym with x ∈ L ↔ f x ∈ M for every word x; reason: Karp's polynomial transformation; the languages are sets of instance codes, so f must also handle words that code no instance
  • reading: UNDIRECTED HAMILTON CIRCUIT on H = (V,E) → uhcLang: the codes dhpCode adj of symmetric Bool matrices on n ≥ 3 nodes with HasHamiltonCircuit adj; reason: an undirected cycle needs at least 3 nodes (paper.md reading 4)
  • reading: G = (N,A) a graph with w: A → ℕ∪{0}, threshold k → RPInstance: nodes Fin n, a list of arcs (tail, head, weight ∈ ℕ, required?) with parallel arcs and loops allowed, k ∈ ℕ; reason: the paper does not restrict G to simple graphs; the instances produced by the reductions are simple, and the weights and k of the paper are natural numbers
  • reading: a postman's tour is an "undirected (directed) cycle traversing each arc in R at least once" → a closed walk: a cyclic list of arc traversals in which nodes and arcs may repeat; the empty list is allowed; reason: the paper's own tour traverses each arc of R twice, so "cycle" means closed walk (paper.md reading 3); the empty tour matters only when R = ∅, where every reading gives weight 0
  • encoding: instances of the decision problems → languages over the four-letter alphabet BSym: rpCode (n, number of arcs, tail, head, weight, required-bit of each arc, k in binary) and dhpCode (n and the adjacency matrix in binary); reason: standard binary encodings; each code determines its instance
Preamble
import Mathlib
import Definitions.Def_RuralPostman_NPC_Instances
Formal statement
namespace RuralPostman.NPC

theorem uhc_polyReducible_urp : CookPvsNP.PolyReducible uhcLang urpLang := by sorry

end RuralPostman.NPC
Source
Lenstra, Rinnooy Kan, On general routing problems, Mathematisch Centrum report BW 42/74 (December 1974), p. 5, §2, proof of the Theorem, "We shall show that UNDIRECTED HAMILTON CIRCUIT ∝ UNDIRECTED RURAL POSTMAN, …"
Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 24, 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