Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 1 — an interchange between two cycles merges them into one

Proved
GilmoreGomoryTSP.MinCost.lemma_1_merge_cycles

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

p2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1permutationstraveling-salesman

Let ψ\psiψ be a permutation of the jobs with cycles C1,…,CpC_1,\dots,C_pC1​,…,Cp​ (fixed points count as cycles of length one), and let αij\alpha_{ij}αij​ be an interchange with i∈Cri\in C_ri∈Cr​, j∈Csj\in C_sj∈Cs​, r≠sr\ne sr=s. Then ψαij\psi\alpha_{ij}ψαij​ has the same cycles as ψ\psiψ except that CrC_rCr​ and CsC_sCs​ are replaced by a single cycle containing all their nodes. Equivalently, for all jobs k,lk,lk,l: kkk and lll lie in the same cycle of ψαij\psi\alpha_{ij}ψαij​ if and only if they lie in the same cycle of ψ\psiψ, or one of them lies in CrC_rCr​ and the other in CsC_sCs​.

Repeated use of this fact turns the cycles of φ\varphiφ into a single tour (Theorem 2).

Formalization Note Cycles are encoded by Mathlib's Equiv.Perm.SameCycle (kkk and lll are in the same cycle iff l=ψm(k)l=\psi^m(k)l=ψm(k) for some integer mmm), and the conclusion is stated as the equivalence above for all k,lk,lk,l. ψαij\psi\alpha_{ij}ψαij​ is ψ * alpha i j.

Preamble
import Mathlib
import Definitions.Def_GilmoreGomoryTSP_MinCost_Model
Formal statement
namespace GilmoreGomoryTSP.MinCost

theorem lemma_1_merge_cycles {n : ℕ} (ψ : Equiv.Perm (Fin (n + 1))) (i j : Fin (n + 1))
    (hij : ¬ ψ.SameCycle i j) (k l : Fin (n + 1)) :
    (ψ * alpha i j).SameCycle k l ↔
      ψ.SameCycle k l ∨ (ψ.SameCycle k i ∧ ψ.SameCycle l j) ∨
        (ψ.SameCycle k j ∧ ψ.SameCycle l i) := by sorry

end GilmoreGomoryTSP.MinCost
Source
Gilmore and Gomory, Sequencing a one state-variable machine, Oper. Res. 12 (1964), p. 660, Lemma 1
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