The mathematics of finite and discrete structures — counting the arrangements of a set, deciding when a configuration meeting prescribed constraints can exist, and characterizing the patterns such structures are forced to contain. It encompasses enumerative and extremal combinatorics, graph theory, design theory, and additive combinatorics, with deep ties to algebra, probability, and computer science.
The Theory of Error-Correcting Codes I: The MacWilliams IdentityTextbook
Motivation
Error-correcting codes protect information against corruption by adding controlled redundancy. For a code, the distribution of Hamming weights records how its words are spread across possible distances from the zero word and determines basic quantities such as its minimum distance. Linear codes also carry an algebraic duality: every linear code C over a finite field has a dual code C⊥ consisting of the words orthogonal to all words of C under the standard coordinatewise bilinear form.
The MacWilliams identity states that the full Hamming-weight distribution of C⊥ is determined by that of C through one linear change of variables. It is the principal result of Chapter 5 of F. J. MacWilliams and N. J. A. Sloane's The Theory of Error-Correcting Codes. The binary identity appears there as Theorem 1, while the arbitrary-finite-field Hamming-weight-enumerator identity formalized here is Theorem 13 on p. 146. The surrounding chapter develops related transformations for complete, Lee, exact, joint, and split weight enumerators, nonlinear-code distance distributions, orthogonal arrays, and Krawtchouk polynomials.
This development isolates the arbitrary-q Hamming identity as a first reusable result. Its declarations are designed to support later formalizations drawn from the same chapter and, more broadly, from the book, without enlarging the present target beyond the MacWilliams identity.
Setting
Let F be a finite field of cardinality q, let ι be a finite coordinate type, and let a word be a function c:ι→F. A linear codeC is an F-linear subspace of the word space. The standard bilinear form is
⟨c,v⟩=i∈ι∑civi,
and the dual code is
C⊥={v:ι→F:⟨c,v⟩=0 for every c∈C}.
The Hamming weightwt(c) is the number of coordinates at which c is nonzero. Writing n=∣ι∣, the homogeneous Hamming weight enumerator of C is the integer-coefficient polynomial
WC(X,Y)=c∈C∑Xn−wt(c)Ywt(c).
Thus the coefficient of Xn−jYj is the number of codewords of weight j. The Lean development represents this object symbolically in MvPolynomial (Fin 2) ℤ; its complex-valued form is obtained by evaluation, so the symbolic and evaluated presentations share a single definition.
Formalization targets
Character orthogonality over a code
For a primitive complex additive character ψ of F, define
SC(v)=c∈C∑ψ(⟨c,v⟩).
The first milestone states that SC(v)=∣C∣ when v∈C⊥ and SC(v)=0 otherwise. The binary statement occurs as Problem 13 on p. 134 of MacWilliams--Sloane; Lemmas 9 and 11 on pp. 143--145 give the finite-field character and Fourier formulation.
Coordinatewise Hamming transform
For every word c and all X,Y∈C, the second milestone records the full character-weighted transform of the Hamming monomial:
This is a separately reusable formulation of the coordinate calculation appearing in the proofs of Theorems 10 and 13 on pp. 144--146.
MacWilliams identity
The capstone is the following equality of integer polynomials:
∣C∣WC⊥(X,Y)=WC(X+(q−1)Y,X−Y).
This is the denominator-free form of Chapter 5, Theorem 13. After evaluation over a characteristic-zero field it is equivalent to the normalized textbook formula
WC⊥(X,Y)=∣C∣1WC(X+(q−1)Y,X−Y).
Significance
The identity turns duality into an enumerative operation: knowing the weight enumerator of a linear code determines the weight enumerator of its dual. It supplies immediate consistency restrictions on possible weight distributions and is a basic input to the study of self-dual codes, Krawtchouk transforms, association schemes, invariant-theoretic properties of enumerators, and linear-programming bounds.
The formalization contributes a small common interface for finite-field words, linear codes, standard duals, and homogeneous Hamming weight enumerators. These declarations are absent from the selected Mathlib environment even though Mathlib already provides Hamming weight, finite-field algebra, additive characters, finite sums, bilinear-form orthogonals, and multivariate polynomials. Establishing the interface and its first central theorem makes those general libraries directly usable for subsequent coding-theory developments.
Difficulty
The paper statement is short, but its formal representations live in several different layers. Codes are submodules whose elements are subtypes; Hamming weight is a natural-number count; duality is expressed through a bilinear form; character identities take values in C; and the final result is most reusable as an equality of symbolic polynomials over Z. The central formalization burden is maintaining exact agreement while transporting the same enumerative data among these layers, including finite instances for codeword subtypes and the natural-number exponents of the homogeneous monomials.
The theorem must also retain the genuine finite-field statement. Replacing the code by an arbitrary finite set, hard-coding the binary field, defining the dual by its expected cardinality, or proving only equality at one chosen pair of evaluation points would not establish the target.
Formalization scope
The coordinate type is an arbitrary finite type rather than only Fin n; its cardinality plays the role of the code length. A word is CodingTheory.Word F ι := ι → F, and a linear code is a submodule of this common word space. This representation provides the linear structure and canonical orthogonal dual required here while leaving room for a future nonlinear-code type built from finite sets of the same words.
The polynomial CodingTheory.hammingWeightEnumeratorPolynomial has coefficients in Z and variables indexed by Fin 2. Variable 0 records zero coordinates and variable 1 records nonzero coordinates. Its name explicitly identifies the Hamming enumerator, leaving separate stable names available for future complete, Lee, exact, joint, and split weight enumerators. Those later enumerators should be added as new declarations and connected to this one by specialization theorems rather than replacing it.
The standard dual is bilinear, not Hermitian. The code alphabet may be any finite field. The zero code, full code, and empty coordinate type are included; in the empty-coordinate case there is one word of weight zero and the identity reduces to 1=1. The present mission does not formalize nonlinear codes, complete or other generalized enumerators, orthogonal arrays, or Krawtchouk-polynomial theory. It establishes only the definitions and two character-sum milestones required for the Hamming MacWilliams identity, with a namespace and module boundary intended for reuse by later missions in the textbook series.
Gross–Yellen Graph Theory I: Cayley's Tree FormulaTextbook
Motivation
Counting the trees on a fixed, labeled vertex set is one of the oldest enumeration
problems in graph theory. Cayley stated the count in 1889 while enumerating isomers of
saturated hydrocarbons — each tree corresponds to a possible carbon skeleton — and the
same number reappears throughout combinatorics as the number of spanning trees of the
complete graph Kn, a special case of Kirchhoff's Matrix–Tree Theorem, and as the base
case against which more refined tree-counting results (trees with a prescribed degree
sequence, forests, spanning trees of general graphs) are measured.
Several independent proofs of the count are known — a direct recursive argument, a
determinant computation via the Matrix–Tree Theorem, a double-counting argument on
increasing trees — and each exposes a different piece of structure. This mission
formalizes the proof via Prüfer sequences, due to Prüfer (1918): an explicit,
computable bijection between labeled trees and certain finite sequences, presented here
following Gross and Yellen, Graph Theory and Its Applications, 3rd ed. (CRC Press,
2018), Section 3.7, pp. 157–162.
Setting
Fix n≥2 and take the vertex set to be {1,…,n} (formalized as Fin n).
A labeled tree on n vertices is a simple graph T on this vertex set that is
connected and acyclic (Mathlib's SimpleGraph.IsTree). Two labeled trees are the same
exactly when their edge sets coincide — the two 4-vertex trees in Figure 3.7.1 of the
source are both paths but are different labeled trees, since the labels sit on
different vertices.
A Prüfer sequence of length n−2 is any sequence (s1,…,sn−2) of
labels drawn from {1,…,n}, repetitions allowed (so there are nn−2 of
them, by the rule of product).
The encoding of a tree T (Algorithm 3.7.1, p. 157) builds its Prüfer sequence by
repeating, n−2 times: find the leaf (degree-one vertex) with the smallest label among
those not yet removed, record the label of its neighbor, then delete that leaf. The
decoding of a sequence (Algorithm 3.7.3, p. 159) reverses this: it rebuilds the
tree edge by edge, at each step joining the smallest label not yet used and not
appearing later in the sequence to the next label in the sequence, finishing by joining
the two labels left over.
Formalization targets
Goal — Cayley's Tree Formula (Theorem 3.7.5, p. 162)
Nat.card{T:SimpleGraph(Fin n)∣T.IsTree}=nn−2,n≥2.
This is the weakest stable statement: it is exactly the count Cayley identified, phrased
without reference to any particular proof method, so it is not tied to properties of
Prüfer sequences beyond what is needed to establish the count.
Significance
The identity itself is foundational: it is the base case of Kirchhoff's Matrix–Tree
Theorem (which computes the analogous count for spanning trees of an arbitrary graph as
a cofactor of its Laplacian) and it appears as an ingredient in random graph theory
(counting spanning trees of Kn bounds the number of ways a random graph process can
build a tree) and in the analysis of algorithms on trees, where the Prüfer encoding
itself is used as a compact serialization of a labeled tree.
The result has been proved by hand for over a century, and its most classical proof (the
one formalized here) has not, to this project's knowledge, appeared as a
machine-checked Lean proof; Mathlib's Combinatorics.SimpleGraph library has the tree
and acyclicity infrastructure this mission builds on, but not the Prüfer bijection or
the count itself. Formalizing it here means constructing the encoding and decoding maps
explicitly as computable, total recursive functions, and proving they are mutually
inverse — the mission's four milestones below are exactly the four supporting results
the source uses for this.
Difficulty
The obvious first attempt is to define the encoding by structural recursion, peeling one
leaf per step, but this immediately runs into a dependent-typing obstacle: after
deleting a vertex, the "remaining graph" naturally lives on a smaller vertex type, so
a naive recursive definition changes type at every step and the final sequence's type
(length n−2) is not visible to the recursion by construction. The formalization here
sidesteps this by keeping the ambient vertex type fixed at Fin n throughout and
tracking the shrinking set of "active" vertices as an ordinary Finset (Fin n)
parameter, so the recursion is on a natural number step-counter rather than on the type
itself; the price is that every step's "leaf" and "neighbor" must be picked out by an
explicit Finset.filter/Finset.min computation whose well-definedness (there is
always a smallest active leaf, and it always has a unique active neighbor) is exactly
the content of Propositions 3.7.1 and 3.7.3 below, rather than something the type system
gives for free. The inverse direction has the dual issue in reverse: decoding recurses
structurally on the sequence while tracking a shrinking label set, and showing the two
recursions undo each other (Proposition 3.7.4) requires the same induction run in both
directions simultaneously.
Formalization scope
Trees are SimpleGraph (Fin n) satisfying Mathlib's SimpleGraph.IsTree; no alternate,
weaker notion of "tree" is used. Prüfer sequences are functions Fin (n - 2) → Fin n
(equivalently, by Fintype.card_fun, exactly the nn−2 count needed) rather than
List or Vector, so that the final counting step is immediate once the bijection is
established. The encoding and decoding functions (pruferEncode, pruferDecode) are
supplied as noncomputable definitions in Definitions.Def_GYGraphTheory — noncomputable
only because Prop-level decidability of a general SimpleGraph.Adj is classical, not
because the algorithm is non-constructive; every step is the literal Prüfer procedure,
junk-valued (defaulting to label 0) outside its intended domain in exactly the way a
hand proof would say "this step is meaningless once fewer than two active vertices
remain." The four milestones give the precise faithful statements of the source's
Propositions 3.7.1, Corollary 3.7.2, Proposition 3.7.3, and Proposition 3.7.4; the goal
theorem is the immediate corollary once all four are in hand, via Fintype.card_congr
and Fintype.card_fun. A trivializing formalization is not available here: IsTree is
Mathlib's standard, non-vacuous notion, and the milestones pin down pruferEncode
and pruferDecode to the source's specific algorithm rather than leaving the bijection's
existence as a free black box. Beyond the four milestones, a full development needs:
basic Finset/List manipulation lemmas relating pruferPeel's step-indexed recursion
to pruferDecodeAux's list-indexed recursion (reusable in any future mission touching
Prüfer-style encodings); and the final cardinality argument tying the bijection to
n ^ (n - 2). Contributions connecting this formula to Mathlib's general Matrix–Tree
machinery (if and when it exists) would be a natural, welcome extension but are out of
scope for this mission.
Selected references
A. Cayley, A theorem on trees, Quart. J. Math. 23 (1889), 376–378.
H. Prüfer, Neuer Beweis eines Satzes über Permutationen, Archiv der Mathematischen
Physik 27 (1918), 742–744.
J.L. Gross and J. Yellen, Graph Theory and Its Applications, 3rd ed., CRC Press,
2018, Section 3.7 "Counting Labeled Trees: Prüfer Encoding", pp. 157–162.
8 thms2 active usersReviewed
🏆Completed
Captain: wamlart
Discrete Mathematics—Lecture Notes I: Capacitated Hall MatchingTextbook
Assigning distinct resources under compatibility constraints
A finite allocation problem begins with a list of permitted choices. Each recipient may use some resources but not others, and a resource may be assigned at most once. Knowing that every recipient has an available resource is insufficient: several recipients may all depend on the same small pool. A useful theorem must decide whether the compatibility pattern permits all requirements to be met simultaneously.
This mission develops the matching results in the chapter on systems of distinct representatives in D. Yogeshwaran's Discrete Mathematics—Lecture Notes, §6.1. Its endpoint allows different recipients to require different numbers of resources. The classical one-resource problem, the regular-graph case, and the case in which a bounded number of assignments may remain unfilled are retained as separate source-numbered results. The project concerns established theorems, not a new conjecture about the existence of matchings.
Graphs, matchings, and demands
A finite simple graph consists of a finite set of vertices and unordered pairs of distinct vertices called edges. A bipartition is a pair of disjoint sets L,R whose union is the vertex set, such that every edge joins a vertex in L to a vertex in R. The left vertices represent recipients and the right vertices represent resources. An edge records that the resource is permitted for that recipient. These graph conventions follow Definition 1.1 of the notes.
For a vertex x, the neighbor setNG(x) contains the vertices joined to x. For a set S of vertices, write NG(S)=⋃x∈SNG(x). A matching is an edge set in which no vertex is used twice. It is complete on L if every left vertex is used, and perfect if every vertex is used. A subgraph may retain selected edges of the original graph. Its degree degH(x) counts the retained neighbors of x.
A demand is a natural number dx attached to each x∈L. Unlike a complete ordinary matching, the capstone may assign more than one resource to a recipient. Resources still have capacity one, and a demand may be zero.
The development also includes Exercise 6.3, asserting that a k-regular bipartite graph has a perfect matching when k>0. Proposition 6.4 states the quantitative deficit version:
This statement retains the entire demand function and does not fix a uniform demand, restrict demands to positive values, or replace integral selections by real weights.
The set-theoretic interface is Corollary 6.9. A finite family of arbitrary sets (Ai)i∈I has a system of distinct representatives, meaning an injective choice f(i)∈Ai, exactly when
∀J⊆I,∣J∣≤i∈J⋃Ai.
Only the index family is finite; the sets themselves may be infinite.
What the development provides
The demand criterion characterizes feasibility entirely in terms of the original compatibility graph and the requested multiplicities. Its necessity identifies an obstruction to any assignment, while its sufficiency asserts that no other obstruction exists. The deficit theorem gives a quantitative statement when complete coverage is unavailable. The regular case gives a distinct consequence for graphs described through their degrees, rather than through a separately supplied collection of neighborhood inequalities. These are the respective contents of Exercises 6.3 and 6.5 and Proposition 6.4.
Mathlib already provides finite-family and graph versions of Hall's theorem in its Hall development and graph interface. The source-aligned development therefore reuses established infrastructure. Its additional work consists of connecting exact graph degrees and edge counts to the source statements, retaining the deficit and zero-demand cases, and supplying an arbitrary-set representatives interface. Local proofs of the five theorem statements have been checked in Lean 4.29.0-rc3 with Mathlib 777aaa6.
Where exact formalization is delicate
Independent local choices do not guarantee a matching: different choices can collide at one resource. Replacing distinct selections by nonnegative real allocations would change the conclusion. Counting total demand alone also misses obstructions carried by proper subsets of recipients.
Several representation issues matter even after the mathematics is known. A left-saturating matching need not be perfect. A subgraph's vertex set may omit isolated ambient vertices. Cardinality conventions for infinite sets can turn a superficially plausible formula into a different assertion. Finally, a theorem that assumes all neighborhood inequalities has not established those inequalities merely because a graph is regular. The individual interfaces must distinguish these obligations rather than hide them inside a definition.
Formalization scope
The graph results use finite vertex types and native SimpleGraph and Subgraph objects. Both disjointness and coverage of the bipartition are explicit. Local-finiteness instances supply finite neighbor enumerations; they impose no further restriction on finite graphs. The complete-matching predicate combines the native matching condition with inclusion of the prescribed vertex set.
Degrees in the capstone are cardinalities of finite subgraph neighbor sets. The deficit conclusion counts unordered subgraph edges. Natural subtraction is truncated at zero, an equivalent convention for these nonnegative cardinality lower bounds. Empty graphs, empty index families, and zero demands remain admissible. In the representatives theorem, arbitrary sets are measured by extended cardinality; infinity is never replaced by zero.
The reusable outputs are the source-aligned graph statements, the complete-matching interface, the prescribed-degree equivalence, and the arbitrary-set representatives criterion. Equivalent proofs and clearer reusable interfaces are within scope. Placeholder conclusions, extra assumptions that exclude the difficult cases, and fractional substitutes for the integral capstone are not.
Selected references
D. Yogeshwaran, Discrete Mathematics—Lecture Notes, Indian Statistical Institute Bangalore, HTML edition generated 2025. Chapter 6.1; graph conventions.
Erdős (1947): The Probabilistic Ramsey Lower BoundResearch Paper
Motivation
Ramsey theory asks for the smallest number R(k) such that every graph on R(k) vertices contains either a clique of size k or an independent set of size k. Beyond being one of the oldest problems in extremal combinatorics, Ramsey numbers sit at the junction of combinatorics, probability, and computer science: the two-coloring of edges they quantify is exactly the distinction between a graph and its complement, and their growth controls constructions used in derandomization and in the theory of Boolean functions.
This mission formalizes the paper that started the probabilistic method as a systematic tool: Erdős's 1947 proof that R(k)>2k/2. It is also the natural companion to the platform's Sipser–Gács–Lautemann mission: the union-bound argument formalized here is the same counting technique that drives the Lautemann lemma used to place BPP in Σ2p.
Timeline. Ramsey proved in 1928 that R(k) is finite; Erdős and Szekeres gave the first upper bounds in 1935; Erdős's 1947 paper supplied the exponential lower bound R(k)>2k/2 by a one-page counting argument, introducing the probabilistic method. Better constants for specific regimes followed (Lovász local lemma 1975, Spencer 1977), but no general lower bound beyond 2(1+o(1))k/2 is known today.
Setting
Fix an integer k≥3 and put N=2⌊k/2⌋. A graph is a pair (V,E) with E an irreflexive symmetric relation on V; here vertices are labeled 0,…,N−1. A subset s⊆V of size k is a clique if every two distinct vertices of s are adjacent, and an independent set if every two distinct vertices of s are non-adjacent. A k-set that is either a clique or an independent set is monochromatic: it is monochromatic in the two-coloring of the complete graph on V in which an edge is colored by the graph (present) or its complement (absent).
The ambient probability space is the uniform distribution over all graphs on N labeled vertices — equivalently, each of the (2N) possible edges is present independently with probability 1/2. This space has exactly 2(2N) elements.
A graph with no monochromatic k-set is a graph with neither a k-clique nor an independent k-set. The mission's goal, "the Ramsey number satisfies R(k)>2k/2", is formalized as the bare existence of such a graph on N=2⌊k/2⌋ vertices, without defining the Ramsey number itself.
Formalization targets
Goal: the probabilistic lower bound
R(k)>2k/2,k≥3
i.e. there exists a graph on N=2⌊k/2⌋ labeled vertices that contains no monochromatic k-set.
Stronger: the three steps of the proof, as separate targets
Count estimate. For k≥3 and N=2⌊k/2⌋,
(kN)⋅21−(2k)<1,equivalently(kN)⋅2<2(2k).
Union-bound principle. In any finite outcome space, if the total number of outcomes ruled out by all bad events together is less than the number of outcomes, some outcome avoids every bad event:
i∑∣{ω:badiω}∣<∣Ω∣⟹∃ω,∀i,¬badiω.
Pair-count bound. Over all graphs on N vertices, the total number of pairs (G,s) with s a monochromatic k-set in G is at most
(kN)⋅21+(2N)−(2k).
The goal follows by combining the three steps: the pair count is the sum over bad events in the union-bound principle, and the count estimate makes that sum smaller than the 2(2N) graphs.
Significance
The result. The lower bound R(k)>2k/2 is exponential, matching (up to the constant in the exponent) the best known upper bound R(k)<4k from Erdős–Szekeres. It shows that the Ramsey function, despite being finite, grows genuinely fast — and the proof's method became more influential than the bound: the probabilistic method now permeates combinatorics, graph theory, and theoretical computer science (random graphs, discrepancy, property testing, derandomization).
Formalizing it. Mathlib currently contains no Ramsey theory at all: no definition of a Ramsey number and no lower bound. This mission closes that gap with the foundational result, in a way that is deliberately elementary — no measure theory, no randomness: the "probabilistic" argument is re-expressed as exact counting, which is why the statements are fully formalizable in Mathlib today. The union-bound principle (target 2) is a reusable lemma for future probabilistic-method formalizations, and the monochromatic-set infrastructure (targets 1 and 3) is the natural base layer for a future definition of the Ramsey number R(k).
Difficulty
The central difficulty is that the bad events — "the k-set s is monochromatic" — overlap heavily: a typical graph contains many monochromatic k-sets, so the union bound must be crude enough to survive the overlap. Concretely, the estimate (kN)⋅21−(2k)<1 holds for N=2⌊k/2⌋ but fails for N=2⌊k/2⌋+1; the naive "take one vertex more" step is where the argument breaks. A solver who tries to strengthen the bound will find the exponent is tight.
A second difficulty is purely formal: the uniform distribution over graphs has to be eliminated. The mission's statements do this by counting graphs with a fixed monochromatic k-set (21+(2N)−(2k) of them) and applying the union-bound principle, so no probability theory enters the formalization.
Formalization scope
Representation. Graphs are SimpleGraph (Fin N): a relation on N labeled vertices. A candidate set is a Finset (Fin N) of cardinality k; "monochromatic" is IsClique ∨ IsIndepSet on the graph; "no monochromatic k-set" is the predicate NoMonoK. All counting is cardinality of finite sets; monoCount N k G is the number of monochromatic k-sets of G.
Conventions.N=2⌊k/2⌋ uses natural-number division, so for odd k the graph lives on 2(k−1)/2 vertices — the standard reading of R(k)>2k/2. The hypothesis k≥3 is explicit. The theorem quantifies existence over all graphs; it does not define the Ramsey number R(k) (a definition item for it, with the re-stated bound R(k)>2k/2, is a natural follow-up contribution).
Reusability. The union-bound principle, the monochromatic-k-set machinery, and the pair-count bound are all reusable beyond this mission. Welcome contributions: defining ramseyNumber and restating the bound as R(k)>2⌊k/2⌋; the Erdős–Szekeres upper bound R(k)≤4k as a companion mission; applications of the same principle elsewhere.
Selected references
Paul Erdős, Some remarks on the theory of graphs, Bulletin of the American Mathematical Society 53(4), 1947, pp. 292–294. https://doi.org/10.1090/S0002-9904-1947-08785-X — the source paper: main construction proving R(k)>2k/2.
Noga Alon, Joel H. Spencer, The Probabilistic Method, 4th ed., Wiley, 2016 — Chapter 1 (the Erdős lower bound) and Chapter 3 (Lovász local lemma); standard exposition of the technique.
Stanisław Radziszowski, Small Ramsey Numbers, Electronic Journal of Combinatorics, Dynamic Survey DS1 — survey of Ramsey number bounds and history.
Context: where this sits in the formalization landscape
This mission is not a duplicate of existing platform content, and the choice of target is deliberate:
Mathlib gap. The pinned environment (mathlib 0df444a) contains no Ramsey-number theory at all — nothing in Combinatorics/SimpleGraph, no ramseyNumber-style definition. This mission seeds that subfield with reusable infrastructure: the monochromatic-set model, the finite union-bound (probabilistic-method) principle, and the double-counting bound are all general-purpose lemmas, not one-off steps.
Existing Ramsey content is a different quantity. The platform's fully-proved Erdos183 mission concerns multicolour triangle Ramsey numbers R(3,…,3) and is driven by recursive palette constructions — a different Ramsey parameter and a different technique. The classical 2-colour diagonal bound formalized here appears nowhere on the platform as a proved statement.
Directly load-bearing for a live open problem. The public open problem diagonal_ramsey_asymptotics (same environment 0df444a) asks, eventually in k, for 2⌊k/2⌋≤R(k,k)≤4k; its upper half is already proved as ramsey_theory_upper_bound. The lower half is exactly what this mission's goal supplies: once ramsey_lower_bound is proved, closing that open problem reduces to a translation between the graph formulation used here (SimpleGraph / NoMonoK) and the edge-colouring formulation (ramseyDiag) used there, plus the eventual-quantifier wrapper.
Formalization convention. The bound is stated on N=2⌊k/2⌋ vertices (natural-number division), matching the exponent convention of the existing platform open problem above. For even k this is exactly Erdős's 2k/2; for odd k it is the standard floor form, equivalent to the classical asymptotic reading R(k)1/k≥2.
5 thms2 active usersReviewed
🏆Completed
Captain: ShouqiaoWang
Cubic Congruence for the q-Secant Inversion EnumeratorResearch Paper
Motivation
Alternating permutations are a classical meeting point of enumerative combinatorics, permutation statistics, and special functions. An up--down permutation alternates between rises and falls, and their ordinary counts are the Euler secant and tangent numbers. Refining this count by the inversion statistic produces the q-secant polynomial E2n(q). Its values and congruences retain information that disappears after setting q=1: they distinguish how the alternating permutations are distributed by inversion number and reveal cancellation at roots such as q=−1. Ji-Cai Liu's article isolates the next nontrivial term in the (1+q)-adic expansion of this polynomial, strengthening an earlier Andrews--Foata congruence. The mission formalizes the article's main result, Theorem 1.1, as an exact polynomial-divisibility statement.
Setting
For n≥0, let A(2n) be the set of permutations σ=(σ1,…,σ2n) of {1,…,2n} satisfying
σ1<σ2>σ3<σ4>⋯<σ2n.
The empty permutation is the unique member of A(0). The inversion number is
inv(σ)=#{(i,j):1≤i<j≤2n,σi>σj}.
The q-secant inversion enumerator is the integer polynomial
E2n(q)=σ∈A(2n)∑qinv(σ)∈Z[q].
Congruence modulo (1+q)3 means divisibility in Z[q]: two polynomials F and G are congruent precisely when (1+q)3 divides F−G. This formulation avoids evaluation at a single number and records the first three orders of behavior at q=−1.
In Lean, a permutation is represented as an equivalence of Fin (2*n). The alternating inequalities and inversion number are finite predicates and counts on this zero-based type. The polynomial variable is the canonical indeterminate in Polynomial ℤ.
Formalization targets
Cubic congruence
For every integer n≥0, prove
E2n(q)≡q2n(n−1)−(2n)(1+q)2(mod(1+q)3).
Equivalently,
(1+q)3∣E2n(q)−(q2n(n−1)−(2n)(1+q)2)in Z[q].
The boundary value n=0 is included. With the empty-permutation convention and natural-number truncated subtraction in the exponent, both sides reduce correctly, so the formal target does not hide a separate exceptional case.
Significance
The theorem identifies the exact quadratic correction to the highest-inversion monomial near q=−1. It therefore explains why the prior congruence modulo (1+q)2 does not generally lift unchanged to the cubic modulus. Specializing at q=1 also yields the corresponding refinement modulo 8 for the ordinary secant numbers. More broadly, the statement is a compact test case for formal reasoning that combines finite permutations, order predicates, inversion statistics, generating polynomials, binomial coefficients, and divisibility in a polynomial ring.
A machine-checked proof would contribute reusable infrastructure for permutation enumerators and polynomial congruences. The published article supplies a human proof; the Prove2me goal is the formal reconstruction of its theorem in Lean. The mission does not encode a proof certificate, an orbit count, or the desired divisibility inside a definition. A successful submission must derive the divisibility from the concrete finite definitions.
The result also gives a useful interface between two styles of formal combinatorics. On one side, alternating permutations are finite objects that can be enumerated, mapped, and partitioned. On the other, their aggregate is an algebraic object in Z[q] whose divisibility can be studied without referring to individual permutations. Infrastructure connecting these levels can be reused for other q-Euler numbers, descent and major-index enumerators, and congruences obtained from finite weighted actions. The mission keeps that infrastructure general-purpose by making the final target an equality in a quotient of the polynomial ring rather than a specialized computational procedure.
Difficulty
Direct expansion of E2n(q) is factorial in n and gives no uniform explanation of divisibility by a third power. Divisibility by (1+q)3 is stronger than merely checking the value at q=−1: it simultaneously constrains the value and the first two formal orders there. A formal solution must control the entire finite family of alternating permutations while preserving exact inversion exponents and polynomial coefficients. Index conventions are also delicate, because the paper numbers positions and values from 1, whereas Lean uses Fin indices from 0.
The source argument introduces combinatorial structure beyond the bare statement. Formalizers may contribute reusable lemmas about switching consecutive values, invariance of alternation under permitted switches, inversion-number changes, finite group actions, and divisibility of orbit enumerators. Those are natural milestones, but the present root goal deliberately remains the stable polynomial congruence rather than committing to one decomposition.
Formalization scope
The mission fixes the coefficient ring to Z and uses exact polynomial divisibility. It does not replace congruence by coefficientwise arithmetic modulo 8, evaluation at q=−1, or a numerical check for bounded n. UpDown is defined directly on permutations of Fin (2*n), invNumber counts ordered index pairs with the required inequality, and qSecant is the finite sum of monomials qinv(σ).
The formal statement quantifies over every natural number. The conventions at n=0 and n=1 are part of the same theorem and have been audited explicitly. The uploaded definition bundle is transparent and sorry-free; the only admitted declaration is the mission theorem itself. Useful contributions include general lemmas about polynomial divisibility, finite involutions and orbit sums, or bridges between one-based paper notation and Lean's finite types.
Selected references
Ji-Cai Liu, A Combinatorial Proof of a Cubic Congruence for the q-Secant Inversion Enumerator, Electronic Journal of Combinatorics 33(3), P3.10, 2026. DOI
Paired states and Hamiltonian cycles in cubic bipartite planar graphsOpen Problem
Motivation
A spanning subgraph in which every vertex has degree two may split into several cycles. Barnette’s question asks when planarity, bipartiteness, and connectivity force those vertices onto one cycle. The source is OpenAI's September 2026 manuscript.
Setting
A cubic graph has degree three at every vertex. A bipartite graph has two vertex classes with every edge crossing between them. A Hamiltonian cycle visits all vertices exactly once before returning to its starting point. Planarity is represented by a drawing using injective continuous edge arcs in the real plane.
Formalization targets
G finite, simple, cubic, bipartite, planar, and 3-vertex-connected⟹G has a Hamiltonian cycle.
Every finite simple graph with decidable vertex equality and adjacency has a Hamiltonian cycle if each vertex has degree three, the vertices can be partitioned into two classes with every edge joining different classes, the graph is planar, and it is three-vertex-connected. Here planarity means that vertices can be placed at distinct points of the real plane and edges drawn as injective continuous arcs whose interiors contain no vertices and whose interiors are disjoint for distinct undirected edges; reversing an edge reverses its arc. Three-vertex-connectivity means that the graph has at least four vertices and remains connected after deletion of any set of at most two vertices. The conclusion is the existence of one closed cycle visiting every vertex exactly once before returning to its starting vertex.
A proof would turn the source’s Hamiltonicity claim into a result available for arbitrary finite graphs satisfying these exact hypotheses. It would also provide a reusable bridge between geometric embeddings and combinatorial walks. The manuscript presents a mathematical argument; the attached goal currently has status Open, so the requested contribution is a Lean proof of the displayed formal target.
Difficulty
Degree constraints do not guarantee that a spanning cycle cover is connected. The target requires a single cycle and must handle unrestricted face sizes, so verifying local degree conditions is insufficient.
Formalization scope
The published goal unfolds MainStatement. Three-vertex-connectivity requires at least four vertices and connectedness after deletion of any set of at most two vertices. The Hamiltonian object is a closed graph walk satisfying the cycle and vertex-coverage conditions. Stronger edge-avoidance conclusions from the paper are not attached as targets.
The shared definitions are supplied by BarnetteHamiltonian. The target uses Lean 4.33.1 with the pinned Mathlib environment. Contributions should preserve the existing statement and develop reusable supporting lemmas in its definitions.
Selected references
OpenAI, Paired states and Hamiltonian cycles in cubic bipartite planar graphs, preprint, September 2026. Manuscript.
A Quantum Lovász Local Lemma (Ambainis, Kempe, Sattath)Research Paper
Status: complete. This mission records a finished formalization rather than an open call for work. Every statement below, including the goal, was uploaded together with a proof that the platform has verified, so there is nothing left to prove.
Motivation
The Lovász Local Lemma (LLL) is a basic tool of the probabilistic method. It shows that a collection of rare "bad" events can all be avoided simultaneously, even when the events are not independent, provided each event depends on only a few others. Its best-known application is to satisfiability: a k-CNF formula in which every variable appears in few clauses has a satisfying assignment.
Quantum satisfiability (k-QSAT) is the quantum analogue of k-SAT. Clauses are replaced by projectors acting on k qubits, and the question is whether some nonzero state is annihilated by all of them, equivalently whether the corresponding local Hamiltonian is frustration-free. Bravyi showed that k-QSAT is QMA1-complete for k≥4, so sufficient conditions for satisfiability are of interest in quantum complexity theory and in many-body physics. Ambainis, Kempe and Sattath (arXiv:0911.1696, J. ACM 2012) proved a quantum version of the LLL in which probability is replaced by relative dimension, and derived a sufficient condition for k-QSAT instances to be satisfiable.
Timeline
1975. Erdős and Lovász introduce the local lemma, in the symmetric form, to colour hypergraphs (Infinite and Finite Sets, 1975).
1977. Spencer publishes the general (asymmetric) form, credited to Lovász, and applies it to Ramsey numbers (Discrete Math. 20, 1977).
1985. Shearer determines the optimal dependency condition, in terms of the independence polynomial of the dependency graph (Combinatorica 5, 1985).
2009 to 2010. Moser gives a constructive proof for k-SAT (arXiv:0810.4812, STOC 2009); Moser and Tardos make the general lemma constructive (arXiv:0903.0544, J. ACM 2010).
2011. Kolipaka and Szegedy show that the Moser and Tardos algorithm works throughout Shearer's region, giving an algorithmic proof of Shearer's bound (Moser and Tardos meet Lovász, STOC 2011, 235 to 244).
2009 to 2012. Ambainis, Kempe and Sattath prove the quantum local lemma and its k-QSAT corollaries (arXiv:0911.1696, J. ACM 59(5):24, 2012).
2013. Arad and Sattath (arXiv:1310.7766) and, independently, Schwarz, Cubitt and Verstraete (arXiv:1311.6474) give constructive versions for commuting projectors.
2016. Sattath, Morampudi, Laumann and Moessner extend Shearer's criterion to the quantum setting and conjecture that it is tight (arXiv:1509.07766, PNAS 2016).
2017. He, Li, Liu, Wang and Xia show that the abstract and variable versions of the local lemma differ: Shearer's bound, tight for the abstract version, is not tight for the variable version (the setting of k-SAT, where events are determined by independent variables) for instance when the base graph of the event-variable graph has an induced cycle of length at least 4, while there is no gap when it is a tree (arXiv:1709.05143, FOCS 2017).
2017. Gilyén and Sattath give an efficient quantum algorithm for the non-commuting case under a spectral gap condition (arXiv:1611.08571, FOCS 2017).
2018 to 2019. He, Li, Sun and Zhang prove this conjecture: Shearer's bound is tight for the quantum local lemma, so in this respect the quantum lemma behaves like the abstract version rather than the variable one; they also show that the tight regions of the quantum lemma and of its commuting variant differ in general (arXiv:1804.07055, STOC 2019).
Setting
Let V be a nonzero finite-dimensional vector space. For a subspace X⊆V, the relative dimension is
R(X)=dimVdimX.
It plays the role of probability: subspaces replace events, intersection replaces conjunction, and R(X∣Y)=dim(X∩Y)/dimY replaces conditional probability.
Subspaces X1,…,Xn have dependency setsΓ(1),…,Γ(n)⊆{1,…,n} when, for every i and every set S of indices with i∈/S and S∩Γ(i)=∅,
R(Xi∩j∈S⋂Xj)=R(Xi)R(j∈S⋂Xj).
In words, Xi is independent, for relative dimension, of every intersection of subspaces outside its dependency set.
A k-QSAT instance on n qubits is a family of projectors Π1,…,Πm, each acting on a set of k qubits and extended by the identity on the others. It is satisfiable if a nonzero state lies in the kernel of every Πi.
The formalization proves the local lemma once, for an abstract valuation: a real function R on a bounded lattice that is nonnegative, monotone and modular, R(x)+R(y)=R(x∨y)+R(x∧y), with R(⊤)=1 and R(⊥)=0. Relative dimension on subspaces and the uniform probability on subsets of a finite set are the two instances used.
Formalization targets
Goal: the quantum local lemma (Theorem 14)
Let X1,…,Xn be subspaces with dependency sets Γ(i), and let 0≤yi<1 satisfy R(Xi)≥1−yi∏j∈Γ(i)(1−yj) for every i. Then
R(i=1⋂nXi)≥i=1∏n(1−yi).
Other formalized results
All of these are proved on Prove2Me and can be found by name (tag quantum-lll):
The same statement for any valuation on a bounded lattice (Theorem 14, abstract form): QLLL.Valuation.lll.
The symmetric quantum local lemma: if R(Xi)≥1−p, each Xi has at most d dependencies and p⋅e⋅(d+1)≤1, then R(⋂iXi)>0 (Theorem 4): QLLL.quantum_lll_symmetric.
The classical Erdős and Lovász local lemma, asymmetric and symmetric (Theorems 13 and 1), for the uniform probability on a finite set: QLLL.SAT.classical_lll, QLLL.SAT.classical_lll_symmetric.
k-SAT: a k-CNF formula in which every variable appears in at most 2k/(ek) clauses is satisfiable (Corollary 2): QLLL.SAT.sat_of_degree_le.
k-QSAT: an instance of rank-≤r constraints in which every qubit appears in at most 2k/(erk) constraints is satisfiable (Corollary 16): QLLL.PiQSAT.inf_ker_extendOp_ne_bot on Mathlib's tensor product, and QLLL.QSAT.satisfiable_of_degree_le for orthogonal projectors.
Two results beyond the paper: infinite k-SAT (QLLL.SAT.exists_assignment_forall), and the local lemma for infinite index sets under a continuity hypothesis (QLLL.lll_iInf).
Significance
The quantum local lemma gives a sufficient condition for k-QSAT satisfiability that depends only on the local structure of the instance: the rank of the projectors and the number of projectors per qubit. It shows that the classical criterion survives the passage from events to subspaces, even though subspaces do not form a distributive lattice. Later work on constructive and tight versions, listed in the timeline, builds on this statement.
All results of this mission are proved and machine-checked. The Lean development was written as a complete formalization of the paper, and every statement here was uploaded together with a proof verified by the platform. What the mission adds is a reusable, Mathlib-based library: the local lemma for abstract valuations, its classical and quantum instances, k-QSAT stated on Mathlib's tensor product of qubits, and linear algebra on intersections of tensor products of subspaces that Mathlib does not yet contain. Mathlib currently has no form of the Lovász Local Lemma.
Difficulty
The classical proof uses complements of events and the identity Pr(A)+Pr(Ac)=1, together with the distributive law for events. Subspaces satisfy neither in general: the lattice of subspaces is modular but not distributive, and the orthogonal complement does not distribute over intersections. The argument has to be rebuilt from the properties of relative dimension that do hold. For k-QSAT, the further difficulty is to show that constraints acting on disjoint sets of qubits are independent for relative dimension, which requires computing intersections and dimensions of tensor products of subspaces.
Formalization scope
Conventions committed to in the Lean statements:
The local lemma is stated for n indexed subspaces (or lattice elements) and real weights 0≤yi<1. An index is never in its own dependency set's complement: independence is required from intersections over sets S that avoid both Γ(i) and i itself.
Independence is stated in product form, R(X∩Y)=R(X)R(Y), which agrees with the conditional form of the paper whenever the conditional relative dimension is defined.
The quantum lemma holds over any field and requires V to be nonzero and finite-dimensional.
The classical lemmas are stated for good events (complements of bad events) under the uniform probability on a finite nonempty set.
Qubits: the main k-QSAT statement uses Mathlib's tensor product ⨂jC2 and allows arbitrary local operators of rank at most r, since only the dimension of their kernels enters. A second form, on functions from bit strings to C, requires the constraints to be orthogonal projectors (idempotent and self-adjoint). Self-adjointness cannot yet be stated on Mathlib's n-fold tensor product, which has no inner product in the pinned Mathlib version.
Degree conditions are integers: "at most 2k/(erk) projectors per qubit" is written as at most D′+1 with 2kr⋅e⋅(kD′+1)≤1, which the paper's hypothesis implies.
An infinite version of k-QSAT is deliberately not included. Nonzero subspaces can have all finite intersections nonzero and zero total intersection, so the infinite statement has to be phrased with compatible families of density matrices, and the current Lean formulation does not yet restrict the constraints to positive operators.
The blueprint of the formalization, linking every paper statement to its Lean declaration, is at sattath.github.io/Quantum-Lovasz-Local-Lemma/blueprint. Natural extensions, outside the scope of this mission: the orthogonal-projector form of Corollary 16 on Mathlib's tensor product once inner products on n-fold tensor products are available, Shearer-type conditions, and a measure-theoretic classical local lemma on general probability spaces.
A note from the contributor
This is my first contribution to Prove2Me, so the definitions, statements, proofs and descriptions may fall short of what an experienced contributor would produce. Some choices may be unidiomatic, some lemmas may duplicate Mathlib, and the split into entries could be better. Every proof is checked by Lean, so the theorems are correct as stated; the question is whether they are stated in the most useful way.
Selected references
P. Erdős and L. Lovász, Problems and results on 3-chromatic hypergraphs and some related questions, Infinite and Finite Sets, Colloq. Math. Soc. János Bolyai 10, 1975, 609 to 627.
J. Spencer, Asymptotic lower bounds for Ramsey functions, Discrete Math. 20, 1977, 69 to 76.
J. B. Shearer, On a problem of Spencer, Combinatorica 5, 1985, 241 to 245.
R. A. Moser, A constructive proof of the Lovász local lemma, STOC 2009. arXiv:0810.4812
R. A. Moser and G. Tardos, A constructive proof of the general Lovász local lemma, J. ACM 57(2), 2010. arXiv:0903.0544
A. Ambainis, J. Kempe and O. Sattath, A quantum Lovász local lemma, J. ACM 59(5):24, 2012. arXiv:0911.1696
I. Arad and O. Sattath, A constructive quantum Lovász local lemma for commuting projectors, 2013. arXiv:1310.7766
M. Schwarz, T. S. Cubitt and F. Verstraete, An information-theoretic proof of the constructive commutative quantum Lovász local lemma, 2013. arXiv:1311.6474
O. Sattath, S. C. Morampudi, C. R. Laumann and R. Moessner, When a local Hamiltonian must be frustration-free, PNAS 113(23), 2016. arXiv:1509.07766
A. Gilyén and O. Sattath, On preparing ground states of gapped Hamiltonians: an efficient quantum Lovász local lemma, FOCS 2017. arXiv:1611.08571
K. He, Q. Li, X. Sun and J. Zhang, Quantum Lovász local lemma: Shearer's bound is tight, STOC 2019. arXiv:1804.07055
APSP in O(n^2.9983) via All-Edges Exact TriangleResearch Paper
All-pairs shortest paths (APSP) computes the shortest distance between every pair of vertices in a weighted graph.
We strengthen the previously formalized O(n2.99942) bound to O(n2.9983) for deterministic APSP on directed graphs with polynomially bounded integer weights and no negative cycles, using the same word-RAM model. It formalizes the improvement outlined by Alman and Vassilevska Williams in their conclusion.
Periodic Multidimensional Costas Arrays (Rubio–Torres Conjecture 1)Open Problem
Motivation
A Costas array is a permutation matrix in which the difference vectors between distinct dots are pairwise distinct; such arrays are frequency-hopping patterns for sonar and radar (Costas, 1984). Rubio and Torres ask whether their m-dimensional version can stay Costas in every window of its periodic extension, and conjecture that this happens only in the smallest order.
Timeline. 1984: Taylor proves that 2D periodic Costas arrays have order ≤2. 2023: Rubio–Torres prove the odd-order and 3D cases, give 2×2×4 examples, and state Conjecture 1.
Setting
Let [n]={1,…,n}, X=[a1]×⋯×[ak], Y=[b1]×⋯×[bl] with all sides ≥2, and φ:X→Y a bijection; the dots are (x,φ(x))∈Zk+l. The array is Costas if the difference vectors between distinct dots are distinct, and periodic Costas if moreover, after repeating the dots periodically over Zk+l, the dots inside every translate t+X×Y have distinct difference vectors.
Formalization target
Conjecture 1: if k≥l≥1 and φ defines a periodic Costas array, then
i=1∏kai=2k,
equivalently every ai=2. The condition k≥l is a normalization (φ−1 swaps the boxes).
Significance
A proof would give the multidimensional analogue of Taylor's theorem; a counterexample would give periodic distinct-difference patterns of non-power-of-two order.
Difficulty
The Rubio–Torres counting argument needs a bound that is available only when Y is one-dimensional, which is why it stops at m=3. Computational evidence: an exhaustive window check reports that the 2×3×2×3 array with dots (1,1,1,1),(1,2,1,2),(1,3,2,1),(2,1,1,3),(2,2,2,3),(2,3,2,2) is periodic Costas, which would disprove the conjecture.
Formalization scope
A point of Zk+l is a pair (x,y); boxes are 1-based; φ is a total function Zk→Zl whose values off X are unused. Differences are plain integer vectors (not reduced modulo the sides), windows range over all t∈Zk+l, and k,l≥1 and sides ≥2 are part of the definition, so no degenerate case holds vacuously.
Selected references
I. Rubio, J. Torres, Multidimensional Costas Arrays and Their Periodicity, IEEE Trans. Inf. Theory 69(8), 2023, 5032–5040. arXiv:2208.02378, DOI
J. P. Costas, A study of a class of detection waveforms having nearly ideal range-Doppler ambiguity properties, Proc. IEEE 72(8), 1984, 996–1009.
S. W. Golomb, H. Taylor, Constructions and properties of Costas arrays, Proc. IEEE 72(9), 1984, 1143–1163.
2 thms1 active userReviewed
🏆Completed
Captain: mysticflounder
Six-colour Schur colourings of [1, 1801] under R₄(3) ≤ 61: balanced classes, nested saturation and forced reflectionResearch Paper
Motivation
The Schur numberS(n) is the largest N such that [1,N]={1,…,N} can be partitioned into nsumfree sets, sets with no x,y,z such that x+y=z (x=y allowed). Schur's argument gives S(n)≤Rn(3)−2, where the triangle Ramsey numberRn(3) is the least N such that every colouring of the edges of KN with n colours has a monochromatic triangle (Fredricksen–Sweet 2000, inequality (2)). Only S(1),…,S(5)=1,4,13,44,160 are known (Heule 2018). For six colours the published range is 536≤S(6)≤1836; the upper bound is R6(3)−2 with R6(3)≤1838 (DS1, rev. 18).
Timeline.
1955: Greenwood and Gleason prove R3(3)=17 and Rn+1(3)≤(n+1)(Rn(3)−1)+2 (Theorem 6) (doi).
1961: Baumert finds S(4)=44 by computer, as reported by Fredricksen and Sweet; they and Heule cite Golomb–Baumert 1965 for it.
1997: Wan bounds Rn(3) and, for even n≥6, states Sn<n!(e−e−1+3)/2−n+2 (zbMATH 0882.05095 summary; doi). If his Sn is the least N that forces a monochromatic solution, this is the centred bound below, applied to his own bound on Rn−1(3); if it is the largest N, it is 1 above it. His proof was not read.
2004: Fettes, Kramer and Radziszowski prove R4(3)≤62 (listed in DS1, which also lists R5(3)≤307).
2018: Heule proves S(5)=160 with a certified SAT computation (AAAI-18; preprint arXiv:1711.08076).
2026: a public repository of M. Tatarevic gives a computer-assisted argument for R4(3)≤61. Its Lean development assumes that a family of 56,830 SAT instances is unsatisfiable, and the repository records solver results for them. The project of this mission's author produced LRAT certificates for all 56,830 instances and checked them; the report is in the repository's issue tracker. This mission does not depend on it.
The first target is a centred-interval bound: if Rk(3)≤r, then S(k+1)≤2(k+1)⌊(r−1)/2⌋+1. With R4(3)≤61 the recursive bound gives R5(3)≤302, and the centred bound gives S(6)≤1801; with R5(3)≤307 it gives only 1837. The mission formalizes what a Schur colouring of [1,1801] with six colours would have to look like under R4(3)≤61.
Setting
All numbers are natural numbers, N={0,1,2,…}, and [a,b]={a,…,b}.
Schur colourings and covers. A colouring with n colours is a map c:N→Finn. It is a Schur colouring of [1,N] (SchurColoring N c) if there are no x,y≥1 with x+y≤N and c(x)=c(y)=c(x+y), the case x=y included. The cover form uses SumFree S and CoveredBySumFree X n (X lies in the union of n sumfree sets); for n≥1 the two bridge theorems pass between the two forms in both directions.
Triangle Ramsey property.TR(k,r) (TriangleRamsey k r): every colouring with at most k colours of the pairs x<y of a finite set of at least r naturals has a monochromatic triangle. For k≥1 it is the inequality Rk(3)≤r.
Neighbourhoods. The difference colouring gives a pair {x,y} the colour c(∣x−y∣). For a Schur colouring of [1,N] it has no monochromatic triangle on [0,N], since (y−x)+(z−y)=z−x. Write
Γi(V,v)={w∈V:w=v,c(∣v−w∣)=i} (colorNbhd c V v i);
Vm=Γc(m+1)([0,2m+1],m), the central neighbourhood (centralNbhd c m), which contains 2m+1;
Pi=Γi(Vm,2m+1), the endpoint neighbourhoods (endpointNbhd c m i).
The frontier. The frontier hypotheses are TR(k,u+1), 2t=(k+1)u, m=(k+2)t, and c a Schur colouring of [1,2m+1] with k+2 colours. From the first two, TR(k+1,2t+2) holds, and the centred bound excludes Schur colourings of [1,2m+2] with k+2 colours; [1,2m+1] is the frontier interval. Six colours: k=4, u=60, t=150, m=900, 2m+1=1801.
Example. For k=1, u=2, t=2, m=6 (and 13=S(3)), the classes {1,4,7,10,13}, {2,3,11,12}, {5,6,8,9} form a Schur colouring of [1,13], with V6={2,5,7,10,13} and endpoint neighbourhoods {2,10} and {5,7}, both closed under x↦12−x.
Formalization targets
Goal: six colours under R4(3)≤61
TR(4,61) and c a Schur colouring of [1,1801] with six colours⟹(1)–(5),
where q=c(901), V=V900 and Pi=Γi(V,1801):
each colour occurs 150 times in [1,900];
∣V∣=301;
∣Γi(V,v)∣=60 for every v∈V and every colour i=q;
c(901−d)=c(901+d) for every d∈[1,900] with c(d)=q;
for every colour i=q: ∣Pi∣=60; x↦1800−x maps Pi to itself without fixed points; and c(∣x−y∣)∈/{i,q} for distinct x,y∈Pi.
The goal is a structure theorem under the hypothesis R4(3)≤61. It does not prove S(6)≤1800, and it does not assert that a Schur colouring of [1,1801] with six colours exists; whether such a colouring, or the structure it would force, exists is open. The goal is the six-colour instance of the general theorems below.
Centred-interval bound
TR(k,r)⟹[1,2(k+1)⌊2r−1⌋+2] is not covered by k+1 sumfree sets.
Balanced colour classes
TR(k,2t+2),m=(k+1)t,c a Schur colouring of [1,2m+1] with k+1 colours⟹{d∈[1,m]:c(d)=j}=t for every colour j.
The result itself. Under R4(3)≤61, S(6)≤1801, and the goal constrains a six-colour Schur colouring of [1,1801] as listed above. In particular, each of its five endpoint neighbourhoods is a set of 30 pairs {900−d,900+d} whose difference colouring uses at most four colours, is invariant under x↦1800−x and, like that of every subset of [0,1801], has no monochromatic triangle. So such a colouring yields five colourings of K60 with at most four colours, no monochromatic triangle and a fixed-point-free colour-preserving involution. A proof that this configuration cannot occur would give S(6)≤1800 under the same hypothesis. Whether it can occur, and whether S(6)≤1800, are open.
Formalizing it. All 12 theorems of the tree, the goal included, are proved in Lean 4 with Mathlib over the bundles ClassicalSchurBasic, ClassicalSchurRamsey and ClassicalSchurColoring, with the axioms propext, Classical.choice and Quot.sound only. Independent Claude agents checked the Lean: one rebuilt the frontier theorems, re-ran their axiom audit and checked their statements against the argument; another checked every statement of the tree against the mathematics. The mathematics is in the paper S(6)≤1801 if R4(3)≤61: a centred Schur bound and the structure at the frontier (A. McKenna, Zenodo, 2026, doi:10.5281/zenodo.23156099), and the Lean code is in its repository; the paper has not been refereed. R4(3)≤61 is not formalized in the mission.
Difficulty
The centred bound counts, for one colour class, the points h±a around the centre of the interval. At the frontier every such count is tight: each colour has t elements in [1,m], and inside Vm each colour other than c(m+1) has degree u, the largest value that Rk(3)≤u+1 allows. So no single counting step gives a contradiction, and the theorems describe the tight case instead of excluding it. The first exclusion that the structure gives, parity, works only for odd u; at six colours u=60.
The reflection is not a property of Schur colourings in general: the colouring {1,4}, {2,3}, {5} of [1,5] has c(2)=c(3) but c(1)=c(5). At the frontier the theorem asserts it only for the d with c(d)=c(m+1), so an argument that assumes a fully symmetric colouring proves a different statement. A direct search is no substitute: S(5)=160 already needed a large certified SAT computation (Heule 2018), and [1,1801] with six colours is a much larger instance.
Formalization scope
Colourings are functions ℕ → Fin n on all of N; SchurColoring N c constrains only [1,N], with x=y allowed. Distances are Nat.dist.
Neighbourhoods are Finsets. Vm lies in range (2 * m + 2)=[0,2m+1], so the point 0 is a candidate member; the centre m never is.
TriangleRamsey k r takes colours from any Finset of at most k naturals; the pair colouring ℕ → ℕ → ℕ is constrained only on the pairs x<y of the vertex set, which is any finite set of naturals. TriangleRamsey k 0 and TriangleRamsey k 1 are false.
Covers.CoveredBySumFree X n uses Fin n → Set ℕ; the sets need not be disjoint or lie in X.
Subtraction is truncated. Under the hypotheses, none of r−1, N−1, m+1−d, 2m−x (with x∈Pi), 901−d and 1800−x truncates.
No trivialization. The frontier theorems are vacuous for u=0, and for k=0 (then [1,2m+1]⊇[1,5], while S(2)=4). For k=1 they are not: the Schur colourings of [1,13] meet the hypotheses, and every conclusion can be checked by hand. The goal holds vacuously if R4(3)>61 or if no six-colour Schur colouring of [1,1801] exists; it is a structure theorem, not a claim that such a colouring exists.
Bundles: ClassicalSchurBasic (SumFree, CoveredBySumFree) and ClassicalSchurRamsey (TriangleRamsey) are already public; ClassicalSchurColoring holds SchurColoring, colorNbhd, centralNbhd and endpointNbhd. Reusable: the colouring–cover bridges, the pigeonhole step, the centred bound for every k, and the automorphism-extension lemma (arbitrary types). Welcome beyond the targets: a formal proof of TriangleRamsey 4 61, and results on whether the configuration of five paired 60-point sets exists.
Provenance: the centred-interval argument was first written by an AI agent based on ChatGPT (OpenAI) in a project discussion on 2026-09-27, and a Claude (Anthropic) agent audited it. The balance, saturation and reflection argument was proposed by an AI agent based on ChatGPT (OpenAI) in a project discussion; Claude checked each step and restated it with explicit hypotheses. Claude wrote the Lean proofs of both parts; the independent checks are described under Formalizing it.
H. Fredricksen, M. M. Sweet, Symmetric sum-free partitions and lower bounds for Schur numbers, Electron. J. Combin. 7 (2000) #R32. https://doi.org/10.37236/1510
Eliahou–Revuelta Schur degree: L(4) = 16 and 49 ≤ L(5) ≤ 65Research Paper
Motivation
A set of integers is sumfree when no two of its elements, equal or distinct, add up to an element of the set. The Schur numberS(n) is the largest N such that {1,…,N} can be partitioned into n sumfree sets; only S(1),…,S(5)=1,4,13,44,160 are known. For n≥4 the best theoretical upper bound that Eliahou and Revuelta could cite in 2021 was S(n)≤Rn(3)−2, where the Ramsey numberRn(3) is the least N such that every n-colouring of the edges of the complete graph KN has a monochromatic triangle. The Ramsey numbers satisfy Rn(3)≤n(Rn−1(3)−1)+2 for n≥2 (Greenwood–Gleason 1955); for S(n) the paper knows no recursive upper bound.
Eliahou and Revuelta proposed a conjectural one. They defined a number L(n) through the Schur degree of block-sum sets, proved S(n)≤nL(n) (Theorem 5.4) and S(n−1)+1≤L(n)≤Rn−1(3)−1 (Proposition 5.3), and conjectured L(n)=S(n−1)+1 (Conjecture 5.6). This would give S(n)≤n(S(n−1)+1) (Conjecture 5.7) and S(6)≤966 (Conjecture 5.8), against the range 536≤S(6)≤1836 that they give. For n=4 they proved 14≤L(4)≤16, conjectured L(4)=14, and left the value open.
Timeline.
1955: Greenwood and Gleason prove R3(3)=17 and the recursive bound above.
1961: Baumert computes S(4)=44 (cited by Eliahou–Revuelta as reference [2]).
2004: Fettes, Kramer and Radziszowski prove R4(3)≤62 (listed in DS1, rev. 18).
2018: Heule proves S(5)=160 with a certified SAT computation (arXiv:1711.08076).
2020–2021: Eliahou and Revuelta, preprint arXiv:2006.01502 and refereed version, with the same numbering of the items used here.
2026: McKenna, The Schur degree of block sums: L(4) = 16 and L(5) ≥ 49 (Zenodo, doi:10.5281/zenodo.22987189), proves L(4)=16 and L(5)≥49; its Lean library ClassicalSchur formalizes both, with L(5)≤65.
Setting
All numbers are natural numbers, except in the group G below.
Sumfree sets. A set S is sumfree when the sum of two of its elements, equal or distinct, is never in S. A set X is covered by n sumfree sets when it lies in the union of n sumfree sets.
Schur degree. The Schur degreesdeg(X) is the least n≥1 such that n sumfree sets cover X. If there is no such n, it is ∞.
For example, sdeg({1,…,N})≤n holds for N≤S(n) and fails for N>S(n).
Block sums. Let A=(a1,…,aL) be a finite sequence of length ∣A∣=L. Its block sums are the sums of runs of consecutive entries:
ai+ai+1+⋯+aj(1≤i≤j≤L).
The set of these sums is A^. The average of A is the rational number μ(A)=(a1+⋯+aL)/L.
The number L(n). A length L has the ER property for n when every sequence A of L positive integers with μ(A)≤n has sdeg(A^)≥n.
For n≥2, the inequality sdeg(A^)≥n holds when no n−1 sumfree sets cover A^. It fails when some n−1 sumfree sets cover A^.
The number L(n) is the least L≥1 with the ER property for n.
The pigeonhole bound. Let ρ(0)=2 and ρ(k+1)=(k+1)(ρ(k)−1)+2. The first values are ρ(1)=3, ρ(2)=6, ρ(3)=17 and ρ(4)=66.
For k≥1, ρ(k) is an upper bound for the Ramsey number: Rk(3)≤ρ(k), with equality for k≤3.
The group G. Let G=Zm1×Zm2. A set C⊆G is sumfree in G when the sum in G of two of its elements, equal or distinct, is never in C.
The lifted sequence. Take m1≥1 and M≥m1. Write the m1m2 numbers u+Mj, with 0≤u<m1 and 0≤j<m2, in increasing order:
x0<x1<⋯<xm1m2−1.
The lifted sequence is the sequence of the m1m2−1 gaps between consecutive terms, x1−x0,…,xm1m2−1−xm1m2−2. Lemma 4.1 below uses it to turn a cover of G∖{0} into a sequence in ℕ.
Lean names.
SumFree S: S is sumfree.
CoveredBySumFree X n: X is covered by n sumfree sets.
sdeg X : ℕ∞: the Schur degree, with ⊤ for ∞.
blockSums A and average A, for A : List ℕ: A^ and μ(A).
ERProperty n L: the length L has the ER property for n.
erL n: L(n).
ramseyBound k: ρ(k).
GroupSumFree C: C is sumfree in G. The Lean definition takes any type with an addition; the targets use it for ZMod m₁ × ZMod m₂.
liftPrefix m₁ M L: xL, defined for all m1 and M by xL=(Lmodm1)+M⌊L/m1⌋.
liftSeq m₁ m₂ M: the lifted sequence, defined for all m1, m2 and M as the list of the m1m2−1 differences xk+1−xk.
Formalization targets
Goal
erL4=16
An exact value, so no later result changes the statement; it is the case Eliahou and Revuelta left open.
Theorem 4.1 of Eliahou–Revuelta, in ℕ, with ρ(k) for Rk(3)
ρ(k)≤∣A∣+1⟹k+1≤sdeg(A^)(k∈N,A a finite sequence in N).
Upper bound of Proposition 5.3, with ρ(k) for Rk(3)
erL(k+1)≤ρ(k)−1(k∈N).
No length below 16 has the property at n=4
¬ERProperty4L(1≤L≤15).
Lemma 4.1 (McKenna 2026): lift from a group
For m1,m2,q≥1, M≥3m1−2 and sets C1,…,Cq, sumfree in G, that cover G∖{0}, the sequence A=liftSeq m₁ m₂ M satisfies
Corollary 4.2 (McKenna 2026): group coverings bound L(n) from below
For n≥3, m1,m2≥1 and n−1 sets, sumfree in G, that cover G∖{0}:
m1m2≤erLn.
Theorem 1.2 (McKenna 2026), with the Lean upper bound: bounds for L(5)
49≤erL5≤65.
Significance
L(4)=16. At n=4, Conjecture 5.6 predicts L(4)=S(3)+1=14. So L(4)=16 refutes the conjecture at n=4. Here L(n) equals the upper bound Rn−1(3)−1 of Proposition 5.3.
The two bounds of Proposition 5.3 coincide at n=2,3, where the paper gives L(2)=2 and L(3)=5. So n=4 is the first case in which the conjecture says more than Proposition 5.3.
L(5)≥49. At n=5, Conjecture 5.6 predicts L(5)=S(4)+1=45. So L(5)≥49 refutes the conjecture at n=5.
What remains open. Conjectures 5.7 and 5.8 remain open.
The paper derives Conjecture 5.7 at each n from Conjecture 5.6 at the same n, with Theorem 5.4. At n=4,5 that derivation is not available. But Conjecture 5.7 holds there by the known values: 44≤4⋅14 and 160≤5⋅45.
Conjecture 5.8 follows from Conjecture 5.6 at n=6 (that is, L(6)=161) with Theorem 5.4. Nothing here decides that case.
With L(4)=16, Theorem 5.4 gives only S(4)≤64. This is weaker than S(4)≤R4(3)−2≤60.
Status. Every target is proved and formalized.
Theorem 4.1 and Proposition 5.3 are proved in the refereed paper.
L(4)=16 (Theorem 1.1), Lemma 4.1, Corollary 4.2 and L(5)≥49 (Theorem 1.2) are proved in McKenna 2026 (doi:10.5281/zenodo.22987189). Before publication, separate agents, with their own code, checked the proofs in two rounds of adversarial audit.
At launch, all 12 theorems of the tree, the goal included, are Proved in Lean over 4 definition bundles. Their only axioms are propext, Classical.choice and Quot.sound.
An independent verifier checked the definitions and the six headline statements against Eliahou–Revuelta and McKenna 2026. The six statements are the goal, Theorem 4.1, Proposition 5.3, Lemma 4.1, Corollary 4.2 and Theorem 1.2.
Literature. The literature search for McKenna 2026 found no result on L(4), L(5) or Conjectures 5.6–5.8. One citing text, in Jungić 2023, was not read. This records the search; it is not a claim of priority.
Open work, not targets.
The exact L(5): 49≤L(5)≤61 on paper (with R4(3)≤62), and 49≤L(5)≤65 in Lean.
The case n=6: 161≤L(6)≤R5(3)−1≤306 (DS1: R5(3)≤307). Here Conjecture 5.6 is the open step toward S(6)≤966.
Difficulty
Two kinds of bound. The two sides of an exact value of L(n) are statements of different kinds.
An upper bound L(n)≤m needs one length. It follows from sdeg(A^)≥n for every sequence A of positive integers of one length L, with 1≤L≤m and average at most n.
A lower bound L(n)≥m needs every shorter length. For every L with 1≤L<m, it needs a sequence of L positive integers, with average at most n, whose block sums are covered by n−1 sumfree sets.
One counterexample at length m−1 is not enough. A sequence of length L+1 and average at most n need not contain L consecutive entries of average at most n. So monotonicity in L does not follow directly from the definition.
The average bound. The lower bound S(n−1)+1 of Proposition 5.3 comes from the constant sequence (1,…,1), with A^={1,…,L}. Conjecture 5.6 states that at length S(n−1)+1, no sequence of average at most n has sdeg(A^)≤n−1.
Without the bound on the average, this fails. The paper gives a sequence of length 14 with sdeg(A^)=3, found by semi-random search. Its average is 114, and the authors remark that such examples "are hard to come by".
The gap for L(5). The gap from 49 to 61 is open. By McKenna 2026 (§5), the construction of Corollary 4.2 gives nothing above 49 at n=5:
S(4)=44 excludes the cyclic groups of order at least 46.
Solver runs exclude the non-cyclic groups of order 50 to 60. Their unsatisfiability proofs (in the DRAT format) were checked.
L(5)≤61 excludes the orders of 62 or more.
McKenna 2026 knows no sequence of length 49 with average at most 5 and sdeg(A^)≤4; such a sequence would give L(5)≥50.
Formalization scope
Ambient ℕ. The paper works in an abelian group; here sets are Set ℕ and sequences List ℕ. For X⊆N the Schur degree is the same in ℕ and in ℤ. Theorem 4.1 is formalized for sequences in ℕ only.
sdeg is sInf in ℕ∞, so it is ⊤ when no cover exists, and sdeg(∅)=1. Covers are Fin n → Set ℕ; the sets need not be disjoint or inside X. Each lower bound on sdeg must exclude every cover.
blockSums A uses B <:+: A with B ≠ []; average [] = 0 is never used, since erL requires L>0.
erL n is sInf {L | 0 < L ∧ ERProperty n L} in ℕ, defined for every n (the paper: n≥2). As sInf ∅ = 0, an upper bound on erL alone would hold if no length had the property; the Theorem 4.1 target excludes this, giving ERProperty (k+1) at length ρ(k)−1≥1, and 0 satisfies neither the goal nor the lower bounds.
Ramsey bound.ρ(k) replaces Rk(3). TriangleRamsey k N says every colouring of the pairs x<y of at least N naturals with at most k colours has a monochromatic triangle; the tree proves it for N=ρ(k). As ρ(4)=66>62≥R4(3), the Lean upper bound for L(5) is 65, not 61.
Lemma 4.1, Corollary 4.2. As in McKenna 2026, the sets need only cover G∖{0}, and Lemma 4.1 requires q≥1: for q=0, m1=m2=1 the sequence is empty and sdeg(∅)=1. The prefix sums are exact: xL.
Subtraction is truncated; with m1,m2≥1 and ρ(k)≥2, none of 3 * m₁ - 2, m₁ * m₂ - 1, ramseyBound k - 1 and n - 1 in Fin (n - 1) (n≥3) truncates, and the differences in liftSeq do not truncate when M≥m1≥1.
Finite checks use kernel decide; no native_decide, no external certificate.
Bundles: ClassicalSchurBasic (the objects of the Setting), ClassicalSchurRamsey (TriangleRamsey, ramseyBound), ClassicalSchurLift (GroupSumFree, liftPrefix, liftSeq), ClassicalSchurValues (the finite data of the two value theorems). As a check, the definitions give the paper's values erL 2 = 2 and erL 3 = 5 (checked in Lean by an independent verifier in a scratch file; not in the tree). Reusable: the definitions of ClassicalSchurBasic (the interface lemmas are inlined in the proofs, not separate nodes), TriangleRamsey k (ramseyBound k), and the lift from group coverings. Welcome beyond the targets: a formal TriangleRamsey 4 62, which with not_coveredBySumFree_blockSums gives L(5)≤61 in Lean; the exact L(5); the case n=6.
H. Fredricksen, M. M. Sweet, Symmetric sum-free partitions and lower bounds for Schur numbers, Electron. J. Combin. 7 (2000) #R32. https://doi.org/10.37236/1510
Every seven-point Steiner triple system is the Fano plane — so the role postulates force the Fano planeTextbook
Motivation
The Shape Zero model reaches the Fano plane — the seven-point, seven-line configuration behind the seven imaginary units of the octonions — by a combinatorial route: C1 Formal Proofs, §3, Theorem 3.6 ("Roles Force Fano") states that any Steiner triple system admitting a role colouring is the Fano plane. Its proof derives only that there are 7 points, and takes the last step on trust: C1 §3 asserts "the unique STS(7) (the Fano plane PG(2, 2))" in Theorem 3.3 and justifies it with one sentence, "Uniqueness of STS(7) is classical."
The companion mission The role postulates force exactly seven points proved the point count and deliberately stopped there. This mission supplies the missing step and completes the chain:
Goal: every Steiner triple system on 7 points is the Fano plane, up to a relabelling of its points.
Capstone: every nonempty Steiner triple system that admits a role colouring is the Fano plane, up to relabelling — C1 Theorem 3.6 in full.
The attack path is the standard textbook proof of the uniqueness of STS(7), supplying the step C1 §3 calls classical. The proof goes through three milestones: a normal form around one point, exactly two completions of it, and an explicit relabelling of each completion onto the Fano plane. The line count (seven lines, three through each point) and the meeting property (any two lines meet in exactly one point) then follow as corollaries of the goal. C1 gives no argument for this step; the milestones below are that classical argument, not C1's.
What this mission does NOT prove.
Not the premise. Why lines have three points and why there are three roles is an input of the model, not derived here.
Not the octonions. The Fano plane is the incidence structure behind the octonion multiplication table, but choosing an orientation and building the multiplication (C1 §4–5: the 16 valid orientations, the 48 role colourings) is a separate step, not covered here.
Up to relabelling only. "Is the Fano plane" means: some bijection of points carries the system's lines exactly onto the Fano plane's lines.
Setting
A Steiner triple system on the points {0,…,n−1} is a family of 3-point subsets, called lines, such that every pair of distinct points lies on exactly one line. A role colouring gives each point of each line one of three roles so that the three points of a line get different roles and every point takes every role exactly once.
The Fano plane is the Steiner triple system on {0,…,6} with lines {i,i+1,i+3} modulo 7:
This is the companion mission's published definition RolesForceSeven.fano, labelled 0,…,6. (C1 §5 writes the same lines on e1,…,e7; this mission uses the companion mission's labelling.)
The definitions RolesForceSeven.STS, RolesForceSeven.RoleColouring and RolesForceSeven.fano are imported from the companion mission, not restated, so both missions refer to the same objects. The one new definition is FanoUnique.IsFano S: there is a bijection e from the points of S to {0,…,6} with {e(ℓ):ℓ a line of S}= the Fano lines.
Formalization targets
Goal: every STS(7) is the Fano plane
S a Steiner triple system on 7 points⟹∃e bijective,e(lines of S)=Fano lines.
This is FanoUnique.sts7_is_fano.
Milestones — the attack path
M1 (normal form). Every STS on 7 points can be relabelled so that the lines through point 0 are {0,1,2}, {0,3,4} and {0,5,6}.
M2 (two completions). If an STS on 7 points contains {0,1,2}, {0,3,4}, {0,5,6}, its lines are exactly one of
A: those three and {1,3,6},{1,4,5},{2,3,5},{2,4,6};
B: those three and {1,3,5},{1,4,6},{2,3,6},{2,4,5}.
M3 (both completions are the Fano plane). Explicit relabellings carry A and B onto the Fano lines.
The goal follows from M1, M2 and M3. (These are M3, M4 and M5 in the draft's original numbering.)
Corollaries of the goal
A — seven lines, three through each point. An STS on 7 points has exactly 7 lines, and every point lies on exactly 3 of them.
B — two lines meet once. Any two distinct lines share exactly one point.
Both hold in the Fano plane and are preserved by relabelling, so they follow from the goal.
Capstone
For n≥1, a Steiner triple system on n points with a role colouring is the Fano plane up to relabelling (FanoUnique.roles_force_fano). The companion mission's goal gives n=7; the goal of this mission does the rest. The hypothesis n≥1 is kept, following the erratum to C1 §3: the empty system satisfies every other condition and is not the Fano plane.
Significance
The result itself. Together with the companion mission, it makes C1 Theorem 3.6 fully machine-verified: the role postulates force not only seven points but the Fano plane itself, up to relabelling.
Formalizing it. C1 cites the uniqueness of STS(7) as classical. It was checked numerically — exhaustively over labelled systems — but never proved in the C1 package; this mission proves it.
Numerical cross-check (exhaustive)
check
result
Steiner triple systems on 7 labelled points
30 (classical count 7!/168=30)
of those, isomorphic to the Fano plane
30 of 30
any two distinct lines meet in exactly one point
true in all 30
completions of {0,1,2},{0,3,4},{0,5,6}
exactly 2 (A and B)
swapping points 1 and 2 carries A to B
true
Difficulty
Moderate. M3 is a finite computation. The work is in M1 — building the relabelling bijection from the three lines through a point — and M2, the case analysis on the line through points 1 and 3, which forces the remaining lines. Corollaries A and B follow from the goal by relabelling. Exhaustive search over all line families (235) is not feasible, so the structured proof is needed.
Formalization scope
Points are Fin n; lines are Finset (Fin n); the definitions are the companion mission's, imported unchanged.
"Is the Fano plane" is an equality of line families after relabelling by an equivalence Fin n ≃ Fin 7; it forces n=7 and exactly 7 lines.
The capstone keeps 0<n and the companion mission's role colouring unchanged.
Reversible Binary 2D Cellular Automata: Disproof of R = 18 and Lower Bound R >= 33,076,358Open Problem
Reversible Binary 2D Cellular Automata: Disproof of R=18 and Lower Bound R≥33,076,358
Problem Statement & Context
A two-dimensional binary cellular automaton (CA) on the infinite grid Z2 with the standard 3×3 Moore neighborhood M={−1,0,1}2 updates configurations c:Z2→{0,1} via a local rule f:{0,1}M→{0,1} according to:
Ff(c)(z)=f((c(z+u))u∈M)
A local rule f is reversible (or bijective) if its global map Ff is a bijection of the configuration space {0,1}Z2.
Let R denote the exact number of reversible binary local rules on the 3×3 Moore neighborhood. A longstanding open conjecture asserted that R=18, corresponding solely to the 18 trivial single-cell shifts and complemented shifts:
f(c)=c(z+u)orf(c)=1−c(z+u)(u∈M)
In this mission, we formally disprove R=18 by constructing an explicit non-trivial conserved-landscape rule f⋆ whose global map Ff⋆ is an involution on Z2, proving 19≤R. We further extend this result to establish R≥33,076,358.
Ladder of Proven Bounds
Bound Level
Proven Bound
Description / Mathematical Mechanism
L0
R≥18
Trivial single-cell shifts and complemented shifts (2×9=18).
L1
R≥19
Disproof of R=18 via explicit non-trivial conserved-landscape rule f⋆.
L2
R≥33,070,982
Conserved-landscape marker rule family (24,576 centered rules).
L3
R≥33,076,358
Incorporation of 5,376 off-centre marker rules reading center cell x0.
Symmetry
Rrot90=74
Exactly 74 rules invariant under 90∘ spatial rotations.
Torus
$
\mathcal{R}_{2,3}
Upper Limit
R≤2511
Derived from constant divergence condition f(0)=f(1).
Key Milestone Theorems
Theorem 1 (Trivial Rule Reversibility): All 18 single-cell shift and negated-shift rules are bijective global maps.
Theorem 2 (Conserved-Landscape Involution f⋆): The rule f⋆ complements a cell iff its W and SE neighbors are 1 and the other six are 0. Ff⋆∘Ff⋆=id.
Theorem 3 (Non-Triviality & 19≤R): f⋆ differs from every trivial rule, establishing 19≤R and disproving R=18.
Theorem 4 (Constant Divergence Condition): Every reversible rule satisfies f(0)=f(1).
Erdős #131: the ELRSS bound F(N) < 3·sqrt(N) + 1 (the open problem itself is NOT settled)Open Problem
What this mission proves, and what it does not. The goal theorem is the explicit upper bound F(N)<3N+1 of Erdős, Lev, Rauzy, Sándor and Sárközy (1999) — a published result, now formally verified here. Erdős problem #131 itself is NOT solved by this mission. Erdős asked for the order of growth of F(N), which is known only to lie between N1/5 and N1/4+o(1) and remains open. A goal theorem reading Proved therefore means the 1999 bound is formalized, nothing more.
Motivation
Call a finite set of positive integers non-dividing if no element of it divides the sum of any nonempty collection of the other elements. The condition is easy to state and immediately restrictive: taking the collection to be a single element already forbids a∣b, so a non-dividing set is primitive, and taking larger collections forbids a great deal more. Paul Erdős asked, with Lev, Rauzy, Sándor and Sárközy, how large such a set can be inside {1,…,N}. Writing F(N) for that maximum, the question is to determine the order of growth of F(N). It remains unanswered, and the gap between what is known from above and from below is a full factor of N1/20.
The problem sits at the meeting point of divisibility and additive combinatorics. Its upper bounds come from the theory of non-averaging sets, since every non-dividing set is non-averaging; its lower bounds come from explicit constructions. The two sides have been improved independently for twenty-five years without meeting.
Setting
Work inside N. For a finite A⊆N and a∈A, write A∖{a} for A with a removed. Say that A is non-dividing when
∀a∈A,∀S⊆A∖{a} with S=∅:a∤x∈S∑x.
Two conventions are forced. First, S ranges over all nonempty subsets, singletons included, so primitivity is part of the property rather than an extra assumption. Second, S must be nonempty: the empty sum is 0 and every a divides 0, so admitting S=∅ would leave no non-dividing sets at all.
Define the extremal function
F(N)=max{∣A∣:A⊆{1,…,N},A non-dividing}.
A set is non-averaging if no element equals the average of some nonempty collection of the others. Every non-dividing set is non-averaging, which is the link through which the strongest upper bounds arrive.
Target
The goal is the explicit upper bound of Erdős, Lev, Rauzy, Sándor and Sárközy:
F(N)<3N1/2+1.
The question Erdős actually posed is stronger and remains open:
Determine the order of growth of F(N).
Significance
The bound above is the sharpest explicit constant in the literature, and it is the natural formalization target: it is a clean closed-form inequality valid for every N, with a self-contained combinatorial proof, and nothing about it is asymptotic.
Beyond it lies the open question. What is known:
F(N)>exp((2/log2+o(1))logN), due to Straus, which refuted Erdős's own initial guess that F(N)<(logN)O(1).
F(N)≫N1/5, from a construction Erdős credits to Csaba.
F(N)<3N1/2+1, the target above.
F(N)≤N1/4+o(1), from Pham and Zakharov's theorem on non-averaging sets. This settles Erdős's specific sub-question — whether F(N)>N1/2−o(1) — in the negative.
So the truth lies between N1/5 and N1/4+o(1), and which end is right is unknown.
Difficulty
The obvious argument gives almost nothing. Pigeonhole on partial sums shows ∣A∣≤minA: order the other elements arbitrarily, form the running sums, and if there are more of them than residues modulo minA then two agree, making a contiguous block sum divisible by minA. That is genuinely all the elementary argument yields, and it is compatible with ∣A∣ as large as N.
The difficulty is that the constraint is a statement about exponentially many subset sums, while the conclusion is about a single cardinality. Every strong bound known proceeds by discarding almost all of that information and keeping a structured fragment — contiguous blocks, or the averaging condition — and the loss at that step is exactly what separates N1/5 from N1/4. Improving either side appears to require using the divisibility conditions for several elements a simultaneously, which no current argument does.
Formalization scope
Sets are Finset ℕ. The forbidden subsets are drawn from A.erase a, so the tested element never appears in the sum it is tested against, and they are quantified as members of (A.erase a).powerset rather than by the subset relation, which makes the property decidable — this is what allows an explicit finite witness to be checked by the kernel rather than asserted. F(N) is a Finset.sup of cardinalities over the filtered powerset of Finset.Icc 1 N, so it is a total function with no junk-value caveats and lower bounds on it follow from exhibiting a single set.
The target inequality is stated over ℝ with Real.sqrt, matching the source's 3N1/2+1 rather than any integer rounding of it.
Timeline
1980s–1998. Erdős poses the problem repeatedly, initially conjecturing F(N)<(logN)O(1).
Straus. Disproves that guess, with F(N)>exp(clogN).
Csaba. A construction giving F(N)≫N1/5, credited by Erdős in 1997.
1999. Erdős, Lev, Rauzy, Sándor and Sárközy name the property non-dividing and prove F(N)<3N1/2+1.
2024. Pham and Zakharov bound non-averaging sets, yielding F(N)≤N1/4+o(1) and answering Erdős's sub-question negatively.
Open. The order of growth of F(N), anywhere between N1/5 and N1/4+o(1).
Selected references
P. Erdős, V. Lev, G. Rauzy, C. Sándor, A. Sárközy, Greedy algorithm, arithmetic progressions, subset sums and divisibility, Discrete Mathematics 200 (1999), 119–135.
H. T. Pham, D. Zakharov, Sharp bound for the Erdős–Straus non-averaging set problem, arXiv:2410.14624; Geom. Funct. Anal. (2025). Theorem 1: a non-averaging A⊆[n] has ∣A∣≤n1/4+o(1).
R. K. Guy, Unsolved Problems in Number Theory, 3rd ed., Springer (2004), problem C16.
Modular Schur numbers: a uniform closed form in the stable-colour regimeResearch Paper
Motivation
A set of integers is sum-free when no two of its members add up to a third. Schur's
theorem (1916) says that for every k there is a largest interval [1,N] that can be split
into k sum-free classes, and the resulting Schur numbersS(k) are notoriously hard to
compute: S(5)=160 was settled only in 2018, by a SAT computation with a machine-checked
proof certificate.
Replacing "adds up to" by "adds up to, modulo m" gives a family that behaves very
differently. Modular Schur numbers were introduced by Chappelon, Revuelta Marchena and
Sanz Domínguez, who settled the moduli m∈{1,2,3} and proved the universal bound
Sm(k,ℓ)≤m−1 (Electron. J. Combin. 20(2) (2013) #P61).
D'orville, Sim, Wong and Ho then closed m∈{4,5,6,7} by residue case analysis and
posed the general modulus as an open problem
(Integers 25 (2025) #A62, their Problem 1).
Each additional modulus had cost a separate case analysis, and the case analysis grew with
m.
The timeline matters for reading what follows. The 2013 paper supplies the universal cap. The
2025 paper supplies a singleton criterion (its Theorem 4) and a divisibility obstruction (its
Corollary 3), and applies the latter only in the coprime case gcd(m,ℓ−1)=1 (its
Corollary 5). What remained was to optimise that obstruction over every residue rather than
only in the coprime case, which is what collapses the whole family to one formula.
Setting
Fix integers m≥2, ℓ≥2 and k≥1. A set S of integers is
ℓ-sum-free modulo m when there are no x1,…,xℓ∈S and y∈S,
repetitions among the xi allowed, with
x1+⋯+xℓ≡y(modm).
The repetition clause is not a technicality: a single element can make its whole class
unsafe. The modular Schur numberSm(k,ℓ) is the greatest N≥0 such that the
interval [1,N] can be partitioned into at most k classes, each ℓ-sum-free modulo
m. A partition into such classes is called valid.
Two derived quantities carry the whole story. Write
d=gcd(m,ℓ−1),n=dm.
Then dn=m exactly, and d∣(ℓ−1) by construction. All Lean statements in this
mission use these same names.
Formalization targets
Goal: the closed form in the many-colours regime
Sm(k,ℓ)=gcd(m,ℓ−1)m−1=n−1for all m≥2,ℓ≥2,k≥n−1.
Closed form here means something precise: the value is produced from m and ℓ by one
gcd, one division and one subtraction, with no search over colourings, no recursion, and no
case split on ℓmodm. The statement fixes no constants and no modulus, so it is not
invalidated by any later refinement of the threshold in k.
The single-colour value
Sm(1,ℓ)=min(ℓ−1,⌊ℓm⌋)(2≤ℓ≤m),
together with the complementary regime m<ℓ, where the value is 0 if
ℓ≡1(modm) and 1 otherwise. The two together give a value for every
admissible pair (m,ℓ) at k=1, and the tree carries that combined formula at the
residue level and at the integer level.
Significance
What the results give. One expression replaces an open-ended sequence of per-modulus case
analyses. The moduli m∈{1,2,3} of the 2013 paper and m∈{4,5,6,7} of the 2025
paper are specialisations, and every remaining modulus is covered at once in the stated range
of k.
The mechanism is a single self-defeating value. Take ℓ copies of n: they sum back to
n modulo m, so the lone class {n} already breaks the rule, while every smaller value is
safe. That one observation supplies a matching upper and lower bound.
The upper bound is uniform in k. Adding colours never raises the value past n−1, which
is what makes the formula stable.
The lower bound costs n−1 colours, one per safe residue. Identifying the least
sufficient number of colours is where the subject is still open.
Status of the tree, stated precisely. Everything listed under Formalization targets is both
proved and machine-checked.
21 theorems and 3 definition bundles, each with a complete Lean proof verified by this
platform.
Axiom-clean: each closure is contained in {propext, Classical.choice, Quot.sound}.
This mission therefore publishes a finished development rather than an open call on its
stated goal.
What is genuinely open is listed under Difficulty below, and is not part of the verified tree.
Relation to the accompanying paper. The paper states the single-colour value only under
2≤ℓ≤m. Three results in the tree go beyond it: the complementary regime
m<ℓ, and the combined formula covering every m≥2 and ℓ≥2, stated once at
the residue level and again at the integer level. Two further results, the coset-cardinality
bounds, are supporting work of the Lean development and are not numbered results of the paper.
Each theorem's source field records which of these it is.
Difficulty
The threshold in k is not n−1
The obvious attack on the general modulus is to guess that only singletons can be safe classes.
The threshold in k would then be exactly n−1, and the problem would close for all k at
once. That guess is false.
Take m=12 and ℓ≡11(mod12), so d=2 and n=6. The two-element set
{1,5} is ℓ-sum-free modulo 12, and three colours then suffice where the singleton
count would demand five.
So the least k at which the closed form takes hold, written k0(m,ℓ), is not n−1 in
general. What is known about it:
Prime moduli.k0(p,ℓ)=p−1 for every ℓ≥p−1 with
ℓ≡1(modp).
Composite moduli. Bracketed above and below, but not determined.
A correction to the published prime-power formula
Theorem 8 of D'orville, Sim, Wong and Ho gives a three-branch formula at prime-power moduli.
Its middle branch is false. The correction is stated here in full because it bears directly on
the threshold.
The counterexample. At p=2, i=3, k=3 and ℓ=8 that branch gives
S8(3,8)=5, while the correct value is S8(3,8)=7.
Where the proof fails. In the supporting Lemma 2(2) of that paper. The pair a=2,
b=6 satisfies every hypothesis of that lemma at p=2, i=3, ℓ=8, yet
{2,6} is 8-sum-free modulo 8.
The replacement result.
Spi(k,ℓ)=pi−1for p prime,i≥1,ℓ≥2,p∤(ℓ−1), and every k≥i(p−1).
It is proved from a valuation-layer colouring that consumes i(p−1) classes, together with the
universal cap. The hypothesis p∤(ℓ−1) forces d=1 and n=pi, so the
replacement reaches the goal theorem's value at k≥i(p−1) in place of k≥pi−1, and
it contradicts the printed middle branch for infinitely many triples (p,i,ℓ).
Status of that correction, stated precisely.
It is a prose proof in a draft note, listed under Selected references below and readable in
full there.
It is not formalized, and it is not part of this mission's verified tree.
Nothing in the verified tree depends on it.
It is recorded here because a reader who compares this mission against the 2025 paper will
otherwise meet the contradiction with no explanation. Formalizing it is the subject of a
separate mission.
The intermediate regime
For 1<k<n−1 the classes must be simultaneously large and ℓ-sum-free, and no formula
is known. The value is empirically eventually periodic in ℓmodm for fixed k,
verified through m≤13.
None of these open directions is weakened by the goal theorem, which deliberately assumes
enough colours to avoid the question.
Formalization scope
Two levels of statement
Two levels appear in the tree, and the distinction between them is the first thing to fix.
At the integer level the objects are the integers 1,…,N themselves.
At the residue level they are their classes modulo m, which in Lean is the type
ZMod m: Mathlib's type of residues modulo m, a commutative ring with exactly m elements
for m≥1, carrying the reduction map from Z and the arithmetic that map
preserves.
Working in ZMod m turns "adds up to, modulo m" into a plain equation instead of a
divisibility side condition, and it makes every colour class a subset of a finite type.
Conventions
The development works residue-by-residue in ZMod m and commits to the following conventions,
all of which are silent in the prose and load-bearing in Lean.
ℓ-tuples are functions Fin ℓ → ZMod m valued in the class. This builds in
"repetitions allowed" rather than leaving it to a side condition.
Classes are Finsets, so finiteness is structural.
A valid partition is a structure with four fields: covering, pairwise disjointness,
containment in the target set, and ℓ-sum-freeness of each class.
Empty classes are permitted. This is what makes "at most k" and "exactly k"
interchangeable once any colouring exists.
The two numbers, and the cap in their definition
Both a residue-level and an integer-level number are defined, and a reduction theorem proves
them equal for every m≥2. Bounds are proved on the residue side and quoted on the integer
side.
Both are defined with Nat.findGreatest against the bound m−1. That cap is neither an
approximation nor a trivialising choice: a separate theorem shows any N admitting a valid
partition satisfies N≤Sm(k,ℓ) with no hypothesis on N, because N≥m admits no
valid partition at all. A reader checking for a vacuous formalization should also note that the
goal is an equality, not a bound, so it cannot be satisfied by weakening a hypothesis.
Reusable beyond this mission
the residue-reduction bridge;
the singleton criterion;
the two coset-cardinality bounds, which are pure counting statements about subsets of a
cyclic group whose differences lie in a proper subgroup.
Contributions welcome on the open directions named under Difficulty, in particular any
lowering of the threshold in k toward k0, and a closed form for k0 at composite moduli.
Selected references
J. Chappelon, M. P. Revuelta Marchena, M. I. Sanz Domínguez, Modular Schur numbers,
Electron. J. Combin. 20(2) (2013) #P61. https://doi.org/10.37236/2374 (also
arXiv:1306.5635)
A. McKenna, A correction to a prime-power formula for modular Schur numbers, 2026.
Draft note, not submitted for publication. Released in the repository below on
2026-09-20:
PDF
·
Markdown source
Magic Squares IV: The Special Classes of Order-Three Magic SquaresResearch Paper
Motivation
The first three missions in this programme settle the ordinary 3×3 magic squares end to end:
Mission I proved MacMahon's count M3(3e)=2e2+2e+1, Mission II his
semi-magic count H3(t)=3(4t+3)+(2t+2), and Mission III
classified the normal squares (Lo Shu uniqueness). All three work with the
plain magic condition.
This mission counts the two special classes that are singled out by requiring
more than magicness, in the opposite directions one expects:
the panmagic (pandiagonal) squares, whose broken diagonals must also have
the magic sum — a strengthening so strong that for order three the whole
family collapses;
the symmetric magic squares, whose array must equal its transpose — a
symmetry that only removes a few conditions and leaves a genuine family.
Writing P3(t) and S3(t) for the two counting functions, the goal is to
determine both for every line sum t:
Everything is built on the vocabulary of MagicSquares (Mission I):
IsPanMagic — semi-magic, and every broken diagonal in both directions has
the line sum, indices read modulo n;
IsSymmetric — Mij=Mji;
panMagicCount, symmetricMagicCount — the cardinalities of the two filtered
finsets of arrays over Fin (t+1), which is lossless because every entry of a
square of line sum t is at most t.
The new definition module MagicSquaresSpecial3 records the two explicit shapes
that the proofs produce: constSquare3 e (the array all of whose entries are
e, read over the ambient Fin (3e+1)) and
symmMagic3(e,a)=a2e−ae2e−aeaea2e−a,
together with the parameter set symmParamSet e={0,…,2e} and its
cardinality symmParamCount e.
Formalization targets
Goal — the complete count
special_three_count: for every natural number t, the pair of equalities
displayed above. The proof splits on 3∣t and reduces to four child nodes.
The route
Panmagic collapses to the constant square (pan_three_card). Writing the
array as a,b,c;d,m,f;g,h,i, the twelve line equations form a linear system
whose only nonnegative solution is a=b=⋯=i=e. So P3(3e)=1.
Symmetry is classified by a corner (symmetric_magic_three_classify).
Symmetry identifies three pairs of entries, leaving five free cells and five
line equations; the anti-diagonal 2c+m=3e forces c=m=e, and the rows give
M=symmMagic3(e,M00).
A bijection onto an interval (symm_three_bij). Sending a symmetric magic
square of line sum 3e to M00 is a bijection onto
{0,1,…,2e}; hence S3(3e)=2e+1.
The divisibility obstruction (pan_three_otherwise,
symm_three_otherwise). Both classes consist of magic squares, and an
order-three magic square has centre t/3 (center_of_order_three), so
3∤t forces both counts to vanish.
Significance
The results. The three order-three counts behave completely differently in the
same parameter: MacMahon's M3 is quadratic, the symmetric count is linear,
and the panmagic count is constant. That contrast is the point of the order-three
study — order three is small enough to be completely understood, and the special
classes show how differently the two natural strengthenings of the magic
condition act. It is also exactly what is lost at order four, where no closed
form is known for any of the three.
Formalizing them. The mathematical content is elementary, but the two classes
require genuinely different proof techniques, which is what makes the mission
worth formalizing:
For the panmagic case the six broken diagonals together with the rows and
columns give a subtraction-free linear system over N, so the
uniqueness step is a single omega call. The only work is exposing the twelve
equations, which requires reducing the index arithmetic i+k and
rev(i)+k on Fin 3.
For the symmetric case the answer is a family, and the admissibility bound
a≤2e is a statement about truncated subtraction: the entry 2e−a is
computed in N, so the row identity a+(2e−a)+e=3e is satisfiable
precisely for a≤2e. Formalizing the bijection therefore needs an honest
treatment of that truncation, where the panmagic case needs none.
Difficulty
Truncated subtraction, in the admissibility direction. The classification
M = symmMagic3 e (M 0 0) is true for every M, without any bound on M00;
the bound only appears when asking which members of the family are squares of
line sum 3e. Keeping those two statements apart is what makes the bijection
proof manageable: classification is a pure omega computation, while
admissibility is a one-line argument that a+(2e−a)=2e forces a≤2e.
Finite but not decidable.panMagicCount and symmetricMagicCount are
cardinalities of filtered finsets over a function type, so the proofs cannot be
decide or norm_num — the platform forbids native_decide in any case. Both
counting theorems are therefore stated as Finset.card_bij / card_eq_one
arguments over explicit bijections, not as finite evaluations.
Formalization scope
The in-scope statements are the two closed forms for all t, together with the
classification of the symmetric family that the bijection is built on.
Parametrization follows MacMahon; the symmetric shape is the diagonal slice
c=e of his two-parameter family, which is why the count drops from
quadratic to linear.
Nothing here re-proves Mission I: the divisibility obstruction is inherited
from the already-proved center_of_order_three.
Reusable beyond this mission: the order-three classification of symmetric magic
squares, the observation that panmagic order-three squares are exactly the
constant ones, and the technique of discharging twelve-index linear systems
over Fin 3 with a single omega.
Selected references
P. A. MacMahon, Combinatory Analysis, Vol. II, Cambridge University Press, 1916.
M. Beck, T. Cohen, J. Cuomo and P. Gribelyuk, The number of "magic" squares, cubes and hypercubes, Amer. Math. Monthly 110 (2003), 707--717. https://arxiv.org/abs/math/0201013
W. S. Andrews, Magic Squares and Cubes, 2nd ed., Dover, 1960.
H. Behforooz, Symmetric and panmagic squares (survey of the symmetry
properties of magic squares), and the standard pandiagonal literature.
7 thms1 active userReviewed
🏆Completed
Captain: mysticflounder
Balog-Szemeredi-Gowers theorem over additive energyResearch Paper
Motivation
Additive combinatorics studies what arithmetic structure follows from statistical
signals. The Balog–Szemerédi–Gowers theorem is its central regularity
statement: a pair of finite sets with large additive energy (many additive
quadruples) contains large subsets whose sumset is small. Balog and
Szemerédi proved the first version in 1994 using the regularity lemma, which
gave a tower-type dependence between the parameters; Gowers obtained a
polynomial dependence in 1998. The theorem powers results across the field —
from sum-product estimates to the structure of sets with small doubling — and
its proof assembles three reusable machines: dependent random choice, the
popular-sum graph, and Ruzsa calculus.
Setting
Work in an arbitrary abelian group G (Lean: AddCommGroup G). For finite
X,Y⊆G, the additive energyE(X,Y) counts quadruples
(x,x′,y,y′) with x+y=x′+y′; the trivial maximum is ∣X∣3 when
∣X∣=∣Y∣. The sumsetX+Y is {x+y}, and the difference set
X−Y is defined pointwise. A set has small doubling when ∣X+X∣ is
linear in ∣X∣. The Lean development uses Finset.addEnergy and
Finset.addConvolution from Mathlib.
A bipartite graph here is an edge set E of type Finset (G × G) with
E⊆A×sB, not a Mathlib SimpleGraph; solvers should state
graph hypotheses that way. Given such an E, the partial sumsetA+EB
is {a+b:(a,b)∈E}, following Tao–Vu Definition 2.28.
Target
The mission goal is the two-set (equal-cardinality) form:
This statement is assembled from the sources rather than quoted from them:
Tao–Vu Lemma 2.30 supplies the energy-to-graph step, Fox–Sudakov §5.1 (the same
theorem as Tao–Vu Theorem 2.29) supplies the graph-level bound, and Ruzsa
calculus converts a sumset bound into the difference-set bound above. No cited
work states this exact form, and the goal deliberately keeps c and C
existential; the explicit-constant variant is proved separately in the mission
with c=η/16.
The four milestones follow the sources' own numbering and are, in dependency
order, Fox–Sudakov Lemma 5.1, Fox–Sudakov Lemma 5.2, the Fox–Sudakov §5.1 /
Tao–Vu Theorem 2.29 graph bound with explicit constants, and Tao–Vu Lemma 2.30.
The first three lie on the goal's proof path; the fourth is the reusable
packaging of the energy-to-graph step.
Significance
The result converts a purely statistical hypothesis (many additive quadruples)
into genuine algebraic structure (a large subset with a small difference set)
with polynomial losses — the step that makes energy methods usable. It is a
standard tool behind quantitative Freiman-type arguments.
Formalizing it matters because the constants are the content: the development
tracks explicit constants through dependent random choice (graph level
c=δ/8 and C=213K3/δ5+212/δ5; energy level
c0=η/16 and C0=213(4/η)3/(η/2)5+212/(η/2)5),
which paper proofs often leave implicit. Fox–Sudakov state the application for
sets of integers; the formalization is over an arbitrary AddCommGroup, with
no further hypothesis on the group. Mathlib at the pinned revision (v4.33.1)
contains no BSG statement, so this fills a genuine upstream gap.
Difficulty
The hard step is dependent random choice: sampling a random vertex subset of
the popular-sum graph must simultaneously keep many vertices and keep the
induced subgraph dense, and the two requirements fight each other. The naive
first idea — take the densest neighborhood — loses control of the vertex count;
the fix is a two-stage Markov-plus-payoff selection whose density analysis
needs the exact path-count lower bound, not just an order estimate.
Two places where the formalization departs from Fox–Sudakov are recorded on the
affected statements rather than hidden: the length-three path count admits
degenerate paths (the source's a′=a and b′=b terms are dropped,
which weakens the conclusion and is sound for the BSG use), and the density
parameter is instantiated at a guaranteed lower bound rather than the exact
edge density.
Formalization scope
Sets are Finset G in an AddCommGroup G with DecidableEq; energy is
Finset.addEnergy; graphs are edge sets Finset (G × G), with the pointwise
sumset and difference operations from open scoped Pointwise. Density
hypotheses are stated with explicit real constants. The counting lemmas at the
bottom of the development (sum_addConvolution_eq_card_product,
path3_count_le_triple_rep_count, restricted_sumset_via_multiplicity) are
unconditional; the statements that need them carry the nonemptiness,
equal-cardinality and density hypotheses that exclude degenerate zero-energy
configurations. Welcome contributions: the single-set polynomial
Freiman–Ruzsa consequences, and non-abelian variants.
Selected references
A. Balog and E. Szemerédi, A statistical theorem of set addition,
Combinatorica 14 (1994), 263–268.
W. T. Gowers, A new proof of Szemerédi's theorem for arithmetic
progressions of length four, Geom. Funct. Anal. 8 (1998), 529–551.
J. Fox and B. Sudakov, Dependent random choice, Random Structures &
Algorithms 38 (2011), 68–99 (Lemmas 5.1/5.2 and §5.1 BSG application).
T. Tao and V. Vu, Additive Combinatorics, Cambridge Univ. Press (2006),
Definition 2.28 (partial sumsets), Theorem 2.29 (BSG, p. 79) and
Lemma 2.30 (energy to partial sumset, p. 80).
C. Reiher and T. Schoen, Note on the theorem of Balog, Szemerédi, and
Gowers, Combinatorica 44 (2024), no. 3, 691–698
(arXiv:2308.10245).
I. Ruzsa's inequalities via Mathlib's Finset.pluennecke_ruzsa_inequality_nsmul_add;
see G. Petridis, New proofs of Plünnecke-type estimates for product sets in
groups, Combinatorica 32 (2012), 721–733
(arXiv:1101.3507).
McKenna, Lean formalization (mathlib-only, axiom-clean),
lean-formalizations,
modules Combinatorics/Additive/BalogSzemerediGowers and
BSGEnergyToGraph.
12 thms1 active userReviewed
🏆Completed
Captain: Yuxuan Xu
Magic Squares III: The Complete Classification of Order-Three Magic SquaresResearch Paper
Motivation
The first two missions in this programme counted order-three squares.
Mission I proved MacMahon's magic count M3(3e)=2e2+2e+1 and Mission II
his semi-magic count H3(t)=3(4t+3)+(2t+2). What neither
does is classify: counting tells you how many squares there are, but not what
they look like.
This mission closes that gap for the most classical case of all. A normal
magic square of order three is a 3×3 array containing each of
1,2,…,9 exactly once, whose rows, columns and two main diagonals all sum
to the magic constant 15. The statement to be proved is the uniqueness of the
Lo Shu square:
every normal magic square of order three is one of the eight images of
438951276 under the symmetry group of
the square.
In particular there are exactly 8 of them, and they form a single orbit under
the dihedral group D4.
Setting
MacMahon's parametrization (already formalized in MagicSquaresParam3) writes
every order-three magic square of line sum 3e as
together with the identification of those eight parameter pairs. By the
bijection magic_three_param_bij this is exactly the statement that there are
eight normal magic squares of order three, i.e. that Lo Shu is unique up to the
symmetry group of the square.
The route
Normality bounds the parameters. If mkMagic3(5,a,c) is normal
then 1leale9 and 1lecle9, because a and c are corner
entries. This reduces the classification to a finite search over
81 pairs.
Classification (magic_three_normal_classify). Within that range,
mkMagic3(5,a,c) is normal exactly when (a,c) is one of
(2,4),(2,6),(4,2),(4,8),(6,2),(6,8),(8,4),(8,6).
The eight surviving pairs are precisely those with a,c distinct corners of
the Lo Shu square; the excluded ones are those with a+c=10, for which the
(2,1) entry a+c−5 collides with the centre 5.
3. Converse (magic_three_normal_converse). Each of the eight pairs really
does give a normal square.
Significance
The result itself. The uniqueness of Lo Shu is the oldest non-trivial
classification in combinatorics — it is the order-three case of the
classification problem for magic squares, and the reason n=3 is special: for
n=4 there are 880 normal squares (up to symmetry) and for n≥5 no
classification is known. Formalizing it shows that the counting machinery of
Missions I and II can be turned around and used as a classification tool: the
parametrization plus a finite verification give the complete list, not just the
cardinality.
Formalizing it. The whole proof is a finite case check over 81 parameter
pairs, so the mathematical content is small and the formalization difficulty is
concentrated in making the finiteness usable. Two things have to be arranged
before automation can see the problem:
IsNormal is stated with a Function.Injective, which is not decidable
as stated; it must first be rewritten into an explicit conjunction of
entrywise bounds and pairwise inequalities over Fin 3.
The quantifiers over Fin 3 do not unfold by simp alone; one needs
Fin.forall_fin_succ to expand them before norm_num can decide the
81 resulting ground instances.
Difficulty
Finiteness must be manufactured. Nothing in IsNormal mentions a bound on
a or c, so the first step is to derive 1≤a,c≤9 from the entrywise
bounds of normality. Skipping it leaves an infinite search that interval_cases
cannot start.
Truncated subtraction. The parametrization is written over N, so
entries such as a+c−5 and 15−a−c truncate at zero. Every ground instance
must be evaluated with the truncation in place — which is why the classification
is carried out by evaluating the actual entries rather than by manipulating
symbolic inequalities.
Formalization scope
Normal means: entries in [1,n2] and pairwise distinct (IsNormal).
The classification is over MacMahon parameters, so it inherits the
parametrization of MagicSquaresParam3 and the bijection of Mission I.
Trivializing formalizations are ruled out: the goal is not a declaration that
some finite set has eight elements, but a derived classification — normality
must be characterized by an explicit list of parameter pairs.
Reusable beyond this mission: the decidable reformulation of IsNormal for
Fin 3 (and the Fin.forall_fin_succ technique for unfolding finite
quantifiers), the list of the eight Lo Shu parameters, and the order-three
classification itself.
Selected references
P. A. MacMahon, Combinatory Analysis, Vol. II, Cambridge University Press, 1916.
M. Beck, T. Cohen, J. Cuomo and P. Gribelyuk, The number of "magic" squares, cubes and hypercubes, Amer. Math. Monthly 110 (2003), 707--717. https://arxiv.org/abs/math/0201013
W. S. Andrews, Magic Squares and Cubes, 2nd ed., Dover, 1960 (the classical enumeration for n=4).
Primal-Dual Online Algorithms III: Set-Cover Approximation via CertificatesTextbook
Motivation
Set cover is the standard worked example of the primal-dual method, and Chapter 2 of Buchbinder's thesis uses it that way: it is where the machinery of §2.1 is first turned on a concrete NP-hard problem. Two analyses appear. The greedy algorithm, analysed by dual fitting, buys the set with the best cost-per-newly-covered-element ratio and charges the price to the elements it covers; the resulting element prices form an infeasible dual that becomes feasible after scaling by Hn. The primal-dual algorithm instead raises the price of an uncovered element until some set's constraint goes tight, buys that set, and repeats; the resulting dual is feasible, and each bought set is paid for by elements of frequency at most f, giving an f-approximation.
Both analyses have the same shape, and it is the shape that matters for the rest of the series: the algorithm never sees the optimum. It maintains a dual solution, and the approximation ratio falls out of comparing the primal it built against the dual it accumulated.
Setting
An instance consists of a finite type E of elements, a finite type S indexing available sets, an assignment s↦As⊆E, and a nonnegative cost c:S→R. Every element is assumed to lie in at least one available set; the source leaves this implicit, and without it no cover exists and the approximation statements are vacuous. The covering LP and its packing dual are
The frequency of an element is the number of sets containing it, and f denotes the maximum frequency over all elements.
The two standing assumptions — nonnegative costs, and every element lying in some available set — are carried by a bundled SetCoverInstance, not passed as loose hypotheses. Every source-facing statement in the mission takes such an instance and reads those facts off its fields, so none of them can be instantiated at data violating either. The two indicator lemmas are the exceptions and are labelled as generalized assisting results: one has no cost function in scope at all, and the other's hypothesis that a given C covers is strictly stronger than coverability of the family.
Costs are permitted to be zero and the ground type is permitted to be empty. No Nonempty E hypothesis appears anywhere; when E is empty, f=0 and the f-approximation bound reads cost(C)≤0, which the certificate's tightness clause forces to be 0≤0 rather than anything false.
Formalization targets
The results are stated about certificates, not about executable algorithms. This is the central modelling decision of the mission and it is deliberate: the mathematical content of the source's proofs is entirely a statement about the invariants the output satisfies, and separating that from the question of whether a particular procedure produces such output keeps each half provable on its own.
A primal-dual certificate is a pair (C,y) where C⊆S covers E, y is dual-feasible, and every s∈C has a tight dual constraint, ∑e∈Asye=cs.
Goal — the primal-dual f-approximation
For any primal-dual certificate (C,y) and any fractional cover x,
s∈C∑cs≤f⋅s∈S∑csxs.
Since this holds against every fractional cover, it holds in particular against an optimal one, so the cover C costs at most f times the fractional optimum and a fortiori at most f times the integral optimum.
The double-counting step
The one substantive step of the goal is split out as its own target: for a primal-dual certificate,
s∈C∑cs≤f⋅e∈E∑ye.
Tightness rewrites the cover's cost as a double sum over chosen sets and their elements; exchanging the order groups it by element, each charged at most f times. With this and weak duality, the goal is two lines.
The greedy bound
A greedy certificate at ratio ρ is a cover C and a nonnegative y with ∑s∈Ccs=∑eye and ∑e∈Asye≤ρcs for every s. For such a certificate and any fractional cover x,
s∈C∑cs≤ρ⋅s∑csxs.
Instantiating ρ=Hn is what recovers the source's greedy guarantee; the harmonic bound itself is already in Mathlib.
Set-cover weak duality and LP attainment
Every dual packing is bounded by every fractional cover, ∑eye≤∑scsxs; the fractional optimum is at most the integral optimum; and both optima are attained, not merely bounded below. Attainment of the fractional optimum is a genuine linear-programming fact and is the hardest supporting item in the mission.
Significance
This is where the series first converts a dual-feasibility invariant into an approximation ratio on a concrete combinatorial problem, and the two certificate predicates are reused verbatim by the online covering missions later in the series. Set cover approximation has, as far as we can determine, no prior formalization in Mathlib or in any public Lean library: there is no set-cover problem statement, no greedy analysis, and no f-approximation result to build on.
Difficulty
The two certificate bounds are finite-summation arguments of moderate length — the work is in a double-counting step that reindexes a sum over chosen sets into a sum over elements, weighted by frequency. Attainment of the fractional optimum is different in kind: it needs a compactness or vertex argument about the covering polytope and is the item most likely to need real work. Zero-cost sets are permitted throughout, so any later algorithm definition that divides by a cost must handle that case explicitly.
Formalization scope
Definitions cover §2.2 of the source, excluding §2.2.2 (randomized rounding), which is deferred to a separate mission because its expected-cost and failure-probability analysis is measure-theoretic and shares no infrastructure with the deterministic results.
Two theorems are not in this mission: that the greedy algorithm produces a greedy certificate, and that the primal-dual algorithm produces a primal-dual certificate. Those require defining the algorithms and proving termination and coverage, and are planned as a second wave. Until that wave lands, the source's Theorems 2.4 and 2.6 should not be described as fully formalized — what this mission establishes is the certificate-to-ratio half of each.
Vijay V. Vazirani, Approximation Algorithms, Springer, 2001, Chapters 2 and 15 — the standard treatment of the greedy and primal-dual set-cover analyses.
10 thms1 active userReviewed
🏆Completed
Captain: Yuxuan Xu
Magic Squares II: MacMahon's Enumeration of Order-Three Semi-Magic SquaresResearch Paper
Motivation
This is the second mission in the magic-squares formalization programme, and it
takes up the case the first one deliberately left open.
Counting semi-magic squares — arrays of nonnegative integers whose rows and
columns all share a common line sum, with the diagonals unconstrained — is the
"honest" version of the enumeration problem. For order three the magic count
M3(t) (mission I) is only a quasi-polynomial: it vanishes unless
3∣t and equals 2e2+2e+1 on t=3e. The semi-magic count H3(t)
has no such periodicity. MacMahon computed it in 1915:
H3(t)=3(4t+3)+(2t+2).
It is an honest polynomial in t of degree 4=(3−1)2, and that degree is
not an accident: Ehrhart and Stanley proved that for every order n the
function Hn(t) is a polynomial of degree (n−1)2 satisfying the
reciprocity law Hn(−n−t)=(−1)n−1Hn(t). The order-three formula above
is the smallest nontrivial instance of that theorem, and the only one small
enough that every step of the derivation can still be exhibited explicitly.
So this mission is the natural companion to mission I: same objects, same
platform vocabulary, but the counting step is genuinely harder — the parameter
space is four-dimensional rather than two, and the parametrization is not
injective until it is normalized.
Setting
Fix n and a line sum t. A square of order n is an n×n array
M of nonnegative integers.
M is semi-magic with line sum t if every row and every column sums to
t. No condition is imposed on the two diagonals, and entries need not be
distinct.
Hn(t) is the number of such squares. Every entry is at most t, so
Hn(t) is the cardinality of a finite set.
For n=3 the whole family is governed by the six permutation matrices. Split
them into the three even ones — the identity and the two 3-cycles — whose
supports are the transversals
D={00,11,22},E={01,12,20},F={02,10,21},
and the three odd ones — the transpositions — with supports
A={00,12,21},B={02,11,20},C={01,10,22}.
Adding them with multiplicities u,v,w (even) and x,y,z (odd) gives
M=u+xw+zv+yv+zu+yw+xw+yv+xu+z,
whose six line sums all equal u+v+w+x+y+z; so this is a semi-magic square of
line sum t whenever the multiplicities sum to t.
Formalization targets
Goal — MacMahon's semi-magic count
H3(t)=3(4t+3)+(2t+2)for every t≥0.
This is the goal because it is the weakest statement that still pins down the
answer: it asserts the shape of H3 without naming the parametrization, and
it survives verbatim as the n=3 case of Stanley's theorem that Hn is a
polynomial of degree (n−1)2.
The route
Canonical decomposition (sm3_canonical). Every 3×3 semi-magic
square arises from the display above, and the representation becomes unique
after normalizing: put u=minD, v=minE, w=minF, subtract the
corresponding even permutation matrices, and the residual odd multiplicities
satisfy min(x,y,z)=0. The normalization is necessary — without it the
single relation
D+E+F=A+B+C(=J)
identifies distinct 6-tuples — and it is exactly what makes the count a
partition rather than an inclusion–exclusion.
2. Bijection (sm3_bij). The map from normalized coefficient vectors to
semi-magic squares is a bijection, so H3(t)=sm3Count(t).
3. Stars and bars (comps_card). The number of k-tuples of nonnegative
integers summing to n is (nn+k−1); the case k=5 is what the
count needs.
4. Evaluating the parameter count (sm3_params_card). Partitioning the
normalized vectors according to the first zero among (x,y,z) writes
sm3Count(t) as
(4t+4)+(4t+3)+(4t+2),
which collapses to 3(4t+3)+(2t+2) by two applications of
Pascal's identity.
Significance
The result itself.H3 is the n=3 case of a theorem that launched a
subject: Stanley's proof that Hn(t) counts lattice points in the
Birkhoff polytope t⋅Bn makes Hn an Ehrhart polynomial, and the
order-three formula is the first nontrivial value of it. Beck, Cohen, Cuomo and
Gribelyuk (Amer. Math. Monthly110 (2003),
707--717) revisited exactly this
computation on the way to their quasi-polynomial theorem for the magic counts,
and Beck and Zaslavsky later pushed the same technique to the panmagic and
symmetric refinements. Getting H3 machine-checked therefore validates the
whole hierarchy at its base.
Formalizing it. Nothing here is open; the mathematics is a century old. What
is missing is the formalized artifact, and the difficulty is concentrated in two
places that are formalization difficulties rather than mathematical ones.
First, surjectivity of the permutation-matrix parametrization. The usual
proof quotes Birkhoff–von Neumann, which in turn needs Hall's marriage theorem.
For order three one can instead do it by hand: subtract the three even
transversal minima and show that the residual satisfies M01=M10. That
last step is a six-case argument in linear arithmetic — if b=M01>c=M10
then each of the three ways for the transversal E to have minimum zero forces
c≥b — and it is precisely the kind of step that is invisible on paper and
must be made explicit in a proof assistant.
Second, the counting step. The parameter set is a filtered finset of
functions Fin 6 → Fin (t+1), while the formula is stated with binomial
coefficients over N. Connecting them requires stars-and-bars, proved
from scratch (by induction on the number of parts plus the hockey-stick
identity), because the available library results count sub-multisets rather
than compositions. And the final collapse to MacMahon's form is a chain of
Pascal identities that must be applied in the right order to stay inside
N, where subtraction is truncated.
Difficulty
Two traps deserve to be named.
Uniqueness needs the normalization. The representation by six multiplicities
is not injective: J=D+E+F=A+B+C. Any formalization that counts 6-tuples
directly will overcount, and the correction is not a subtraction but a choice of
canonical representative. Deciding "first zero among (x,y,z)" is what turns
the count into a genuine partition.
Truncated subtraction. The decomposition is expressed over N, so
every identity — in particular the recovery of the multiplicities from a square
— must be stated with the admissibility inequalities as explicit hypotheses. A
truncated subtraction is only correct because normalization forbids the
truncation, and that side condition has to be discharged rather than assumed.
Formalization scope
Squares are indexed by Fin n; semiMagicCount n t is the cardinality of a
finset of arrays over Fin (t+1) — lossless, since every entry is at most
t.
The parametrization and its normalization are defined over N with
truncated subtraction where necessary.
Trivializing formalizations are ruled out. The goal is not a statement about a
hardcoded small t, nor about a finset declared to have the right
cardinality: the count must be derived, by an explicit bijection followed by
an explicit evaluation of a finite sum.
Reusable beyond this mission: the canonical decomposition of 3×3
semi-magic squares (equivalently, the toric description of the order-three
Birkhoff polytope with its single relation), the stars-and-bars lemma for
compositions into any number of parts, and the order-three counts themselves.
Selected references
P. A. MacMahon, Combinatory Analysis, Vol. II, Cambridge University Press, 1916 (the H3 formula dates to his 1915 work).
M. Beck, T. Cohen, J. Cuomo and P. Gribelyuk, The number of "magic" squares, cubes and hypercubes, Amer. Math. Monthly 110 (2003), 707--717. https://arxiv.org/abs/math/0201013
M. Beck and T. Zaslavsky, Six little squares and how their numbers grow, J. Combin. Theory Ser. A 113 (2006). https://arxiv.org/abs/math/0502370
R. P. Stanley, Enumerative Combinatorics, Vol. I, 2nd ed., Cambridge University Press, 2012 (Ehrhart theory and reciprocity for Hn).
9 thms1 active userReviewed
🏆Completed
Captain: Yuxuan Xu
Magic Squares I: MacMahon's Enumeration of Order-Three Magic SquaresResearch Paper
Motivation
Counting magic squares — arrays of nonnegative integers whose rows, columns
and two main diagonals all share a common line sum — is one of the oldest
problems in enumerative combinatorics, and the testing ground on which the
general theory was built. MacMahon computed the order-three count in 1915 by
hand; sixty years later Stanley, and then Beck, Cohen, Cuomo and Gribelyuk
(Amer. Math. Monthly110 (2003), 707--717),
showed that for general order n the counting functions are
quasi-polynomials in the line sum, by identifying them with Ehrhart
quasi-polynomials of rational polytopes. The order-three case is the oldest
nontrivial instance of that theory and the one where every step can still be
checked by hand.
The subject therefore has a curious status: the enumerative answer for n=3 has
been known for over a century, and the structural facts behind it (a
3×3 magic square is determined by two corner entries; opposite cells sum
to twice the centre) are folklore — but none of it has a machine-checked proof.
This mission formalizes the classical derivation end to end.
Setting
Fix an order n and a type α of entries. A square of order n is an
n×n array M with entries in α; its row sums, column
sums, and the two diagonal sums (main and anti-diagonal) are the sums of
the entries along those lines.
M is semi-magic with line sum s if every row and every column sums to
s.
M is magic with line sum s if in addition both main diagonals sum to
s.
M is panmagic (pandiagonal) if every broken diagonal, in both
directions, also sums to s.
No distinctness of entries is required. Let Hn(t) denote the number of
semi-magic and Mn(t) the number of magic squares of order n with
nonnegative integer entries and line sum t. Every entry of such a square is at
most t, so these are finite counts.
For n=3 the whole family is parametrized. If M has line sum 3e then the
centre cell equals e, and writing a=M00 and c=M02 the eight line
identities force
M=ae+c−a2e−c3e−a−cea+c−ece+a−c2e−a.
All nine entries are nonnegative exactly when
e≤a+c≤3e,a≤e+c,c≤e+a,
and substituting p=a−e, q=c−e turns these into ∣p∣+∣q∣≤e: the
ℓ1 ball of radius e in Z2.
Formalization targets
Goal — MacMahon's count
M3(3e)=2e2+2e+1,
together with the companion vanishing M3(t)=0 when 3∤t. This is the
count of 3×3magic squares of line sum 3e with nonnegative integer
entries (entries need not be distinct). It is the goal because it is the
weakest stable statement: it asserts only the shape of the answer, not the
intermediate parametrization, and it survives verbatim as the n=3 case of the
general quasi-polynomial theorem.
Stronger — the parametrization itself
That the map M↦(M00,M02) is a bijection from the 3×3
magic squares of line sum 3e onto the admissible parameter pairs, and that the
latter are counted by the ℓ1-ball cardinality. This is the route the
mission actually takes; the count is its corollary.
Further — semi-magic counts
H3(t), the analogous count for semi-magic squares, is a genuinely
different and harder quasi-polynomial. It is listed as a stretch target, not a
milestone.
Significance
The result itself. MacMahon's formula is the base case of the Ehrhart-theory
reading of magic-square enumeration; Beck--Cohen--Cuomo--Gribelyuk's
quasi-polynomial theorem for general n degenerates to it at n=3, so it is
the sanity check any generalization must pass. The parametrization behind it is
what makes the "how many" question finite-dimensional at all: it reduces a
search over t9 arrays to a count of lattice points in a two-dimensional ball.
Downstream, the same parametrization governs the classification of normal3×3 magic squares (the Lo Shu square and its symmetries) and the
associativity identity Mij+M2−i,2−j=2M11.
Formalizing it. The mathematics is classical and proved; nothing here is
open. What is missing is the formalized artifact. The order-three structural
lemmas — the centre identity, the opposite-cell identity, and the two directions
of the parametrization — are already machine-checked on this platform. The
remaining work is the counting step: exhibiting a concrete bijection between
two finsets whose elements live in different types (arrays over Fin (3e+1)
versus pairs of naturals) and evaluating a finite sum. That is where the
formalization, not the mathematics, is hard.
Difficulty
The obvious attack — "each magic square is determined by (a,c), so just count
the pairs" — fails at exactly one point, and it is not a mathematical point. The
counting function M3 is defined as the cardinality of a finset of arrays with
entries in Fin (3e+1) (a finite type, so that Finset.univ exists), whereas
the parametrization lives over N. Proving the counts agree therefore
requires a honest Finset.card_bij in both directions:
forward, extract (M00,M02) from an array and show the pair is
admissible;
backward, build mkMagic3 from an admissible pair, coerce every entry into
Fin (3e+1) using the bound Mij≤2e≤3e, and show the round trip is
the identity.
Neither direction is deep, but the coercions are unforgiving: a truncated
subtraction in mkMagic3 is only correct because admissibility forbids the
truncation, and that side condition must be discharged explicitly rather than
assumed. The second difficulty is the cardinality of the ℓ1 ball: the
identification ∣p+q∣≤e∧∣p−q∣≤e⟺∣p∣+∣q∣≤e needs the elementary identity
max(∣p+q∣,∣p−q∣)=∣p∣+∣q∣, after which the count is
1+4∑k=1ek=2e2+2e+1.
Formalization scope
Entries are indexed by Fin n; the anti-diagonal uses Fin.rev, and broken
diagonals use addition modulo n. Counting functions are cardinalities of
finsets of arrays over Fin (t+1) — lossless, since every entry is at most
t — and return natural numbers.
mkMagic3 is defined over N with truncated subtraction. Every
row/column/diagonal identity therefore carries the admissibility inequalities
as explicit hypotheses; no identity is asserted unconditionally.
Trivializing formalizations are ruled out: the goal is not a statement about a
hardcoded small e, nor about a finset declared to have the right
cardinality. The count must be derived.
Reusable beyond this mission: the core vocabulary (Square, IsSemiMagic,
IsMagic, IsPanMagic, IsAssociative, IsNormal, magicConstant, and the
four counting functions Hn,Mn,Pn,Sn), the symmetry/affine toolbox, and
the order-three structural lemmas. Contributions are welcome on the
semi-magic count H3, on panmagic and associative refinements, and on the
extension to general n.
Selected references
P. A. MacMahon, Combinatory Analysis, Vol. II, Cambridge University Press, 1916 (the M3 formula dates to his 1915 work).
M. Beck, T. Cohen, J. Cuomo and P. Gribelyuk, The number of "magic" squares, cubes and hypercubes, Amer. Math. Monthly 110 (2003), 707--717. https://arxiv.org/abs/math/0201013
M. Beck and T. Zaslavsky, Six little squares and how their numbers grow, J. Combin. Theory Ser. A 113 (2006). https://arxiv.org/abs/math/0502370
Herzog-Schönheim for subnormal coversResearch Paper
Motivation
A coset partition of a group G is a finite family of left cosets a1G1,…,akGk
that are pairwise disjoint and cover G. In 1974 Herzog and
Schönheim asked whether the indices
ni=[G:Gi] of such a partition, with k>1, can be pairwise distinct. They cannot when
G=Z — there a coset partition is an exact covering system of the integers, and
Davenport–Rado and Mirsky–Newman showed the largest modulus must repeat — but for general groups
the question is still open, even for finite solvable groups.
The paper formalized here, Z.-W. Sun, J. Algebra273 (2004)
153–175, takes a third route: it constrains the
subgroups rather than the group, and simultaneously weakens "partition" to "uniform cover".
Its hypothesis — that the Gi be subnormal — costs nothing in the nilpotent case (every
subgroup of a nilpotent group is subnormal) yet applies to arbitrary, possibly infinite, ambient
groups G. It also answers negatively an open question of the same paper, generalizing one of
Erdős: the indices of such a cover cannot all be large if each occurs only boundedly often.
Setting
Let G be a group, written multiplicatively. For a finite system
A={aiGi}i=1k
of left cosets, the covering function counts memberships,
wA(x)={1≤i≤k:x∈aiGi}.
If wA is constant, say wA≡w, then A is a
uniform cover of G of weight w; the case w=1 is exactly a coset partition. A uniform
cover is trivial when Gi=G for every i, and this is the only degenerate case that must
be excluded. Uniform covers are genuinely more general than partitions: one may have no disjoint
subcover at all.
A subgroup H≤G is subnormal if some finite chain
H=H0⊴H1⊴⋯⊴Hn=G reaches G, each
term normal in the next. Normal subgroups are subnormal; in a nilpotent group every subgroup is;
and Sym(4) shows a subgroup of a solvable group need not be.
Write ni=[G:Gi] for the indices, always assumed finite, and
N=[n1,…,nk]
for their least common multiple, whose prime divisors are exactly those of n1⋯nk. Let
p∗ and p∗ denote the least and greatest prime divisors of N, let φ be Euler's
totient, and let
M=1≤j≤kmax{1≤i≤k:ni=nj}
be the largest multiplicity with which an index is repeated. The Herzog–Schönheim conjecture says
M≥2.
Target
The goal theorem is Theorem 4.3(i) of the source: for a nontrivial uniform cover of any group by
cosets of subnormal subgroups of finite index, some index divisible by the largest prime p∗ is
repeated at least p∗ times,
∃j,p∗∣njand{i:ni=nj}≥p∗.
In particular M≥p∗. Two weaker consequences are separate targets. Since p∗≥2, this
gives the Herzog–Schönheim conjecture for subnormal uniform covers,
∃i=j,[G:Gi]=[G:Gj],
and the quantitative step behind it is a Burshtein-type inequality, which after clearing
denominators reads
p∗p∣N∏(p−1)<{i:ni=nj}p∣N∏pfor some j with p∗∣nj.
Significance
The result itself. It is the widest structural class in which Herzog–Schönheim is known, and
the only one that does not require G to be finite: subnormality of the Gi is a condition on
the subgroups, so G itself is arbitrary. It strictly contains the nilpotent case of
Berger–Felzenbaum–Fraenkel, and being quantitative it also yields the Burshtein conjecture in
this setting — a bound no purely qualitative statement gives. Because the conclusion is a lower
bound on M growing with p∗, it answers the paper's open question: one cannot make all the
indices of a uniform cover large while keeping every multiplicity bounded.
Formalizing it. Nothing here is open, and the mission is the machine-checked version of a known
proof. What it adds is a formal vocabulary for uniform covers — Mathlib has
Mathlib/GroupTheory/CosetCover.lean (B. H. Neumann's theorems, ∑i1/[G:Hi]≥1) but no
notion of covering multiplicity — and the arithmetic of subnormality, in particular that
[G:⋂iGi]divides∏i[G:Gi] when the Gi are subnormal. Mathlib has
Subgroup.IsSubnormal with the basic closure properties but nothing about indices of subnormal
subgroups, and that divisibility is the whole reason subnormal covers behave. The totient measure
this proof runs on is already formalized: Sun's Lemma 3.1 is Berger–Felzenbaum–Fraenkel's equation
(14), already proved on the platform as BFFPyramidal.muMeasure_divisorClosure_image_mul, and
this mission reuses that definition file rather than duplicating it.
Status disclosure. Complete Lean proofs of the goal and of every milestone below already
exist and will be submitted at launch, so this mission is not an open frontier: its value is the
verified artifact, the reusable vocabulary, and the fact that the development turned up two
places where the published argument needs repair or can be simplified (see Formalization
scope). Alternative proofs, sharper variants, and the analytic parts excluded below remain
genuinely open contributions.
Difficulty
The reciprocal identity is the first thing anyone writes down and it is not enough: a uniform
cover of weight w satisfies ∑i1/ni=w, and pairwise distinct ni can do that.
The real obstruction is that a cover does not descend to a quotient. A part aiGi need not
lie in one coset of a chosen normal subgroup, so the induction that proves the finite nilpotent
case has nothing to induct along once G may be infinite and the Gi are merely subnormal.
Sun's replacement is a lower bound for the size of a union of cosets, Theorem 3.1: if
H≤Gi for all i and [G:H]<∞, then the number of cosets of H inside
⋃iaiGi is at least the number of n<[G:H] divisible by some ni. The union is
compared not with the Gi but with a purely numerical shadow of itself in
{0,1,…,[G:H]−1}, and it is here that subnormality enters, through the divisibility
[G:⋂Gi]∣∏[G:Gi] (Lemma 2.1) — for arbitrary finite-index subgroups
Poincaré gives only the inequality [G:⋂Gi]≤∏[G:Gi], which is too weak.
The second difficulty is arithmetic and is where the source spends its effort. Turning
Theorem 3.1 into a bound on multiplicities (Theorem 3.2) requires computing the density of a
union ⋃iniZ, and the identity the paper uses (Lemma 3.4) expresses that
density as ∏p∈Ppp−1 times an infinite sum of reciprocals over
P-smooth elements of the union. Along that route the full series is needed: truncating it loses
precisely the geometric factors (1−p−(1+δp))−1 that produce the divisor
sum ∑d∣N/g1/d in the conclusion.
It is worth saying, though, that this analytic detour is avoidable — a solver need not take
it. Theorem 3.2 can also be reached by a purely finite argument: bound the density from below by
injecting each index s into the divisor lcm{s′:s′∣x}/s, which is
sharp in the same cases as the series argument. Lemma 3.4 remains a faithful and separately
interesting milestone of the paper, but it is not on the critical path to the goal. The naive
version of the finite estimate — bounding the density below by 1/minini — is genuinely
false, as {4,6,9,12,18,36} shows, so the injection is the content, not a one-liner.
Formalization scope
The development commits to the following conventions, worth stating because the prose leaves them
implicit.
Covers are indexed families rather than sets of cosets: IsUniformCover K a w asserts that for
every x the number of indices i with (ai)−1x∈Ki is exactly w, counted as
Nat.card of a subtype so that no decidability hypothesis is needed. Indexing by Fin k keeps
multiplicities visible, which matters because every conclusion counts indices, not distinct
subgroups. Nontriviality is never folded into the definition; it appears as the explicit
hypothesis ∃ i, K i ≠ ⊤, and without it every statement here is false (take k=1, G1=G).
G is an arbitrary group — not assumed finite. Finiteness enters only through
Subgroup.FiniteIndex on each Ki, which the source assumes implicitly when it writes "the
(finite) indices". Indices are Subgroup.index and [Gi:H] is H.relIndex (K i). For a
subgroup H that is not assumed normal, G ⧸ H is still the type of left cosets and
Nat.card (G ⧸ H) = H.index; Theorem 3.1 is stated with that type, since the H it is applied
to is not normal.
Densities are never limits. The density of a union ⋃iniZ is taken as the
finite ratio ∣{x<N:∃i,ni∣x}∣/N for an explicit common multiple N,
which is exactly equal to the asymptotic density and keeps Lemma 3.4 free of any analysis on the
left-hand side; the right-hand side genuinely is an infinite sum and is stated with HasSum over
R.
Inequalities are cleared of denominators and stated in N wherever possible, so that
∑d∣m1/d≤c appears as ∑d∈m.divisorsd≤c⋅m. Readers should
check the direction: N subtraction truncates, so ∏p∣N(p−1) is only the
intended quantity because every p here is prime, hence ≥2.
⚠️ Parts (ii)–(iv) of the source's Theorem 4.3 are out of scope. Those bound the primes
dividing the indices, their number, and logn1 by eγMlog2M+O(MlogMloglogM) and similar, and they rest on Mertens' third theorem,
∏p≤x(1−1/p)∼e−γ/logx, which Mathlib does not have. It is worth
being precise about what Mathlib does have, since the gap is narrower than it looks: the prime
counting function Nat.primeCounting, Chebyshev's θ and ψ with the machinery around
them (Mathlib/NumberTheory/Chebyshev.lean), Euler products
(Mathlib/NumberTheory/EulerProduct/), and the constant γ itself
(Real.eulerMascheroniConstant) are all present — what is missing is Mertens' asymptotic tying
them together, and the π(x) asymptotics. Supplying that is a substantial number-theory
project in its own right, so this mission stops at the arithmetic core, part (i), which is what
implies Herzog–Schönheim. Contributions adding the analytic parts are welcome and would complete
Theorem 4.3.
Two things the development established that the paper does not state. First, Lemma 2.1 is true
in a stronger form: [G:A∩B]∣[G:A][G:B] needs only A subnormal, not both, and
needs no finiteness hypothesis at all (with Mathlib's convention that an infinite index is 0).
Second, Theorem 4.1's passage from the largest prime p∗ to the smallest p∗ can be isolated
as a self-contained arithmetic inequality, (p∗−1)∏p∣Np≤p∗∏p∣N(p−1),
which is tight at prime powers; it is listed as its own milestone for that reason.
Reusable beyond this mission: the uniform-cover vocabulary, the subnormal index divisibility of
Lemma 2.1, and Theorem 3.1's union bound, which applies to any attack on Herzog–Schönheim
including the still-open solvable case. The source also leaves Conjecture 4.1 open — that for
a nontrivial uniform cover by subnormal subgroups the largest index n is repeated at least
p(n) times, p(n) its least prime factor — which would be a natural follow-on target.
Selected references
Z.-W. Sun, On the Herzog–Schönheim conjecture for uniform covers of groups, Journal of Algebra 273 (2004) 153–175. DOI
M. Herzog, J. Schönheim, Research problem No. 9, Canadian Mathematical Bulletin 17 (1974) 150.
M. A. Berger, A. Felzenbaum, A. S. Fraenkel, The Herzog–Schönheim conjecture for finite nilpotent groups, Canadian Mathematical Bulletin 29 (1986) 329–333. DOI
M. A. Berger, A. Felzenbaum, A. S. Fraenkel, Remark on the multiplicity of a partition of a group into cosets, Fundamenta Mathematicae 128 (1987) 139–144. DOI
N. Burshtein, On natural exactly covering systems of congruences having moduli occurring at most M times, Discrete Mathematics 14 (1976) 205–214. DOI
R. J. Simpson, Exact coverings of the integers by arithmetic progressions, Discrete Mathematics 59 (1986) 181–190. DOI
Z.-W. Sun, Exact m-covers of groups by cosets, European Journal of Combinatorics 22 (2001) 415–429. DOI
B. H. Neumann, Groups covered by finitely many cosets, Publicationes Mathematicae Debrecen 3 (1954) 227–242.
L. Margolis, O. Schnabel, The Herzog–Schönheim conjecture for small groups and harmonic subgroups, Beiträge zur Algebra und Geometrie 60 (2019) 399–418. arXiv
Herzog-Schönheim for finite pyramidal groupsResearch Paper
Motivation
A coset partition of a group G is a finite family of left cosets a1K1,…,atKt of
subgroups Ki≤G that are pairwise disjoint and cover G. Asking which multisets of indices
[G:Ki] can occur is a question with two independent origins. For G=Z the cosets are
arithmetic progressions and a coset partition is an exact covering system of the integers;
Erdős asked whether the moduli of such a system can be pairwise distinct, and Davenport and Rado,
and independently Mirsky and Newman, showed they cannot — the largest modulus must repeat. For
general groups, Herzog and Schönheim (1974) asked the
same question: in any coset partition with t>1, must two of the indices coincide? That question
is still open.
Progress has come by restricting the group. Berger, Felzenbaum and Fraenkel proved the conjecture
for finite nilpotent groups in Canad. Math. Bull. 29 (1986)
329–333, and the paper formalized here extends it to a
wider class defined by a chain condition. Later work bounds the order instead of the structure:
Ginosar and Schnabel (2011) settle every G
whose order has at most two prime divisors, and three prime divisors when 6∤∣G∣, while
Margolis and Schnabel (2019) verify all ∣G∣<1440. The
conjecture remains open even for finite solvable groups.
Setting
Let p(m) denote the least prime factor of m and P(m) the greatest, and let φ be
Euler's totient function.
A finite group G is pyramidal if it admits a chain of subgroups
{1}=Gn⊆Gn−1⊆⋯⊆G1⊆G0=G
in which every step has index equal to the least prime factor of the order of the preceding term:
[Gk−1:Gk]=p(∣Gk−1∣),1≤k≤n.
A subgroup whose index is the smallest prime dividing the order is automatically normal, so the
chain is a composition series; consequently every pyramidal group is solvable, and every
supersolvable group is pyramidal. Pyramidality is therefore a chain condition sitting between
supersolvability and solvability.
Given a coset partition a1K1,…,atKt of G, write
l=gcd(∣K1∣,…,∣Kt∣)∣G∣.
Target
The goal theorem is the multiplicity lower bound of Berger–Felzenbaum–Fraenkel. If G is
pyramidal and the cosets aiKi, 1≤i≤t, partition G with t>1, then at least
x=⌊lP(l)φ(l)⌋+1
of the subgroups Ki have the same order.
Two consequences are separate targets. Since x≥2 whenever l≥2, the bound yields the
Herzog–Schönheim conjecture for pyramidal groups:
∃i=j,[G:Ki]=[G:Kj],
and it likewise settles Burshtein's conjecture in this setting, which concerns the case
gcd(∣Ki∣)=1 and bounds the primes dividing ∣G∣ in terms of the largest multiplicity.
Significance
The bound is quantitative where the Herzog–Schönheim conjecture is qualitative: it does not merely
assert that a repetition exists but forces a repetition of prescribed multiplicity, growing with
the largest prime factor of l. That is what makes it strong enough to also imply Burshtein's
conjecture, which no purely qualitative statement does.
The class it covers is also of independent interest. Nilpotent groups are pyramidal, so the result
subsumes the authors' earlier theorem, and it reaches groups that are solvable but far from
nilpotent. It remains, more than three decades later, among the structural (as opposed to
order-bounded) cases in which the conjecture is known.
No part of this development is currently formalized: Mathlib has the ingredients — Sylow theory,
Hall subgroups of solvable groups, Euler's totient with Gauss's identity ∑d∣mφ(d)=m — but neither coset partitions as a structure, nor pyramidality, nor any case of
Herzog–Schönheim. The mission produces the first machine-checked proof of a structural case of the
conjecture, together with a reusable formal vocabulary for coset partitions.
Difficulty
The reciprocal identity ∑i[G:Ki]−1=1 is immediate and useless on its own: distinct
indices can satisfy it, so no counting argument over the indices alone can succeed.
The natural attack — induct along the chain, quotienting by G1 — fails because a coset partition
does not descend to a quotient. A part aiKi need not lie inside a single coset of G1: if
KiG1=G then it meets every coset of G1, and the induced family on G/G1 is a cover with
multiplicity rather than a partition. Controlling that dichotomy is the first obstacle, and it is
precisely where the definition of pyramidality is used, the index [G:G1] being the least prime
factor of ∣G∣ rather than an arbitrary one.
The second obstacle is that the conclusion counts subgroups of equal order, so the induction
must carry a lower bound on the size of a union of cosets that is sensitive to the orders ∣Ki∣
and not merely to their number. The paper's device is a measure μ on the naturals with
μ({m})=φ(m), evaluated on the divisor closure of the set of orders; Gauss's identity
makes μ interact correctly with divisibility, and the required inequality is genuinely a
statement about the group, not about the multiset of orders. The final step splits off the Sylow
P(∣G∣)-subgroup against a Hall complement, which exists only because pyramidal groups are
solvable.
Formalization scope
The development commits to the following conventions, all fixed in Lean and worth stating because
the prose leaves them implicit.
Coset partitions are indexed families rather than sets of cosets: IsCosetPartition K a asserts
that for every x there is a unique index i with (ai)−1x∈Ki. Indexing by Fin t
keeps multiplicities visible, which matters since the conclusion counts indices, not distinct
subgroups; and uniqueness encodes disjointness and covering simultaneously. Groups are finite via
[Finite G], and orders and indices are Nat.card and Subgroup.index.
Pyramidality is stated as the existence of a length n and a chain c : ℕ → Subgroup G with
c 0 = ⊤, c n = ⊥, and Subgroup.relIndex (c (k+1)) (c k) = Nat.minFac (Nat.card (c k)) for
k < n. Normality of each step is a consequence, not a hypothesis, and is deliberately not assumed.
The greatest prime factor is maxPrimeFac m = m.primeFactors.sup id, which is 0 for
m∈{0,1}; the floor in x is natural-number division, so the goal statement is
(maxPrimeFac l * Nat.totient l) / l + 1 ≤ …. Note that the bound is vacuous at l=1 — there
P(1)φ(1)/1=0 and x=1 — so t>1 is a necessary hypothesis and is present in every
statement that needs it; a formalization omitting it would be trivially true and is ruled out.
A complete development needs, beyond the goal: the coset intersection lemma; the least-prime-index
dichotomy; uniqueness of the Sylow P(∣G∣)-subgroup of a pyramidal group; the scaling law
μ(D(kR))=kμ(D(R)) for the divisor-closure measure; the union lower bound; and
solvability of pyramidal groups. The coset-partition vocabulary and the union bound are reusable
for any other case of Herzog–Schönheim, including the still-open solvable case, and contributions
of alternative proofs or sharper variants are welcome.
Selected references
M. A. Berger, A. Felzenbaum, A. S. Fraenkel, Remark on the multiplicity of a partition of a group into cosets, Fundamenta Mathematicae 128 (1987) 139–144. DOI
M. A. Berger, A. Felzenbaum, A. S. Fraenkel, The Herzog–Schönheim conjecture for finite nilpotent groups, Canadian Mathematical Bulletin 29 (1986) 329–333. DOI
M. Herzog, J. Schönheim, Research problem No. 9, Canadian Mathematical Bulletin 17 (1974) 150.
N. Burshtein, On natural exactly covering systems of congruences having moduli occurring at most M times, Discrete Mathematics 14 (1976) 205–214. DOI
I. Korec, Š. Znám, On disjoint covering of groups by their cosets, Mathematica Slovaca 27 (1977) 3–7.
Z.-W. Sun, On the Herzog–Schönheim conjecture for uniform covers of groups, Journal of Algebra 273 (2004) 153–175. DOI
L. Margolis, O. Schnabel, The Herzog–Schönheim conjecture for small groups and harmonic subgroups, Beiträge zur Algebra und Geometrie 60 (2019) 399–418. arXiv
Rothvoß Discrepancy Notes I: Spencer's Theorem via the Entropy MethodTextbook
Motivation
Discrepancy theory asks how unbalanced a two-coloring of a combinatorial structure must be in the worst case. Concretely: given n sets over an n-element ground set, color each element +1 or −1 so that every set is as close to balanced as possible. The question is classical (Beck–Fiala 1981; Spencer 1985) and the answer for general (dense) set systems is one of the sharpest gaps between a naive probabilistic bound and the truth known in combinatorics: assigning colors uniformly at random only guarantees discrepancy Θ(nlogn), yet a coloring with discrepancy O(n) always exists — the logarithmic factor is an artifact of the naive argument, not of the problem. This mission formalizes that removal, following T. Rothvoß's lecture-note exposition of J. Spencer's entropy method (MIT 18.095, "Discrepancy theory"), the standard modern presentation of the technique (see also Matoušek, Geometric Discrepancy, Ch. 4). The entropy method is the ancestor of the whole "partial coloring" family of arguments used throughout discrepancy theory and combinatorial algorithm design, so a machine-checked account of its base case is reusable well beyond this one theorem.
Setting
Fix n≥1 and an n×n matrix A with entries in {0,1}, thought of as the incidence matrix of n sets S1,…,Sn over an n-element ground set: Aij=1 iff element j lies in set Si. A coloring is a map ε:{1,…,n}→{−1,+1}, and the discrepancy of row i under ε is ∑jAijεj, the signed imbalance of set Si. The discrepancy of the matrix is the value achieved by the best coloring, minimizing the worst row.
The entropy method bounds this via the partial coloring lemma: rather than coloring all n elements at once, one repeatedly colors a constant fraction of the currently uncolored elements while keeping every row's contribution small, then recurses on what remains. Each round is itself produced by an entropy/pigeonhole argument: quantize each row's signed sum (under a uniformly random coloring) into O(1) "shells" of width Θ(m) (where m is the number of active elements); a short computation shows this quantization carries very little Shannon entropyH(Z)=∑xPr[Z=x]log2Pr[Z=x]1 once the shell width exceeds a threshold; subadditivity of entropy across the n rows then bounds the joint quantization entropy, which by pigeonhole forces an exponentially large set of colorings landing in the same joint shell; Kleitman's theorem on the diameter of a large subset of the Hamming cube then extracts two such colorings that are far apart in Hamming distance, and their difference is the sought partial coloring.
This is the qualitative, constant-suppressed form of Spencer's theorem: it asserts O(n) discrepancy with a single universal constant, and deliberately leaves that constant unspecified. This is the right goal for this mission because it is the weakest statement that is still stable: any future improvement to the constant (down to Spencer's sharp 6, or beyond) refines this theorem rather than invalidating it.
Significance
The removal of the logn factor is the entire content of Spencer's theorem: it is what separates discrepancy theory from a corollary of concentration inequalities, and the partial-coloring/entropy method it introduced underlies later results throughout the field (Beck–Fiala-type bounds, the Komlós conjecture literature, and constructive/algorithmic discrepancy minimization). Formalizing it is formalizing the base case that every later partial-coloring argument specializes.
This mission's goal theorem, spencer_discrepancy_sqrt_n_bound, is already proved (zero sorrys), by a from-scratch entropy-method development: the per-row shell-entropy bound, the joint pigeonhole-and-Kleitman assembly for one round, and the outer geometric iteration and induction combining rounds into a full coloring. What remains open in this mission is shannonEntropy_shellFin_le (Lemma 9 in Rothvoß's notes) — the per-row entropy bound is currently imported as an assumption by the one-round lemma lemma8_partial_coloring_round, which is therefore only conditionally proved pending it. A separate, harder mission on this platform (Komlos.spencer_six_deviations) targets Spencer's sharp constant 6 via a tighter, non-standard numeric derivation; that is a distinct, substantially harder target and this mission does not duplicate it.
Difficulty
The obvious argument is: fix a target bound t=λn, use a Chernoff/Hoeffding bound to show each row fails with probability at most 2e−λ2/2, union-bound over the n rows, and take a coloring outside the bad event. This works to prove a single good coloring exists — but it is not strong enough to survive being iterated to remove the entire uncolored set, because a per-row union bound loses a factor of n that a fixed λ cannot always absorb once the active column count m is close to n: for the scaling family where the row count and the active set shrink together, the naive union bound's failure probability grows linearly in m, not exponentially, exactly canceling the exponential decay one is trying to exploit. The fix is to bound the joint entropy of all n rows' quantizations at once (subadditivity of Shannon entropy), rather than union-bounding row-by-row failure events; this is genuinely a different technique, not a tightening of the same one, and it is the reason the entropy method is presented as its own tool rather than a Chernoff-bound corollary.
Formalization scope
Matrices are Fin n → Fin n → ℝ with an explicit ∀ i j, A i j = 0 ∨ A i j = 1 hypothesis; colorings are represented two ways in this development — Fin m → Bool internally (via the platform definition RSign converting to ±1) during the entropy/Kleitman argument, and directly as Fin n → ℝ constrained to {−1,1} pointwise in the goal theorem's statement, matching the usual {±1}-coloring convention. The row-sum shell quantization is the platform definitions rowSumB, shellIdx, shellFin (an integer-valued "round to nearest shell" construction, packaged into a fixed Fin (2m+3) type for entropy purposes). The active column set during the outer iteration is tracked as a shrinking Finset (Fin n) of the original index type throughout, rather than moving between different Fin m types round to round, which keeps the induction free of type-level bookkeeping.
Reusable, already-Proved infrastructure this development builds on: shannonEntropy_pi_le (subadditivity across independent rows), shannonEntropy_pigeonhole, choose_sum_le_exp_mul_binEntropy, and kleitman_diameter, all already Proved on the platform independent of this mission. The one genuinely open piece — and the mission's standing invitation — is shannonEntropy_shellFin_le (Lemma 9): a self-contained Shannon-entropy computation about the shellFin quantization that does not depend on anything else in this mission and can be attempted independently.
Selected references
J. Spencer, Six standard deviations suffice, Trans. Amer. Math. Soc. 289 (1985), 679–706. DOI
T. Rothvoß, Discrepancy theory, or: how much balance is possible?, MIT 18.095 lecture notes. PDF
J. Matoušek, Geometric Discrepancy: An Illustrated Guide, Algorithms and Combinatorics 18, Springer, 1999.
J. Beck, T. Fiala, "Integer-making" theorems, Discrete Appl. Math. 3(1) (1981), 1–8.
Erdős Problem 146: Failure of the 2-Degenerate Extremal BoundResearch Paper
A graph H is r-degenerate if every nonempty subgraph of H has a vertex of degree at most r. Erdős conjectured — this is Erdős problem #146 — that every fixed bipartite r-degenerate graph H satisfies
ex(n,H)=O(n2−1/r).
The conjecture was known in several cases: when one bipartition class has maximum degree at most r, for r-degenerate blow-ups of trees, and, for r=2, for grids and certain critical 2-degenerate graphs. The best general bound was the weaker ex(n,H)=O(n2−1/(4r)) of Alon, Krivelevich and Sudakov.
This mission carries a complete Lean 4 formalisation refuting it at r=2.
Theorem. There exist a fixed connected bipartite 2-degenerate graph H and constants c,ε>0 such that
ex(n,H)≥cn3/2+ε
for all sufficiently large n. Since the conjectured bound at r=2 is O(n3/2), the excess is polynomial rather than constant, so the conjecture fails outright. A related conjecture of Erdős (problem #113) asserts that a bipartite graph is 2-degenerate if and only if ex(n,H)=O(n3/2); Janzer had already disproved the reverse implication, and this result refutes the forward one.
The construction. The counterexample H is built in layers: starting from a layer V0 of size L0, each subsequent layer is Vi=(2Vi−1), and every vertex {a,b}∈Vi is joined to its two parents a,b∈Vi−1. The result is connected, bipartite and 2-degenerate by construction, and is related to the complete degenerate graphs of Grzesik, Janzer and Nagy.
The lower bound comes from a sampled Hamming-ball graph. With U={0,1}m, two disjoint copies UL,UR are joined whenever their Hamming distance is at most k=⌊τm⌋, and each vertex is retained independently with probability p=2−βm. The two parameters are governed by the thresholds
A(τ)=κ+τlog23,C(τ)=2h(τ)−1,
and the construction needs a sampling exponent with A(τ)<β<C(τ). The lower threshold controls exclusion of the layered graph; the upper one controls whether the sampled host has more than n3/2 edges.
Exclusion runs on a conditional-entropy functional E(u,z)=m1∑jH(Zj∣Xj,Yj) over parent and child arrays. An array of conditional entropy E has at most 2mME+O(mlog2M) realisations, while requiring its M=(2L) children to survive sampling costs 2−βmM — which dominates the 2mL possible parent arrays whenever E<β. An embedding of H would therefore have to raise a bounded entropy potential by a fixed amount at each layer, which is impossible after enough layers. A second-moment argument shows the sampled graph still has Ω(n3/2+ε) edges, and padding extends the construction to every sufficiently large order.
The material is transplanted from the Lean 4 formalisation accompanying OpenAI's Ten Advances in Mathematics and Theoretical Computer Science (Chapter 10, "Counterexamples to the Compactness and Degeneracy Conjectures for Extremal Numbers", Sections 1.2 and 5–8), and re-verified in this environment: every node is proved from [propext, Classical.choice, Quot.sound] alone, and each staged statement's elaborated type was checked to be identical to the original declaration's. The mission is offered as a curated, closed campaign whose definitions and lemmas — binary entropy and the pair kernel, the layered construction, the Hamming-ball host and its retention measure — are reusable foundations for further work in extremal graph theory.
This is the companion result to Erdős problem #180, the Erdős–Simonovits compactness conjecture, which is formalised in the same source chapter and published as a separate mission.