Documentation

CslibFrontier.Foundations.Analysis.SpecialFunctions.SmoothSwitch

Smooth switches with Lipschitz roots #

A switch χ_{α,β} is a nondecreasing function that vanishes on (-∞, α] and is one on [β, ∞). The stochastic atoms of the OpenAI preprint need switches such that χ_{α,β} ^ (1/s) and (1 - χ_{α,β}) ^ (1/s) are Lipschitz, so that errors in the root metrics of the later estimates propagate linearly through every cutoff [OpenAI2026LogSpace, Section 5.1].

We take Mathlib's Real.smoothTransition, rescaled to [α, β] (Cslib.smoothSwitch). The preprint instead rescales a normalized integral of z^{s-1} (1 - z)^{s-1}; any fixed switch with these properties serves. Every positive power of Real.smoothTransition is again continuously differentiable, since exp (-1/x) ^ p = exp (-1/(x/p)), and it is constant outside [0, 1]. Hence every positive power is Lipschitz (Real.smoothTransition.exists_lipschitzWith_rpow). The complement is the reflection 1 - smoothTransition x = smoothTransition (1 - x) (Real.smoothTransition.one_sub), so its powers are Lipschitz too.

Main definitions #

Main results #

References #

The complement of the smooth transition is its reflection at 1/2.

theorem Real.smoothTransition.exists_lipschitzWith_rpow {p : ℝ} (hp : 0 < p) :
∃ (K : NNReal), LipschitzWith K fun (x : ℝ) => x.smoothTransition ^ p

Every positive power of the smooth transition is Lipschitz.

theorem Real.smoothTransition.exists_lipschitzWith_one_sub_rpow {p : ℝ} (hp : 0 < p) :
∃ (K : NNReal), LipschitzWith K fun (x : ℝ) => (1 - x.smoothTransition) ^ p

Every positive power of the complement of the smooth transition is Lipschitz.

noncomputable def Cslib.smoothSwitch (α β t : ℝ) :

The switch χ_{α,β}: Real.smoothTransition rescaled from [0, 1] to [α, β]. It vanishes on (-∞, α], is one on [β, ∞) and is nondecreasing [OpenAI2026LogSpace, Section 5.1].

theorem Cslib.smoothSwitch_nonneg (α β t : ℝ) :
0 ≤ smoothSwitch α β t
theorem Cslib.smoothSwitch_le_one (α β t : ℝ) :
smoothSwitch α β t ≤ 1
theorem Cslib.smoothSwitch_eq_zero_iff {α β t : ℝ} (hαβ : α < β) :
smoothSwitch α β t = 0 ↔ t ≤ α
theorem Cslib.smoothSwitch_eq_one_iff {α β t : ℝ} (hαβ : α < β) :
smoothSwitch α β t = 1 ↔ β ≤ t
theorem Cslib.smoothSwitch_of_le {α β t : ℝ} (hαβ : α < β) (ht : t ≤ α) :
smoothSwitch α β t = 0
theorem Cslib.smoothSwitch_of_ge {α β t : ℝ} (hαβ : α < β) (ht : β ≤ t) :
smoothSwitch α β t = 1
theorem Cslib.monotone_smoothSwitch {α β : ℝ} (hαβ : α ≤ β) :
theorem Cslib.exists_lipschitzWith_smoothSwitch_rpow {α β : ℝ} (hαβ : α < β) {p : ℝ} (hp : 0 < p) :
∃ (K : NNReal), LipschitzWith K fun (t : ℝ) => smoothSwitch α β t ^ p

Every positive power of a switch is Lipschitz; for p = 1/s this is the root-Lipschitz property of [OpenAI2026LogSpace, Section 5.1].

theorem Cslib.exists_lipschitzWith_one_sub_smoothSwitch_rpow {α β : ℝ} (hαβ : α < β) {p : ℝ} (hp : 0 < p) :
∃ (K : NNReal), LipschitzWith K fun (t : ℝ) => (1 - smoothSwitch α β t) ^ p

Every positive power of the complement of a switch is Lipschitz.