Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Primal-dual certificates give an fff-approximation

Proved
PrimalDualOnline.SetCover.primalDual_certificate_bound

by moutei · Sep 17, 2026 · Mathlib 0df444a (Lean v4.33.1)

approximation-algorithmscombinatoricsprimal-dualset-cover

The certificate half of Theorem 2.6 of the source. Let (C,y)(C, y)(C,y) be a primal-dual certificate for a set-cover instance: CCC covers every element, yyy is a dual packing, and every s∈Cs \in Cs∈C has a tight dual constraint ∑e∈Asye=cs\sum_{e \in A_s} y_e = c_s∑e∈As​​ye​=cs​. Then for every fractional cover xxx,

∑s∈Ccs ≤ f⋅∑s∈Scsxs,\sum_{s \in C} c_s \ \le\ f \cdot \sum_{s \in S} c_s x_s,s∈C∑​cs​ ≤ f⋅s∈S∑​cs​xs​,

where fff is the maximum frequency of the instance, cast from N\mathbb{N}N to R\mathbb{R}R.

Because the bound is asserted against an arbitrary fractional cover, it holds in particular against an optimal one, so CCC costs at most fff times the fractional optimum and hence at most fff times the integral optimum. The argument is a double count, isolated as its own milestone: tightness converts the cost of CCC into a sum of element prices, each element being charged by at most fff chosen sets; set-cover weak duality then bounds the total price by the cost of xxx.

The empty ground type is not excluded. When EEE is empty, f=0f = 0f=0 and the bound reads ∑s∈Ccs≤0\sum_{s \in C} c_s \le 0∑s∈C​cs​≤0; the tightness clause forces cs=0c_s = 0cs​=0 for every s∈Cs \in Cs∈C, so both sides are 000. Under these hypotheses f=0f = 0f=0 happens exactly when EEE is empty, since coverability gives every element frequency at least 111.

This is a statement about certificates, not about an algorithm. It does not assert that any particular procedure produces such a pair; the companion theorem that the primal-dual algorithm does so needs the algorithm defined and its termination and coverage proved, and is planned as a second wave. Until that wave lands, Theorem 2.6 should not be described as fully formalized.

Instance-bundled hypotheses. The problem's two standing assumptions - every set cost is nonnegative, and every element lies in at least one available set - are not loose hypotheses of this statement. They are fields of the SetCoverInstance argument, so the statement cannot be instantiated at data violating either.

Preamble
import Definitions.Def_PrimalDualOnline_SetCover
import Mathlib.Tactic
Formal statement
open PrimalDualOnline.SetCover

theorem PrimalDualOnline.SetCover.primalDual_certificate_bound
    {E S : Type*} [Fintype E] [Fintype S] [DecidableEq E] [DecidableEq S]
    (I : SetCoverInstance E S) (C : Finset S) (y : E → ℝ)
    (hcert : IsPrimalDualCertificate I.sets I.cost C y)
    (x : S → ℝ) (hx : IsFractionalCover I.sets x) :
    coverCost I.cost C ≤ (maxFrequency I.sets : ℝ) * fractionalCost I.cost x := by sorry
Source
Niv Buchbinder, Designing Competitive Online Algorithms via a Primal-Dual Approach, PhD thesis, Tel Aviv University, 2008, https://www.tau.ac.il/~nivb/download/phd-thsis.pdf, Section 2.2, Theorem 2.6, p. 14 (certificate-to-ratio half only)
Read-back

What the Lean code literally says, in plain math · claude-opus-5

Read-backs: certificate bounds

Throughout, the shared vocabulary is expanded as follows. A set-cover instance III on two types EEE (elements) and SSS (set indices) is a bundle of exactly four components:

  • a family A:S→Pfin(E)A : S \to \mathcal{P}_{\mathrm{fin}}(E)A:S→Pfin​(E), i.e. a finite subset As⊆EA_s \subseteq EAs​⊆E for each index sss;
  • a cost function c:S→Rc : S \to \mathbb{R}c:S→R;
  • a proof of nonnegative cost: ∀s∈S, 0≤cs\forall s \in S,\ 0 \le c_s∀s∈S, 0≤cs​;
  • a proof of coverability: ∀e∈E, ∃s∈S, e∈As\forall e \in E,\ \exists s \in S,\ e \in A_s∀e∈E, ∃s∈S, e∈As​.

Derived notions, all expanded inline in each section below:

N(e)  =  { s∈S  :  e∈As },f(e)  =  ∣N(e)∣∈N,Δ  =  sup⁡e∈Ef(e)∈N,N(e) \;=\; \{\, s \in S \;:\; e \in A_s \,\}, \qquad f(e) \;=\; |N(e)| \in \mathbb{N}, \qquad \Delta \;=\; \sup_{e \in E} f(e) \in \mathbb{N},N(e)={s∈S:e∈As​},f(e)=∣N(e)∣∈N,Δ=e∈Esup​f(e)∈N,

where N(e)N(e)N(e) is formed by filtering the whole index type SSS, f(e)f(e)f(e) is a cardinality in N\mathbb{N}N, and Δ\DeltaΔ is a supremum in N\mathbb{N}N taken over all of EEE — a supremum of an empty family, which is 000 when EEE is empty. Further:

coverCost(c,C)=∑s∈Ccs,fracCost(c,x)=∑s∈Scsxs,pack(y)=∑e∈Eye.\mathrm{coverCost}(c, \mathcal{C}) = \sum_{s \in \mathcal{C}} c_s, \qquad \mathrm{fracCost}(c, x) = \sum_{s \in S} c_s x_s, \qquad \mathrm{pack}(y) = \sum_{e \in E} y_e .coverCost(c,C)=s∈C∑​cs​,fracCost(c,x)=s∈S∑​cs​xs​,pack(y)=e∈E∑​ye​.

coverCost\mathrm{coverCost}coverCost sums only over the given finite index set C\mathcal{C}C; fracCost\mathrm{fracCost}fracCost sums over all of SSS; pack\mathrm{pack}pack sums over all of EEE.


PrimalDualOnline.SetCover.primalDual_certificate_bound

Binders and instance arguments. Universally quantified over arbitrary types EEE and SSS (implicit), with four typeclass arguments: EEE finite, SSS finite, equality on EEE decidable, equality on SSS decidable; either type may be empty. Decidable equality on SSS is needed to form N(e)N(e)N(e), the frequencies, and the covering sums; decidable equality on EEE is required as an instance argument though no notion in the statement refers to it. Five explicit arguments, in order: a set-cover instance III (carrying AAA, ccc, the proof ∀s, 0≤cs\forall s,\ 0 \le c_s∀s, 0≤cs​, and the proof ∀e∃s, e∈As\forall e \exists s,\ e \in A_s∀e∃s, e∈As​); a finite index set C⊆S\mathcal{C} \subseteq SC⊆S; a function y:E→Ry : E \to \mathbb{R}y:E→R; then, after the certificate hypothesis, a function x:S→Rx : S \to \mathbb{R}x:S→R.

Hypotheses. Two, independent of each other:

  1. (C,y)(\mathcal{C}, y)(C,y) is a primal–dual certificate for (A,c)(A, c)(A,c), unfolding to the conjunction of
    • ∀e∈E, ∃s∈C, e∈As\forall e \in E,\ \exists s \in \mathcal{C},\ e \in A_s∀e∈E, ∃s∈C, e∈As​ (C\mathcal{C}C covers EEE);
    • ∀e∈E, 0≤ye\forall e \in E,\ 0 \le y_e∀e∈E, 0≤ye​ and ∀s∈S, ∑e∈Asye≤cs\forall s \in S,\ \sum_{e \in A_s} y_e \le c_s∀s∈S, ∑e∈As​​ye​≤cs​ (yyy is a dual packing, the inequalities holding at every index of SSS);
    • ∀s∈C, ∑e∈Asye=cs\forall s \in \mathcal{C},\ \sum_{e \in A_s} y_e = c_s∀s∈C, ∑e∈As​​ye​=cs​ (exact tightness on C\mathcal{C}C).
  2. xxx is a fractional cover of AAA, unfolding to ∀s∈S, 0≤xs\forall s \in S,\ 0 \le x_s∀s∈S, 0≤xs​ together with ∀e∈E, 1≤∑s∈N(e)xs\forall e \in E,\ 1 \le \sum_{s \in N(e)} x_s∀e∈E, 1≤∑s∈N(e)​xs​. No upper bound is placed on any xsx_sxs​.

Conclusion.

∑s∈Ccs    ≤    Δ⋅∑s∈Scs xs,Δ=sup⁡e∈E∣{s∈S:e∈As}∣∈N,\sum_{s \in \mathcal{C}} c_s \;\;\le\;\; \Delta \cdot \sum_{s \in S} c_s\, x_s, \qquad \Delta = \sup_{e \in E} \bigl| \{ s \in S : e \in A_s \} \bigr| \in \mathbb{N},s∈C∑​cs​≤Δ⋅s∈S∑​cs​xs​,Δ=e∈Esup​​{s∈S:e∈As​}​∈N,

with Δ\DeltaΔ cast into R\mathbb{R}R. The dual vector yyy occurs only in the hypothesis; it does not appear in the conclusion.

1. Nonnegativity of cost; every element in some set. Both are fields of the bundled argument III, not loose hypotheses, so the statement cannot be instantiated at data violating either — the bundle cannot be formed without both proofs.

2. Logical redundancy.

  • Nonnegativity of cost is derivable from the dual-packing part of hypothesis 1: 0≤∑e∈Asye≤cs0 \le \sum_{e \in A_s} y_e \le c_s0≤∑e∈As​​ye​≤cs​ for every sss, the left inequality holding because y≥0y \ge 0y≥0.
  • Coverability is derivable twice over: from the covering conjunct of hypothesis 1 (a witness in C\mathcal{C}C is a witness in SSS), and independently from hypothesis 2 (if N(e)N(e)N(e) were empty the covering sum would be 000, contradicting 1≤01 \le 01≤0).
  • Inside the certificate, the packing inequality at indices s∈Cs \in \mathcal{C}s∈C is implied by the tightness equality there, so those inequalities are only independent at indices outside C\mathcal{C}C.
  • Nothing else is redundant: hypothesis 1 does not follow from hypothesis 2 or conversely, and y≥0y \ge 0y≥0, the covering conjunct, the tightness conjunct, and both halves of hypothesis 2 are otherwise independent.

Dropping the two bundled fields would leave the covered situations unchanged, since the remaining hypotheses force both properties.

3. Arbitrary or specific. The fractional cover is arbitrary: xxx is universally quantified subject only to feasibility, so the inequality is asserted for every feasible xxx separately; the least fractional cost is never mentioned, and no xxx is claimed optimal. The cover C\mathcal{C}C is arbitrary subject to being part of a certificate — not claimed minimum-cost or minimal. The dual vector yyy is arbitrary subject to being a dual packing tight on C\mathcal{C}C — not claimed to be of maximum value.

4. Cast from N\mathbb{N}N to R\mathbb{R}R. The cast occurs at the multiplier Δ\DeltaΔ, computed in N\mathbb{N}N as a supremum of cardinalities over EEE (empty supremum =0= 0=0) and cast to multiply the real fracCost(c,x)\mathrm{fracCost}(c,x)fracCost(c,x). When the cast value is 000 the claim reduces to

∑s∈Ccs  ≤  0.\sum_{s \in \mathcal{C}} c_s \;\le\; 0 .s∈C∑​cs​≤0.

Δ=0\Delta = 0Δ=0 means all frequencies vanish or EEE is empty; since coverability (bundled, and also implied by either hypothesis) gives f(e)≥1f(e) \ge 1f(e)≥1 for each e∈Ee \in Ee∈E, under these hypotheses Δ=0\Delta = 0Δ=0 exactly when EEE is empty. The hypotheses then force each side: every AsA_sAs​ is empty, so tightness gives cs=0c_s = 0cs​=0 for all s∈Cs \in \mathcal{C}s∈C and the left side is 000; the right side is 0⋅fracCost(c,x)=00 \cdot \mathrm{fracCost}(c,x) = 00⋅fracCost(c,x)=0 regardless of xxx (which is then constrained only by x≥0x \ge 0x≥0, its covering inequalities being vacuous). The claim becomes 0≤00 \le 00≤0.

5. Degenerate cases.

  • EEE empty. Covering and y≥0y \ge 0y≥0 vacuous; Δ=0\Delta = 0Δ=0; tightness forces cs=0c_s = 0cs​=0 on C\mathcal{C}C; both sides 000. xxx is unconstrained beyond nonnegativity, and yyy entirely unconstrained.
  • SSS empty. Then C=∅\mathcal{C} = \emptysetC=∅ and N(e)=∅N(e) = \emptysetN(e)=∅ for all eee, so hypothesis 2 is satisfiable only when EEE is empty (and the bundled coverability field already forces this); all sums are empty and the conclusion is 0≤00 \le 00≤0.
  • C\mathcal{C}C empty. The covering conjunct is then unsatisfiable unless EEE is empty; in that case both sides are 000.
  • c≡0c \equiv 0c≡0. The packing inequalities plus y≥0y \ge 0y≥0 force ye=0y_e = 0ye​=0 for every covered eee, hence for all eee; fracCost(c,x)=0\mathrm{fracCost}(c,x) = 0fracCost(c,x)=0 and coverCost(c,C)=0\mathrm{coverCost}(c,\mathcal{C}) = 0coverCost(c,C)=0, so the conclusion reads 0≤Δ⋅0=00 \le \Delta \cdot 0 = 00≤Δ⋅0=0 for every feasible xxx, however large its entries.
  • Individual zero-cost sets inside the certificate. For s∈Cs \in \mathcal{C}s∈C with cs=0c_s = 0cs​=0, tightness forces ∑e∈Asye=0\sum_{e \in A_s} y_e = 0∑e∈As​​ye​=0 and hence ye=0y_e = 0ye​=0 for all e∈Ase \in A_se∈As​; for s∉Cs \notin \mathcal{C}s∈/C with cs=0c_s = 0cs​=0 the packing inequality forces the same. Such indices contribute 000 to the left side and 000 to the right side whatever xsx_sxs​ is.
  • Δ\DeltaΔ small or large. Δ=1\Delta = 1Δ=1 leaves coverCost(c,C)≤fracCost(c,x)\mathrm{coverCost}(c,\mathcal{C}) \le \mathrm{fracCost}(c,x)coverCost(c,C)≤fracCost(c,x); larger Δ\DeltaΔ weakens the claim. Δ\DeltaΔ is a property of the whole family AAA over all of SSS; nothing ties it to C\mathcal{C}C, to xxx, or to the type cardinalities.
  • Unbounded entries of the fractional cover. Entries xsx_sxs​ may be arbitrarily large, making the right-hand side arbitrarily large; entries may also be 000, and every index of SSS is summed over in fracCost\mathrm{fracCost}fracCost. Since c≥0c \ge 0c≥0 and x≥0x \ge 0x≥0, the right-hand side is always nonnegative.
  • ρ\rhoρ. Not applicable: the multiplier is the cast maximum frequency, not a free parameter.

Not asserted. No claim that C\mathcal{C}C is a minimum-cost cover, that xxx is a minimum-cost fractional cover, or that yyy is a maximum packing; the least-cover-cost and least-fractional-cost notions are not used, so nothing is said about the integral or fractional optimum as such. No claim that pack(y)\mathrm{pack}(y)pack(y) equals or bounds either side. No claim that a certificate or a fractional cover exists, and no claim that the hypotheses are jointly satisfiable. No tightness, attainment, reverse inequality, or strict inequality; no claim that Δ\DeltaΔ is the smallest valid multiplier. Nothing about the indicator vector of C\mathcal{C}C being a fractional cover, nothing about algorithms or online arrival.


Human review
  • Endorsed by Shuze Chen · Sep 17, 2026

  • Endorsed by moutei · Sep 17, 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