Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1 — the Allocation Algorithm is (1−1/c)(1−Rmax⁡)(1 - 1/c)(1 - R_{\max})(1−1/c)(1−Rmax​)-competitive

Proved
BJNAdAuctions.Basic.allocation_algorithm_competitive

by mikedeng1 · Sep 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

ad-auctionscompetitive-ratioonline-algorithmsp2o-batch-b23ap2o-gran-per-chapterp2o-plan-bookp2o-v1primal-dual

Consider an instance of the online ad-auctions problem with a nonempty finite set III of buyers, budgets B(i)>0B(i) > 0B(i)>0 and bids b(i,j)≥0b(i,j) \ge 0b(i,j)≥0 on mmm products. Let R>0R > 0R>0 bound the bid-to-budget ratios, b(i,j)≤R B(i)b(i,j) \le R\,B(i)b(i,j)≤RB(i) for all i,ji, ji,j, and let

c=(1+R)1/R.c = (1 + R)^{1/R}.c=(1+R)1/R.

Run the Allocation Algorithm with parameter ccc and any tie-breaking rule that picks a buyer maximizing b(i,j)(1−x(i))b(i,j)(1 - x(i))b(i,j)(1−x(i)). Then for every feasible solution y′y'y′ of the packing LP of Fig. 2, the revenue collected by the algorithm satisfies

Revenue  ≥  (1−1c)(1−R)∑j=1m∑i∈Ib(i,j) y′(i,j).\mathrm{Revenue} \;\ge\; \Big(1 - \frac{1}{c}\Big)(1 - R) \sum_{j=1}^m \sum_{i\in I} b(i,j)\,y'(i,j).Revenue≥(1−c1​)(1−R)j=1∑m​i∈I∑​b(i,j)y′(i,j).

Taking R=Rmax⁡=max⁡i,jb(i,j)/B(i)R = R_{\max} = \max_{i,j} b(i,j)/B(i)R=Rmax​=maxi,j​b(i,j)/B(i) (when positive) gives the paper's Theorem 1: the Allocation Algorithm is (1−1/c)(1−Rmax⁡)(1 - 1/c)(1 - R_{\max})(1−1/c)(1−Rmax​)-competitive with c=(1+Rmax⁡)1/Rmax⁡c = (1 + R_{\max})^{1/R_{\max}}c=(1+Rmax​)1/Rmax​. The bound is against the optimum of the fractional LP, which is at least the revenue of any integral offline allocation, so it implies the competitive ratio against the integral offline optimum. Since the algorithm is deterministic and the statement holds for every instance, it holds against every adversary.

Formalization Note The revenue is revenue inst c sel, the sum over buyers of the amounts charged by the run that AllocationAlgorithm computes from the instance; the tie-breaking rule sel is universally quantified subject to the argmax property. The statement is for any bound RRR on the ratios, not only their exact maximum; the exact maximum is one admissible choice.

Preamble
import Mathlib
import Definitions.Def_BJNAdAuctions_Basic_Instance
import Definitions.Def_BJNAdAuctions_Basic_AllocationAlgorithm
Formal statement
namespace BJNAdAuctions.Basic

/-- **Theorem 1** (p. 7), first sentence: the Allocation Algorithm is
`(1 - 1/c)(1 - R_max)`-competitive, where `c = (1 + R_max)^(1/R_max)`. Stated for any bound
`R > 0` with `b(i, j) ≤ R · B(i)` for all `i, j` (the exact `R_max` is one such bound), for every
tie-breaking of the argmax, against every feasible solution `y'` of the fractional packing LP of
Fig. 2 (whose optimum bounds the integral offline optimum from above). -/
theorem allocation_algorithm_competitive {I : Type*} [Fintype I] [Nonempty I] {m : ℕ}
    (inst : Instance I m) (R : ℝ) (hR : 0 < R) (hbR : ∀ i j, inst.b i j ≤ R * inst.B i)
    (sel : (I → ℝ) → Fin m → I) (hsel : IsArgmaxRule inst sel)
    (y' : I → Fin m → ℝ) (hy' : PackingFeasible inst y') :
    (1 - 1 / (1 + R) ^ (1 / R)) * (1 - R) * packingValue inst y' ≤
      revenue inst ((1 + R) ^ (1 / R)) sel := by sorry

end BJNAdAuctions.Basic
Source
Buchbinder, Jain & Naor, Online Primal-Dual Algorithms for Maximizing Ad-Auctions Revenue, ESA 2007, DOI 10.1007/978-3-540-75520-3_24, p. 7, Theorem 1
Human review
  • Endorsed by Shuze Chen · Oct 2, 2026

    Confirmed by the moderator at approval.

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