FormalConjectures/Wikipedia/SixStandardDeviations.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

4 declarations, 3 contain sorry, 0 declared as axioms

Six standard deviations suffice (Spencer's theorem)

Spencer's theorem in discrepancy theory: for every $n$ and every family of $n$ subsets $S_1, \dots, S_n$ of $\{1, \dots, n\}$, there is a colouring $\chi : \{1, \dots, n\} \to \{-1, +1\}$ such that $$\left|\sum_{j \in S_i} \chi(j)\right| \le 6\sqrt{n}$$ for every $i$.

A uniformly random colouring only achieves the bound $O(\sqrt{n \log n})$, so Spencer's theorem ("six standard deviations suffice") is a genuine improvement over the basic probabilistic method; its proof uses a partial-colouring argument based on the entropy method, and the bound $\Theta(\sqrt{n})$ is tight up to the value of the constant. Spencer's original argument is non-constructive; polynomial-time algorithms achieving $O(\sqrt{n})$ were later found by Bansal (2010) and Lovett–Meka (2012).

The Komlós conjecture (the subject of a companion file in this directory) would strengthen this theorem: applied to the incidence vectors of the sets, scaled by $1/\sqrt{n}$, it would give a discrepancy bound $O(\sqrt{n})$ for any number of sets, not just $n$ of them.

References:

Imports (1)
  1. theorem SixStandardDeviations.six_standard_deviations Documented declaration: six_standard_deviations sorry line 63 source

    Source documentation

    Six standard deviations suffice (Spencer, 1985)

    For every $n$ and every family of $n$ subsets $S_1, \dots, S_n$ of $\{1, \dots, n\}$, there is a colouring $\chi : \{1, \dots, n\} \to \{-1, +1\}$ such that $\left|\sum_{j \in S_i} \chi(j)\right| \le 6\sqrt{n}$ for every $i$.

    depends on sorry what this means

    Statement uses: Nat, Fin, Finset, Exists, Real, And, Or, Eq, OfNat.ofNat, Neg.neg, LE.le, abs, Finset.sum, HMul.hMul, Real.sqrt

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    30 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem six_standard_deviations :
        ∀ (n : ℕ) (S : Fin n → Finset (Fin n)),
          ∃ χ : Fin n → ℝ, (∀ j, χ j = 1 ∨ χ j = -1) ∧
            ∀ i, |∑ j ∈ S i, χ j| ≤ 6 * Real.sqrt n := by
    …
  2. theorem SixStandardDeviations.six_standard_deviations.variants.random_bound sorry line 84 source

    depends on sorry what this means

    Statement uses: Exists, Real, And, LT.lt, OfNat.ofNat, Nat, Fin, Finset, Or, Eq, Neg.neg, LE.le, abs, Finset.sum, HMul.hMul, Real.sqrt, Real.log, HAdd.hAdd

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    40 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  3. theorem SixStandardDeviations.six_standard_deviations.variants.universal_bound sorry line 101 source

    depends on sorry what this means

    Statement uses: Exists, Real, And, LT.lt, OfNat.ofNat, Nat, Fin, Finset, Or, Eq, Neg.neg, LE.le, abs, Finset.sum, HMul.hMul, Real.sqrt

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    29 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  4. theorem SixStandardDeviations.six_standard_deviations.variants.zero_sets Sanity check: with no points and no sets ($n = 0$), the empty colouring works and the bound $6\sqrt{0} = 0$ holds vacuously line 112 source

    Source documentation

    Sanity check: with no points and no sets ($n = 0$), the empty colouring works and the bound $6\sqrt{0} = 0$ holds vacuously.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Fin, OfNat.ofNat, Nat, Finset, Exists, Real, And, Or, Eq, Neg.neg, LE.le, abs, Finset.sum, HMul.hMul, Real.sqrt

    Proof uses: Exists.intro, Fin.elim0, And.intro

    32 instances, coercions and auxiliary constants left out.

    theorem six_standard_deviations.variants.zero_sets (S : Fin 0 → Finset (Fin 0)) :
        ∃ χ : Fin 0 → ℝ, (∀ j, χ j = 1 ∨ χ j = -1) ∧
          ∀ i, |∑ j ∈ S i, χ j| ≤ 6 * Real.sqrt 0 :=
    …