Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5 — RANKING produces at least as large a matching as EARLY

Proved
KVVMatching.Ranking.lemma_5

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

bipartite-matchingonline-algorithmsp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Fix an upper-triangular n×nn\times nn×n adjacency matrix with unit diagonal and any ordering of its rows. RANKING matches each arriving row to the highest-ranked eligible column. EARLY follows the same rule except that it refuses row iii when its own matching has already covered column iii. For this fixed order,

∣MEARLY(B,σ)∣≤∣MRANKING(B,σ)∣.|M_{\mathrm{EARLY}}(B,\sigma)|\le |M_{\mathrm{RANKING}}(B,\sigma)|.∣MEARLY​(B,σ)∣≤∣MRANKING​(B,σ)∣.

This is a pointwise comparison for every row order, before taking any expectation.

Preamble
import Definitions.Def_KVVMatching_Ranking_Algorithms
Formal statement
namespace KVVMatching.Ranking

/-- Lemma 5, p. 354: RANKING's matching is at least as large as EARLY's. -/
theorem lemma_5 {n : ℕ} (adj : Fin n → Fin n → Prop)
    (hdiag : ∀ i, adj i i)
    (hupper : ∀ i j, adj i j → i ≤ j)
    (rowOrder : Equiv.Perm (Fin n)) :
    (earlyMatching adj rowOrder).card ≤ (rowRankingMatching adj rowOrder).card := by sorry

end KVVMatching.Ranking
Source
Karp, Vazirani, Vazirani, An Optimal Algorithm for On-line Bipartite Matching, STOC 1990, p. 354, EARLY definition and Lemma 5
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