Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The Beck--Fiala theorem: discrepancy at most 2t−12t-12t−1

Proved
Komlos.beck_fiala

by Shuze Chen · Sep 3, 2026 · Mathlib 0df444a (Lean v4.33.1)

beck-fialadiscrepancyset-systems

(Beck--Fiala 1981.) Let AAA be an m×nm \times nm×n matrix with entries in {0,1}\{0, 1\}{0,1} — the incidence matrix of mmm sets over nnn elements — in which every column has at most t≥1t \ge 1t≥1 ones: every element belongs to at most ttt sets. Then there are signs εj∈{±1}\varepsilon_j \in \{\pm 1\}εj​∈{±1} with

∣∑j=1nAij εj∣≤2t−1for every set i.\Big|\sum_{j=1}^{n} A_{ij}\,\varepsilon_j\Big| \le 2t - 1 \qquad \text{for every set } i.​j=1∑n​Aij​εj​​≤2t−1for every set i.

The bound depends only on the degree ttt, not on mmm or nnn. The hypothesis t≥1t \ge 1t≥1 is necessary for the formal statement (a degree-000 system has discrepancy 000, but 2t−12t-12t−1 would be −1-1−1).

Preamble
import Mathlib
import Definitions.Def_Komlos_model
Formal statement
namespace Komlos

theorem beck_fiala (t n m : ℕ) (ht : 1 ≤ t) (A : Fin m → Fin n → ℝ)
    (h01 : ∀ i j, A i j = 0 ∨ A i j = 1)
    (hdeg : ∀ j, ({i | A i j = 1} : Finset (Fin m)).card ≤ t) :
    ∃ ε : Fin n → ℝ, IsSignVector ε ∧
      ∀ i, |∑ j, A i j * ε j| ≤ 2 * (t : ℝ) - 1 := by sorry

end Komlos
Source
Beck--Fiala, "Integer-making" theorems, Discrete Applied Mathematics 3 (1981) 1-8, Theorem: disc at most 2t-1 for degree-t set systems, https://doi.org/10.1016/0166-218X(81)90022-6
Read-back

What the Lean code literally says, in plain math · claude-fable-5

Read-back of Komlos.beck_fiala.

The statement quantifies over three natural numbers t,n,mt, n, mt,n,m (any of which may be 000, except that ttt is constrained by a hypothesis below), a hypothesis 1≤t1 \le t1≤t, and a real matrix AAA with mmm rows and nnn columns, i.e. a function assigning a real number Ai,jA_{i,j}Ai,j​ to each row index i∈{0,…,m−1}i \in \{0, \dots, m-1\}i∈{0,…,m−1} and column index j∈{0,…,n−1}j \in \{0, \dots, n-1\}j∈{0,…,n−1}. It assumes:

  • (0/1 entries) for every row iii and column jjj, either Ai,j=0A_{i,j} = 0Ai,j​=0 or Ai,j=1A_{i,j} = 1Ai,j​=1;
  • (column degree bound) for every column jjj, the number of row indices iii with Ai,j=1A_{i,j} = 1Ai,j​=1 is at most ttt.

Under these hypotheses it asserts the existence of a vector ε=(ε0,…,εn−1)\varepsilon = (\varepsilon_0, \dots, \varepsilon_{n-1})ε=(ε0​,…,εn−1​) of real numbers which is a sign vector — here this is the unfolded content of the custom predicate IsSignVector, meaning that for every index jjj, either εj=1\varepsilon_j = 1εj​=1 or εj=−1\varepsilon_j = -1εj​=−1 — such that for every row iii,

∣∑j=0n−1Ai,j εj∣  ≤  2t−1,\left| \sum_{j=0}^{n-1} A_{i,j}\, \varepsilon_j \right| \;\le\; 2t - 1,​j=0∑n−1​Ai,j​εj​​≤2t−1,

where the bound is the non-strict inequality ≤\le≤, the sum ranges over all nnn columns, and 2t−12t - 12t−1 is computed in the real numbers after coercing the natural number ttt (so no truncated natural-number subtraction occurs; since 1≤t1 \le t1≤t, the bound is at least 111).

Degenerate cases silently included by the quantifiers: if m=0m = 0m=0 there are no rows, so the final condition on rows holds vacuously (any sign vector works); if n=0n = 0n=0 the sign vector is the empty vector, every sum is the empty sum 000, and the bound 0≤2t−10 \le 2t - 10≤2t−1 holds since t≥1t \ge 1t≥1. Nothing in the statement requires the rows (viewed as sets of columns) to be distinct or nonempty, and the hypothesis 1≤t1 \le t1≤t excludes only the case t=0t = 0t=0. The declaration is stated with its proof omitted (sorry), so the file records the claim, not a completed proof.

Human review
  • Endorsed by Community (Bot) · Sep 3, 2026

  • Endorsed by Shuze Chen · Sep 3, 2026

    Confirmed by the mission captain (proposal self-audit).

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, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me