Corollary to Theorem 4 — nearest and cheapest insertion: INSERT ≤ 2(1 − 1/n)·OPTIMAL
ProvedTSPHeuristics.NearCheap.insertion_le_two_mul_one_sub_inv_optimalLet be a traveling salesman graph on nodes (symmetric, nonnegative distances satisfying the triangle inequality), and let INSERT be the length of a tour obtained by nearest insertion or by cheapest insertion, from any start node and with any resolution of ties. Then
where OPTIMAL is the length of an optimal tour.
This sharpens Theorem 4 () to the exact constant ; the paper shows elsewhere (Theorem 5) that this constant is attained, so the bound is the worst case of both heuristics.
Formalization Note The ratio (4.12) is multiplied out, so no nontriviality hypothesis on is needed (if both sides are ). The run is any insertion-method run satisfying the nearest-insertion rule (4.2) or the cheapest-insertion rule (4.3), with an arbitrary start node and arbitrary ties. The distance satisfies (normalization); nodes are Fin n.
import Mathlib import Definitions.Def_TSPHeuristics_Shared_Insertion
namespace TSPHeuristics.NearCheap
theorem insertion_le_two_mul_one_sub_inv_optimal {n : ℕ} (hn : 1 ≤ n) (d : Fin n → Fin n → ℝ)
(hd : TSPHeuristics.Shared.IsTSPDist d) (T : ℕ → List (Fin n)) (a : ℕ → Fin n) (hrun : TSPHeuristics.Shared.IsInsertionRun d T a)
(hrule : TSPHeuristics.Shared.IsNearestRule 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.NearCheap
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix with . Let be a set of cities, and let be any real-valued function on ordered pairs of cities, with written for the value at .
The statement uses five notions from an imported module. That module is not shown here, so this read-back names them but cannot give their content:
- is a property of .
- is a property of , and .
- and are two further properties of the same triple.
- is a real number assigned to a finite list of cities.
- is a real number assigned to .
The auditor must look up the definitions of all five, including how is defined (for example, as a minimum, an infimum, or some other expression).
The other two inputs are sequences indexed by all natural numbers:
- , where each is a finite list of cities in . Repeated entries are allowed, and nothing in the signature limits the length of a list.
- , where each .
The theorem assumes three hypotheses:
- holds.
- holds.
- At least one of or holds. This is an inclusive "or".
Under these hypotheses, the conclusion is that the value of at the -th list satisfies
computed in the real numbers. Only the one list appears in the conclusion. The index is the same number as the number of cities. The other lists and the cities enter only through the hypotheses. The inequality is non-strict ().
Degenerate cases.
- No city set is empty. The hypothesis excludes , so always has at least one city.
- No division by zero. Since , the factor is always a genuine real reciprocal.
- One city (). The coefficient is , so the claim becomes . This holds whatever the value of . The statement is not vacuous at : it is a real claim that the length of is at most zero, and whether that is true depends on the unseen definitions.
- General case. For the coefficient lies in and is strictly positive once .
- Default values in the conclusion. If is defined as an infimum or supremum, or by a construction that returns a default value in some situations (for example, for an empty or unbounded set), the right-hand side takes that default value. The inequality is then asserted against that value.
- Could the hypotheses be vacuous? From the code shown, one cannot tell whether hypotheses 1–3 can all hold at once for a given and . If no , , satisfy them together, the theorem holds vacuously. Only the imported definitions can settle this.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.
Confirmed by the moderator at approval.