Exact second and fourth moment identities for a balanced race
ProvedKServer.race_kernel_momentsLet be a finite set, let be real weights, and let be real-valued arrays for . Suppose , every denominator is nonzero for , and for every real test function the averaged transition identity holds:
Then the terminal second and fourth moments satisfy the exact identities
Every term inside a weighted sum is evaluated at the same outcome . These formulas turn terminal-moment conditions into sums of local race quantities. When the weights are probabilities and the two step sizes are nonnegative, the transition is the balanced left/right race used by BCR. The fourth-moment formula retains the asymmetric cubic contribution.
Formalization Note The theorem is algebraic: it does not need positivity or normalization of the weights, or positivity of the step sizes. It includes . The averaged transition identity is the exact hypothesis; no stronger filtration-adaptedness claim is implicit.
import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Data.Real.Basic import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.Ring set_option autoImplicit false open scoped BigOperators
theorem KServer.race_kernel_moments {Ω : Type*} [Fintype Ω] (P : Ω → ℝ)
(S L R : ℕ → Ω → ℝ) (n : ℕ) (hzero : ∀ ω, S 0 ω = 0)
(hden : ∀ j < n, ∀ ω, L j ω + R j ω ≠ 0)
(hstep : ∀ j < n, ∀ f : ℝ → ℝ,
(∑ ω, P ω * f (S (j + 1) ω)) =
∑ ω, P ω * (R j ω / (L j ω + R j ω) * f (S j ω + L j ω) +
L j ω / (L j ω + R j ω) * f (S j ω - R j ω))) :
(∑ ω, P ω * S n ω ^ 2) = ∑ j ∈ Finset.range n, ∑ ω, P ω * (L j ω * R j ω) ∧
(∑ ω, P ω * S n ω ^ 4) = ∑ j ∈ Finset.range n, ∑ ω,
P ω * (L j ω * R j ω * (6 * S j ω ^ 2 + 4 * S j ω * (L j ω - R j ω) +
L j ω ^ 2 - L j ω * R j ω + R j ω ^ 2)) := by sorry