The greedy punishing rule punishes each at least times by cost
ProvedCompetitivePaging.Combining.greedy_punishing_meets_quotasLet be positive reals with
Index the units of cost incurred by an on-line algorithm by , and let be the number of times has punished by the time it has incurred cost , with . When incurs its -st unit of cost it punishes an algorithm chosen greedily: minimizes over all , ties broken arbitrarily. The count of then grows by at least one, , and no count ever decreases (other algorithms may be punished incidentally). Then for every positive integer and every ,
This is the scheduling claim that completes the sufficiency proof of Theorem 6: once has incurred cost , algorithm has been punished at least times.
Formalization Note The choice sequence is indexed from : choice r is and pun r i is . The counts are an arbitrary function subject to pun 0 i = 0 and pun r i + [choice r = i] ≤ pun (r+1) i, so punishments of algorithms other than the chosen one are allowed, as in the paper, where counts every punishment. The floor is Nat.floor of a real number. For no choice sequence exists and the statement is vacuous, as is the paper's.
import Mathlib
namespace CompetitivePaging.Combining
/-- Fiat et al. 1991, §6, proof of Theorem 6, p. 9, the scheduling claim. Index `A`'s units of
cost by `r = 0, 1, 2, …` (a lazy `A` pays one unit per fault). `pun r i` is `PUN(i, ·, σ)`, the
number of times `A` has punished `B(i)` by the time it has incurred cost `r`; it starts at `0`.
At its `(r+1)`-st unit of cost `A` punishes `choice r`, the `B(i)` for which
`c(i) · (PUN(i) + 1)` is least (ties broken arbitrarily); the chosen count grows by at least one,
and any count may also grow by incidental punishments. If every `c(i) > 0` and `∑ 1/c(i) ≤ 1`,
then for all positive integers `r` and all `i`, `B(i)` has been punished at least `⌊r / c(i)⌋`
times by the time `A` incurs cost `r`. -/
theorem greedy_punishing_meets_quotas {m : ℕ} (c : Fin m → ℝ) (hc : ∀ i, 0 < c i)
(hsum : ∑ i, 1 / c i ≤ 1) (choice : ℕ → Fin m) (pun : ℕ → Fin m → ℕ)
(hpun0 : ∀ i, pun 0 i = 0)
(hpun : ∀ (r : ℕ) (i : Fin m), pun r i + (if choice r = i then 1 else 0) ≤ pun (r + 1) i)
(hgreedy : ∀ (r : ℕ) (j : Fin m),
c (choice r) * ((pun r (choice r) : ℝ) + 1) ≤ c j * ((pun r j : ℝ) + 1)) :
∀ r : ℕ, 0 < r → ∀ i : Fin m, ⌊(r : ℝ) / c i⌋₊ ≤ pun r i := by sorry
end CompetitivePaging.Combining
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
This statement concerns weights and two sequences indexed by a step counter . The data are:
- a natural number and the index set ;
- real weights ;
- a choice function , which picks one index at each step ;
- a counting function , written .
The hypotheses are:
- Positive weights: for every .
- Sum condition:
Since every term is positive, this forces for each . 3. Initial counts are zero: for every . 4. Growth: for every and every ,
where is if the condition holds and otherwise. So every count is non-decreasing in , and the count of the chosen index goes up by at least at each step. Any count may also go up by any larger amount. 5. Greedy choice: for every and every index ,
So at step the chosen index minimizes . When several indices tie, any of them may be chosen.
Conclusion: for every natural number and every index ,
Here is the floor taken as a natural number, which returns on negative inputs. Because , the quotient is non-negative, so this is the ordinary floor. No division by zero can occur.
Degenerate cases.
- : there are no indices, so no choice function exists. The hypotheses cannot all be supplied and the statement is vacuous. The conclusion, which quantifies over no indices, is also empty.
- : the sum condition says , and the choice is always index . The hypotheses give , and the conclusion claims .
- : excluded by the hypothesis . It would read anyway.
- Coupling between sequences: nothing ties or to any underlying process beyond hypotheses 3–5. The claim covers every pair that satisfies them, including counts that grow arbitrarily fast.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.