Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 4 — matching size from doubly covered indices

Proved
KVVMatching.Ranking.lemma_4

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

bipartite-matchingcombinatoricsp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let BBB be an n×nn\times nn×n upper-triangular adjacency matrix with unit diagonal, and let MMM be a matching using its edges. Suppose that for each index iii, row iii or column iii is matched, possibly both. Write DDD for the indices where both are matched. Then

∣M∣=n+∣D∣2.|M|=\frac{n+|D|}{2}.∣M∣=2n+∣D∣​.

This counting identity turns the analysis of matching size into an analysis of the indices covered on both sides. The disjunction in the hypothesis is inclusive.

Preamble
import Definitions.Def_KVVMatching_Ranking_Algorithms
Formal statement
namespace KVVMatching.Ranking

/-- Lemma 4, p. 354: counting the vertices covered by a matching. -/
theorem lemma_4 {n : ℕ} (adj : Fin n → Fin n → Prop)
    (hdiag : ∀ i, adj i i)
    (hupper : ∀ i j, adj i j → i ≤ j)
    (M : Finset (Fin n × Fin n))
    (hM : IsMatching M)
    (hEdges : ∀ e ∈ M, adj e.1 e.2)
    (hCover : ∀ i : Fin n, firstMatched M i ∨ secondMatched M i) :
    (M.card : ℝ) = ((n : ℝ) + (doubleCovered M).card) / 2 := by sorry

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