Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 1 — Σ l_p ≤ ½(⌈lg n⌉ + 1)·OPTIMAL

Proved
TSPHeuristics.Insertion.lemma_1_sum_le_half_clog_add_one_mul_optimal

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

heuristicsp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1traveling-salesman

Let (N,d)(N,d)(N,d) be a traveling salesman graph with n≥1n\ge1n≥1 nodes, and assign to each node ppp a real number lpl_plp​ such that

  1. d(p,q)≥min⁡(lp,lq)d(p,q)\ge\min(l_p,l_q)d(p,q)≥min(lp​,lq​) for all distinct nodes ppp and qqq, and
  2. lp≤12 OPTIMALl_p\le\tfrac12\,\mathrm{OPTIMAL}lp​≤21​OPTIMAL for all nodes ppp.

Then

∑p∈Nlp ≤ 12(⌈lg⁡n⌉+1) OPTIMAL,\sum_{p\in N} l_p\ \le\ \tfrac12\bigl(\lceil\lg n\rceil+1\bigr)\,\mathrm{OPTIMAL},p∈N∑​lp​ ≤ 21​(⌈lgn⌉+1)OPTIMAL,

where lg⁡\lglg is the logarithm to base 2 and ⌈x⌉\lceil x\rceil⌈x⌉ the least integer ≥x\ge x≥x.

This lemma is the common engine of the paper's two logarithmic upper bounds: Theorem 1 (nearest neighbor) and Theorem 3 (every insertion method).

Formalization Note Nodes are Fin n (0-based). A traveling salesman graph is IsTSPDist d: symmetric, nonnegative, triangle inequality, plus the normalization d(i,i)=0d(i,i)=0d(i,i)=0, which is not in the paper and does not affect any length, since a loop never enters a tour, subtour or insertion cost. ⌈lg⁡n⌉\lceil\lg n\rceil⌈lgn⌉ is Nat.clog 2 n (so it is 000 at n=1n=1n=1). The page states condition 1 "for all nodes ppp and qqq"; with p=qp=qp=q and d(p,p)=0d(p,p)=0d(p,p)=0 that would force every lp≤0l_p\le0lp​≤0 and the lemma could no longer be applied in the proofs of Theorems 1 and 3. The proof uses condition 1 only on edges of a tour, whose endpoints are distinct, so it is stated for distinct nodes. No sign condition on lll is imposed, as on the page.

Preamble
import Mathlib
import Definitions.Def_TSPHeuristics_Shared_TSPModel
import Definitions.Def_TSPHeuristics_Insertion_InsertionMethod
Formal statement
namespace TSPHeuristics.Insertion

/-- Lemma 1, p. 565: if `d(p, q) ≥ min(l_p, l_q)` for all distinct nodes `p, q` and
`l_p ≤ OPTIMAL / 2` for all nodes `p`, then `Σ_p l_p ≤ ½(⌈lg n⌉ + 1) OPTIMAL`.
Condition a) is required for distinct nodes only (the page says "for all nodes p and q"; with
`p = q` it would force `l_p ≤ 0`, and the proof applies it only to edges of a tour). -/
theorem lemma_1_sum_le_half_clog_add_one_mul_optimal {n : ℕ} (hn : 1 ≤ n)
    (d : Fin n → Fin n → ℝ) (hd : TSPHeuristics.Shared.IsTSPDist d) (l : Fin n → ℝ)
    (ha : ∀ p q, p ≠ q → min (l p) (l q) ≤ d p q)
    (hb : ∀ p, l p ≤ TSPHeuristics.Shared.optimal d / 2) :
    ∑ p, l p ≤ (1 / 2) * ((Nat.clog 2 n : ℝ) + 1) * TSPHeuristics.Shared.optimal d := by sorry

end TSPHeuristics.Insertion
Source
Rosenkrantz, Stearns, Lewis, An Analysis of Several Heuristics for the Traveling Salesman Problem, SIAM J. Comput. 6(3), 1977, https://doi.org/10.1137/0206041, p. 565, Lemma 1
Read-back

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

Let n≥1n\ge 1n≥1 be a natural number, with nodes {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1}. Let ddd be a real-valued function on pairs of nodes satisfying the imported predicate IsTSPDist(d)\mathrm{IsTSPDist}(d)IsTSPDist(d), whose definition is not shown. Write OPTd\mathrm{OPT}_dOPTd​ for the imported quantity optimal(d)\mathrm{optimal}(d)optimal(d), also not shown. Let l:{0,…,n−1}→Rl:\{0,\dots,n-1\}\to\mathbb Rl:{0,…,n−1}→R be any real numbers with no sign condition, satisfying:

  • (a) distinct nodes: min⁡(lp,lq)≤d(p,q)\min(l_p,l_q)\le d(p,q)min(lp​,lq​)≤d(p,q) for all distinct nodes p≠qp\ne qp=q;
  • (b) upper bound: lp≤OPTd/2l_p\le \mathrm{OPT}_d/2lp​≤OPTd​/2 for every node ppp.

No ordering of lll is assumed. The theorem asserts

∑p=0n−1lp  ≤  12(⌈log⁡2n⌉+1) OPTd.\sum_{p=0}^{n-1} l_p\;\le\;\frac12\bigl(\lceil\log_2 n\rceil+1\bigr)\,\mathrm{OPT}_d .p=0∑n−1​lp​≤21​(⌈log2​n⌉+1)OPTd​.

Here ⌈log⁡2n⌉\lceil\log_2 n\rceil⌈log2​n⌉ means the least natural number ccc with n≤2cn\le 2^cn≤2c, so it is 000 for n=1n=1n=1, 111 for n=2n=2n=2, and 222 for n=3,4n=3,4n=3,4.

Degenerate case:

  • n=1n=1n=1: condition (a) is vacuous. The conclusion reads l0≤12OPTdl_0\le\frac12\mathrm{OPT}_dl0​≤21​OPTd​, which is exactly hypothesis (b).
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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me