Partial colouring via Kleitman's diameter theorem
ProvedKomlos.partial_coloring_via_kleitmanLet be an matrix with entries in , let be a nonempty set of columns with , let be a natural number with , and let satisfy the budget inequality
where is the binary entropy function (in nats). Then there is a partial colouring , vanishing outside , which colours more than of the columns in ,
and keeps every row balanced to within :
This is a reduction of Spencer's partial-colouring step (the entropy method of J. Spencer, Six standard deviations suffice, 1985) to Kleitman's diameter theorem (kleitman_diameter, submitted separately): a union bound over sub-Gaussian row-sum tail bounds gives a 'good' set of colourings of size at least ; the classical entropy bound on binomial sums (choose_sum_le_exp_mul_binEntropy) shows this exceeds the size of a Hamming ball of radius exactly when the budget inequality holds; Kleitman's theorem then produces two colourings in the good set at Hamming distance greater than , and their difference (divided by 2) is the desired partial colouring, since two row sums each within average to a row sum within .
Formalization Note. This is deliberately not a literal formalization of the captain-curated Komlos.spencer_partial_coloring (whose budget hypothesis is stated with different, sharper constants tuned to Spencer's own numerical schedule) — it is a faithful, independently-derivable reduction with the same conclusion shape and the same combinatorial mechanism, isolating Kleitman's theorem as the single remaining unproved ingredient. The conclusion is phrased with the natural number (colouring more than of ) rather than a real fraction , matching Kleitman's theorem's own output exactly.
import Mathlib open Finset MeasureTheory ProbabilityTheory Real open scoped Classical
namespace Komlos
theorem partial_coloring_via_kleitman
{n : ℕ} (A : Fin n → Fin n → ℝ) (T : Finset (Fin n))
(h01 : ∀ i j, A i j = 0 ∨ A i j = 1) (hT : 0 < T.card)
(s : ℕ) (hs : 2 * s < T.card) (ν : ℝ) (hν : 0 ≤ ν)
(hbudget : (n : ℝ) * 2 * Real.exp (-ν ^ 2 / 2)
< 1 - Real.exp (-(T.card : ℝ) * (Real.log 2 - Real.binEntropy ((s : ℝ) / T.card)))) :
∃ χ : Fin n → ℝ,
(∀ j, χ j = 1 ∨ χ j = -1 ∨ χ j = 0) ∧
(∀ j, j ∉ T → χ j = 0) ∧
2 * s < (T.filter (fun j => χ j ≠ 0)).card ∧
(∀ i, |∑ j ∈ T, A i j * χ j| ≤ ν * Real.sqrt T.card) := by sorry
end Komlos