Orthogonality of martingale increments (finite discrete form)
ProvedKServer.martingale_second_momentFor a finite discrete martingale difference sequence with conditional variances (in the atom-encoded filtration model IsDiscreteMartingale), the second moment of the final partial sum is the expected total conditional variance:
Role
The orthogonality of martingale increments — cross terms vanish because is measurable at time . In the Bubeck–Coester–Rabani stage-2a analysis this identifies the second moment of the stopped left-right imbalance with the accumulated conditional variance, which the stopping rule pins to a prescribed window; it is one half of the elementary anti-concentration argument replacing Ibragimov's martingale Berry–Esseen inequality.
Formalization note
The proof is a finite induction with a fiberwise conditioning lemma: sums over split over the atoms of , where time--measurable factors are constant.
import Mathlib import Definitions.Def_KServer_discrete_martingale
namespace KServer
theorem martingale_second_moment {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
{P : Ω → ℝ} {N : ℕ} {hist : ℕ → Ω → ℕ} {X v : ℕ → Ω → ℝ}
(H : IsDiscreteMartingale P N hist X v) :
∑ ω, P ω * (mgSum X N ω) ^ 2 = ∑ ω, P ω * (∑ j ∈ Finset.range N, v j ω) := by sorry
end KServer