Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 2.3 — the unweighted algorithm covers X′X'X′ with ∣C∣≤⌈4ln⁡n⌉ ∣COPT∣(log⁡2m+2)|\mathcal C|\le\lceil 4\ln n\rceil\,|\mathcal C_{OPT}|(\log_2 m+2)∣C∣≤⌈4lnn⌉∣COPT​∣(log2​m+2)

Proved
OnlineSetCover.Unweighted.theorem_2_3

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

competitive-analysisonline-algorithmsp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1set-cover

Let a set-cover instance have a ground set of n≥2n\ge2n≥2 elements and mmm sets, all of unit cost. Let σ\sigmaσ be any sequence of elements given by the adversary (the set X′X'X′ of given elements), and let COPT\mathcal C_{OPT}COPT​ be any family of sets covering every element of σ\sigmaσ. Then:

  1. the unweighted online algorithm of Section 2 has a run on σ\sigmaσ (at every arrival an admissible choice exists), and
  2. every run of the algorithm on σ\sigmaσ ends with a cover C\mathcal CC that is a feasible cover of X′X'X′ (every element of σ\sigmaσ lies in some member of C\mathcal CC) and satisfies
∣C∣  ≤  ⌈4ln⁡n⌉⋅∣COPT∣⋅(log⁡2m+2).|\mathcal C|\;\le\;\lceil 4\ln n\rceil\cdot|\mathcal C_{OPT}|\cdot(\log_2 m+2).∣C∣≤⌈4lnn⌉⋅∣COPT​∣⋅(log2​m+2).

In particular the algorithm is O(log⁡mlog⁡n)O(\log m\log n)O(logmlogn)-competitive for unweighted online set cover: the paper writes ∣C∣=O(∣COPT∣log⁡mlog⁡n)|\mathcal C|=O(|\mathcal C_{OPT}|\log m\log n)∣C∣=O(∣COPT​∣logmlogn), and its proof yields the explicit bound above (Lemma 2.1 times Lemma 2.2).

Formalization Note The paper writes O(⋅)O(\cdot)O(⋅); the proof yields the constant ⌈4ln⁡n⌉⋅(log⁡2m+2)\lceil 4\ln n\rceil\cdot(\log_2 m+2)⌈4lnn⌉⋅(log2​m+2), where ⌈4ln⁡n⌉\lceil 4\ln n\rceil⌈4lnn⌉ is the paper's "4log⁡n4\log n4logn" sets per augmentation (natural logarithm, rounded up) and log⁡2m+2=log⁡2(4m)\log_2 m+2=\log_2(4m)log2​m+2=log2​(4m). The hypothesis n≥2n\ge2n≥2 is the paper's tacit assumption behind log⁡n\log nlogn: for n=1n=1n=1 no set may be added and the arriving element stays uncovered. Since the algorithm's choice in step 2(c) is not determined, it is a relation, and part 1 (existence of a run) is part of the statement. Arrival lists may repeat elements.

Preamble
import Mathlib
import Definitions.Def_OnlinePrimalDual_OnlineSetCover_SetCoverInstance
import Definitions.Def_OnlinePrimalDual_OnlineSetCover_coveredBy
import Definitions.Def_OnlineSetCover_Unweighted_Algorithm
open OnlinePrimalDual.OnlineSetCover
Formal statement
namespace OnlineSetCover.Unweighted

/-- Theorem 2.3 (Alon et al. 2009, p. 364), with the explicit constant of its proof. Let the
instance have `n ≥ 2` elements and `m` sets, let `σ` be an arrival list and `OPT` any family of
sets covering every element of `σ`. Then
(a) the unweighted algorithm has a run on `σ` (an admissible choice exists at every step), and
(b) every run ends with a cover `𝒞` that covers every element of `σ` and satisfies
`|𝒞| ≤ ⌈4 ln n⌉ · |OPT| · (log₂ m + 2)`. -/
theorem theorem_2_3 {E T : Type*} [Fintype E] [Fintype T] [DecidableEq T]
    (inst : SetCoverInstance E T) (hn : 2 ≤ Fintype.card E)
    (σ : List E) (OPT : Finset T) (hOPT : ∀ j ∈ σ, coveredBy inst OPT j) :
    (∃ (s : State T) (a : ℕ), Run inst σ s a) ∧
      ∀ (s : State T) (a : ℕ), Run inst σ s a →
        (∀ j ∈ σ, coveredBy inst s.cover j) ∧
          (s.cover.card : ℝ) ≤
            (setCap (Fintype.card E) : ℝ) * (OPT.card : ℝ) * (Real.logb 2 (Fintype.card T) + 2) := by sorry

end OnlineSetCover.Unweighted
Source
Alon, Awerbuch, Azar, Buchbinder, Naor, The Online Set Cover Problem, SIAM J. Comput. 39(2) (2009), p. 364, Theorem 2.3
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 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