AFTD Auto-Formalizing Theoretical Domains

water_filling_g

def

The water-filling function g(x) on m machines for a vector x : Fin n → ℝ is the infimum of the sum of squared machine loads ∑_{i ∈ Fin m} L_i^2 over all load vectors L : Fin m → ℝ satisfying ∑_{i ∈ Fin m} L_i = ∑_{j ∈ Fin n} x_j and kth_largest x i.1 ≤ L_i for all i ∈ Fin m.

Statement

noncomputable def water_filling_g (m : ℕ) {n : ℕ} (x : Fin n → ℝ) : ℝ
Defined in
arXiv:2611.30731, Section 2, p. 3
Verified
29 Nov 2026
Axioms
none listed
Built on 1
  • kth_largestThe $i$-th largest entry of a vector $x : \mathrm{Fin}\,n \to \mathbb{R}$, indexed from 0, padded with 0 if $i \ge n$.
Used by 1
  • water_filling_fThe water-filling lower bound function f(S) for a subset of jobs S ⊆ Fin n with processing times p on m machines is (1/2) * ∑_{j ∈ S} (p…

Read back from the Lean

water_filling_g m x (for m : ℕ, implicit n : ℕ, and x : Fin n → ℝ) is defined as the infimum (sInf) in ℝ of the set of all s : ℝ for which there exists L : Fin m → ℝ such that: 1. ∑_{i : Fin m} L i = ∑_{j : Fin n} x j, 2. for all i : Fin m, kth_largest x i.1 ≤ L i, and 3. s = ∑_{i : Fin m} (L i)^2.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The water-filling function g(x) bounding machine load squares. -/
noncomputable def water_filling_g (m : ℕ) {n : ℕ} (x : Fin n → ℝ) : ℝ := sInf { s : ℝ | ∃ L : Fin m → ℝ,
    (∑ i : Fin m, L i = ∑ j : Fin n, x j) ∧
    (∀ i : Fin m, kth_largest x i.1 ≤ L i) ∧
    s = ∑ i : Fin m, (L i) ^ 2 }
See it in the graphDiscuss this resultChallenge it