Spencer's discrepancy theorem, form
Provedspencer_discrepancy_sqrt_n_boundThis is the asymptotic (constant-suppressed) form of Spencer's "six standard deviations suffice" discrepancy theorem, proved via the entropy method exactly as presented in Rothvöß's course notes (Theorem 7 there), rather than with Spencer's original sharp constant .
Let be a positive integer and let be an matrix with entries in , thought of as the incidence matrix of sets over an -element ground set. The claim is that there is a single universal constant (not depending on or ) and a sign vector such that every row sum is controlled:
A uniformly random coloring only achieves discrepancy with high probability; the content of the theorem is that the factor can be removed entirely, for every matrix, at the cost of an unspecified (but -independent) multiplicative constant. This is the qualitative heart of Spencer's discrepancy theorem and the standard entry point for applications that only need an bound rather than the literal constant .
Formalization Note. The sign vector is represented as a function constrained pointwise to , matching the usual -coloring convention; the existential quantifier on is placed outermost so that the SAME constant works uniformly across every and every matrix , which is what makes this an statement rather than a per-instance bound.
import Mathlib open Finset
theorem spencer_discrepancy_sqrt_n_bound :
∃ C : ℝ, ∀ (n : ℕ), 0 < n → ∀ (A : Fin n → Fin n → ℝ),
(∀ i j, A i j = 0 ∨ A i j = 1) →
∃ ε : Fin n → ℝ, (∀ j, ε j = 1 ∨ ε j = -1) ∧
∀ i, |∑ j, A i j * ε j| ≤ C * Real.sqrt (n : ℝ) := by sorry
Confirmed by the mission captain (proposal self-audit).