Weak duality for the ski-rental covering/packing pair
ProvedPrimalDualOnline.SkiRental.weak_dualityLet be a purchase price and a number of ski days. Let be any feasible solution of the ski-rental primal covering program as printed in Figure 3.1 — so , , and for every day — and let be any feasible solution of the dual packing program — so for every day and . Then
The objective value of any feasible dual solution is at most the objective value of any feasible primal solution. Its role in the mission is to convert the dual objective accumulated by an online algorithm into a lower bound on the offline optimum, which the algorithm never observes.
Source correspondence.
- What the thesis states: Chapter 3 does not prove weak duality; on p. 18 it appeals to the general linear-programming weak-duality theorem, which is Theorem 2.1 of the background chapter (p. 8), stated there for an arbitrary primal/dual pair with nonnegative data.
- What this Lean theorem states: that same inequality, specialised to the single covering/packing pair of Figure 3.1.
- Strengthenings introduced by the formalization: none in substance; this is a restriction of the general theorem to one instance, not a generalisation of it.
On the hypothesis . It is stated to keep the theorem inside the source's model, where the purchase price is a positive cost. It should not be read as repairing a defect: the hypothesis is in fact logically redundant, since dual feasibility already forces (the are nonnegative, so their sum is nonnegative, and that sum is bounded by ). Dropping it would give a statement of exactly the same strength, whose negative- instances are vacuous rather than false. The hypothesis is therefore documentary — it records the intended domain in the signature — and is not load-bearing.
Anti-duplication note. This statement is recorded as reusable infrastructure. The companion mission on the source's background chapter is expected to carry the general Theorem 2.1, and a solver who proves the general form there should derive this instance from it rather than open a competing formalisation of general linear-programming duality inside this mission.
import Definitions.Def_PrimalDualOnline_SkiRentalLP import Definitions.Def_PrimalDualOnline_SkiRentalAlg import Mathlib.Tactic open PrimalDualOnline.SkiRental
theorem PrimalDualOnline.SkiRental.weak_duality
(B : ℝ) (hB : 0 ≤ B) (k : ℕ) (x : ℝ) (z y : Fin k → ℝ)
(hp : PrimalFeasible k x z) (hd : DualFeasible B k y) :
dualValue y ≤ primalCost B x z := by sorryRead-back
What the Lean code literally says, in plain math · claude-opus-5
The statement quantifies over: a real number ; a hypothesis ; a natural number ; a real number ; and two functions , written below as finite families and . All five data (, , , , ) are explicit universally quantified arguments.
The first hypothesis, " is primal feasible for index count ", unfolds to the conjunction of three conditions:
The last condition is a lower bound of exactly on each sum , non-strict. There is no upper bound anywhere in this hypothesis: may be arbitrarily large, each may be arbitrarily large (in particular and are permitted), and there is no integrality restriction. So the primal region is unbounded above in every variable.
The second hypothesis, " is dual feasible for and ", unfolds to:
Both the per-coordinate bounds and the budget constraint are non-strict. Here the region is bounded above: each lies in , and the total is capped by , so .
The conclusion, with both defined quantities expanded inline, is the single non-strict inequality
i.e. the dual value is at most the primal cost. The direction is dual primal; no reverse inequality, no equality, and no claim about any gap being small or about either side being optimal is asserted.
and are constrained only by their respective feasibility hypotheses: the statement links them by nothing else — no complementary-slackness relation, no algorithm producing one from the other, no optimality of either. It is a claim about every primal-feasible pair and every dual-feasible vector sharing the same and the same , taken independently.
Degenerate and edge cases. (i) : the index type is empty, so both "for every " clauses hold vacuously and both sums are . Primal feasibility then says only ; dual feasibility says only ; and the conclusion reduces to . The hypotheses are satisfiable (e.g. ), but the case carries no content about the or . (ii) : dual feasibility forces while each , hence every and the left side is ; the right side becomes , which the primal hypothesis already forces to be . (iii) : dual feasibility is unsatisfiable, so such an instance would be vacuous — and it is additionally excluded by the standing hypothesis . (iv) Nothing prevents with all , nor with all ; both are feasible.
On the hypothesis : it is logically implied by the dual feasibility hypothesis alone. Dual feasibility gives for each , hence , and combined with this yields . The derivation also goes through when , where the empty sum is and the budget constraint reads directly. So adds no restriction to the set of instances the theorem covers beyond what the other hypotheses already impose; it is stated redundantly rather than doing independent work. It would be load-bearing if dual feasibility were dropped, but as written it is not.
Confirmed by the mission captain (proposal self-audit).