The query model for Fradin et al., Theorem 3.1
DefinitionFradinV2Theorem31Modelheavy-tailed-noiselower-boundsstochastic-optimization
Defines the source's zero-respecting optimization protocol with a shared fresh sample in each round, the response-only risk, and the worst-case number of rounds. The stationarity criterion uses the first slot.
Definition code
import Mathlib
set_option autoImplicit false
/-
MIT License
Copyright (c) 2026 Zhixiao Xiong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-/
-- From HeavyTailedNoise.Model.Basic
section
/-!
The shared gradient-only finite-budget interface. This file states no lower-bound theorem.
`N` counts returned vectors; the arbitrary output is a further decision with no response.
-/
open MeasureTheory
noncomputable section
namespace HeavyTailedNoise
abbrev Point (d : ℕ) := EuclideanSpace ℝ (Fin d)
/-- `F(0) - inf F ≤ Δ` is encoded as the equivalent pointwise inequality. -/
structure Objective (d : ℕ) (Δ : ℝ) where
dimension_pos : 0 < d
value : Point d → ℝ
grad : Point d → Point d
hasGradientAt : ∀ x, HasGradientAt value (grad x) x
continuous_grad : Continuous grad
gap : ∀ x, value 0 - value x ≤ Δ
/-- The private seed is not an observation. A call returns one vector only. -/
structure GradientOracle (d : ℕ) (Seed : Type*) [MeasurableSpace Seed] where
law : Measure Seed
law_probability : IsProbabilityMeasure law
response : Point d → Seed → Point d
measurable_response : Measurable (fun z : Point d × Seed => response z.1 z.2)
/-- Finite `q` only. Moment bounds are written without taking the positive `p`/`q` root. -/
structure Admissible (d : ℕ) (Seed : Type*) [MeasurableSpace Seed]
(p q Δ σ Lbar : ℝ) where
objective : Objective d Δ
oracle : GradientOracle d Seed
p_range : 1 < p ∧ p ≤ 2
q_range : 1 ≤ q
delta_pos : 0 < Δ
sigma_nonneg : 0 ≤ σ
Lbar_pos : 0 < Lbar
integrable_response : ∀ x, Integrable (oracle.response x) oracle.law
unbiased : ∀ x, (∫ ξ, oracle.response x ξ ∂oracle.law) = objective.grad x
centered_moment : ∀ x,
(∫⁻ ξ, ENNReal.ofReal (‖oracle.response x ξ - objective.grad x‖ ^ p) ∂oracle.law)
≤ ENNReal.ofReal (σ ^ p)
same_seed_increment : ∀ x y,
(∫⁻ ξ, ENNReal.ofReal (‖oracle.response x ξ - oracle.response y ξ‖ ^ q)
∂oracle.law) ≤ ENNReal.ofReal ((Lbar * ‖x - y‖) ^ q)
/-- Independent identical fresh seeds across the `N` responsive decisions. -/
def freshSeedLaw {d : ℕ} {Seed : Type*} [MeasurableSpace Seed]
(O : GradientOracle d Seed) (N : ℕ) : Measure (Fin N → Seed) :=
Measure.pi (fun _ => O.law)
end HeavyTailedNoise
end
-- From HeavyTailedNoise.Lower.Fradin.Parameters
section
/-! Public first-order scaling. The reveal rate handles zero noise explicitly:
S≤c uses the noiseless rate 1, so no inverse of zero defines an oracle law. -/
namespace HeavyTailedNoise.Fradin
noncomputable section
set_option autoImplicit false
def tailExponent (p : ℝ) : ℝ := p / (p-1)
end
end HeavyTailedNoise.Fradin
end
-- From HeavyTailedNoise.Lower.Fradin.Protocol
section
/-! First-order shared-seed batch protocol for Fradin et al., arXiv:2512.18713v2.
The observed value is the population value F(x), not a sampled loss or a seed.
`n` counts completed rounds; the next batch is decision round n+1, with no response.
-/
namespace HeavyTailedNoise.Fradin
open MeasureTheory
noncomputable section
set_option autoImplicit false
universe u v
abbrev Batch (d K : ℕ) := Fin K → Point d
abbrev BatchRecord (d K : ℕ) := Fin K → Point d × (ℝ × Point d)
abbrev Transcript (d K n : ℕ) := Fin n → BatchRecord d K
/-- Only observation structure is added to the existing gradient oracle. -/
structure FirstOrderOracle (d : ℕ) (Seed : Type*) [MeasurableSpace Seed] where
gradient : GradientOracle d Seed
value : Point d → ℝ
measurable_value : Measurable value
def FirstOrderOracle.ofAdmissible {d : ℕ} {Seed : Type*} [MeasurableSpace Seed]
{p q Δ σ L : ℝ} (I : Admissible d Seed p q Δ σ L) : FirstOrderOracle d Seed where
gradient := I.oracle
value := I.objective.value
measurable_value := (continuous_iff_continuousAt.mpr
(fun x => (I.objective.hasGradientAt x).continuousAt)).measurable
/-- An arbitrary measurable private seed and every full-history batch rule. -/
structure Algorithm (d K : ℕ) (Private : Type*) [MeasurableSpace Private] where
privateLaw : Measure Private
private_probability : IsProbabilityMeasure privateLaw
decide : (n : ℕ) → Private → Transcript d K n → Batch d K
measurable_decide : ∀ n, Measurable
(fun z : Private × Transcript d K n => decide n z.1 z.2)
/-- All K points are chosen before the same seed is evaluated at any point. -/
def runTranscript {d K : ℕ} {Seed Private : Type*}
[MeasurableSpace Seed] [MeasurableSpace Private]
(O : FirstOrderOracle d Seed) (A : Algorithm d K Private) (r : Private) :
(n : ℕ) → (Fin n → Seed) → Transcript d K n
| 0, _ => fun i => i.elim0
| n+1, seeds =>
let h := runTranscript O A r n (fun i => seeds i.castSucc)
let x := A.decide n r h
Fin.snoc h (fun k => (x k, O.value (x k),
O.gradient.response (x k) (seeds (Fin.last n))))
/-- The first-order oracle class of Fradin v2, Definition B.1, before imposing
moment, smoothness, or initial-gap restrictions. This predicate includes every
continuously differentiable population value with an integrable unbiased oracle. -/
def FirstOrderOracle.IsUnbiased {d : ℕ} {Seed : Type u} [MeasurableSpace Seed]
(O : FirstOrderOracle d Seed) : Prop :=
∃ grad : Point d → Point d,
(∀ x, HasGradientAt O.value (grad x) x) ∧ Continuous grad ∧
(∀ x, Integrable (O.gradient.response x) O.gradient.law) ∧
(∀ x, (∫ ξ, O.gradient.response x ξ ∂O.gradient.law) = grad x)
end
end HeavyTailedNoise.Fradin
end
-- From HeavyTailedNoise.Lower.Fradin.Representation
section
/-!
Response-only algorithms from Fradin v2 B.1.3 and the canonical query-record
representation use the same objective, oracle and iid runtime. An algorithm's
own queries are reconstructed from its private seed and past observations.
The reconstruction has no oracle or oracle-seed argument. Equality with the
canonical algorithm is asserted on actual runs, not on unreachable histories.
The first-slot stationarity normalization is the same in both representations.
-/
namespace HeavyTailedNoise.Fradin
open MeasureTheory
noncomputable section
set_option autoImplicit false
universe u v
abbrev ObservationTranscript (d K n : ℕ) := Fin n → Fin K → ℝ × Point d
def eraseQueries {d K n : ℕ} (h : Transcript d K n) : ObservationTranscript d K n :=
fun j k => (h j k).2
theorem measurable_eraseQueries (d K n : ℕ) :
Measurable (eraseQueries (d := d) (K := K) (n := n)) :=
measurable_pi_iff.mpr fun j => measurable_pi_iff.mpr fun k =>
measurable_snd.comp ((measurable_pi_apply k).comp (measurable_pi_apply j))
/-- The source decision maps see only past population values and gradients. -/
structure ObservedAlgorithm (d K : ℕ) (Private : Type v) [MeasurableSpace Private] where
privateLaw : Measure Private
private_probability : IsProbabilityMeasure privateLaw
decide : (n : ℕ) → Private → ObservationTranscript d K n → Batch d K
measurable_decide : ∀ n, Measurable
(fun z : Private × ObservationTranscript d K n => decide n z.1 z.2)
/-- Forget the query component before applying each original decision map. -/
def ObservedAlgorithm.toAlgorithm {d K : ℕ} {Private : Type v}
[MeasurableSpace Private] (B : ObservedAlgorithm d K Private) : Algorithm d K Private where
privateLaw := B.privateLaw
private_probability := B.private_probability
decide := fun n r h => B.decide n r (eraseQueries h)
measurable_decide := fun n => (B.measurable_decide n).comp
(measurable_fst.prodMk ((measurable_eraseQueries d K n).comp measurable_snd))
/-- The observation-only runtime is the projection of the one canonical runtime. -/
def observedRun {d K : ℕ} {Seed : Type u} {Private : Type v}
[MeasurableSpace Seed] [MeasurableSpace Private]
(O : FirstOrderOracle d Seed) (B : ObservedAlgorithm d K Private)
(r : Private) (n : ℕ) (seeds : Fin n → Seed) : ObservationTranscript d K n :=
eraseQueries (runTranscript O B.toAlgorithm r n seeds)
def observedNextBatch {d K : ℕ} {Seed : Type u} {Private : Type v}
[MeasurableSpace Seed] [MeasurableSpace Private]
(O : FirstOrderOracle d Seed) (B : ObservedAlgorithm d K Private)
(n : ℕ) (r : Private) (seeds : Fin n → Seed) : Batch d K :=
B.decide n r (observedRun O B r n seeds)
/-- Support condition stated using only the original observed gradients. -/
def ObservedZeroRespectingOn {d K : ℕ} {Seed : Type u} {Private : Type v}
[MeasurableSpace Seed] [MeasurableSpace Private]
(O : FirstOrderOracle d Seed) (B : ObservedAlgorithm d K Private) : Prop :=
∀ n, ∀ᵐ z ∂B.privateLaw.prod (freshSeedLaw O.gradient n),
∀ k : Fin K, ∀ i : Fin d,
observedNextBatch O B n z.1 z.2 k i ≠ 0 →
∃ j : Fin n, ∃ l : Fin K, (observedRun O B z.1 n z.2 j l).2 i ≠ 0
/-- All C¹ populations and integrable unbiased oracles, with explicit universes. -/
def ObservedZeroRespecting {d K : ℕ} {Private : Type v} [MeasurableSpace Private]
(B : ObservedAlgorithm d K Private) : Prop :=
∀ (Seed : Type u) (m : MeasurableSpace Seed),
letI := m
∀ O : FirstOrderOracle d Seed, O.IsUnbiased → ObservedZeroRespectingOn O B
def observedSlotRisk {d K : ℕ} {Seed : Type u} {Private : Type v}
[MeasurableSpace Seed] [MeasurableSpace Private]
{p q Δ σ L : ℝ} (I : Admissible d Seed p q Δ σ L)
(B : ObservedAlgorithm d K Private) (n : ℕ) (k : Fin K) : ENNReal :=
∫⁻ z : Private × (Fin n → Seed),
ENNReal.ofReal ‖I.objective.grad
(observedNextBatch (FirstOrderOracle.ofAdmissible I) B n z.1 z.2 k)‖
∂B.privateLaw.prod (freshSeedLaw I.oracle n)
def observedRoundInfimum {d K : ℕ} {Seed : Type u} {Private : Type v}
[MeasurableSpace Seed] [MeasurableSpace Private]
{p q Δ σ L : ℝ} (I : Admissible d Seed p q Δ σ L)
(B : ObservedAlgorithm d K Private) (ε : ℝ) (k : Fin K) : ENNReal :=
sInf {r : ENNReal | ∃ n : ℕ,
r = ((n+1 : ℕ) : ENNReal) ∧ observedSlotRisk I B n k ≤ ENNReal.ofReal ε}
/-- Infimum over the source's response-only globally zero-respecting algorithms. -/
def observedInstanceRoundComplexity {d K : ℕ} {Seed : Type u} [MeasurableSpace Seed]
{p q Δ σ L : ℝ} (I : Admissible d Seed p q Δ σ L)
(ε : ℝ) (k : Fin K) : ENNReal :=
⨅ (Private : Type v) (m : MeasurableSpace Private),
letI := m
⨅ (B : ObservedAlgorithm d K Private) (_ : ObservedZeroRespecting.{u, v} B),
observedRoundInfimum I B ε k
def observedObjectiveRoundComplexity {d K : ℕ} {p q Δ σ L : ℝ}
(F : Objective d Δ) (ε : ℝ) (k : Fin K) : ENNReal :=
⨆ (Seed : Type u) (m : MeasurableSpace Seed),
letI := m
⨆ (I : Admissible d Seed p q Δ σ L) (_ : I.objective = F),
observedInstanceRoundComplexity.{u, v} I ε k
def observedSourceRoundComplexity (K : ℕ) (hK : 0 < K)
(p q Δ σ L ε : ℝ) : ENNReal :=
⨆ d : ℕ, ⨆ F : Objective d Δ,
observedObjectiveRoundComplexity.{u, v} (p := p) (q := q) (σ := σ) (L := L)
F ε ⟨0, hK⟩
end
end HeavyTailedNoise.Fradin
end
Source
Fradin et al., arXiv v2 Appendix B, https://arxiv.org/abs/2512.18713v2. Code from the pinned v0.4.0 formalization: https://github.com/xiong-zx/heavy-tailed-noise-lean/blob/09dfb3cbe13aca0f791bea3ecb34d1943ae61340/docs/fradin-contract.md