Theorem 5 — nearest and cheapest insertion can reach INSERT/OPTIMAL
ProvedTSPHeuristics.KOpt.theorem_5_insertion_ratio_two_mul_one_sub_invFor every there is a traveling salesman graph on nodes with on which both nearest insertion and cheapest insertion can produce a tour of length INSERT with
Together with the Corollary to Theorem 4 (INSERT OPTIMAL for both methods) this shows that the bound is attained for every .
Formalization Note The ratio is multiplied out: cycleLength d (T n) = 2 * (1 - 1/n) * optimal d. The conjunct 0 < optimal d is the paper's standing assumption (1.1) (p. 564, which excludes the identically zero distance); without it the zero distance would make the statement trivial. "For either the nearest insertion or cheapest insertion methods" is read as both methods on one and the same graph, which is what the proof gives; each method comes with its own run ( and ), existentially quantified since ties may be resolved suitably.
import Mathlib import Definitions.Def_TSPHeuristics_Shared_Insertion
namespace TSPHeuristics.KOpt
theorem theorem_5_insertion_ratio_two_mul_one_sub_inv (n : ℕ) (hn : 6 ≤ n) :
∃ d : Fin n → Fin n → ℝ, TSPHeuristics.Shared.IsTSPDist d ∧ 0 < TSPHeuristics.Shared.optimal d ∧
(∃ (T : ℕ → List (Fin n)) (a : ℕ → Fin n), TSPHeuristics.Shared.IsInsertionRun d T a ∧ TSPHeuristics.Shared.IsNearestRule d T a ∧
TSPHeuristics.Shared.cycleLength d (T n) = 2 * (1 - 1 / (n : ℝ)) * TSPHeuristics.Shared.optimal d) ∧
(∃ (T : ℕ → List (Fin n)) (a : ℕ → Fin n), TSPHeuristics.Shared.IsInsertionRun d T a ∧ TSPHeuristics.Shared.IsCheapestRule d T a ∧
TSPHeuristics.Shared.cycleLength d (T n) = 2 * (1 - 1 / (n : ℝ)) * TSPHeuristics.Shared.optimal d) := by sorry
end TSPHeuristics.KOpt
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Hypothesis. .
Claim. There exists a real-valued function on ordered pairs of nodes in such that all of the following hold:
- ;
- ;
- there exist a sequence of node lists and a sequence of nodes with and , and
- there exist (possibly different) sequences with and , and the same equality holds for .
Scope of the existentials.
- The function is only asserted to exist. It is not specified.
- The nearest-rule run and the cheapest-rule run are separate existentials, so they need not be the same run.
Undisplayed definitions. , , , , and come from a shared module whose code is not included here. Their content cannot be stated from this code.
Degenerate cases. rules out small , so is an ordinary reciprocal and no division by zero occurs. The equality is exact. It says the lengths equal the ratio times the optimum; it is not stated as an upper or lower bound.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.
Confirmed by the moderator at approval.