Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§1, Step 2, first bracket, p. 34 — the alternating sequence Z_0, …, Z_2k exists, is unique, and has distinct elements

Proved
MunkresAlg.Assignment.step2_sequence

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

alternating-sequenceassignment-probleminvariantp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let AAA be a real n×nn\times nn×n matrix and let sss be a state reachable by Munkres' algorithm from AAA that is at Step 2 with the primed zero Z0Z_0Z0​. Call a list Z0,Z1,…,Z2kZ_0,Z_1,\dots,Z_{2k}Z0​,Z1​,…,Z2k​ a Step 2 sequence if it starts at Z0Z_0Z0​, each Z2i+1Z_{2i+1}Z2i+1​ is a starred zero in the column of Z2iZ_{2i}Z2i​, each Z2i+2Z_{2i+2}Z2i+2​ is a primed zero in the row of Z2i+1Z_{2i+1}Z2i+1​, and Z2kZ_{2k}Z2k​ has no starred zero in its column. Then:

  1. a Step 2 sequence exists (the construction never fails and the sequence stops);
  2. any two Step 2 sequences are equal (the sequence is uniquely specified);
  3. the elements of a Step 2 sequence are distinct;
  4. Z0Z_0Z0​ is a primed zero, it is non-covered, and it is the only non-covered primed zero.

These facts make Step 2 well defined; part 1 is what rules out the algorithm getting stuck at Step 2.

Preamble
import Mathlib
import Definitions.Def_MunkresAlg_Assignment_Basic
import Definitions.Def_MunkresAlg_Assignment_Algorithm
Formal statement
namespace MunkresAlg.Assignment

/-- §1, Step 2, p. 34: at Step 2 the alternating sequence `Z₀, Z₁, …, Z₂ₖ` exists (it stops),
it is uniquely specified, its elements are distinct, and `Z₀` is the only non-covered primed
zero. -/
theorem step2_sequence {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (s : State n)
    (z₀ : Fin n × Fin n) (hs : Reachable A s) (hph : s.phase = Phase.step2 z₀) :
    (∃ zs, IsStep2Seq s z₀ zs) ∧
    (∀ zs zs', IsStep2Seq s z₀ zs → IsStep2Seq s z₀ zs' → zs = zs') ∧
    (∀ zs, IsStep2Seq s z₀ zs → zs.Nodup) ∧
    (z₀ ∈ s.primed ∧ NonCovered s z₀ ∧ ∀ p ∈ s.primed, NonCovered s p → p = z₀) := by sorry

end MunkresAlg.Assignment
Source
Munkres, Algorithms for the assignment and transportation problems, J. SIAM 5 (1957), p. 34, §1, Step 2, first bracket (and '[There is only one.]')
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