Documentation

CslibFrontier.Foundations.Analysis.RootError

Root errors and the homogeneous loss #

The estimators of the OpenAI preprint measure the error of a nonnegative quantity by the difference of s-th roots, |H^{1/s} - H'^{1/s}|, rather than by |H - H'| [OpenAI2026LogSpace, Sections 5.6 and 7.3]. This file collects the scalar facts behind that choice.

Ordinary versus root error [OpenAI2026LogSpace, (5.21)]. For 0 ≤ z, w ≤ C, |z - w| ≤ s C^{(s-1)/s} |z^{1/s} - w^{1/s}| (Cslib.abs_sub_le_mul_abs_rpow_inv_sub).

The homogeneous loss [OpenAI2026LogSpace, (7.6), Lemma 7.2]. For nonnegative H, H', L(H, H') = |H - H'|^s / (H + H')^{s-1} (Cslib.homogeneousLoss; for s ≥ 1, Lean's division by zero gives the preprint's value 0 at H = H' = 0). It is homogeneous of degree one. It is comparable to the root error, |H^{1/s} - H'^{1/s}|^s / 2^{s-1} ≤ L(H, H') ≤ s^s |H^{1/s} - H'^{1/s}|^s (Cslib.rpow_inv_sub_pow_le_homogeneousLoss, Cslib.homogeneousLoss_le_rpow_inv_sub_pow). Unlike the root error, it contracts under nonnegative mixtures (Cslib.homogeneousLoss_sum_le), so it passes through conditional expectations. Finally it controls a clipped relative error: if 0 ≤ H ≤ C₀ G, then for every a > 0 and H' ≥ 0, a · min (1, |H - H'| / (a + G))^s ≤ 2 (3 C₀ + 3)^{s-1} L(H, H') (Cslib.mul_min_pow_le_homogeneousLoss, (7.7)).

Main definitions #

Main results #

References #

theorem Cslib.abs_sub_le_mul_abs_rpow_inv_sub {s : ℕ} (hs : s ≠ 0) {z w C : ℝ} (hz : 0 ≤ z) (hw : 0 ≤ w) (hzC : z ≤ C) (hwC : w ≤ C) :
|z - w| ≤ ↑s * C ^ ((↑s - 1) / ↑s) * |z ^ (↑s)⁻¹ - w ^ (↑s)⁻¹|

Ordinary error is controlled by root error [OpenAI2026LogSpace, (5.21)]. For 0 ≤ z, w ≤ C and s ≥ 1, |z - w| ≤ s C^{(s-1)/s} |z^{1/s} - w^{1/s}|.

theorem Cslib.abs_sub_le_four_mul_root_lipschitz {f : ℝ → ℝ} {L : NNReal} (hf : ∀ (z : ℝ), f z ∈ Set.Icc 0 1) (hL : LipschitzWith L fun (z : ℝ) => f z ^ 4⁻¹) (a b : ℝ) :
|f a - f b| ≤ 4 * ↑L * |a - b|

Bounded root regularity implies ordinary regularity, using the existing scalar root-error comparison at cap one. The factor four is explicit.

noncomputable def Cslib.homogeneousLoss (s : ℕ) (H H' : ℝ) :

The homogeneous loss L(H, H') = |H - H'|^s / (H + H')^{s-1} of the OpenAI preprint [OpenAI2026LogSpace, (7.6)]. On nonnegative arguments with s ≥ 1 it agrees with the preprint's definition, which sets L(0, 0) = 0.

theorem Cslib.homogeneousLoss_nonneg {s : ℕ} {H H' : ℝ} (hH : 0 ≤ H) (hH' : 0 ≤ H') :
@[simp]
theorem Cslib.homogeneousLoss_self {s : ℕ} (hs : s ≠ 0) (H : ℝ) :
theorem Cslib.homogeneousLoss_mul {s : ℕ} (hs : s ≠ 0) {c : ℝ} (hc : 0 ≤ c) (H H' : ℝ) :
homogeneousLoss s (c * H) (c * H') = c * homogeneousLoss s H H'

The loss is homogeneous of degree one.

theorem Cslib.rpow_inv_sub_pow_le_homogeneousLoss {s : ℕ} {H H' : ℝ} (hs : s ≠ 0) (hH : 0 ≤ H) (hH' : 0 ≤ H') :
|H ^ (↑s)⁻¹ - H' ^ (↑s)⁻¹| ^ s ≤ 2 ^ (s - 1) * homogeneousLoss s H H'

The homogeneous loss bounds the root error from above [OpenAI2026LogSpace, Lemma 7.2].

theorem Cslib.homogeneousLoss_le_rpow_inv_sub_pow {s : ℕ} {H H' : ℝ} (hs : s ≠ 0) (hH : 0 ≤ H) (hH' : 0 ≤ H') :
homogeneousLoss s H H' ≤ ↑s ^ s * |H ^ (↑s)⁻¹ - H' ^ (↑s)⁻¹| ^ s

The root error bounds the homogeneous loss from above [OpenAI2026LogSpace, Lemma 7.2].

theorem Cslib.homogeneousLoss_sum_le {s : ℕ} {ι : Type u_1} (t : Finset ι) (hs : s ≠ 0) {w F F' : ι → ℝ} (hw : ∀ i ∈ t, 0 ≤ w i) (hF : ∀ i ∈ t, 0 ≤ F i) (hF' : ∀ i ∈ t, 0 ≤ F' i) :
homogeneousLoss s (∑ i ∈ t, w i * F i) (∑ i ∈ t, w i * F' i) ≤ ∑ i ∈ t, w i * homogeneousLoss s (F i) (F' i)

Mixture contraction [OpenAI2026LogSpace, Lemma 7.2]: the homogeneous loss of two nonnegative mixtures is at most the mixture of the losses. With unit weights this is subadditivity over finite sums.

theorem Cslib.mul_min_pow_le_homogeneousLoss {s : ℕ} {H H' : ℝ} (hs : s ≠ 0) {C₀ G a : ℝ} (hC₀ : 0 ≤ C₀) (hG : 0 ≤ G) (ha : 0 < a) (hH : 0 ≤ H) (hHG : H ≤ C₀ * G) (hH' : 0 ≤ H') :
a * min 1 (|H - H'| / (a + G)) ^ s ≤ 2 * (3 * C₀ + 3) ^ (s - 1) * homogeneousLoss s H H'

The clipped relative error [OpenAI2026LogSpace, (7.7)]. If 0 ≤ H ≤ C₀ G, then for every a > 0 and H' ≥ 0, a · min (1, |H - H'| / (a + G))^s ≤ 2 (3 C₀ + 3)^{s-1} L(H, H').