Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 2 — no on-line algorithm exceeds the asymptotic bound

Proved
KVVMatching.UpperBound.theorem_2

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

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

For every ε>0\varepsilon>0ε>0, there is an NNN such that for every n≥Nn\ge Nn≥N and every randomized on-line matching algorithm AAA on nnn boys and nnn girls, some graph GGG containing a perfect matching satisfies

EA[∣M(G)∣]≤(1−e−1+ε)n.\mathbb E_A[|M(G)|]\le (1-e^{-1}+\varepsilon)n.EA​[∣M(G)∣]≤(1−e−1+ε)n.

Hence the performance of every algorithm is at most n(1−1/e)+o(n)n(1-1/e)+o(n)n(1−1/e)+o(n) in the paper's sense. The threshold NNN is independent of AAA; the hard graph is chosen after AAA.

Formalization Note The paper writes o(n)o(n)o(n); the quantified inequality is its uniform upper-bound form. The fixed reverse order of columns represents any preselected order after relabeling the girls.

Preamble
import Mathlib
import Definitions.Def_KVVMatching_UpperBound_RandomValue
import Definitions.Def_KVVMatching_UpperBound_Triangular
import Definitions.Def_DiscreteConvex_IntegralConvexityB_IsPerfectMatchingBij
Formal statement
namespace KVVMatching.UpperBound

/-- Karp, Vazirani and Vazirani, Theorem 2 (p. 357), with uniform `o(n)`. -/
theorem theorem_2 :
    ∀ ε : ℝ, 0 < ε → ∃ N : ℕ, ∀ n : ℕ, N ≤ n →
      ∀ A : RandomAlg n, ∃ G : Graph n,
        (∃ σ : Fin n ≃ Fin n,
          DiscreteConvex.IntegralConvexityB.IsPerfectMatchingBij G σ) ∧
        expectedSize G A ≤ (1 - Real.exp (-1) + ε) * (n : ℝ) := by sorry

end KVVMatching.UpperBound
Source
Karp, Vazirani, Vazirani, An Optimal Algorithm for On-line Bipartite Matching, STOC 1990, p. 357, Theorem 2
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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me