Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Spencer's six-deviations bound in the trivial range n≤36n \le 36n≤36

Proved
Komlos.spencer_six_deviations_small

by carlok · Sep 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

combinatoricsdiscrepancyspencer

Spencer's theorem in the trivial range n≤36n \le 36n≤36.

Spencer's "six standard deviations suffice" theorem states that for any n×nn \times nn×n matrix AAA with entries in {0,1}\{0,1\}{0,1} there exist signs εj∈{±1}\varepsilon_j \in \{\pm 1\}εj​∈{±1} with

∣∑j=1nAij εj∣≤6nfor every i.\Big|\sum_{j=1}^{n} A_{ij}\,\varepsilon_j\Big| \le 6\sqrt{n} \qquad \text{for every } i.​j=1∑n​Aij​εj​​≤6n​for every i.

This statement restricts the claim to n≤36n \le 36n≤36, where it holds for a soft reason and requires none of Spencer's partial-colouring machinery. Every row sum of a {0,1}\{0,1\}{0,1}-matrix under the all-ones colouring lies in [0,n][0, n][0,n], so the discrepancy of that colouring is at most nnn; and n≤6nn \le 6\sqrt{n}n≤6n​ precisely when n≤36n \le 36n≤36. The threshold is sharp for this argument: at n=36n = 36n=36 the two bounds coincide (36=63636 = 6\sqrt{36}36=636​), and for n>36n > 36n>36 the trivial colouring no longer suffices, which is exactly where the real content of Spencer's theorem begins.

It is recorded separately because any proof of the general theorem by induction, by dimension reduction, or by the entropy method needs a base range in which the conclusion is available for free, and because it fixes the arithmetic of the constant 666 against the statement.

Preamble
import Mathlib
import Definitions.Def_Komlos_model
Formal statement
namespace Komlos

theorem spencer_six_deviations_small (n : ℕ) (hn : n ≤ 36) (A : Fin n → Fin n → ℝ)
    (h01 : ∀ i j, A i j = 0 ∨ A i j = 1) :
    ∃ ε : Fin n → ℝ, IsSignVector ε ∧
      ∀ i, |∑ j, A i j * ε j| ≤ 6 * Real.sqrt n := by sorry

end Komlos
Source
Base range of J. Spencer, Six standard deviations suffice, Trans. Amer. Math. Soc. 289 (1985), 679-706, Theorem 1 (the 6*sqrt(n) bound). This is the range n <= 36 in which the bound follows from the trivial estimate |sum_j A_ij eps_j| <= n and n <= 6*sqrt(n); it uses none of the partial-colouring argument of that paper. Companion to the platform statement Komlos.spencer_six_deviations.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, licensed under Apache 2.0.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTermsJoin SlackJoin Zulip© 2026 Prove2Me