Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 1 — duality of RANKING

Proved
KVVMatching.Ranking.lemma_1

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

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

Fix a bipartite graph and an ordering of each side. Girls arriving in their order and selecting the highest-ranked available boy produce the same set of edges as boys arriving in their priority order and selecting the highest-ranked eligible girl, where the girls' priority order is their original arrival order.

Mgirls arrive(B;σV,σU)=Mboys arrive(B;σU,σV).M_{\mathrm{girls\ arrive}}(B;\sigma_V,\sigma_U)=M_{\mathrm{boys\ arrive}}(B;\sigma_U,\sigma_V).Mgirls arrive​(B;σV​,σU​)=Mboys arrive​(B;σU​,σV​).

This duality principle allows the analysis to exchange which side arrives online while retaining the individual matched edges.

Formalization Note Each permutation maps a time or priority index to a vertex; a smaller index arrives earlier or has higher priority. The two runs' edge pairs are placed in the same (boy, girl) orientation before comparison.

Preamble
import Definitions.Def_KVVMatching_Ranking_GreedyRun
Formal statement
namespace KVVMatching.Ranking

/-- Lemma 1, p. 353: the duality principle for fixed orders. -/
theorem lemma_1 {n : ℕ} (adj : Fin n → Fin n → Prop)
    (boyOrder girlOrder : Equiv.Perm (Fin n)) :
    (greedyRun (fun g b => adj b g) girlOrder boyOrder
      (fun _ _ _ => false)).image Prod.swap =
    greedyRun adj boyOrder girlOrder (fun _ _ _ => false) := by sorry

end KVVMatching.Ranking
Source
Karp, Vazirani, Vazirani, An Optimal Algorithm for On-line Bipartite Matching, STOC 1990, p. 353, Duality Principle and 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